braintrust 3.13.0 → 3.14.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 (50) hide show
  1. package/dev/dist/index.d.mts +6 -8
  2. package/dev/dist/index.d.ts +6 -8
  3. package/dev/dist/index.js +809 -466
  4. package/dev/dist/index.mjs +367 -24
  5. package/dist/apply-auto-instrumentation.js +204 -174
  6. package/dist/apply-auto-instrumentation.mjs +35 -5
  7. package/dist/auto-instrumentations/bundler/esbuild.cjs +225 -1
  8. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -1
  9. package/dist/auto-instrumentations/bundler/next.cjs +225 -1
  10. package/dist/auto-instrumentations/bundler/next.mjs +3 -2
  11. package/dist/auto-instrumentations/bundler/rollup.cjs +225 -1
  12. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -1
  13. package/dist/auto-instrumentations/bundler/vite.cjs +225 -1
  14. package/dist/auto-instrumentations/bundler/vite.mjs +2 -1
  15. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +8 -0
  16. package/dist/auto-instrumentations/bundler/webpack.cjs +225 -1
  17. package/dist/auto-instrumentations/bundler/webpack.mjs +3 -2
  18. package/dist/auto-instrumentations/chunk-J57YF7WS.mjs +208 -0
  19. package/dist/auto-instrumentations/{chunk-WFEUJACP.mjs → chunk-OTUQ7KH5.mjs} +1 -1
  20. package/dist/auto-instrumentations/chunk-QFMACSOL.mjs +280 -0
  21. package/dist/auto-instrumentations/{chunk-GJOO4ESL.mjs → chunk-XKAAVWT6.mjs} +23 -1
  22. package/dist/auto-instrumentations/hook.mjs +7980 -7
  23. package/dist/auto-instrumentations/loader/cjs-patch.cjs +194 -4
  24. package/dist/auto-instrumentations/loader/cjs-patch.mjs +13 -27
  25. package/dist/auto-instrumentations/loader/esm-hook.mjs +24 -10
  26. package/dist/browser.d.mts +127 -11
  27. package/dist/browser.d.ts +127 -11
  28. package/dist/browser.js +293 -24
  29. package/dist/browser.mjs +293 -24
  30. package/dist/{chunk-26JGOELH.js → chunk-NKD77KGB.js} +179 -1
  31. package/dist/{chunk-75IQCUB2.mjs → chunk-NU2GSPHX.mjs} +179 -1
  32. package/dist/cli.js +374 -51
  33. package/dist/edge-light.d.mts +1 -1
  34. package/dist/edge-light.d.ts +1 -1
  35. package/dist/edge-light.js +293 -24
  36. package/dist/edge-light.mjs +293 -24
  37. package/dist/index.d.mts +127 -11
  38. package/dist/index.d.ts +127 -11
  39. package/dist/index.js +1113 -838
  40. package/dist/index.mjs +305 -30
  41. package/dist/instrumentation/index.d.mts +7 -8
  42. package/dist/instrumentation/index.d.ts +7 -8
  43. package/dist/instrumentation/index.js +101 -24
  44. package/dist/instrumentation/index.mjs +101 -24
  45. package/dist/workerd.d.mts +1 -1
  46. package/dist/workerd.d.ts +1 -1
  47. package/dist/workerd.js +293 -24
  48. package/dist/workerd.mjs +293 -24
  49. package/package.json +1 -7
  50. package/dist/auto-instrumentations/chunk-MWZXZQUO.mjs +0 -81
@@ -3935,6 +3935,76 @@ var LRUCache = class {
3935
3935
  }
3936
3936
  };
3937
3937
 
3938
+ // src/prompt-cache/cache-config.ts
3939
+ var CACHE_LOCATION_ENV_VAR = "BRAINTRUST_CACHE_LOCATION";
3940
+ var DEFAULT_CACHE_MEMORY_MAX = 1 << 10;
3941
+ var DEFAULT_CACHE_DISK_MAX = 1 << 20;
3942
+ var warnedInvalidCacheModeEnvValue = false;
3943
+ var warnedUnavailableDiskCacheMode = false;
3944
+ function warnInvalidCacheMode(value) {
3945
+ if (warnedInvalidCacheModeEnvValue) {
3946
+ return;
3947
+ }
3948
+ warnedInvalidCacheModeEnvValue = true;
3949
+ debugLogger.warn(
3950
+ `Invalid ${CACHE_LOCATION_ENV_VAR} value "${value}". Expected "mixed", "memory", "disk", or "none". Falling back to "mixed".`
3951
+ );
3952
+ }
3953
+ function warnUnavailableDiskCache() {
3954
+ if (warnedUnavailableDiskCacheMode) {
3955
+ return;
3956
+ }
3957
+ warnedUnavailableDiskCacheMode = true;
3958
+ debugLogger.warn(
3959
+ `Disk cache is not supported on this platform, so ${CACHE_LOCATION_ENV_VAR}="disk" disables prompt and parameters caching.`
3960
+ );
3961
+ }
3962
+ function parseCacheMode() {
3963
+ const value = isomorph_default.getEnv(CACHE_LOCATION_ENV_VAR);
3964
+ const normalized = value?.trim().toLowerCase();
3965
+ if (!normalized) {
3966
+ return "mixed";
3967
+ }
3968
+ if (normalized === "mixed" || normalized === "memory" || normalized === "disk" || normalized === "none") {
3969
+ return normalized;
3970
+ }
3971
+ warnInvalidCacheMode(value ?? "");
3972
+ return "mixed";
3973
+ }
3974
+ function parsePositiveIntegerEnv(envVar, defaultValue) {
3975
+ const value = Number(isomorph_default.getEnv(envVar));
3976
+ return Number.isInteger(value) && value > 0 ? value : defaultValue;
3977
+ }
3978
+ function createCacheLayers({
3979
+ memoryMaxEnvVar,
3980
+ diskCacheDirEnvVar,
3981
+ diskMaxEnvVar,
3982
+ getDefaultDiskCacheDir
3983
+ }) {
3984
+ const mode = parseCacheMode();
3985
+ const memoryCache = mode === "mixed" || mode === "memory" ? new LRUCache({
3986
+ max: parsePositiveIntegerEnv(
3987
+ memoryMaxEnvVar,
3988
+ DEFAULT_CACHE_MEMORY_MAX
3989
+ )
3990
+ }) : void 0;
3991
+ let diskCache;
3992
+ if (mode === "mixed" || mode === "disk") {
3993
+ if (canUseDiskCache()) {
3994
+ diskCache = new DiskCache({
3995
+ cacheDir: isomorph_default.getEnv(diskCacheDirEnvVar) ?? getDefaultDiskCacheDir(),
3996
+ max: parsePositiveIntegerEnv(diskMaxEnvVar, DEFAULT_CACHE_DISK_MAX)
3997
+ });
3998
+ } else if (mode === "disk") {
3999
+ warnUnavailableDiskCache();
4000
+ }
4001
+ }
4002
+ if (diskCache) {
4003
+ return { memoryCache, diskCache };
4004
+ }
4005
+ return { memoryCache };
4006
+ }
4007
+
3938
4008
  // src/prompt-cache/prompt-cache.ts
3939
4009
  function createCacheKey(key) {
3940
4010
  if (key.id) {
@@ -3962,16 +4032,18 @@ var PromptCache = class {
3962
4032
  */
3963
4033
  async get(key) {
3964
4034
  const cacheKey = createCacheKey(key);
3965
- const memoryPrompt = this.memoryCache.get(cacheKey);
3966
- if (memoryPrompt !== void 0) {
3967
- return memoryPrompt;
4035
+ if (this.memoryCache) {
4036
+ const memoryPrompt = this.memoryCache.get(cacheKey);
4037
+ if (memoryPrompt !== void 0) {
4038
+ return memoryPrompt;
4039
+ }
3968
4040
  }
3969
4041
  if (this.diskCache) {
3970
4042
  const diskPrompt = await this.diskCache.get(cacheKey);
3971
4043
  if (!diskPrompt) {
3972
4044
  return void 0;
3973
4045
  }
3974
- this.memoryCache.set(cacheKey, diskPrompt);
4046
+ this.memoryCache?.set(cacheKey, diskPrompt);
3975
4047
  return diskPrompt;
3976
4048
  }
3977
4049
  return void 0;
@@ -3986,7 +4058,7 @@ var PromptCache = class {
3986
4058
  */
3987
4059
  async set(key, value) {
3988
4060
  const cacheKey = createCacheKey(key);
3989
- this.memoryCache.set(cacheKey, value);
4061
+ this.memoryCache?.set(cacheKey, value);
3990
4062
  if (this.diskCache) {
3991
4063
  await this.diskCache.set(cacheKey, value);
3992
4064
  }
@@ -4016,23 +4088,25 @@ var ParametersCache = class {
4016
4088
  }
4017
4089
  async get(key) {
4018
4090
  const cacheKey = createCacheKey2(key);
4019
- const memoryParams = this.memoryCache.get(cacheKey);
4020
- if (memoryParams !== void 0) {
4021
- return memoryParams;
4091
+ if (this.memoryCache) {
4092
+ const memoryParams = this.memoryCache.get(cacheKey);
4093
+ if (memoryParams !== void 0) {
4094
+ return memoryParams;
4095
+ }
4022
4096
  }
4023
4097
  if (this.diskCache) {
4024
4098
  const diskParams = await this.diskCache.get(cacheKey);
4025
4099
  if (!diskParams) {
4026
4100
  return void 0;
4027
4101
  }
4028
- this.memoryCache.set(cacheKey, diskParams);
4102
+ this.memoryCache?.set(cacheKey, diskParams);
4029
4103
  return diskParams;
4030
4104
  }
4031
4105
  return void 0;
4032
4106
  }
4033
4107
  async set(key, value) {
4034
4108
  const cacheKey = createCacheKey2(key);
4035
- this.memoryCache.set(cacheKey, value);
4109
+ this.memoryCache?.set(cacheKey, value);
4036
4110
  if (this.diskCache) {
4037
4111
  await this.diskCache.set(cacheKey, value);
4038
4112
  }
@@ -4564,21 +4638,22 @@ var BraintrustState = class _BraintrustState {
4564
4638
  setGlobalDebugLogLevel(void 0);
4565
4639
  }
4566
4640
  this.resetLoginInfo();
4567
- const memoryCache = new LRUCache({
4568
- max: Number(isomorph_default.getEnv("BRAINTRUST_PROMPT_CACHE_MEMORY_MAX")) ?? 1 << 10
4641
+ const { memoryCache, diskCache } = createCacheLayers({
4642
+ memoryMaxEnvVar: "BRAINTRUST_PROMPT_CACHE_MEMORY_MAX",
4643
+ diskCacheDirEnvVar: "BRAINTRUST_PROMPT_CACHE_DIR",
4644
+ diskMaxEnvVar: "BRAINTRUST_PROMPT_CACHE_DISK_MAX",
4645
+ getDefaultDiskCacheDir: () => `${isomorph_default.getEnv("HOME") ?? isomorph_default.homedir()}/.braintrust/prompt_cache`
4569
4646
  });
4570
- const diskCache = canUseDiskCache() ? new DiskCache({
4571
- cacheDir: isomorph_default.getEnv("BRAINTRUST_PROMPT_CACHE_DIR") ?? `${isomorph_default.getEnv("HOME") ?? isomorph_default.homedir()}/.braintrust/prompt_cache`,
4572
- max: Number(isomorph_default.getEnv("BRAINTRUST_PROMPT_CACHE_DISK_MAX")) ?? 1 << 20
4573
- }) : void 0;
4574
4647
  this.promptCache = new PromptCache({ memoryCache, diskCache });
4575
- const parametersMemoryCache = new LRUCache({
4576
- max: Number(isomorph_default.getEnv("BRAINTRUST_PARAMETERS_CACHE_MEMORY_MAX")) ?? 1 << 10
4648
+ const {
4649
+ memoryCache: parametersMemoryCache,
4650
+ diskCache: parametersDiskCache
4651
+ } = createCacheLayers({
4652
+ memoryMaxEnvVar: "BRAINTRUST_PARAMETERS_CACHE_MEMORY_MAX",
4653
+ diskCacheDirEnvVar: "BRAINTRUST_PARAMETERS_CACHE_DIR",
4654
+ diskMaxEnvVar: "BRAINTRUST_PARAMETERS_CACHE_DISK_MAX",
4655
+ getDefaultDiskCacheDir: () => `${isomorph_default.getEnv("HOME") ?? isomorph_default.homedir()}/.braintrust/parameters_cache`
4577
4656
  });
4578
- const parametersDiskCache = canUseDiskCache() ? new DiskCache({
4579
- cacheDir: isomorph_default.getEnv("BRAINTRUST_PARAMETERS_CACHE_DIR") ?? `${isomorph_default.getEnv("HOME") ?? isomorph_default.homedir()}/.braintrust/parameters_cache`,
4580
- max: Number(isomorph_default.getEnv("BRAINTRUST_PARAMETERS_CACHE_DISK_MAX")) ?? 1 << 20
4581
- }) : void 0;
4582
4657
  this.parametersCache = new ParametersCache({
4583
4658
  memoryCache: parametersMemoryCache,
4584
4659
  diskCache: parametersDiskCache
@@ -25718,7 +25793,7 @@ var BraintrustPlugin = class extends BasePlugin {
25718
25793
  this.config = config;
25719
25794
  }
25720
25795
  onEnable() {
25721
- const integrations = this.config.integrations || {};
25796
+ const integrations = this.config.integrations ?? {};
25722
25797
  if (integrations.openai !== false) {
25723
25798
  this.openaiPlugin = new OpenAIPlugin();
25724
25799
  this.openaiPlugin.enable();
@@ -25783,7 +25858,7 @@ var BraintrustPlugin = class extends BasePlugin {
25783
25858
  this.genkitPlugin = new GenkitPlugin();
25784
25859
  this.genkitPlugin.enable();
25785
25860
  }
25786
- if (getIntegrationConfig(integrations, "gitHubCopilot") !== false) {
25861
+ if (integrations.gitHubCopilot !== false) {
25787
25862
  this.gitHubCopilotPlugin = new GitHubCopilotPlugin();
25788
25863
  this.gitHubCopilotPlugin.enable();
25789
25864
  }
@@ -25896,6 +25971,7 @@ var envIntegrationAliases = {
25896
25971
  cursorsdk: "cursorSDK",
25897
25972
  flue: "flue",
25898
25973
  "flue-runtime": "flue",
25974
+ mastra: "mastra",
25899
25975
  "openai-agents": "openAIAgents",
25900
25976
  openaiagents: "openAIAgents",
25901
25977
  "openai-agents-core": "openAIAgents",
@@ -25938,6 +26014,7 @@ function getDefaultInstrumentationIntegrations() {
25938
26014
  cursor: true,
25939
26015
  cursorSDK: true,
25940
26016
  flue: true,
26017
+ mastra: true,
25941
26018
  openAIAgents: true,
25942
26019
  openrouter: true,
25943
26020
  openrouterAgent: true,
@@ -26110,6 +26187,7 @@ __export(exports_exports, {
26110
26187
  BaseExperiment: () => BaseExperiment,
26111
26188
  BraintrustLangChainCallbackHandler: () => BraintrustLangChainCallbackHandler,
26112
26189
  BraintrustMiddleware: () => BraintrustMiddleware,
26190
+ BraintrustObservabilityExporter: () => BraintrustObservabilityExporter,
26113
26191
  BraintrustState: () => BraintrustState,
26114
26192
  BraintrustStream: () => BraintrustStream,
26115
26193
  CachedSpanFetcher: () => CachedSpanFetcher,
@@ -27726,6 +27804,196 @@ function toolRunnerProxy(toolRunner, anthropic, channel2) {
27726
27804
  }
27727
27805
 
27728
27806
  // src/wrappers/mastra.ts
27807
+ var MASTRA_BRAINTRUST_EXPORTER_NAME = "braintrust";
27808
+ var SPAN_TYPE_MAP = {
27809
+ agent_run: "task" /* TASK */,
27810
+ model_generation: "llm" /* LLM */,
27811
+ model_step: "llm" /* LLM */,
27812
+ model_chunk: "llm" /* LLM */,
27813
+ tool_call: "tool" /* TOOL */,
27814
+ mcp_tool_call: "tool" /* TOOL */,
27815
+ workflow_run: "task" /* TASK */,
27816
+ workflow_step: "function" /* FUNCTION */,
27817
+ workflow_conditional: "function" /* FUNCTION */,
27818
+ workflow_conditional_eval: "function" /* FUNCTION */,
27819
+ workflow_parallel: "function" /* FUNCTION */,
27820
+ workflow_loop: "function" /* FUNCTION */,
27821
+ workflow_sleep: "function" /* FUNCTION */,
27822
+ workflow_wait_event: "function" /* FUNCTION */,
27823
+ memory_operation: "function" /* FUNCTION */,
27824
+ workspace_action: "function" /* FUNCTION */,
27825
+ rag_ingestion: "task" /* TASK */,
27826
+ rag_embedding: "llm" /* LLM */,
27827
+ rag_vector_operation: "function" /* FUNCTION */,
27828
+ rag_action: "function" /* FUNCTION */,
27829
+ graph_action: "function" /* FUNCTION */,
27830
+ scorer_run: "score" /* SCORE */,
27831
+ scorer_step: "score" /* SCORE */,
27832
+ processor_run: "function" /* FUNCTION */,
27833
+ generic: "function" /* FUNCTION */
27834
+ };
27835
+ function spanTypeFor(mastraType) {
27836
+ return SPAN_TYPE_MAP[mastraType] ?? "function" /* FUNCTION */;
27837
+ }
27838
+ function epochSeconds(value) {
27839
+ if (value === void 0) return void 0;
27840
+ const ms = value instanceof Date ? value.getTime() : typeof value === "number" ? value : Date.parse(value);
27841
+ return Number.isFinite(ms) ? ms / 1e3 : void 0;
27842
+ }
27843
+ function modelMetrics(attributes) {
27844
+ if (!isObject(attributes)) return void 0;
27845
+ const usage = isObject(attributes.usage) ? attributes.usage : void 0;
27846
+ if (!usage) return void 0;
27847
+ const out = {};
27848
+ if (typeof usage.inputTokens === "number")
27849
+ out.prompt_tokens = usage.inputTokens;
27850
+ if (typeof usage.outputTokens === "number")
27851
+ out.completion_tokens = usage.outputTokens;
27852
+ if (typeof usage.inputTokens === "number" && typeof usage.outputTokens === "number") {
27853
+ out.tokens = usage.inputTokens + usage.outputTokens;
27854
+ }
27855
+ const inputDetails = isObject(usage.inputDetails) ? usage.inputDetails : void 0;
27856
+ const outputDetails = isObject(usage.outputDetails) ? usage.outputDetails : void 0;
27857
+ if (inputDetails && typeof inputDetails.cacheRead === "number") {
27858
+ out.prompt_cached_tokens = inputDetails.cacheRead;
27859
+ }
27860
+ if (inputDetails && typeof inputDetails.cacheWrite === "number") {
27861
+ out.prompt_cache_creation_tokens = inputDetails.cacheWrite;
27862
+ }
27863
+ if (outputDetails && typeof outputDetails.reasoning === "number") {
27864
+ out.completion_reasoning_tokens = outputDetails.reasoning;
27865
+ }
27866
+ return Object.keys(out).length > 0 ? out : void 0;
27867
+ }
27868
+ function buildMetadata(exported) {
27869
+ const out = {};
27870
+ if (exported.entityId !== void 0) out.entity_id = exported.entityId;
27871
+ if (exported.entityName !== void 0) out.entity_name = exported.entityName;
27872
+ if (exported.entityType !== void 0) out.entity_type = exported.entityType;
27873
+ if (exported.metadata && isObject(exported.metadata)) {
27874
+ Object.assign(out, exported.metadata);
27875
+ }
27876
+ if (exported.attributes && isObject(exported.attributes)) {
27877
+ for (const [key, value] of Object.entries(exported.attributes)) {
27878
+ if (key === "usage") continue;
27879
+ if (value !== void 0) out[key] = value;
27880
+ }
27881
+ }
27882
+ if (exported.tags && exported.tags.length > 0) {
27883
+ out.tags = exported.tags;
27884
+ }
27885
+ if (exported.requestContext && isObject(exported.requestContext)) {
27886
+ out.request_context = exported.requestContext;
27887
+ }
27888
+ return out;
27889
+ }
27890
+ var BraintrustObservabilityExporter = class {
27891
+ name = MASTRA_BRAINTRUST_EXPORTER_NAME;
27892
+ spans = /* @__PURE__ */ new Map();
27893
+ // Captured at the first SPAN_STARTED event. Mastra's observability bus may
27894
+ // dispatch later events outside the user's AsyncLocalStorage context, where
27895
+ // `currentSpan()` returns NOOP_SPAN — which would make our `startSpan()`
27896
+ // calls go to a no-op logger and silently drop. Anchoring on the parent
27897
+ // we observe while still in-context keeps the whole Mastra subtree under
27898
+ // the user's traced scenario.
27899
+ capturedParent;
27900
+ constructor() {
27901
+ _internalSetInitialState();
27902
+ }
27903
+ async exportTracingEvent(event) {
27904
+ const exported = event.exportedSpan;
27905
+ if (exported.isInternal === true) return;
27906
+ try {
27907
+ switch (event.type) {
27908
+ case "span_started":
27909
+ this.onStart(exported);
27910
+ break;
27911
+ case "span_updated":
27912
+ this.onUpdate(exported);
27913
+ break;
27914
+ case "span_ended":
27915
+ this.onEnd(exported);
27916
+ break;
27917
+ }
27918
+ } catch (err) {
27919
+ logExporterError(err);
27920
+ }
27921
+ }
27922
+ async flush() {
27923
+ const state = _internalGetGlobalState();
27924
+ if (state) {
27925
+ await state.bgLogger().flush();
27926
+ }
27927
+ }
27928
+ async shutdown() {
27929
+ await this.flush();
27930
+ this.spans.clear();
27931
+ }
27932
+ onStart(exported) {
27933
+ if (this.spans.has(exported.id)) return;
27934
+ const args = {
27935
+ name: exported.name,
27936
+ spanAttributes: { type: spanTypeFor(exported.type) },
27937
+ startTime: epochSeconds(exported.startTime)
27938
+ };
27939
+ const parentRecord = exported.parentSpanId ? this.spans.get(exported.parentSpanId) : void 0;
27940
+ if (!this.capturedParent) {
27941
+ const probe = currentSpan();
27942
+ if (probe && probe.spanId) {
27943
+ this.capturedParent = probe;
27944
+ }
27945
+ }
27946
+ const span = parentRecord ? parentRecord.span.startSpan(args) : this.capturedParent ? this.capturedParent.startSpan(args) : startSpan(args);
27947
+ const record = { span, hasLoggedInput: false };
27948
+ this.logPayload(record, exported);
27949
+ this.spans.set(exported.id, record);
27950
+ if (exported.isEvent === true) {
27951
+ span.end({ endTime: args.startTime });
27952
+ this.spans.delete(exported.id);
27953
+ }
27954
+ }
27955
+ onUpdate(exported) {
27956
+ const record = this.spans.get(exported.id);
27957
+ if (!record) return;
27958
+ this.logPayload(record, exported);
27959
+ }
27960
+ onEnd(exported) {
27961
+ const record = this.spans.get(exported.id);
27962
+ if (!record) return;
27963
+ this.logPayload(record, exported);
27964
+ if (exported.errorInfo) {
27965
+ record.span.log({
27966
+ error: exported.errorInfo.message || exported.errorInfo.name || "Unknown Mastra error"
27967
+ });
27968
+ }
27969
+ record.span.end({ endTime: epochSeconds(exported.endTime) });
27970
+ this.spans.delete(exported.id);
27971
+ }
27972
+ logPayload(record, exported) {
27973
+ const event = {};
27974
+ if (exported.input !== void 0) {
27975
+ event.input = exported.input;
27976
+ record.hasLoggedInput = true;
27977
+ }
27978
+ if (exported.output !== void 0) {
27979
+ event.output = exported.output;
27980
+ }
27981
+ const metadata = buildMetadata(exported);
27982
+ if (Object.keys(metadata).length > 0) {
27983
+ event.metadata = metadata;
27984
+ }
27985
+ const metrics = modelMetrics(exported.attributes);
27986
+ if (metrics) {
27987
+ event.metrics = metrics;
27988
+ }
27989
+ if (Object.keys(event).length > 0) {
27990
+ record.span.log(event);
27991
+ }
27992
+ }
27993
+ };
27994
+ function logExporterError(err) {
27995
+ debugLogger.warn("Mastra exporter failure:", err);
27996
+ }
27729
27997
  function wrapMastraAgent(agent, _options) {
27730
27998
  return agent;
27731
27999
  }
@@ -33224,6 +33492,7 @@ export {
33224
33492
  BaseExperiment,
33225
33493
  BraintrustLangChainCallbackHandler,
33226
33494
  BraintrustMiddleware,
33495
+ BraintrustObservabilityExporter,
33227
33496
  BraintrustState,
33228
33497
  BraintrustStream,
33229
33498
  CachedSpanFetcher,