braintrust 3.17.0 → 3.19.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 (59) hide show
  1. package/README.md +0 -10
  2. package/dev/dist/index.d.mts +13 -0
  3. package/dev/dist/index.d.ts +13 -0
  4. package/dev/dist/index.js +11289 -7551
  5. package/dev/dist/index.mjs +11249 -7511
  6. package/dist/apply-auto-instrumentation.js +406 -187
  7. package/dist/apply-auto-instrumentation.mjs +237 -18
  8. package/dist/auto-instrumentations/bundler/esbuild.cjs +299 -18
  9. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
  10. package/dist/auto-instrumentations/bundler/next.cjs +299 -18
  11. package/dist/auto-instrumentations/bundler/next.mjs +3 -3
  12. package/dist/auto-instrumentations/bundler/rollup.cjs +299 -18
  13. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
  14. package/dist/auto-instrumentations/bundler/vite.cjs +299 -18
  15. package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
  16. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +298 -17
  17. package/dist/auto-instrumentations/bundler/webpack.cjs +299 -18
  18. package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
  19. package/dist/auto-instrumentations/{chunk-CNQ7BUKN.mjs → chunk-K74TZGGM.mjs} +1 -1
  20. package/dist/auto-instrumentations/{chunk-VXJONZVX.mjs → chunk-S4374IP6.mjs} +96 -6
  21. package/dist/auto-instrumentations/{chunk-E5DUYJWK.mjs → chunk-W4E36GIW.mjs} +210 -15
  22. package/dist/auto-instrumentations/hook.mjs +311 -18
  23. package/dist/auto-instrumentations/index.cjs +213 -16
  24. package/dist/auto-instrumentations/index.d.mts +5 -1
  25. package/dist/auto-instrumentations/index.d.ts +5 -1
  26. package/dist/auto-instrumentations/index.mjs +7 -3
  27. package/dist/auto-instrumentations/loader/cjs-patch.cjs +1 -1
  28. package/dist/auto-instrumentations/loader/cjs-patch.mjs +1 -1
  29. package/dist/auto-instrumentations/loader/esm-hook.mjs +1 -1
  30. package/dist/browser.d.mts +254 -17
  31. package/dist/browser.d.ts +254 -17
  32. package/dist/browser.js +4470 -385
  33. package/dist/browser.mjs +8610 -4525
  34. package/dist/chunk-37RLJF2U.js +29262 -0
  35. package/dist/{chunk-VMBQETG3.js → chunk-LPC4W2WX.js} +80 -4
  36. package/dist/chunk-VEQ2PCMC.mjs +29262 -0
  37. package/dist/{chunk-O4ZIWXO3.mjs → chunk-Y7W7WP6H.mjs} +79 -3
  38. package/dist/cli.js +11262 -7518
  39. package/dist/edge-light.d.mts +1 -1
  40. package/dist/edge-light.d.ts +1 -1
  41. package/dist/edge-light.js +4470 -385
  42. package/dist/edge-light.mjs +8610 -4525
  43. package/dist/index.d.mts +254 -17
  44. package/dist/index.d.ts +254 -17
  45. package/dist/index.js +952 -25912
  46. package/dist/index.mjs +699 -25659
  47. package/dist/instrumentation/index.d.mts +69 -6
  48. package/dist/instrumentation/index.d.ts +69 -6
  49. package/dist/instrumentation/index.js +12602 -8900
  50. package/dist/instrumentation/index.mjs +12602 -8900
  51. package/dist/vitest-evals-reporter.d.mts +22 -0
  52. package/dist/vitest-evals-reporter.d.ts +22 -0
  53. package/dist/vitest-evals-reporter.js +401 -0
  54. package/dist/vitest-evals-reporter.mjs +401 -0
  55. package/dist/workerd.d.mts +1 -1
  56. package/dist/workerd.d.ts +1 -1
  57. package/dist/workerd.js +4470 -385
  58. package/dist/workerd.mjs +8610 -4525
  59. package/package.json +16 -10
@@ -6144,9 +6144,14 @@ interface InstrumentationIntegrationsConfig {
6144
6144
  mistral?: boolean;
6145
6145
  cohere?: boolean;
6146
6146
  groq?: boolean;
6147
+ bedrock?: boolean;
6148
+ awsBedrock?: boolean;
6149
+ awsBedrockRuntime?: boolean;
6147
6150
  genkit?: boolean;
6148
6151
  gitHubCopilot?: boolean;
6149
6152
  openaiCodexSDK?: boolean;
6153
+ piCodingAgent?: boolean;
6154
+ strandsAgentSDK?: boolean;
6150
6155
  langchain?: boolean;
6151
6156
  langgraph?: boolean;
6152
6157
  }
@@ -6195,10 +6200,13 @@ declare class BraintrustPlugin extends BasePlugin {
6195
6200
  private googleADKPlugin;
6196
6201
  private coherePlugin;
6197
6202
  private groqPlugin;
6203
+ private bedrockRuntimePlugin;
6198
6204
  private genkitPlugin;
6199
6205
  private gitHubCopilotPlugin;
6200
6206
  private fluePlugin;
6201
6207
  private langChainPlugin;
6208
+ private piCodingAgentPlugin;
6209
+ private strandsAgentSDKPlugin;
6202
6210
  constructor(config?: BraintrustPluginConfig);
6203
6211
  protected onEnable(): void;
6204
6212
  protected onDisable(): void;
@@ -7621,6 +7629,7 @@ declare class Experiment extends ObjectFetcher<ExperimentEvent> implements Expor
7621
7629
  _waitForId(): Promise<void>;
7622
7630
  get name(): Promise<string>;
7623
7631
  get project(): Promise<ObjectMetadata>;
7632
+ _getBaseExperimentId(): Promise<string | undefined>;
7624
7633
  private parentObjectType;
7625
7634
  protected getState(): Promise<BraintrustState>;
7626
7635
  /**
@@ -8165,15 +8174,69 @@ declare class OpenAIAgentsTraceProcessor {
8165
8174
  private omitKeys;
8166
8175
  }
8167
8176
 
8168
- type FlueObserver = (event: unknown, ctx?: unknown) => void;
8169
8177
  /**
8170
- * Braintrust's Flue observe subscriber.
8171
- *
8172
- * Pass this directly to @flue/runtime/app.observe:
8178
+ * Vendored types for @flue/runtime observe/instrument-based instrumentation.
8173
8179
  *
8174
- * const unsubscribe = observe(braintrustFlueObserver);
8180
+ * Keep this surface intentionally narrow. These types are not exported to SDK
8181
+ * users and should only cover fields we read, correlate, or log.
8175
8182
  */
8176
- declare const braintrustFlueObserver: FlueObserver;
8183
+ type FlueOperationKind = "prompt" | "skill" | "task" | "compact";
8184
+ interface FlueContext {
8185
+ readonly id?: string;
8186
+ readonly runId?: string;
8187
+ [key: string | symbol]: unknown;
8188
+ }
8189
+ type FlueExecutionOperation = {
8190
+ type: "workflow";
8191
+ runId: string;
8192
+ workflowName: string;
8193
+ phase: "start" | "resume";
8194
+ startedAt: string;
8195
+ } | {
8196
+ type: "agent";
8197
+ operationId: string;
8198
+ operationKind: FlueOperationKind;
8199
+ } | {
8200
+ type: "model";
8201
+ turnId: string;
8202
+ } | {
8203
+ type: "tool";
8204
+ toolCallId: string;
8205
+ toolName: string;
8206
+ } | {
8207
+ type: "task";
8208
+ taskId: string;
8209
+ };
8210
+ interface FlueTraceCarrier {
8211
+ traceparent: string;
8212
+ tracestate?: string;
8213
+ }
8214
+ interface FlueExecutionContext {
8215
+ eventContext?: FlueContext;
8216
+ runId?: string;
8217
+ instanceId?: string;
8218
+ submissionId?: string;
8219
+ dispatchId?: string;
8220
+ agentName?: string;
8221
+ conversationId?: string;
8222
+ harness?: string;
8223
+ session?: string;
8224
+ operationId?: string;
8225
+ turnId?: string;
8226
+ taskId?: string;
8227
+ traceCarrier?: FlueTraceCarrier;
8228
+ }
8229
+ type FlueExecutionInterceptor = <T>(operation: FlueExecutionOperation, ctx: FlueExecutionContext, next: () => Promise<T>) => Promise<T>;
8230
+ interface FlueInstrumentation {
8231
+ key?: symbol;
8232
+ observe(event: unknown, ctx?: unknown): void | Promise<void>;
8233
+ interceptor: FlueExecutionInterceptor;
8234
+ dispose(): void | Promise<void>;
8235
+ }
8236
+
8237
+ type FlueObserver = (event: unknown, ctx?: unknown) => void;
8238
+ type BraintrustFlueObserver = FlueObserver & FlueInstrumentation;
8239
+ declare const braintrustFlueObserver: BraintrustFlueObserver;
8177
8240
 
8178
8241
  /**
8179
8242
  * Plugin registry and configuration for auto-instrumentation.
@@ -6144,9 +6144,14 @@ interface InstrumentationIntegrationsConfig {
6144
6144
  mistral?: boolean;
6145
6145
  cohere?: boolean;
6146
6146
  groq?: boolean;
6147
+ bedrock?: boolean;
6148
+ awsBedrock?: boolean;
6149
+ awsBedrockRuntime?: boolean;
6147
6150
  genkit?: boolean;
6148
6151
  gitHubCopilot?: boolean;
6149
6152
  openaiCodexSDK?: boolean;
6153
+ piCodingAgent?: boolean;
6154
+ strandsAgentSDK?: boolean;
6150
6155
  langchain?: boolean;
6151
6156
  langgraph?: boolean;
6152
6157
  }
@@ -6195,10 +6200,13 @@ declare class BraintrustPlugin extends BasePlugin {
6195
6200
  private googleADKPlugin;
6196
6201
  private coherePlugin;
6197
6202
  private groqPlugin;
6203
+ private bedrockRuntimePlugin;
6198
6204
  private genkitPlugin;
6199
6205
  private gitHubCopilotPlugin;
6200
6206
  private fluePlugin;
6201
6207
  private langChainPlugin;
6208
+ private piCodingAgentPlugin;
6209
+ private strandsAgentSDKPlugin;
6202
6210
  constructor(config?: BraintrustPluginConfig);
6203
6211
  protected onEnable(): void;
6204
6212
  protected onDisable(): void;
@@ -7621,6 +7629,7 @@ declare class Experiment extends ObjectFetcher<ExperimentEvent> implements Expor
7621
7629
  _waitForId(): Promise<void>;
7622
7630
  get name(): Promise<string>;
7623
7631
  get project(): Promise<ObjectMetadata>;
7632
+ _getBaseExperimentId(): Promise<string | undefined>;
7624
7633
  private parentObjectType;
7625
7634
  protected getState(): Promise<BraintrustState>;
7626
7635
  /**
@@ -8165,15 +8174,69 @@ declare class OpenAIAgentsTraceProcessor {
8165
8174
  private omitKeys;
8166
8175
  }
8167
8176
 
8168
- type FlueObserver = (event: unknown, ctx?: unknown) => void;
8169
8177
  /**
8170
- * Braintrust's Flue observe subscriber.
8171
- *
8172
- * Pass this directly to @flue/runtime/app.observe:
8178
+ * Vendored types for @flue/runtime observe/instrument-based instrumentation.
8173
8179
  *
8174
- * const unsubscribe = observe(braintrustFlueObserver);
8180
+ * Keep this surface intentionally narrow. These types are not exported to SDK
8181
+ * users and should only cover fields we read, correlate, or log.
8175
8182
  */
8176
- declare const braintrustFlueObserver: FlueObserver;
8183
+ type FlueOperationKind = "prompt" | "skill" | "task" | "compact";
8184
+ interface FlueContext {
8185
+ readonly id?: string;
8186
+ readonly runId?: string;
8187
+ [key: string | symbol]: unknown;
8188
+ }
8189
+ type FlueExecutionOperation = {
8190
+ type: "workflow";
8191
+ runId: string;
8192
+ workflowName: string;
8193
+ phase: "start" | "resume";
8194
+ startedAt: string;
8195
+ } | {
8196
+ type: "agent";
8197
+ operationId: string;
8198
+ operationKind: FlueOperationKind;
8199
+ } | {
8200
+ type: "model";
8201
+ turnId: string;
8202
+ } | {
8203
+ type: "tool";
8204
+ toolCallId: string;
8205
+ toolName: string;
8206
+ } | {
8207
+ type: "task";
8208
+ taskId: string;
8209
+ };
8210
+ interface FlueTraceCarrier {
8211
+ traceparent: string;
8212
+ tracestate?: string;
8213
+ }
8214
+ interface FlueExecutionContext {
8215
+ eventContext?: FlueContext;
8216
+ runId?: string;
8217
+ instanceId?: string;
8218
+ submissionId?: string;
8219
+ dispatchId?: string;
8220
+ agentName?: string;
8221
+ conversationId?: string;
8222
+ harness?: string;
8223
+ session?: string;
8224
+ operationId?: string;
8225
+ turnId?: string;
8226
+ taskId?: string;
8227
+ traceCarrier?: FlueTraceCarrier;
8228
+ }
8229
+ type FlueExecutionInterceptor = <T>(operation: FlueExecutionOperation, ctx: FlueExecutionContext, next: () => Promise<T>) => Promise<T>;
8230
+ interface FlueInstrumentation {
8231
+ key?: symbol;
8232
+ observe(event: unknown, ctx?: unknown): void | Promise<void>;
8233
+ interceptor: FlueExecutionInterceptor;
8234
+ dispose(): void | Promise<void>;
8235
+ }
8236
+
8237
+ type FlueObserver = (event: unknown, ctx?: unknown) => void;
8238
+ type BraintrustFlueObserver = FlueObserver & FlueInstrumentation;
8239
+ declare const braintrustFlueObserver: BraintrustFlueObserver;
8177
8240
 
8178
8241
  /**
8179
8242
  * Plugin registry and configuration for auto-instrumentation.