braintrust 3.29.0 → 3.31.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 (51) hide show
  1. package/dev/dist/index.d.mts +4 -1
  2. package/dev/dist/index.d.ts +4 -1
  3. package/dev/dist/index.js +1492 -887
  4. package/dev/dist/index.mjs +836 -231
  5. package/dist/apply-auto-instrumentation.js +217 -217
  6. package/dist/apply-auto-instrumentation.mjs +2 -2
  7. package/dist/auto-instrumentations/bundler/esbuild.cjs +13 -1
  8. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
  9. package/dist/auto-instrumentations/bundler/next.cjs +22 -4
  10. package/dist/auto-instrumentations/bundler/next.mjs +12 -6
  11. package/dist/auto-instrumentations/bundler/rollup.cjs +13 -1
  12. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
  13. package/dist/auto-instrumentations/bundler/vite.cjs +13 -1
  14. package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
  15. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +13 -1
  16. package/dist/auto-instrumentations/bundler/webpack.cjs +13 -1
  17. package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
  18. package/dist/auto-instrumentations/{chunk-DKTGDNA7.mjs → chunk-LW4HDHXT.mjs} +1 -1
  19. package/dist/auto-instrumentations/{chunk-OMCZ3MV2.mjs → chunk-OXINGIEZ.mjs} +1 -1
  20. package/dist/auto-instrumentations/{chunk-AOIYCVEL.mjs → chunk-U64OYU4Q.mjs} +13 -1
  21. package/dist/auto-instrumentations/hook.mjs +18 -4
  22. package/dist/auto-instrumentations/index.cjs +13 -1
  23. package/dist/auto-instrumentations/index.mjs +1 -1
  24. package/dist/browser.d.mts +614 -480
  25. package/dist/browser.d.ts +614 -480
  26. package/dist/browser.js +1172 -305
  27. package/dist/browser.mjs +1172 -305
  28. package/dist/{chunk-6Z5S7VOU.js → chunk-4AQGZS6X.js} +13 -1
  29. package/dist/{chunk-M6XPNJC4.mjs → chunk-AJT4FR25.mjs} +703 -120
  30. package/dist/{chunk-7FA6VP2S.mjs → chunk-CE3BLB2L.mjs} +13 -1
  31. package/dist/{chunk-XLLGRXGR.js → chunk-V32LW47Z.js} +1819 -1236
  32. package/dist/cli.js +846 -241
  33. package/dist/edge-light.d.mts +1 -1
  34. package/dist/edge-light.d.ts +1 -1
  35. package/dist/edge-light.js +1172 -305
  36. package/dist/edge-light.mjs +1172 -305
  37. package/dist/index.d.mts +614 -480
  38. package/dist/index.d.ts +614 -480
  39. package/dist/index.js +915 -643
  40. package/dist/index.mjs +349 -77
  41. package/dist/instrumentation/index.d.mts +15 -0
  42. package/dist/instrumentation/index.d.ts +15 -0
  43. package/dist/instrumentation/index.js +836 -230
  44. package/dist/instrumentation/index.mjs +836 -230
  45. package/dist/vitest-evals-reporter.js +16 -16
  46. package/dist/vitest-evals-reporter.mjs +2 -2
  47. package/dist/workerd.d.mts +1 -1
  48. package/dist/workerd.d.ts +1 -1
  49. package/dist/workerd.js +1172 -305
  50. package/dist/workerd.mjs +1172 -305
  51. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -673,6 +673,9 @@ interface Score {
673
673
  */
674
674
  error?: unknown;
675
675
  }
676
+ type SingleScore = Omit<Score, "name"> & {
677
+ name?: string;
678
+ };
676
679
 
677
680
  declare const spanComponentsV4Schema: z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
678
681
  object_type: z.ZodNativeEnum<typeof SpanObjectTypeV3>;
@@ -23679,6 +23682,117 @@ interface RegisterSandboxResult {
23679
23682
  */
23680
23683
  declare function registerSandbox(options: RegisterSandboxOptions): Promise<RegisterSandboxResult>;
23681
23684
 
23685
+ type OpenAIBatchJSONL = string | Iterable<unknown> | AsyncIterable<unknown>;
23686
+ type OpenAIBatchFileContent = OpenAIBatchJSONL | Response;
23687
+ type OpenAIBatchFile = OpenAIBatchFileContent | PromiseLike<OpenAIBatchFileContent>;
23688
+ interface OpenAIFileLike {
23689
+ id: string;
23690
+ [key: string]: unknown;
23691
+ }
23692
+ interface OpenAIBatchLike {
23693
+ id: string;
23694
+ endpoint: string;
23695
+ input_file_id: string;
23696
+ status: string;
23697
+ created_at?: number | null;
23698
+ in_progress_at?: number | null;
23699
+ completed_at?: number | null;
23700
+ failed_at?: number | null;
23701
+ expired_at?: number | null;
23702
+ cancelled_at?: number | null;
23703
+ request_counts?: {
23704
+ completed?: number;
23705
+ failed?: number;
23706
+ total?: number;
23707
+ } | null;
23708
+ [key: string]: unknown;
23709
+ }
23710
+ type OpenAIEnhancedResponse<T> = {
23711
+ response: Response;
23712
+ data: T;
23713
+ request_id?: string | null;
23714
+ };
23715
+ interface OpenAIAPIPromise$1<T> extends Promise<T> {
23716
+ withResponse(): Promise<OpenAIEnhancedResponse<T>>;
23717
+ asResponse(): Promise<Response>;
23718
+ }
23719
+ interface OpenAIFilesResource<TParams, TFile, TOptions> {
23720
+ create(params: TParams, options?: TOptions): OpenAIAPIPromise$1<TFile>;
23721
+ }
23722
+ interface OpenAIBatchesResource<TBatch, TOptions> {
23723
+ retrieve(batchId: string, options?: TOptions): OpenAIAPIPromise$1<TBatch>;
23724
+ }
23725
+ interface CompleteOpenAIBatchTraceArgs {
23726
+ inputFileId: string;
23727
+ inputFileContent: OpenAIBatchFile;
23728
+ outputFileContent?: OpenAIBatchFile;
23729
+ errorFileContent?: OpenAIBatchFile;
23730
+ }
23731
+
23732
+ /**
23733
+ * Wrap `openai.files.create` to trace an OpenAI Batch input file upload.
23734
+ *
23735
+ * Pass the `openai.files` resource, then call the returned function with the
23736
+ * same arguments as `openai.files.create`. Files whose purpose is not `batch`
23737
+ * are passed through without tracing. Blob and Response uploads are copied for
23738
+ * tracing; async-iterable uploads (including Node file streams) are teed so the
23739
+ * exact bytes still flow to OpenAI while Braintrust reads a separate branch.
23740
+ *
23741
+ * The returned input file ID identifies the trace. Each request span is
23742
+ * identified by that file ID and its JSONL `custom_id`, so use every traced
23743
+ * input file for only one OpenAI Batch.
23744
+ *
23745
+ * @example
23746
+ * ```ts
23747
+ * const inputFile = await openaiFilesCreateTraced(openai.files)({
23748
+ * file: createReadStream("batch.jsonl"),
23749
+ * purpose: "batch",
23750
+ * });
23751
+ * ```
23752
+ */
23753
+ declare function openaiFilesCreateTraced<TParams, TFile extends OpenAIFileLike, TOptions = unknown>(files: OpenAIFilesResource<TParams, TFile, TOptions>): (params: TParams, options?: TOptions) => OpenAIAPIPromise$1<TFile>;
23754
+ /**
23755
+ * Wrap `openai.batches.retrieve` to update an OpenAI Batch trace with the
23756
+ * server-recorded lifecycle timestamps and close its spans at a terminal
23757
+ * status.
23758
+ *
23759
+ * Pass the `openai.batches` resource, then call the returned function with the
23760
+ * same arguments as `openai.batches.retrieve`. The Batch must use an input file
23761
+ * previously uploaded through `openaiFilesCreateTraced` in this process.
23762
+ *
23763
+ * @example
23764
+ * ```ts
23765
+ * const batch = await openaiBatchesRetrieveTraced(openai.batches)(batchId);
23766
+ * ```
23767
+ */
23768
+ declare function openaiBatchesRetrieveTraced<TBatch extends OpenAIBatchLike, TOptions = unknown>(batches: OpenAIBatchesResource<TBatch, TOptions>): (batchId: string, options?: TOptions) => OpenAIAPIPromise$1<TBatch>;
23769
+ /**
23770
+ * Add result data to spans created by `openaiFilesCreateTraced`.
23771
+ *
23772
+ * This helper performs no OpenAI API requests. Pass the input file ID and the
23773
+ * input, output, and error contents returned by `openai.files.content`, or pass
23774
+ * JSONL strings/iterables directly. Response bodies are consumed. Call
23775
+ * `openaiBatchesRetrieveTraced` first when exact OpenAI lifecycle timestamps
23776
+ * are available.
23777
+ *
23778
+ * @example
23779
+ * ```ts
23780
+ * const outputFileContent = batch.output_file_id
23781
+ * ? await openai.files.content(batch.output_file_id)
23782
+ * : undefined;
23783
+ * const errorFileContent = batch.error_file_id
23784
+ * ? await openai.files.content(batch.error_file_id)
23785
+ * : undefined;
23786
+ * await completeOpenAIBatchTrace({
23787
+ * inputFileId: batch.input_file_id,
23788
+ * inputFileContent: await openai.files.content(batch.input_file_id),
23789
+ * outputFileContent,
23790
+ * errorFileContent,
23791
+ * });
23792
+ * ```
23793
+ */
23794
+ declare function completeOpenAIBatchTrace(args: CompleteOpenAIBatchTraceArgs): Promise<void>;
23795
+
23682
23796
  declare function isTemplateFormat(v: unknown): v is TemplateFormat;
23683
23797
  declare function parseTemplateFormat(value: unknown, defaultFormat?: TemplateFormat): TemplateFormat;
23684
23798
  declare function renderTemplateContent(template: string, variables: Record<string, unknown>, escape: (v: unknown) => string, options: {
@@ -24097,10 +24211,12 @@ declare function parseCachedHeader(value: string | null | undefined): number | u
24097
24211
  */
24098
24212
  interface OpenAIAPIPromise<T> extends Promise<T> {
24099
24213
  withResponse(): Promise<OpenAIWithResponse<T>>;
24214
+ asResponse(): Promise<Response>;
24100
24215
  }
24101
24216
  interface OpenAIWithResponse<T> {
24102
24217
  data: T;
24103
24218
  response: Response;
24219
+ request_id?: string | null;
24104
24220
  }
24105
24221
  interface OpenAIChatCreateParams {
24106
24222
  messages: unknown;
@@ -24941,8 +25057,23 @@ type EveProviderStepAttemptTerminalEvent = {
24941
25057
  readonly type: "step.attempt.completed" | "step.attempt.failed";
24942
25058
  };
24943
25059
  type EveProviderHandler<TEvent> = (event: TEvent, context: EveProviderContext) => void | PromiseLike<void>;
25060
+ type EveChannelAudience = "private" | "public" | "unknown";
25061
+ interface EveTraceCaptureContext {
25062
+ readonly agentName?: string;
25063
+ readonly audience: EveChannelAudience;
25064
+ readonly channelType?: string;
25065
+ }
25066
+ type EveTracePolicyDecision = {
25067
+ readonly emit: false;
25068
+ } | {
25069
+ readonly emit: true;
25070
+ readonly recordInputs: boolean;
25071
+ readonly recordOutputs: boolean;
25072
+ };
25073
+ type EveTraceCapturePolicy = (trace: EveTraceCaptureContext) => EveTracePolicyDecision | boolean;
24944
25074
  interface EveProviderDefinition {
24945
25075
  readonly capture?: "content" | "metadata";
25076
+ readonly tracePolicy?: EveTraceCapturePolicy;
24946
25077
  readonly events?: {
24947
25078
  readonly "action.completed"?: EveProviderHandler<EveProviderActionTerminalEvent>;
24948
25079
  readonly "action.failed"?: EveProviderHandler<EveProviderActionTerminalEvent>;
@@ -25502,483 +25633,6 @@ declare function wrapLangSmithTraceable<T>(namespace: T): T;
25502
25633
  declare function wrapLangSmithRunTrees<T>(namespace: T): T;
25503
25634
  declare function wrapLangSmithClient<T>(namespace: T): T;
25504
25635
 
25505
- type ScorerFunction<Output = unknown> = (args: {
25506
- output: Output;
25507
- expected?: unknown;
25508
- input?: unknown;
25509
- metadata?: Record<string, unknown>;
25510
- }) => Score | Promise<Score> | number | null | Array<Score>;
25511
- type ProgressEvent = {
25512
- type: "suite_start";
25513
- suiteName: string;
25514
- } | {
25515
- type: "test_start";
25516
- testName: string;
25517
- } | {
25518
- type: "test_complete";
25519
- testName: string;
25520
- passed: boolean;
25521
- duration: number;
25522
- } | {
25523
- type: "suite_complete";
25524
- suiteName: string;
25525
- passed: number;
25526
- failed: number;
25527
- };
25528
-
25529
- interface BraintrustTestConfig {
25530
- input?: unknown;
25531
- expected?: unknown;
25532
- metadata?: Record<string, unknown>;
25533
- tags?: string[];
25534
- scorers?: ScorerFunction[];
25535
- data?: Array<{
25536
- input?: unknown;
25537
- expected?: unknown;
25538
- metadata?: Record<string, unknown>;
25539
- tags?: string[];
25540
- }>;
25541
- }
25542
- interface TestConfig extends BraintrustTestConfig {
25543
- [key: string]: unknown;
25544
- }
25545
- type WithModifiers<T> = T & {
25546
- skip: T;
25547
- only: T;
25548
- concurrent: T;
25549
- todo: (name: string) => void;
25550
- };
25551
- type TestContext = Pick<BraintrustTestConfig, "input" | "expected" | "metadata">;
25552
- type BaseTestFunction<VitestContext = unknown> = {
25553
- (name: string, fn: (context: VitestContext) => void | Promise<void>): void;
25554
- each?: <T>(cases: readonly T[]) => (name: string, fn: (context: T) => void | Promise<void>) => void;
25555
- };
25556
- type TestFunction<VitestContext = unknown> = WithModifiers<BaseTestFunction<VitestContext>>;
25557
- type BaseDescribeFunction = {
25558
- (name: string, factory: () => void): void;
25559
- each?: <T>(cases: readonly T[]) => (name: string, factory: () => void) => void;
25560
- };
25561
- type DescribeFunction = WithModifiers<BaseDescribeFunction>;
25562
- interface BaseWrappedTest<VitestContext = unknown> {
25563
- (name: string, fn: (context: VitestContext) => unknown | Promise<unknown>): void;
25564
- (name: string, config: TestConfig, fn: (context: TestContext & VitestContext) => unknown | Promise<unknown>): void;
25565
- each: <T>(cases: readonly T[]) => (name: string, fn: (context: T & TestContext & VitestContext) => unknown | Promise<unknown>) => void;
25566
- }
25567
- type WrappedTest<VitestContext = unknown> = WithModifiers<BaseWrappedTest<VitestContext>>;
25568
- interface BaseWrappedDescribe {
25569
- (name: string, factory: () => void): void;
25570
- each: <T>(cases: readonly T[]) => (name: string, factory: () => void) => void;
25571
- }
25572
- type WrappedDescribe = WithModifiers<BaseWrappedDescribe>;
25573
- interface VitestMethods<VitestContext = unknown, ExpectType extends (...args: unknown[]) => unknown = (...args: unknown[]) => unknown> {
25574
- test: TestFunction<VitestContext>;
25575
- it?: TestFunction<VitestContext>;
25576
- expect: ExpectType;
25577
- describe: DescribeFunction;
25578
- beforeAll?: (fn: () => void | Promise<void>) => void;
25579
- afterAll?: (fn: () => void | Promise<void>) => void;
25580
- beforeEach?: (fn: (context: VitestContext) => void | Promise<void>) => void;
25581
- afterEach?: (fn: (context: VitestContext) => void | Promise<void>) => void;
25582
- }
25583
- interface BraintrustVitest<VitestContext = unknown, ExpectType extends (...args: unknown[]) => unknown = (...args: unknown[]) => unknown> {
25584
- test: WrappedTest<VitestContext>;
25585
- it: WrappedTest<VitestContext>;
25586
- expect: ExpectType;
25587
- describe: WrappedDescribe;
25588
- beforeAll: (fn: () => void | Promise<void>) => void;
25589
- afterAll: (fn: () => void | Promise<void>) => void;
25590
- beforeEach?: (fn: (context: VitestContext) => void | Promise<void>) => void;
25591
- afterEach?: (fn: (context: VitestContext) => void | Promise<void>) => void;
25592
- logOutputs: (outputs: Record<string, unknown>) => void;
25593
- logFeedback: (feedback: {
25594
- name: string;
25595
- score: number;
25596
- metadata?: Record<string, unknown>;
25597
- }) => void;
25598
- getCurrentSpan: () => Span | null;
25599
- /**
25600
- * Helper function to flush the experiment and optionally display a summary.
25601
- * Use this in afterAll() instead of manually calling getExperimentContext().
25602
- *
25603
- * @param options - Optional configuration
25604
- * @param options.displaySummary - Whether to display the experiment summary (defaults to true)
25605
- */
25606
- flushExperiment: (options?: {
25607
- displaySummary?: boolean;
25608
- }) => Promise<void>;
25609
- }
25610
- interface WrapperConfig {
25611
- projectName?: string;
25612
- /**
25613
- * The id of the project to create experiments in. Takes precedence over
25614
- * `projectName` if both are set.
25615
- */
25616
- projectId?: string;
25617
- /**
25618
- * If true, displays a formatted experiment summary with scores and URL after the test suite completes.
25619
- * Defaults to true. Set to false to suppress the summary output.
25620
- */
25621
- displaySummary?: boolean;
25622
- /**
25623
- * Callback for real-time progress events.
25624
- * Called when tests start, complete, or progress updates occur.
25625
- * Progress reporting is always enabled when this callback is provided.
25626
- */
25627
- onProgress?: (event: ProgressEvent) => void;
25628
- }
25629
-
25630
- /**
25631
- * Wraps Vitest methods with Braintrust experiment tracking. This automatically creates
25632
- * datasets and experiments from your Vitest tests, tracking pass/fail rates and evaluation metrics.
25633
- * Experiments are automatically flushed after all tests complete.
25634
- *
25635
- * @param vitestMethods - Object containing Vitest methods (test, describe, expect, etc.)
25636
- * @param config - Optional configuration object
25637
- * @param config.projectName - Project name for the experiment (defaults to suite name)
25638
- * @param config.displaySummary - If true, displays experiment summary after flushing (defaults to true)
25639
- * @returns Wrapped Vitest methods with Braintrust experiment tracking
25640
- *
25641
- * @example Basic Usage
25642
- * ```typescript
25643
- * import * as vitest from "vitest";
25644
- * import { wrapVitest } from 'braintrust';
25645
- *
25646
- * const {test, expect, describe } = wrapVitest(
25647
- * { projectName: 'my-project' }
25648
- * );
25649
- *
25650
- * describe('Translation Tests', () => {
25651
- *
25652
- * // Tests with input/expected are automatically added to the dataset
25653
- * test(
25654
- * 'translates hello',
25655
- * {
25656
- * input: { text: 'hello' },
25657
- * expected: 'hola',
25658
- * metadata: { language: 'spanish' },
25659
- * },
25660
- * async ({ input, expected }) => {
25661
- * const result = await translate(input.text);
25662
- * bt.logOutputs({ translation: result });
25663
- * expect(result).toBe(expected);
25664
- * }
25665
- * );
25666
- *
25667
- * // Tests without input/expected still run and track pass/fail
25668
- * test('basic functionality', async () => {
25669
- * const result = await someFunction();
25670
- * expect(result).toBeTruthy();
25671
- * });
25672
- * });
25673
- * ```
25674
- *
25675
- * @see README.md for full documentation and examples
25676
- */
25677
- declare function wrapVitest<VitestContext = unknown, ExpectType extends (...args: unknown[]) => unknown = (...args: unknown[]) => unknown>(vitestMethods: VitestMethods<VitestContext, ExpectType>, config?: WrapperConfig): BraintrustVitest<VitestContext, ExpectType>;
25678
-
25679
- /** Progress events emitted by the node-test integration. */
25680
- type NodeTestProgressEvent = {
25681
- type: "test_start";
25682
- testName: string;
25683
- } | {
25684
- type: "test_complete";
25685
- testName: string;
25686
- passed: boolean;
25687
- duration: number;
25688
- };
25689
- /**
25690
- * Minimal test context interface compatible with node:test's TestContext.
25691
- * We only use `name` from the context, making this compatible with any
25692
- * test runner that provides a `{ name?: string }` context object.
25693
- */
25694
- interface MinimalTestContext {
25695
- name?: string;
25696
- }
25697
- /**
25698
- * Configuration for `initNodeTestSuite()`.
25699
- */
25700
- interface NodeTestSuiteConfig {
25701
- /** Project name for the Braintrust experiment. */
25702
- projectName: string;
25703
- /** Optional experiment name. Defaults to a timestamp-based name. */
25704
- experimentName?: string;
25705
- /**
25706
- * If true, displays a formatted experiment summary after flushing.
25707
- * Defaults to true.
25708
- */
25709
- displaySummary?: boolean;
25710
- /**
25711
- * Pass `after` from `node:test` to auto-register a flush hook.
25712
- * When provided, `suite.flush()` is called automatically after all tests.
25713
- */
25714
- after?: (fn: () => void | Promise<void>) => void;
25715
- /**
25716
- * Callback for real-time progress events.
25717
- * Emits `test_start` and `test_complete` events.
25718
- */
25719
- onProgress?: (event: NodeTestProgressEvent) => void;
25720
- }
25721
- /**
25722
- * Configuration for a single eval test case.
25723
- */
25724
- interface EvalConfig {
25725
- /** Test input data, logged to the span. */
25726
- input?: unknown;
25727
- /** Expected output, passed to scorers. */
25728
- expected?: unknown;
25729
- /** Custom metadata, logged to the span. */
25730
- metadata?: Record<string, unknown>;
25731
- /** Tags for organizing test cases. */
25732
- tags?: string[];
25733
- /** Scorer functions to evaluate the output. */
25734
- scorers?: ScorerFunction[];
25735
- /** Override span name (defaults to `t.name`, then `"unnamed test"`). */
25736
- name?: string;
25737
- }
25738
- /**
25739
- * Context passed to the eval test function.
25740
- */
25741
- interface EvalContext {
25742
- input: unknown;
25743
- expected?: unknown;
25744
- metadata?: Record<string, unknown>;
25745
- }
25746
- /**
25747
- * The public API surface returned by `initNodeTestSuite()`.
25748
- */
25749
- interface NodeTestSuite {
25750
- /**
25751
- * Creates a test function compatible with `node:test`.
25752
- * Pass the result to `test()` from `node:test`.
25753
- *
25754
- * @param config - Eval configuration (input, expected, scorers, etc.)
25755
- * @param fn - The test function. Its return value is logged as output and passed to scorers.
25756
- * @returns A function accepting a test context `t` from `node:test`.
25757
- */
25758
- eval(config: EvalConfig, fn: (context: EvalContext) => unknown | Promise<unknown>): (t: MinimalTestContext) => Promise<void>;
25759
- /**
25760
- * Flush the experiment: summarize results and send data to Braintrust.
25761
- * Called automatically if `after` was provided in the config.
25762
- */
25763
- flush(): Promise<void>;
25764
- }
25765
-
25766
- /**
25767
- * Creates a new Node.js test suite with Braintrust experiment tracking.
25768
- *
25769
- * @example
25770
- * ```typescript
25771
- * import { test, describe, after } from 'node:test';
25772
- * import { initNodeTestSuite } from 'braintrust';
25773
- *
25774
- * describe('My Tests', () => {
25775
- * const suite = initNodeTestSuite({ projectName: 'my-project', after });
25776
- *
25777
- * test('my eval', suite.eval(
25778
- * { input: 'hello', expected: 'world', scorers: [myScorer] },
25779
- * async ({ input }) => {
25780
- * return await myFunction(input);
25781
- * }
25782
- * ));
25783
- * });
25784
- * ```
25785
- */
25786
- declare function initNodeTestSuite(config: NodeTestSuiteConfig): NodeTestSuite;
25787
-
25788
- type LangChainSerialized = {
25789
- id?: unknown[];
25790
- name?: string;
25791
- };
25792
- type LangChainCallbackHandlerOptions<IsAsyncFlush extends boolean> = {
25793
- debug: boolean;
25794
- excludeMetadataProps: RegExp;
25795
- logger?: Logger<IsAsyncFlush> | Span;
25796
- parent?: Span | (() => Span);
25797
- };
25798
- type LangChainStartSpanArgs = StartSpanArgs & {
25799
- parentRunId?: string;
25800
- runId: string;
25801
- };
25802
- type LangChainEndSpanArgs = ExperimentLogPartialArgs & {
25803
- parentRunId?: string;
25804
- runId: string;
25805
- tags?: string[];
25806
- };
25807
- type LangChainLLMResult = {
25808
- generations?: unknown[];
25809
- llmOutput?: Record<string, unknown>;
25810
- };
25811
-
25812
- declare const BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME = "BraintrustCallbackHandler";
25813
- declare class BraintrustLangChainCallbackHandler<IsAsyncFlush extends boolean = true> {
25814
- name: string;
25815
- private spans;
25816
- private skippedRuns;
25817
- private parent?;
25818
- private rootRunId?;
25819
- private options;
25820
- private startTimes;
25821
- private firstTokenTimes;
25822
- private ttftMs;
25823
- constructor(options?: Partial<LangChainCallbackHandlerOptions<IsAsyncFlush>>);
25824
- protected startSpan({ runId, parentRunId, ...args }: LangChainStartSpanArgs): void;
25825
- protected endSpan({ runId, parentRunId, tags, metadata, ...args }: LangChainEndSpanArgs): void;
25826
- handleLLMStart(llm: LangChainSerialized, prompts: string[], runId: string, parentRunId?: string, extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<void>;
25827
- handleLLMError(err: Error, runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
25828
- handleLLMEnd(output: LangChainLLMResult, runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
25829
- handleChatModelStart(llm: LangChainSerialized, messages: unknown[][], runId: string, parentRunId?: string, extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<void>;
25830
- handleChainStart(chain: LangChainSerialized, inputs: unknown, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, runType?: string, runName?: string): Promise<void>;
25831
- handleChainError(err: Error, runId: string, parentRunId?: string, tags?: string[], kwargs?: {
25832
- inputs?: Record<string, unknown>;
25833
- }): Promise<void>;
25834
- handleChainEnd(outputs: unknown, runId: string, parentRunId?: string, tags?: string[], kwargs?: {
25835
- inputs?: Record<string, unknown>;
25836
- }): Promise<void>;
25837
- handleToolStart(tool: LangChainSerialized, input: string, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<void>;
25838
- handleToolError(err: Error, runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
25839
- handleToolEnd(output: unknown, runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
25840
- handleAgentAction(action: Record<string, unknown>, runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
25841
- handleAgentEnd(action: unknown, runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
25842
- handleRetrieverStart(retriever: LangChainSerialized, query: string, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, name?: string): Promise<void>;
25843
- handleRetrieverEnd(documents: unknown[], runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
25844
- handleRetrieverError(err: Error, runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
25845
- handleLLMNewToken(_token: string, _idx: {
25846
- prompt: number;
25847
- completion: number;
25848
- }, runId: string, _parentRunId?: string, _tags?: string[]): Promise<void>;
25849
- }
25850
-
25851
- interface BuildContext {
25852
- getFunctionId(functionObj: unknown): Promise<FunctionIdType>;
25853
- }
25854
- interface Node {
25855
- readonly id: string;
25856
- __type: "node";
25857
- build(context: BuildContext): Promise<GraphNodeType>;
25858
- addDependency(dependency: Dependency): void;
25859
- }
25860
- type NodeLike = Node | Prompt<boolean, boolean> | ProxyVariable;
25861
- type LazyGraphNode = {
25862
- type: "lazy";
25863
- id: string;
25864
- };
25865
- declare class GraphBuilder {
25866
- private nodes;
25867
- private edges;
25868
- private nodeLikeNodes;
25869
- readonly IN: InputNode;
25870
- readonly OUT: OutputNode;
25871
- constructor();
25872
- build(context: BuildContext): Promise<GraphDataType>;
25873
- addEdge({ source, sourceVar, target, targetVar, expr, purpose, }: {
25874
- source: NodeLike;
25875
- sourceVar?: string;
25876
- target: NodeLike;
25877
- targetVar?: string;
25878
- expr?: string;
25879
- purpose: GraphEdgeType["purpose"];
25880
- }): void;
25881
- resolveNode(node: NodeLike): [Node, string[]];
25882
- literal<T>(value: T): LiteralNode<T>;
25883
- gate(options: {
25884
- condition: string;
25885
- }): GateNode;
25886
- aggregator(): AggregatorNode;
25887
- promptTemplate(options: {
25888
- prompt: PromptBlockDataType;
25889
- }): PromptTemplateNode;
25890
- private generateId;
25891
- private createInputNode;
25892
- private createOutputNode;
25893
- private createPromptNode;
25894
- }
25895
- type ProxyVariable = {
25896
- [key: string]: ProxyVariable;
25897
- };
25898
- type TransformFn = (input: ProxyVariable) => Node;
25899
- interface Dependency {
25900
- node: Node;
25901
- sourceVar?: string;
25902
- targetVar?: string;
25903
- expr?: string;
25904
- }
25905
- declare abstract class BaseNode implements Node {
25906
- protected graph: GraphBuilder;
25907
- readonly id: string;
25908
- readonly __type = "node";
25909
- dependencies: Dependency[];
25910
- constructor(graph: GraphBuilder, id: string);
25911
- addDependency(dependency: Dependency): void;
25912
- abstract build(context: BuildContext): Promise<GraphNodeType>;
25913
- }
25914
- declare class InputNode extends BaseNode implements Node {
25915
- constructor(graph: GraphBuilder, id: string);
25916
- build(context: BuildContext): Promise<GraphNodeType>;
25917
- }
25918
- declare class OutputNode extends BaseNode implements Node {
25919
- constructor(graph: GraphBuilder, id: string);
25920
- build(context: BuildContext): Promise<GraphNodeType>;
25921
- }
25922
- declare class PromptNode extends BaseNode implements Node {
25923
- private prompt;
25924
- constructor(graph: GraphBuilder, id: string, prompt: Prompt);
25925
- build(context: BuildContext): Promise<GraphNodeType>;
25926
- }
25927
- declare class GateNode extends BaseNode implements Node {
25928
- private condition;
25929
- constructor(graph: GraphBuilder, id: string, condition: string);
25930
- build(context: BuildContext): Promise<GraphNodeType>;
25931
- }
25932
- declare class AggregatorNode extends BaseNode implements Node {
25933
- constructor(graph: GraphBuilder, id: string);
25934
- build(context: BuildContext): Promise<GraphNodeType>;
25935
- }
25936
- declare class PromptTemplateNode extends BaseNode implements Node {
25937
- private prompt;
25938
- constructor(graph: GraphBuilder, id: string, prompt: PromptBlockDataType);
25939
- build(context: BuildContext): Promise<GraphNodeType>;
25940
- }
25941
- declare class LiteralNode<T> extends BaseNode implements Node {
25942
- private value;
25943
- constructor(graph: GraphBuilder, id: string, value: T);
25944
- build(context: BuildContext): Promise<GraphNodeType>;
25945
- }
25946
- declare function createGraph(): GraphBuilder;
25947
- declare function escapePath(parts: string[]): string | undefined;
25948
- declare function unescapePath(path: string): string[];
25949
- declare const _default: {
25950
- createGraph: typeof createGraph;
25951
- };
25952
-
25953
- type graphFramework_AggregatorNode = AggregatorNode;
25954
- declare const graphFramework_AggregatorNode: typeof AggregatorNode;
25955
- type graphFramework_BuildContext = BuildContext;
25956
- type graphFramework_GateNode = GateNode;
25957
- declare const graphFramework_GateNode: typeof GateNode;
25958
- type graphFramework_GraphBuilder = GraphBuilder;
25959
- declare const graphFramework_GraphBuilder: typeof GraphBuilder;
25960
- type graphFramework_InputNode = InputNode;
25961
- declare const graphFramework_InputNode: typeof InputNode;
25962
- type graphFramework_LazyGraphNode = LazyGraphNode;
25963
- type graphFramework_LiteralNode<T> = LiteralNode<T>;
25964
- declare const graphFramework_LiteralNode: typeof LiteralNode;
25965
- type graphFramework_Node = Node;
25966
- type graphFramework_NodeLike = NodeLike;
25967
- type graphFramework_OutputNode = OutputNode;
25968
- declare const graphFramework_OutputNode: typeof OutputNode;
25969
- type graphFramework_PromptNode = PromptNode;
25970
- declare const graphFramework_PromptNode: typeof PromptNode;
25971
- type graphFramework_PromptTemplateNode = PromptTemplateNode;
25972
- declare const graphFramework_PromptTemplateNode: typeof PromptTemplateNode;
25973
- type graphFramework_ProxyVariable = ProxyVariable;
25974
- type graphFramework_TransformFn = TransformFn;
25975
- declare const graphFramework_createGraph: typeof createGraph;
25976
- declare const graphFramework_escapePath: typeof escapePath;
25977
- declare const graphFramework_unescapePath: typeof unescapePath;
25978
- declare namespace graphFramework {
25979
- export { graphFramework_AggregatorNode as AggregatorNode, type graphFramework_BuildContext as BuildContext, graphFramework_GateNode as GateNode, graphFramework_GraphBuilder as GraphBuilder, graphFramework_InputNode as InputNode, type graphFramework_LazyGraphNode as LazyGraphNode, graphFramework_LiteralNode as LiteralNode, type graphFramework_Node as Node, type graphFramework_NodeLike as NodeLike, graphFramework_OutputNode as OutputNode, graphFramework_PromptNode as PromptNode, graphFramework_PromptTemplateNode as PromptTemplateNode, type graphFramework_ProxyVariable as ProxyVariable, type graphFramework_TransformFn as TransformFn, graphFramework_createGraph as createGraph, _default as default, graphFramework_escapePath as escapePath, graphFramework_unescapePath as unescapePath };
25980
- }
25981
-
25982
25636
  type GenericFunction<Input, Output> = ((input: Input) => Output) | ((input: Input) => Promise<Output>);
25983
25637
  interface BaseFnOpts {
25984
25638
  name: string;
@@ -46582,7 +46236,7 @@ type EvalScorerArgs<Input, Output, Expected, Metadata extends BaseMetadata = Def
46582
46236
  output: Output;
46583
46237
  trace?: Trace;
46584
46238
  };
46585
- type OneOrMoreScores = Score | number | null | Array<Score>;
46239
+ type OneOrMoreScores = SingleScore | number | null | Array<Score>;
46586
46240
  type EvalScorer<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = (args: EvalScorerArgs<Input, Output, Expected, Metadata>) => OneOrMoreScores | Promise<OneOrMoreScores>;
46587
46241
  type OneOrMoreClassifications = Classification | Classification[] | null;
46588
46242
  type EvalClassifier<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = (args: EvalScorerArgs<Input, Output, Expected, Metadata>) => OneOrMoreClassifications | Promise<OneOrMoreClassifications>;
@@ -46852,6 +46506,483 @@ type ScoreAccumulator = {
46852
46506
  declare function buildLocalSummary(evaluator: EvaluatorDef<any, any, any, any>, results: EvalResult<any, any, any, any>[], precomputedScores?: ScoreAccumulator): ExperimentSummary;
46853
46507
  declare function reportFailures<Input, Output, Expected, Metadata extends BaseMetadata>(evaluator: EvaluatorDef<Input, Output, Expected, Metadata>, failingResults: EvalResult<Input, Output, Expected, Metadata>[], { verbose, jsonl }: ReporterOpts): void;
46854
46508
 
46509
+ type ScorerFunction<Output = unknown> = (args: {
46510
+ output: Output;
46511
+ expected?: unknown;
46512
+ input?: unknown;
46513
+ metadata?: Record<string, unknown>;
46514
+ }) => OneOrMoreScores | Promise<OneOrMoreScores>;
46515
+ type ProgressEvent = {
46516
+ type: "suite_start";
46517
+ suiteName: string;
46518
+ } | {
46519
+ type: "test_start";
46520
+ testName: string;
46521
+ } | {
46522
+ type: "test_complete";
46523
+ testName: string;
46524
+ passed: boolean;
46525
+ duration: number;
46526
+ } | {
46527
+ type: "suite_complete";
46528
+ suiteName: string;
46529
+ passed: number;
46530
+ failed: number;
46531
+ };
46532
+
46533
+ interface BraintrustTestConfig {
46534
+ input?: unknown;
46535
+ expected?: unknown;
46536
+ metadata?: Record<string, unknown>;
46537
+ tags?: string[];
46538
+ scorers?: ScorerFunction[];
46539
+ data?: Array<{
46540
+ input?: unknown;
46541
+ expected?: unknown;
46542
+ metadata?: Record<string, unknown>;
46543
+ tags?: string[];
46544
+ }>;
46545
+ }
46546
+ interface TestConfig extends BraintrustTestConfig {
46547
+ [key: string]: unknown;
46548
+ }
46549
+ type WithModifiers<T> = T & {
46550
+ skip: T;
46551
+ only: T;
46552
+ concurrent: T;
46553
+ todo: (name: string) => void;
46554
+ };
46555
+ type TestContext = Pick<BraintrustTestConfig, "input" | "expected" | "metadata">;
46556
+ type BaseTestFunction<VitestContext = unknown> = {
46557
+ (name: string, fn: (context: VitestContext) => void | Promise<void>): void;
46558
+ each?: <T>(cases: readonly T[]) => (name: string, fn: (context: T) => void | Promise<void>) => void;
46559
+ };
46560
+ type TestFunction<VitestContext = unknown> = WithModifiers<BaseTestFunction<VitestContext>>;
46561
+ type BaseDescribeFunction = {
46562
+ (name: string, factory: () => void): void;
46563
+ each?: <T>(cases: readonly T[]) => (name: string, factory: () => void) => void;
46564
+ };
46565
+ type DescribeFunction = WithModifiers<BaseDescribeFunction>;
46566
+ interface BaseWrappedTest<VitestContext = unknown> {
46567
+ (name: string, fn: (context: VitestContext) => unknown | Promise<unknown>): void;
46568
+ (name: string, config: TestConfig, fn: (context: TestContext & VitestContext) => unknown | Promise<unknown>): void;
46569
+ each: <T>(cases: readonly T[]) => (name: string, fn: (context: T & TestContext & VitestContext) => unknown | Promise<unknown>) => void;
46570
+ }
46571
+ type WrappedTest<VitestContext = unknown> = WithModifiers<BaseWrappedTest<VitestContext>>;
46572
+ interface BaseWrappedDescribe {
46573
+ (name: string, factory: () => void): void;
46574
+ each: <T>(cases: readonly T[]) => (name: string, factory: () => void) => void;
46575
+ }
46576
+ type WrappedDescribe = WithModifiers<BaseWrappedDescribe>;
46577
+ interface VitestMethods<VitestContext = unknown, ExpectType extends (...args: unknown[]) => unknown = (...args: unknown[]) => unknown> {
46578
+ test: TestFunction<VitestContext>;
46579
+ it?: TestFunction<VitestContext>;
46580
+ expect: ExpectType;
46581
+ describe: DescribeFunction;
46582
+ beforeAll?: (fn: () => void | Promise<void>) => void;
46583
+ afterAll?: (fn: () => void | Promise<void>) => void;
46584
+ beforeEach?: (fn: (context: VitestContext) => void | Promise<void>) => void;
46585
+ afterEach?: (fn: (context: VitestContext) => void | Promise<void>) => void;
46586
+ }
46587
+ interface BraintrustVitest<VitestContext = unknown, ExpectType extends (...args: unknown[]) => unknown = (...args: unknown[]) => unknown> {
46588
+ test: WrappedTest<VitestContext>;
46589
+ it: WrappedTest<VitestContext>;
46590
+ expect: ExpectType;
46591
+ describe: WrappedDescribe;
46592
+ beforeAll: (fn: () => void | Promise<void>) => void;
46593
+ afterAll: (fn: () => void | Promise<void>) => void;
46594
+ beforeEach?: (fn: (context: VitestContext) => void | Promise<void>) => void;
46595
+ afterEach?: (fn: (context: VitestContext) => void | Promise<void>) => void;
46596
+ logOutputs: (outputs: Record<string, unknown>) => void;
46597
+ logFeedback: (feedback: {
46598
+ name: string;
46599
+ score: number;
46600
+ metadata?: Record<string, unknown>;
46601
+ }) => void;
46602
+ getCurrentSpan: () => Span | null;
46603
+ /**
46604
+ * Helper function to flush the experiment and optionally display a summary.
46605
+ * Use this in afterAll() instead of manually calling getExperimentContext().
46606
+ *
46607
+ * @param options - Optional configuration
46608
+ * @param options.displaySummary - Whether to display the experiment summary (defaults to true)
46609
+ */
46610
+ flushExperiment: (options?: {
46611
+ displaySummary?: boolean;
46612
+ }) => Promise<void>;
46613
+ }
46614
+ interface WrapperConfig {
46615
+ projectName?: string;
46616
+ /**
46617
+ * The id of the project to create experiments in. Takes precedence over
46618
+ * `projectName` if both are set.
46619
+ */
46620
+ projectId?: string;
46621
+ /**
46622
+ * If true, displays a formatted experiment summary with scores and URL after the test suite completes.
46623
+ * Defaults to true. Set to false to suppress the summary output.
46624
+ */
46625
+ displaySummary?: boolean;
46626
+ /**
46627
+ * Callback for real-time progress events.
46628
+ * Called when tests start, complete, or progress updates occur.
46629
+ * Progress reporting is always enabled when this callback is provided.
46630
+ */
46631
+ onProgress?: (event: ProgressEvent) => void;
46632
+ }
46633
+
46634
+ /**
46635
+ * Wraps Vitest methods with Braintrust experiment tracking. This automatically creates
46636
+ * datasets and experiments from your Vitest tests, tracking pass/fail rates and evaluation metrics.
46637
+ * Experiments are automatically flushed after all tests complete.
46638
+ *
46639
+ * @param vitestMethods - Object containing Vitest methods (test, describe, expect, etc.)
46640
+ * @param config - Optional configuration object
46641
+ * @param config.projectName - Project name for the experiment (defaults to suite name)
46642
+ * @param config.displaySummary - If true, displays experiment summary after flushing (defaults to true)
46643
+ * @returns Wrapped Vitest methods with Braintrust experiment tracking
46644
+ *
46645
+ * @example Basic Usage
46646
+ * ```typescript
46647
+ * import * as vitest from "vitest";
46648
+ * import { wrapVitest } from 'braintrust';
46649
+ *
46650
+ * const {test, expect, describe } = wrapVitest(
46651
+ * { projectName: 'my-project' }
46652
+ * );
46653
+ *
46654
+ * describe('Translation Tests', () => {
46655
+ *
46656
+ * // Tests with input/expected are automatically added to the dataset
46657
+ * test(
46658
+ * 'translates hello',
46659
+ * {
46660
+ * input: { text: 'hello' },
46661
+ * expected: 'hola',
46662
+ * metadata: { language: 'spanish' },
46663
+ * },
46664
+ * async ({ input, expected }) => {
46665
+ * const result = await translate(input.text);
46666
+ * bt.logOutputs({ translation: result });
46667
+ * expect(result).toBe(expected);
46668
+ * }
46669
+ * );
46670
+ *
46671
+ * // Tests without input/expected still run and track pass/fail
46672
+ * test('basic functionality', async () => {
46673
+ * const result = await someFunction();
46674
+ * expect(result).toBeTruthy();
46675
+ * });
46676
+ * });
46677
+ * ```
46678
+ *
46679
+ * @see README.md for full documentation and examples
46680
+ */
46681
+ declare function wrapVitest<VitestContext = unknown, ExpectType extends (...args: unknown[]) => unknown = (...args: unknown[]) => unknown>(vitestMethods: VitestMethods<VitestContext, ExpectType>, config?: WrapperConfig): BraintrustVitest<VitestContext, ExpectType>;
46682
+
46683
+ /** Progress events emitted by the node-test integration. */
46684
+ type NodeTestProgressEvent = {
46685
+ type: "test_start";
46686
+ testName: string;
46687
+ } | {
46688
+ type: "test_complete";
46689
+ testName: string;
46690
+ passed: boolean;
46691
+ duration: number;
46692
+ };
46693
+ /**
46694
+ * Minimal test context interface compatible with node:test's TestContext.
46695
+ * We only use `name` from the context, making this compatible with any
46696
+ * test runner that provides a `{ name?: string }` context object.
46697
+ */
46698
+ interface MinimalTestContext {
46699
+ name?: string;
46700
+ }
46701
+ /**
46702
+ * Configuration for `initNodeTestSuite()`.
46703
+ */
46704
+ interface NodeTestSuiteConfig {
46705
+ /** Project name for the Braintrust experiment. */
46706
+ projectName: string;
46707
+ /** Optional experiment name. Defaults to a timestamp-based name. */
46708
+ experimentName?: string;
46709
+ /**
46710
+ * If true, displays a formatted experiment summary after flushing.
46711
+ * Defaults to true.
46712
+ */
46713
+ displaySummary?: boolean;
46714
+ /**
46715
+ * Pass `after` from `node:test` to auto-register a flush hook.
46716
+ * When provided, `suite.flush()` is called automatically after all tests.
46717
+ */
46718
+ after?: (fn: () => void | Promise<void>) => void;
46719
+ /**
46720
+ * Callback for real-time progress events.
46721
+ * Emits `test_start` and `test_complete` events.
46722
+ */
46723
+ onProgress?: (event: NodeTestProgressEvent) => void;
46724
+ }
46725
+ /**
46726
+ * Configuration for a single eval test case.
46727
+ */
46728
+ interface EvalConfig {
46729
+ /** Test input data, logged to the span. */
46730
+ input?: unknown;
46731
+ /** Expected output, passed to scorers. */
46732
+ expected?: unknown;
46733
+ /** Custom metadata, logged to the span. */
46734
+ metadata?: Record<string, unknown>;
46735
+ /** Tags for organizing test cases. */
46736
+ tags?: string[];
46737
+ /** Scorer functions to evaluate the output. */
46738
+ scorers?: ScorerFunction[];
46739
+ /** Override span name (defaults to `t.name`, then `"unnamed test"`). */
46740
+ name?: string;
46741
+ }
46742
+ /**
46743
+ * Context passed to the eval test function.
46744
+ */
46745
+ interface EvalContext {
46746
+ input: unknown;
46747
+ expected?: unknown;
46748
+ metadata?: Record<string, unknown>;
46749
+ }
46750
+ /**
46751
+ * The public API surface returned by `initNodeTestSuite()`.
46752
+ */
46753
+ interface NodeTestSuite {
46754
+ /**
46755
+ * Creates a test function compatible with `node:test`.
46756
+ * Pass the result to `test()` from `node:test`.
46757
+ *
46758
+ * @param config - Eval configuration (input, expected, scorers, etc.)
46759
+ * @param fn - The test function. Its return value is logged as output and passed to scorers.
46760
+ * @returns A function accepting a test context `t` from `node:test`.
46761
+ */
46762
+ eval(config: EvalConfig, fn: (context: EvalContext) => unknown | Promise<unknown>): (t: MinimalTestContext) => Promise<void>;
46763
+ /**
46764
+ * Flush the experiment: summarize results and send data to Braintrust.
46765
+ * Called automatically if `after` was provided in the config.
46766
+ */
46767
+ flush(): Promise<void>;
46768
+ }
46769
+
46770
+ /**
46771
+ * Creates a new Node.js test suite with Braintrust experiment tracking.
46772
+ *
46773
+ * @example
46774
+ * ```typescript
46775
+ * import { test, describe, after } from 'node:test';
46776
+ * import { initNodeTestSuite } from 'braintrust';
46777
+ *
46778
+ * describe('My Tests', () => {
46779
+ * const suite = initNodeTestSuite({ projectName: 'my-project', after });
46780
+ *
46781
+ * test('my eval', suite.eval(
46782
+ * { input: 'hello', expected: 'world', scorers: [myScorer] },
46783
+ * async ({ input }) => {
46784
+ * return await myFunction(input);
46785
+ * }
46786
+ * ));
46787
+ * });
46788
+ * ```
46789
+ */
46790
+ declare function initNodeTestSuite(config: NodeTestSuiteConfig): NodeTestSuite;
46791
+
46792
+ type LangChainSerialized = {
46793
+ id?: unknown[];
46794
+ name?: string;
46795
+ };
46796
+ type LangChainCallbackHandlerOptions<IsAsyncFlush extends boolean> = {
46797
+ debug: boolean;
46798
+ excludeMetadataProps: RegExp;
46799
+ logger?: Logger<IsAsyncFlush> | Span;
46800
+ parent?: Span | (() => Span);
46801
+ };
46802
+ type LangChainStartSpanArgs = StartSpanArgs & {
46803
+ parentRunId?: string;
46804
+ runId: string;
46805
+ };
46806
+ type LangChainEndSpanArgs = ExperimentLogPartialArgs & {
46807
+ parentRunId?: string;
46808
+ runId: string;
46809
+ tags?: string[];
46810
+ };
46811
+ type LangChainLLMResult = {
46812
+ generations?: unknown[];
46813
+ llmOutput?: Record<string, unknown>;
46814
+ };
46815
+
46816
+ declare const BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME = "BraintrustCallbackHandler";
46817
+ declare class BraintrustLangChainCallbackHandler<IsAsyncFlush extends boolean = true> {
46818
+ name: string;
46819
+ private spans;
46820
+ private skippedRuns;
46821
+ private parent?;
46822
+ private rootRunId?;
46823
+ private options;
46824
+ private startTimes;
46825
+ private firstTokenTimes;
46826
+ private ttftMs;
46827
+ constructor(options?: Partial<LangChainCallbackHandlerOptions<IsAsyncFlush>>);
46828
+ protected startSpan({ runId, parentRunId, ...args }: LangChainStartSpanArgs): void;
46829
+ protected endSpan({ runId, parentRunId, tags, metadata, ...args }: LangChainEndSpanArgs): void;
46830
+ handleLLMStart(llm: LangChainSerialized, prompts: string[], runId: string, parentRunId?: string, extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<void>;
46831
+ handleLLMError(err: Error, runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
46832
+ handleLLMEnd(output: LangChainLLMResult, runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
46833
+ handleChatModelStart(llm: LangChainSerialized, messages: unknown[][], runId: string, parentRunId?: string, extraParams?: Record<string, unknown>, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<void>;
46834
+ handleChainStart(chain: LangChainSerialized, inputs: unknown, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, runType?: string, runName?: string): Promise<void>;
46835
+ handleChainError(err: Error, runId: string, parentRunId?: string, tags?: string[], kwargs?: {
46836
+ inputs?: Record<string, unknown>;
46837
+ }): Promise<void>;
46838
+ handleChainEnd(outputs: unknown, runId: string, parentRunId?: string, tags?: string[], kwargs?: {
46839
+ inputs?: Record<string, unknown>;
46840
+ }): Promise<void>;
46841
+ handleToolStart(tool: LangChainSerialized, input: string, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, runName?: string): Promise<void>;
46842
+ handleToolError(err: Error, runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
46843
+ handleToolEnd(output: unknown, runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
46844
+ handleAgentAction(action: Record<string, unknown>, runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
46845
+ handleAgentEnd(action: unknown, runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
46846
+ handleRetrieverStart(retriever: LangChainSerialized, query: string, runId: string, parentRunId?: string, tags?: string[], metadata?: Record<string, unknown>, name?: string): Promise<void>;
46847
+ handleRetrieverEnd(documents: unknown[], runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
46848
+ handleRetrieverError(err: Error, runId: string, parentRunId?: string, tags?: string[]): Promise<void>;
46849
+ handleLLMNewToken(_token: string, _idx: {
46850
+ prompt: number;
46851
+ completion: number;
46852
+ }, runId: string, _parentRunId?: string, _tags?: string[]): Promise<void>;
46853
+ }
46854
+
46855
+ interface BuildContext {
46856
+ getFunctionId(functionObj: unknown): Promise<FunctionIdType>;
46857
+ }
46858
+ interface Node {
46859
+ readonly id: string;
46860
+ __type: "node";
46861
+ build(context: BuildContext): Promise<GraphNodeType>;
46862
+ addDependency(dependency: Dependency): void;
46863
+ }
46864
+ type NodeLike = Node | Prompt<boolean, boolean> | ProxyVariable;
46865
+ type LazyGraphNode = {
46866
+ type: "lazy";
46867
+ id: string;
46868
+ };
46869
+ declare class GraphBuilder {
46870
+ private nodes;
46871
+ private edges;
46872
+ private nodeLikeNodes;
46873
+ readonly IN: InputNode;
46874
+ readonly OUT: OutputNode;
46875
+ constructor();
46876
+ build(context: BuildContext): Promise<GraphDataType>;
46877
+ addEdge({ source, sourceVar, target, targetVar, expr, purpose, }: {
46878
+ source: NodeLike;
46879
+ sourceVar?: string;
46880
+ target: NodeLike;
46881
+ targetVar?: string;
46882
+ expr?: string;
46883
+ purpose: GraphEdgeType["purpose"];
46884
+ }): void;
46885
+ resolveNode(node: NodeLike): [Node, string[]];
46886
+ literal<T>(value: T): LiteralNode<T>;
46887
+ gate(options: {
46888
+ condition: string;
46889
+ }): GateNode;
46890
+ aggregator(): AggregatorNode;
46891
+ promptTemplate(options: {
46892
+ prompt: PromptBlockDataType;
46893
+ }): PromptTemplateNode;
46894
+ private generateId;
46895
+ private createInputNode;
46896
+ private createOutputNode;
46897
+ private createPromptNode;
46898
+ }
46899
+ type ProxyVariable = {
46900
+ [key: string]: ProxyVariable;
46901
+ };
46902
+ type TransformFn = (input: ProxyVariable) => Node;
46903
+ interface Dependency {
46904
+ node: Node;
46905
+ sourceVar?: string;
46906
+ targetVar?: string;
46907
+ expr?: string;
46908
+ }
46909
+ declare abstract class BaseNode implements Node {
46910
+ protected graph: GraphBuilder;
46911
+ readonly id: string;
46912
+ readonly __type = "node";
46913
+ dependencies: Dependency[];
46914
+ constructor(graph: GraphBuilder, id: string);
46915
+ addDependency(dependency: Dependency): void;
46916
+ abstract build(context: BuildContext): Promise<GraphNodeType>;
46917
+ }
46918
+ declare class InputNode extends BaseNode implements Node {
46919
+ constructor(graph: GraphBuilder, id: string);
46920
+ build(context: BuildContext): Promise<GraphNodeType>;
46921
+ }
46922
+ declare class OutputNode extends BaseNode implements Node {
46923
+ constructor(graph: GraphBuilder, id: string);
46924
+ build(context: BuildContext): Promise<GraphNodeType>;
46925
+ }
46926
+ declare class PromptNode extends BaseNode implements Node {
46927
+ private prompt;
46928
+ constructor(graph: GraphBuilder, id: string, prompt: Prompt);
46929
+ build(context: BuildContext): Promise<GraphNodeType>;
46930
+ }
46931
+ declare class GateNode extends BaseNode implements Node {
46932
+ private condition;
46933
+ constructor(graph: GraphBuilder, id: string, condition: string);
46934
+ build(context: BuildContext): Promise<GraphNodeType>;
46935
+ }
46936
+ declare class AggregatorNode extends BaseNode implements Node {
46937
+ constructor(graph: GraphBuilder, id: string);
46938
+ build(context: BuildContext): Promise<GraphNodeType>;
46939
+ }
46940
+ declare class PromptTemplateNode extends BaseNode implements Node {
46941
+ private prompt;
46942
+ constructor(graph: GraphBuilder, id: string, prompt: PromptBlockDataType);
46943
+ build(context: BuildContext): Promise<GraphNodeType>;
46944
+ }
46945
+ declare class LiteralNode<T> extends BaseNode implements Node {
46946
+ private value;
46947
+ constructor(graph: GraphBuilder, id: string, value: T);
46948
+ build(context: BuildContext): Promise<GraphNodeType>;
46949
+ }
46950
+ declare function createGraph(): GraphBuilder;
46951
+ declare function escapePath(parts: string[]): string | undefined;
46952
+ declare function unescapePath(path: string): string[];
46953
+ declare const _default: {
46954
+ createGraph: typeof createGraph;
46955
+ };
46956
+
46957
+ type graphFramework_AggregatorNode = AggregatorNode;
46958
+ declare const graphFramework_AggregatorNode: typeof AggregatorNode;
46959
+ type graphFramework_BuildContext = BuildContext;
46960
+ type graphFramework_GateNode = GateNode;
46961
+ declare const graphFramework_GateNode: typeof GateNode;
46962
+ type graphFramework_GraphBuilder = GraphBuilder;
46963
+ declare const graphFramework_GraphBuilder: typeof GraphBuilder;
46964
+ type graphFramework_InputNode = InputNode;
46965
+ declare const graphFramework_InputNode: typeof InputNode;
46966
+ type graphFramework_LazyGraphNode = LazyGraphNode;
46967
+ type graphFramework_LiteralNode<T> = LiteralNode<T>;
46968
+ declare const graphFramework_LiteralNode: typeof LiteralNode;
46969
+ type graphFramework_Node = Node;
46970
+ type graphFramework_NodeLike = NodeLike;
46971
+ type graphFramework_OutputNode = OutputNode;
46972
+ declare const graphFramework_OutputNode: typeof OutputNode;
46973
+ type graphFramework_PromptNode = PromptNode;
46974
+ declare const graphFramework_PromptNode: typeof PromptNode;
46975
+ type graphFramework_PromptTemplateNode = PromptTemplateNode;
46976
+ declare const graphFramework_PromptTemplateNode: typeof PromptTemplateNode;
46977
+ type graphFramework_ProxyVariable = ProxyVariable;
46978
+ type graphFramework_TransformFn = TransformFn;
46979
+ declare const graphFramework_createGraph: typeof createGraph;
46980
+ declare const graphFramework_escapePath: typeof escapePath;
46981
+ declare const graphFramework_unescapePath: typeof unescapePath;
46982
+ declare namespace graphFramework {
46983
+ export { graphFramework_AggregatorNode as AggregatorNode, type graphFramework_BuildContext as BuildContext, graphFramework_GateNode as GateNode, graphFramework_GraphBuilder as GraphBuilder, graphFramework_InputNode as InputNode, type graphFramework_LazyGraphNode as LazyGraphNode, graphFramework_LiteralNode as LiteralNode, type graphFramework_Node as Node, type graphFramework_NodeLike as NodeLike, graphFramework_OutputNode as OutputNode, graphFramework_PromptNode as PromptNode, graphFramework_PromptTemplateNode as PromptTemplateNode, type graphFramework_ProxyVariable as ProxyVariable, type graphFramework_TransformFn as TransformFn, graphFramework_createGraph as createGraph, _default as default, graphFramework_escapePath as escapePath, graphFramework_unescapePath as unescapePath };
46984
+ }
46985
+
46855
46986
  declare const BATCH_TASK_KIND = "braintrust.durable.batch-task";
46856
46987
  declare const BATCH_SCORER_KIND = "braintrust.durable.batch-scorer";
46857
46988
  type JsonPrimitive = string | number | boolean | null;
@@ -47717,6 +47848,7 @@ declare const exports$1_braintrustFlueObserver: typeof braintrustFlueObserver;
47717
47848
  declare const exports$1_braintrustStreamChunkSchema: typeof braintrustStreamChunkSchema;
47718
47849
  declare const exports$1_buildLocalSummary: typeof buildLocalSummary;
47719
47850
  declare const exports$1_collectAnthropicSession: typeof collectAnthropicSession;
47851
+ declare const exports$1_completeOpenAIBatchTrace: typeof completeOpenAIBatchTrace;
47720
47852
  declare const exports$1_configureInstrumentation: typeof configureInstrumentation;
47721
47853
  declare const exports$1_constructLogs3OverflowRequest: typeof constructLogs3OverflowRequest;
47722
47854
  declare const exports$1_createFinalValuePassThroughStream: typeof createFinalValuePassThroughStream;
@@ -47754,6 +47886,8 @@ declare const exports$1_login: typeof login;
47754
47886
  declare const exports$1_loginToState: typeof loginToState;
47755
47887
  declare const exports$1_logs3OverflowUploadSchema: typeof logs3OverflowUploadSchema;
47756
47888
  declare const exports$1_newId: typeof newId;
47889
+ declare const exports$1_openaiBatchesRetrieveTraced: typeof openaiBatchesRetrieveTraced;
47890
+ declare const exports$1_openaiFilesCreateTraced: typeof openaiFilesCreateTraced;
47757
47891
  declare const exports$1_parseCachedHeader: typeof parseCachedHeader;
47758
47892
  declare const exports$1_parseTemplateFormat: typeof parseTemplateFormat;
47759
47893
  declare const exports$1_permalink: typeof permalink;
@@ -47822,7 +47956,7 @@ declare const exports$1_wrapTraced: typeof wrapTraced;
47822
47956
  declare const exports$1_wrapVitest: typeof wrapVitest;
47823
47957
  declare const exports$1_wrapVoyageAI: typeof wrapVoyageAI;
47824
47958
  declare namespace exports$1 {
47825
- export { type exports$1_AnyDataset as AnyDataset, exports$1_Attachment as Attachment, type exports$1_AttachmentParams as AttachmentParams, exports$1_AttachmentReference as AttachmentReference, exports$1_BAGGAGE_HEADER as BAGGAGE_HEADER, exports$1_BRAINTRUST_CURRENT_SPAN_STORE as BRAINTRUST_CURRENT_SPAN_STORE, exports$1_BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME as BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME, exports$1_BRAINTRUST_PARENT_KEY as BRAINTRUST_PARENT_KEY, type exports$1_BackgroundLoggerOpts as BackgroundLoggerOpts, exports$1_BaseAttachment as BaseAttachment, exports$1_BaseExperiment as BaseExperiment, type exports$1_BaseMetadata as BaseMetadata, exports$1_BatchScorer as BatchScorer, exports$1_BatchTask as BatchTask, exports$1_BraintrustLangChainCallbackHandler as BraintrustLangChainCallbackHandler, exports$1_BraintrustMiddleware as BraintrustMiddleware, exports$1_BraintrustObservabilityExporter as BraintrustObservabilityExporter, exports$1_BraintrustState as BraintrustState, exports$1_BraintrustStream as BraintrustStream, type exports$1_BraintrustStreamChunk as BraintrustStreamChunk, exports$1_CachedSpanFetcher as CachedSpanFetcher, type exports$1_ChatPrompt as ChatPrompt, exports$1_CodeFunction as CodeFunction, type exports$1_CodeOpts as CodeOpts, exports$1_CodePrompt as CodePrompt, type exports$1_CommentEvent as CommentEvent, type exports$1_CompiledPrompt as CompiledPrompt, type exports$1_CompiledPromptParams as CompiledPromptParams, type exports$1_CompletionPrompt as CompletionPrompt, exports$1_ContextManager as ContextManager, type exports$1_ContextParentSpanIds as ContextParentSpanIds, type exports$1_CreateProjectOpts as CreateProjectOpts, type exports$1_CurrentSpanStore as CurrentSpanStore, exports$1_DEFAULT_FETCH_BATCH_SIZE as DEFAULT_FETCH_BATCH_SIZE, exports$1_DEFAULT_MAX_REQUEST_SIZE as DEFAULT_MAX_REQUEST_SIZE, type exports$1_DataSummary as DataSummary, exports$1_Dataset as Dataset, exports$1_DatasetPipeline as DatasetPipeline, type exports$1_DatasetRecord as DatasetRecord, type exports$1_DatasetRestorePreviewResult as DatasetRestorePreviewResult, type exports$1_DatasetRestoreResult as DatasetRestoreResult, type DatasetSnapshotType as DatasetSnapshot, type exports$1_DatasetSummary as DatasetSummary, type exports$1_DefaultMetadataType as DefaultMetadataType, type exports$1_DefaultPromptArgs as DefaultPromptArgs, exports$1_DurableEvalMemoryStore as DurableEvalMemoryStore, exports$1_DurableEvalRedisStore as DurableEvalRedisStore, type exports$1_DurableEvalStore as DurableEvalStore, exports$1_ERR_PERMALINK as ERR_PERMALINK, type exports$1_EndSpanArgs as EndSpanArgs, exports$1_Eval as Eval, type exports$1_EvalCase as EvalCase, type exports$1_EvalClassifier as EvalClassifier, type exports$1_EvalHooks as EvalHooks, type exports$1_EvalParameterSerializedSchema as EvalParameterSerializedSchema, type exports$1_EvalParameters as EvalParameters, type exports$1_EvalResult as EvalResult, exports$1_EvalResultWithSummary as EvalResultWithSummary, type exports$1_EvalScorer as EvalScorer, type exports$1_EvalScorerArgs as EvalScorerArgs, type exports$1_EvalTask as EvalTask, type exports$1_Evaluator as Evaluator, type exports$1_EvaluatorDef as EvaluatorDef, type exports$1_EvaluatorDefinition as EvaluatorDefinition, type exports$1_EvaluatorDefinitions as EvaluatorDefinitions, type exports$1_EvaluatorFile as EvaluatorFile, type exports$1_EvaluatorManifest as EvaluatorManifest, exports$1_Experiment as Experiment, type exports$1_ExperimentLogFullArgs as ExperimentLogFullArgs, type exports$1_ExperimentLogPartialArgs as ExperimentLogPartialArgs, type exports$1_ExperimentSummary as ExperimentSummary, type exports$1_Exportable as Exportable, exports$1_ExternalAttachment as ExternalAttachment, type exports$1_ExternalAttachmentParams as ExternalAttachmentParams, exports$1_FailedHTTPResponse as FailedHTTPResponse, type exports$1_FullInitDatasetOptions as FullInitDatasetOptions, type exports$1_FullInitOptions as FullInitOptions, type exports$1_FullLoginOptions as FullLoginOptions, type exports$1_FunctionEvent as FunctionEvent, type exports$1_GetThreadOptions as GetThreadOptions, exports$1_IDGenerator as IDGenerator, type exports$1_IdField as IdField, type exports$1_InitDatasetOptions as InitDatasetOptions, type exports$1_InitLoggerOptions as InitLoggerOptions, type exports$1_InitOptions as InitOptions, type exports$1_InputField as InputField, type exports$1_InstrumentationConfig as InstrumentationConfig, type exports$1_InvokeFunctionArgs as InvokeFunctionArgs, type exports$1_InvokeReturn as InvokeReturn, exports$1_JSONAttachment as JSONAttachment, exports$1_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, exports$1_LOGS3_OVERFLOW_REFERENCE_TYPE as LOGS3_OVERFLOW_REFERENCE_TYPE, type exports$1_LangChainCallbackHandlerOptions as LangChainCallbackHandlerOptions, exports$1_LazyValue as LazyValue, type exports$1_LoadPromptOptions as LoadPromptOptions, exports$1_LocalTrace as LocalTrace, type exports$1_LogCommentFullArgs as LogCommentFullArgs, type exports$1_LogFeedbackFullArgs as LogFeedbackFullArgs, type exports$1_LogOptions as LogOptions, exports$1_Logger as Logger, exports$1_LoginInvalidOrgError as LoginInvalidOrgError, type exports$1_LoginOptions as LoginOptions, type exports$1_Logs3OverflowInputRow as Logs3OverflowInputRow, type exports$1_Logs3OverflowUpload as Logs3OverflowUpload, type exports$1_MastraObservabilityExporter as MastraObservabilityExporter, type exports$1_MetricSummary as MetricSummary, exports$1_NOOP_SPAN as NOOP_SPAN, exports$1_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, exports$1_NoopSpan as NoopSpan, exports$1_OTELIDGenerator as OTELIDGenerator, exports$1_ObjectFetcher as ObjectFetcher, type exports$1_ObjectMetadata as ObjectMetadata, type exports$1_OtherExperimentLogFields as OtherExperimentLogFields, type exports$1_ParametersSource as ParametersSource, type exports$1_ParentExperimentIds as ParentExperimentIds, type exports$1_ParentProjectLogIds as ParentProjectLogIds, type exports$1_ParsedTraceparent as ParsedTraceparent, exports$1_Project as Project, exports$1_ProjectNameIdMap as ProjectNameIdMap, type exports$1_PromiseUnless as PromiseUnless, exports$1_Prompt as Prompt, exports$1_PromptBuilder as PromptBuilder, type exports$1_PromptContents as PromptContents, type exports$1_PromptDefinition as PromptDefinition, type exports$1_PromptDefinitionWithTools as PromptDefinitionWithTools, type exports$1_PromptOpts as PromptOpts, type exports$1_PromptRowWithId as PromptRowWithId, type exports$1_PropagatedState as PropagatedState, type exports$1_PropagationContext as PropagationContext, exports$1_ReadonlyAttachment as ReadonlyAttachment, exports$1_ReadonlyExperiment as ReadonlyExperiment, type exports$1_RegisterSandboxOptions as RegisterSandboxOptions, type exports$1_RegisterSandboxResult as RegisterSandboxResult, exports$1_Reporter as Reporter, type exports$1_ReporterBody as ReporterBody, type exports$1_SandboxConfig as SandboxConfig, type exports$1_ScoreSummary as ScoreSummary, exports$1_ScorerBuilder as ScorerBuilder, type exports$1_ScorerOpts as ScorerOpts, type exports$1_SerializedBraintrustState as SerializedBraintrustState, type exports$1_SetCurrentArg as SetCurrentArg, type exports$1_Span as Span, type exports$1_SpanContext as SpanContext, type exports$1_SpanData as SpanData, exports$1_SpanFetcher as SpanFetcher, exports$1_SpanImpl as SpanImpl, type exports$1_StartSpanArgs as StartSpanArgs, exports$1_TRACEPARENT_HEADER as TRACEPARENT_HEADER, exports$1_TRACESTATE_HEADER as TRACESTATE_HEADER, type exports$1_TemplateFormat as TemplateFormat, type exports$1_TemplateRenderer as TemplateRenderer, type exports$1_TemplateRendererPlugin as TemplateRendererPlugin, exports$1_TestBackgroundLogger as TestBackgroundLogger, exports$1_ToolBuilder as ToolBuilder, type exports$1_Trace as Trace, type exports$1_TraceContextCarrier as TraceContextCarrier, type exports$1_TraceContextHeaders as TraceContextHeaders, exports$1_UUIDGenerator as UUIDGenerator, type exports$1_WithTransactionId as WithTransactionId, exports$1_X_CACHED_HEADER as X_CACHED_HEADER, exports$1__exportsForTestingOnly as _exportsForTestingOnly, exports$1__internalGetGlobalState as _internalGetGlobalState, iso as _internalIso, exports$1__internalSetInitialState as _internalSetInitialState, exports$1_addAzureBlobHeaders as addAzureBlobHeaders, exports$1_agentAssertionScorer as agentAssertionScorer, exports$1_braintrustAISDKTelemetry as braintrustAISDKTelemetry, exports$1_braintrustEveHook as braintrustEveHook, exports$1_braintrustEveInstrumentation as braintrustEveInstrumentation, exports$1_braintrustFlueInstrumentation as braintrustFlueInstrumentation, exports$1_braintrustFlueObserver as braintrustFlueObserver, exports$1_braintrustStreamChunkSchema as braintrustStreamChunkSchema, exports$1_buildLocalSummary as buildLocalSummary, exports$1_collectAnthropicSession as collectAnthropicSession, exports$1_configureInstrumentation as configureInstrumentation, exports$1_constructLogs3OverflowRequest as constructLogs3OverflowRequest, exports$1_createFinalValuePassThroughStream as createFinalValuePassThroughStream, exports$1_currentExperiment as currentExperiment, exports$1_currentLogger as currentLogger, exports$1_currentSpan as currentSpan, exports$1_deepCopyEvent as deepCopyEvent, exports$1_defaultErrorScoreHandler as defaultErrorScoreHandler, exports$1_defineDurableEval as defineDurableEval, exports$1_deserializePlainStringAsJSON as deserializePlainStringAsJSON, exports$1_devNullWritableStream as devNullWritableStream, exports$1_evaluatorDefinitionSchema as evaluatorDefinitionSchema, exports$1_evaluatorDefinitionsSchema as evaluatorDefinitionsSchema, exports$1_extractTraceContextFromHeaders as extractTraceContextFromHeaders, exports$1_flush as flush, exports$1_getContextManager as getContextManager, exports$1_getIdGenerator as getIdGenerator, exports$1_getPromptVersions as getPromptVersions, exports$1_getSpanParentObject as getSpanParentObject, exports$1_getTemplateRenderer as getTemplateRenderer, graphFramework as graph, exports$1_init as init, exports$1_initDataset as initDataset, exports$1_initExperiment as initExperiment, exports$1_initFunction as initFunction, exports$1_initLogger as initLogger, exports$1_initNodeTestSuite as initNodeTestSuite, exports$1_injectTraceContext as injectTraceContext, exports$1_invoke as invoke, exports$1_isTemplateFormat as isTemplateFormat, exports$1_loadParameters as loadParameters, exports$1_loadPrompt as loadPrompt, exports$1_log as log, exports$1_logError as logError, exports$1_login as login, exports$1_loginToState as loginToState, exports$1_logs3OverflowUploadSchema as logs3OverflowUploadSchema, exports$1_newId as newId, exports$1_parseCachedHeader as parseCachedHeader, exports$1_parseTemplateFormat as parseTemplateFormat, exports$1_permalink as permalink, exports$1_pickLogs3OverflowObjectIds as pickLogs3OverflowObjectIds, exports$1_projects as projects, exports$1_promptContentsSchema as promptContentsSchema, exports$1_promptDefinitionSchema as promptDefinitionSchema, exports$1_promptDefinitionToPromptData as promptDefinitionToPromptData, exports$1_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, exports$1_registerOtelFlush as registerOtelFlush, exports$1_registerSandbox as registerSandbox, exports$1_registerTemplatePlugin as registerTemplatePlugin, exports$1_renderMessage as renderMessage, exports$1_renderPromptParams as renderPromptParams, exports$1_renderTemplateContent as renderTemplateContent, exports$1_reportFailures as reportFailures, exports$1_runEvaluator as runEvaluator, exports$1_setFetch as setFetch, exports$1_setMaskingFunction as setMaskingFunction, exports$1_spanComponentsToObjectId as spanComponentsToObjectId, exports$1_startSpan as startSpan, exports$1_summarize as summarize, exports$1_templateRegistry as templateRegistry, ToolFunctionDefinition as toolFunctionDefinitionSchema, exports$1_traceable as traceable, exports$1_traced as traced, exports$1_updateSpan as updateSpan, exports$1_uploadLogs3OverflowPayload as uploadLogs3OverflowPayload, exports$1_utf8ByteLength as utf8ByteLength, exports$1_withCurrent as withCurrent, exports$1_withDataset as withDataset, exports$1_withExperiment as withExperiment, exports$1_withLogger as withLogger, exports$1_withParent as withParent, exports$1_wrapAISDK as wrapAISDK, exports$1_wrapAISDKModel as wrapAISDKModel, exports$1_wrapAgentClass as wrapAgentClass, exports$1_wrapAnthropic as wrapAnthropic, exports$1_wrapBedrockRuntime as wrapBedrockRuntime, exports$1_wrapClaudeAgentSDK as wrapClaudeAgentSDK, exports$1_wrapCloudflareAIChat as wrapCloudflareAIChat, exports$1_wrapCloudflareAgent as wrapCloudflareAgent, exports$1_wrapCloudflareThink as wrapCloudflareThink, exports$1_wrapCohere as wrapCohere, exports$1_wrapCopilotClient as wrapCopilotClient, exports$1_wrapCursorSDK as wrapCursorSDK, exports$1_wrapGenkit as wrapGenkit, exports$1_wrapGoogleADK as wrapGoogleADK, exports$1_wrapGoogleGenAI as wrapGoogleGenAI, exports$1_wrapGroq as wrapGroq, exports$1_wrapHuggingFace as wrapHuggingFace, exports$1_wrapHuggingFaceTransformers as wrapHuggingFaceTransformers, exports$1_wrapLangSmithClient as wrapLangSmithClient, exports$1_wrapLangSmithRunTrees as wrapLangSmithRunTrees, exports$1_wrapLangSmithTraceable as wrapLangSmithTraceable, exports$1_wrapMastraAgent as wrapMastraAgent, exports$1_wrapMistral as wrapMistral, exports$1_wrapOllama as wrapOllama, exports$1_wrapOpenAI as wrapOpenAI, exports$1_wrapOpenAICodexSDK as wrapOpenAICodexSDK, exports$1_wrapOpenAIv4 as wrapOpenAIv4, exports$1_wrapOpenRouter as wrapOpenRouter, exports$1_wrapOpenRouterAgent as wrapOpenRouterAgent, exports$1_wrapPiCodingAgentSDK as wrapPiCodingAgentSDK, exports$1_wrapStrandsAgentSDK as wrapStrandsAgentSDK, exports$1_wrapTraced as wrapTraced, exports$1_wrapVitest as wrapVitest, exports$1_wrapVoyageAI as wrapVoyageAI };
47959
+ export { type exports$1_AnyDataset as AnyDataset, exports$1_Attachment as Attachment, type exports$1_AttachmentParams as AttachmentParams, exports$1_AttachmentReference as AttachmentReference, exports$1_BAGGAGE_HEADER as BAGGAGE_HEADER, exports$1_BRAINTRUST_CURRENT_SPAN_STORE as BRAINTRUST_CURRENT_SPAN_STORE, exports$1_BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME as BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME, exports$1_BRAINTRUST_PARENT_KEY as BRAINTRUST_PARENT_KEY, type exports$1_BackgroundLoggerOpts as BackgroundLoggerOpts, exports$1_BaseAttachment as BaseAttachment, exports$1_BaseExperiment as BaseExperiment, type exports$1_BaseMetadata as BaseMetadata, exports$1_BatchScorer as BatchScorer, exports$1_BatchTask as BatchTask, exports$1_BraintrustLangChainCallbackHandler as BraintrustLangChainCallbackHandler, exports$1_BraintrustMiddleware as BraintrustMiddleware, exports$1_BraintrustObservabilityExporter as BraintrustObservabilityExporter, exports$1_BraintrustState as BraintrustState, exports$1_BraintrustStream as BraintrustStream, type exports$1_BraintrustStreamChunk as BraintrustStreamChunk, exports$1_CachedSpanFetcher as CachedSpanFetcher, type exports$1_ChatPrompt as ChatPrompt, exports$1_CodeFunction as CodeFunction, type exports$1_CodeOpts as CodeOpts, exports$1_CodePrompt as CodePrompt, type exports$1_CommentEvent as CommentEvent, type exports$1_CompiledPrompt as CompiledPrompt, type exports$1_CompiledPromptParams as CompiledPromptParams, type exports$1_CompletionPrompt as CompletionPrompt, exports$1_ContextManager as ContextManager, type exports$1_ContextParentSpanIds as ContextParentSpanIds, type exports$1_CreateProjectOpts as CreateProjectOpts, type exports$1_CurrentSpanStore as CurrentSpanStore, exports$1_DEFAULT_FETCH_BATCH_SIZE as DEFAULT_FETCH_BATCH_SIZE, exports$1_DEFAULT_MAX_REQUEST_SIZE as DEFAULT_MAX_REQUEST_SIZE, type exports$1_DataSummary as DataSummary, exports$1_Dataset as Dataset, exports$1_DatasetPipeline as DatasetPipeline, type exports$1_DatasetRecord as DatasetRecord, type exports$1_DatasetRestorePreviewResult as DatasetRestorePreviewResult, type exports$1_DatasetRestoreResult as DatasetRestoreResult, type DatasetSnapshotType as DatasetSnapshot, type exports$1_DatasetSummary as DatasetSummary, type exports$1_DefaultMetadataType as DefaultMetadataType, type exports$1_DefaultPromptArgs as DefaultPromptArgs, exports$1_DurableEvalMemoryStore as DurableEvalMemoryStore, exports$1_DurableEvalRedisStore as DurableEvalRedisStore, type exports$1_DurableEvalStore as DurableEvalStore, exports$1_ERR_PERMALINK as ERR_PERMALINK, type exports$1_EndSpanArgs as EndSpanArgs, exports$1_Eval as Eval, type exports$1_EvalCase as EvalCase, type exports$1_EvalClassifier as EvalClassifier, type exports$1_EvalHooks as EvalHooks, type exports$1_EvalParameterSerializedSchema as EvalParameterSerializedSchema, type exports$1_EvalParameters as EvalParameters, type exports$1_EvalResult as EvalResult, exports$1_EvalResultWithSummary as EvalResultWithSummary, type exports$1_EvalScorer as EvalScorer, type exports$1_EvalScorerArgs as EvalScorerArgs, type exports$1_EvalTask as EvalTask, type exports$1_Evaluator as Evaluator, type exports$1_EvaluatorDef as EvaluatorDef, type exports$1_EvaluatorDefinition as EvaluatorDefinition, type exports$1_EvaluatorDefinitions as EvaluatorDefinitions, type exports$1_EvaluatorFile as EvaluatorFile, type exports$1_EvaluatorManifest as EvaluatorManifest, exports$1_Experiment as Experiment, type exports$1_ExperimentLogFullArgs as ExperimentLogFullArgs, type exports$1_ExperimentLogPartialArgs as ExperimentLogPartialArgs, type exports$1_ExperimentSummary as ExperimentSummary, type exports$1_Exportable as Exportable, exports$1_ExternalAttachment as ExternalAttachment, type exports$1_ExternalAttachmentParams as ExternalAttachmentParams, exports$1_FailedHTTPResponse as FailedHTTPResponse, type exports$1_FullInitDatasetOptions as FullInitDatasetOptions, type exports$1_FullInitOptions as FullInitOptions, type exports$1_FullLoginOptions as FullLoginOptions, type exports$1_FunctionEvent as FunctionEvent, type exports$1_GetThreadOptions as GetThreadOptions, exports$1_IDGenerator as IDGenerator, type exports$1_IdField as IdField, type exports$1_InitDatasetOptions as InitDatasetOptions, type exports$1_InitLoggerOptions as InitLoggerOptions, type exports$1_InitOptions as InitOptions, type exports$1_InputField as InputField, type exports$1_InstrumentationConfig as InstrumentationConfig, type exports$1_InvokeFunctionArgs as InvokeFunctionArgs, type exports$1_InvokeReturn as InvokeReturn, exports$1_JSONAttachment as JSONAttachment, exports$1_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, exports$1_LOGS3_OVERFLOW_REFERENCE_TYPE as LOGS3_OVERFLOW_REFERENCE_TYPE, type exports$1_LangChainCallbackHandlerOptions as LangChainCallbackHandlerOptions, exports$1_LazyValue as LazyValue, type exports$1_LoadPromptOptions as LoadPromptOptions, exports$1_LocalTrace as LocalTrace, type exports$1_LogCommentFullArgs as LogCommentFullArgs, type exports$1_LogFeedbackFullArgs as LogFeedbackFullArgs, type exports$1_LogOptions as LogOptions, exports$1_Logger as Logger, exports$1_LoginInvalidOrgError as LoginInvalidOrgError, type exports$1_LoginOptions as LoginOptions, type exports$1_Logs3OverflowInputRow as Logs3OverflowInputRow, type exports$1_Logs3OverflowUpload as Logs3OverflowUpload, type exports$1_MastraObservabilityExporter as MastraObservabilityExporter, type exports$1_MetricSummary as MetricSummary, exports$1_NOOP_SPAN as NOOP_SPAN, exports$1_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, exports$1_NoopSpan as NoopSpan, exports$1_OTELIDGenerator as OTELIDGenerator, exports$1_ObjectFetcher as ObjectFetcher, type exports$1_ObjectMetadata as ObjectMetadata, type exports$1_OtherExperimentLogFields as OtherExperimentLogFields, type exports$1_ParametersSource as ParametersSource, type exports$1_ParentExperimentIds as ParentExperimentIds, type exports$1_ParentProjectLogIds as ParentProjectLogIds, type exports$1_ParsedTraceparent as ParsedTraceparent, exports$1_Project as Project, exports$1_ProjectNameIdMap as ProjectNameIdMap, type exports$1_PromiseUnless as PromiseUnless, exports$1_Prompt as Prompt, exports$1_PromptBuilder as PromptBuilder, type exports$1_PromptContents as PromptContents, type exports$1_PromptDefinition as PromptDefinition, type exports$1_PromptDefinitionWithTools as PromptDefinitionWithTools, type exports$1_PromptOpts as PromptOpts, type exports$1_PromptRowWithId as PromptRowWithId, type exports$1_PropagatedState as PropagatedState, type exports$1_PropagationContext as PropagationContext, exports$1_ReadonlyAttachment as ReadonlyAttachment, exports$1_ReadonlyExperiment as ReadonlyExperiment, type exports$1_RegisterSandboxOptions as RegisterSandboxOptions, type exports$1_RegisterSandboxResult as RegisterSandboxResult, exports$1_Reporter as Reporter, type exports$1_ReporterBody as ReporterBody, type exports$1_SandboxConfig as SandboxConfig, type exports$1_ScoreSummary as ScoreSummary, exports$1_ScorerBuilder as ScorerBuilder, type exports$1_ScorerOpts as ScorerOpts, type exports$1_SerializedBraintrustState as SerializedBraintrustState, type exports$1_SetCurrentArg as SetCurrentArg, type exports$1_Span as Span, type exports$1_SpanContext as SpanContext, type exports$1_SpanData as SpanData, exports$1_SpanFetcher as SpanFetcher, exports$1_SpanImpl as SpanImpl, type exports$1_StartSpanArgs as StartSpanArgs, exports$1_TRACEPARENT_HEADER as TRACEPARENT_HEADER, exports$1_TRACESTATE_HEADER as TRACESTATE_HEADER, type exports$1_TemplateFormat as TemplateFormat, type exports$1_TemplateRenderer as TemplateRenderer, type exports$1_TemplateRendererPlugin as TemplateRendererPlugin, exports$1_TestBackgroundLogger as TestBackgroundLogger, exports$1_ToolBuilder as ToolBuilder, type exports$1_Trace as Trace, type exports$1_TraceContextCarrier as TraceContextCarrier, type exports$1_TraceContextHeaders as TraceContextHeaders, exports$1_UUIDGenerator as UUIDGenerator, type exports$1_WithTransactionId as WithTransactionId, exports$1_X_CACHED_HEADER as X_CACHED_HEADER, exports$1__exportsForTestingOnly as _exportsForTestingOnly, exports$1__internalGetGlobalState as _internalGetGlobalState, iso as _internalIso, exports$1__internalSetInitialState as _internalSetInitialState, exports$1_addAzureBlobHeaders as addAzureBlobHeaders, exports$1_agentAssertionScorer as agentAssertionScorer, exports$1_braintrustAISDKTelemetry as braintrustAISDKTelemetry, exports$1_braintrustEveHook as braintrustEveHook, exports$1_braintrustEveInstrumentation as braintrustEveInstrumentation, exports$1_braintrustFlueInstrumentation as braintrustFlueInstrumentation, exports$1_braintrustFlueObserver as braintrustFlueObserver, exports$1_braintrustStreamChunkSchema as braintrustStreamChunkSchema, exports$1_buildLocalSummary as buildLocalSummary, exports$1_collectAnthropicSession as collectAnthropicSession, exports$1_completeOpenAIBatchTrace as completeOpenAIBatchTrace, exports$1_configureInstrumentation as configureInstrumentation, exports$1_constructLogs3OverflowRequest as constructLogs3OverflowRequest, exports$1_createFinalValuePassThroughStream as createFinalValuePassThroughStream, exports$1_currentExperiment as currentExperiment, exports$1_currentLogger as currentLogger, exports$1_currentSpan as currentSpan, exports$1_deepCopyEvent as deepCopyEvent, exports$1_defaultErrorScoreHandler as defaultErrorScoreHandler, exports$1_defineDurableEval as defineDurableEval, exports$1_deserializePlainStringAsJSON as deserializePlainStringAsJSON, exports$1_devNullWritableStream as devNullWritableStream, exports$1_evaluatorDefinitionSchema as evaluatorDefinitionSchema, exports$1_evaluatorDefinitionsSchema as evaluatorDefinitionsSchema, exports$1_extractTraceContextFromHeaders as extractTraceContextFromHeaders, exports$1_flush as flush, exports$1_getContextManager as getContextManager, exports$1_getIdGenerator as getIdGenerator, exports$1_getPromptVersions as getPromptVersions, exports$1_getSpanParentObject as getSpanParentObject, exports$1_getTemplateRenderer as getTemplateRenderer, graphFramework as graph, exports$1_init as init, exports$1_initDataset as initDataset, exports$1_initExperiment as initExperiment, exports$1_initFunction as initFunction, exports$1_initLogger as initLogger, exports$1_initNodeTestSuite as initNodeTestSuite, exports$1_injectTraceContext as injectTraceContext, exports$1_invoke as invoke, exports$1_isTemplateFormat as isTemplateFormat, exports$1_loadParameters as loadParameters, exports$1_loadPrompt as loadPrompt, exports$1_log as log, exports$1_logError as logError, exports$1_login as login, exports$1_loginToState as loginToState, exports$1_logs3OverflowUploadSchema as logs3OverflowUploadSchema, exports$1_newId as newId, exports$1_openaiBatchesRetrieveTraced as openaiBatchesRetrieveTraced, exports$1_openaiFilesCreateTraced as openaiFilesCreateTraced, exports$1_parseCachedHeader as parseCachedHeader, exports$1_parseTemplateFormat as parseTemplateFormat, exports$1_permalink as permalink, exports$1_pickLogs3OverflowObjectIds as pickLogs3OverflowObjectIds, exports$1_projects as projects, exports$1_promptContentsSchema as promptContentsSchema, exports$1_promptDefinitionSchema as promptDefinitionSchema, exports$1_promptDefinitionToPromptData as promptDefinitionToPromptData, exports$1_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, exports$1_registerOtelFlush as registerOtelFlush, exports$1_registerSandbox as registerSandbox, exports$1_registerTemplatePlugin as registerTemplatePlugin, exports$1_renderMessage as renderMessage, exports$1_renderPromptParams as renderPromptParams, exports$1_renderTemplateContent as renderTemplateContent, exports$1_reportFailures as reportFailures, exports$1_runEvaluator as runEvaluator, exports$1_setFetch as setFetch, exports$1_setMaskingFunction as setMaskingFunction, exports$1_spanComponentsToObjectId as spanComponentsToObjectId, exports$1_startSpan as startSpan, exports$1_summarize as summarize, exports$1_templateRegistry as templateRegistry, ToolFunctionDefinition as toolFunctionDefinitionSchema, exports$1_traceable as traceable, exports$1_traced as traced, exports$1_updateSpan as updateSpan, exports$1_uploadLogs3OverflowPayload as uploadLogs3OverflowPayload, exports$1_utf8ByteLength as utf8ByteLength, exports$1_withCurrent as withCurrent, exports$1_withDataset as withDataset, exports$1_withExperiment as withExperiment, exports$1_withLogger as withLogger, exports$1_withParent as withParent, exports$1_wrapAISDK as wrapAISDK, exports$1_wrapAISDKModel as wrapAISDKModel, exports$1_wrapAgentClass as wrapAgentClass, exports$1_wrapAnthropic as wrapAnthropic, exports$1_wrapBedrockRuntime as wrapBedrockRuntime, exports$1_wrapClaudeAgentSDK as wrapClaudeAgentSDK, exports$1_wrapCloudflareAIChat as wrapCloudflareAIChat, exports$1_wrapCloudflareAgent as wrapCloudflareAgent, exports$1_wrapCloudflareThink as wrapCloudflareThink, exports$1_wrapCohere as wrapCohere, exports$1_wrapCopilotClient as wrapCopilotClient, exports$1_wrapCursorSDK as wrapCursorSDK, exports$1_wrapGenkit as wrapGenkit, exports$1_wrapGoogleADK as wrapGoogleADK, exports$1_wrapGoogleGenAI as wrapGoogleGenAI, exports$1_wrapGroq as wrapGroq, exports$1_wrapHuggingFace as wrapHuggingFace, exports$1_wrapHuggingFaceTransformers as wrapHuggingFaceTransformers, exports$1_wrapLangSmithClient as wrapLangSmithClient, exports$1_wrapLangSmithRunTrees as wrapLangSmithRunTrees, exports$1_wrapLangSmithTraceable as wrapLangSmithTraceable, exports$1_wrapMastraAgent as wrapMastraAgent, exports$1_wrapMistral as wrapMistral, exports$1_wrapOllama as wrapOllama, exports$1_wrapOpenAI as wrapOpenAI, exports$1_wrapOpenAICodexSDK as wrapOpenAICodexSDK, exports$1_wrapOpenAIv4 as wrapOpenAIv4, exports$1_wrapOpenRouter as wrapOpenRouter, exports$1_wrapOpenRouterAgent as wrapOpenRouterAgent, exports$1_wrapPiCodingAgentSDK as wrapPiCodingAgentSDK, exports$1_wrapStrandsAgentSDK as wrapStrandsAgentSDK, exports$1_wrapTraced as wrapTraced, exports$1_wrapVitest as wrapVitest, exports$1_wrapVoyageAI as wrapVoyageAI };
47826
47960
  }
47827
47961
 
47828
- export { type AnyDataset, Attachment, type AttachmentParams, AttachmentReference, BAGGAGE_HEADER, BRAINTRUST_CURRENT_SPAN_STORE, BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME, BRAINTRUST_PARENT_KEY, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BatchScorer, BatchTask, BraintrustLangChainCallbackHandler, BraintrustMiddleware, BraintrustObservabilityExporter, BraintrustState, BraintrustStream, type BraintrustStreamChunk, CachedSpanFetcher, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, ContextManager, type ContextParentSpanIds, type CreateProjectOpts, type CurrentSpanStore, DEFAULT_FETCH_BATCH_SIZE, DEFAULT_MAX_REQUEST_SIZE, type DataSummary, Dataset, DatasetPipeline, type DatasetRecord, type DatasetRestorePreviewResult, type DatasetRestoreResult, type DatasetSnapshotType as DatasetSnapshot, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, DurableEvalMemoryStore, DurableEvalRedisStore, type DurableEvalStore, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalClassifier, type EvalHooks, type EvalParameterSerializedSchema, type EvalParameters, type EvalResult, EvalResultWithSummary, type EvalScorer, type EvalScorerArgs, type EvalTask, type Evaluator, type EvaluatorDef, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorFile, type EvaluatorManifest, Experiment, type ExperimentLogFullArgs, type ExperimentLogPartialArgs, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitDatasetOptions, type FullInitOptions, type FullLoginOptions, type FunctionEvent, type GetThreadOptions, IDGenerator, type IdField, type InitDatasetOptions, type InitLoggerOptions, type InitOptions, type InputField, type InstrumentationConfig, type InvokeFunctionArgs, type InvokeReturn, JSONAttachment, LEGACY_CACHED_HEADER, LOGS3_OVERFLOW_REFERENCE_TYPE, type LangChainCallbackHandlerOptions, LazyValue, type LoadPromptOptions, LocalTrace, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, LoginInvalidOrgError, type LoginOptions, type Logs3OverflowInputRow, type Logs3OverflowUpload, type MastraObservabilityExporter, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, OTELIDGenerator, ObjectFetcher, type ObjectMetadata, type OtherExperimentLogFields, type ParametersSource, type ParentExperimentIds, type ParentProjectLogIds, type ParsedTraceparent, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, type PropagatedState, type PropagationContext, ReadonlyAttachment, ReadonlyExperiment, type RegisterSandboxOptions, type RegisterSandboxResult, Reporter, type ReporterBody, type SandboxConfig, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span, type SpanContext, type SpanData, SpanFetcher, SpanImpl, type StartSpanArgs, TRACEPARENT_HEADER, TRACESTATE_HEADER, type TemplateFormat, type TemplateRenderer, type TemplateRendererPlugin, TestBackgroundLogger, ToolBuilder, type Trace, type TraceContextCarrier, type TraceContextHeaders, UUIDGenerator, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, iso as _internalIso, _internalSetInitialState, addAzureBlobHeaders, agentAssertionScorer, braintrustAISDKTelemetry, braintrustEveHook, braintrustEveInstrumentation, braintrustFlueInstrumentation, braintrustFlueObserver, braintrustStreamChunkSchema, buildLocalSummary, collectAnthropicSession, configureInstrumentation, constructLogs3OverflowRequest, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, deepCopyEvent, exports$1 as default, defaultErrorScoreHandler, defineDurableEval, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, extractTraceContextFromHeaders, flush, getContextManager, getIdGenerator, getPromptVersions, getSpanParentObject, getTemplateRenderer, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, initNodeTestSuite, injectTraceContext, invoke, isTemplateFormat, loadParameters, loadPrompt, log, logError, login, loginToState, logs3OverflowUploadSchema, newId, parseCachedHeader, parseTemplateFormat, permalink, pickLogs3OverflowObjectIds, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, registerOtelFlush, registerSandbox, registerTemplatePlugin, renderMessage, renderPromptParams, renderTemplateContent, reportFailures, runEvaluator, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, templateRegistry, ToolFunctionDefinition as toolFunctionDefinitionSchema, traceable, traced, updateSpan, uploadLogs3OverflowPayload, utf8ByteLength, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDK, wrapAISDKModel, wrapAgentClass, wrapAnthropic, wrapBedrockRuntime, wrapClaudeAgentSDK, wrapCloudflareAIChat, wrapCloudflareAgent, wrapCloudflareThink, wrapCohere, wrapCopilotClient, wrapCursorSDK, wrapGenkit, wrapGoogleADK, wrapGoogleGenAI, wrapGroq, wrapHuggingFace, wrapHuggingFaceTransformers, wrapLangSmithClient, wrapLangSmithRunTrees, wrapLangSmithTraceable, wrapMastraAgent, wrapMistral, wrapOllama, wrapOpenAI, wrapOpenAICodexSDK, wrapOpenAIv4, wrapOpenRouter, wrapOpenRouterAgent, wrapPiCodingAgentSDK, wrapStrandsAgentSDK, wrapTraced, wrapVitest, wrapVoyageAI };
47962
+ export { type AnyDataset, Attachment, type AttachmentParams, AttachmentReference, BAGGAGE_HEADER, BRAINTRUST_CURRENT_SPAN_STORE, BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME, BRAINTRUST_PARENT_KEY, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BatchScorer, BatchTask, BraintrustLangChainCallbackHandler, BraintrustMiddleware, BraintrustObservabilityExporter, BraintrustState, BraintrustStream, type BraintrustStreamChunk, CachedSpanFetcher, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, ContextManager, type ContextParentSpanIds, type CreateProjectOpts, type CurrentSpanStore, DEFAULT_FETCH_BATCH_SIZE, DEFAULT_MAX_REQUEST_SIZE, type DataSummary, Dataset, DatasetPipeline, type DatasetRecord, type DatasetRestorePreviewResult, type DatasetRestoreResult, type DatasetSnapshotType as DatasetSnapshot, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, DurableEvalMemoryStore, DurableEvalRedisStore, type DurableEvalStore, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalClassifier, type EvalHooks, type EvalParameterSerializedSchema, type EvalParameters, type EvalResult, EvalResultWithSummary, type EvalScorer, type EvalScorerArgs, type EvalTask, type Evaluator, type EvaluatorDef, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorFile, type EvaluatorManifest, Experiment, type ExperimentLogFullArgs, type ExperimentLogPartialArgs, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitDatasetOptions, type FullInitOptions, type FullLoginOptions, type FunctionEvent, type GetThreadOptions, IDGenerator, type IdField, type InitDatasetOptions, type InitLoggerOptions, type InitOptions, type InputField, type InstrumentationConfig, type InvokeFunctionArgs, type InvokeReturn, JSONAttachment, LEGACY_CACHED_HEADER, LOGS3_OVERFLOW_REFERENCE_TYPE, type LangChainCallbackHandlerOptions, LazyValue, type LoadPromptOptions, LocalTrace, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, LoginInvalidOrgError, type LoginOptions, type Logs3OverflowInputRow, type Logs3OverflowUpload, type MastraObservabilityExporter, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, OTELIDGenerator, ObjectFetcher, type ObjectMetadata, type OtherExperimentLogFields, type ParametersSource, type ParentExperimentIds, type ParentProjectLogIds, type ParsedTraceparent, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, type PropagatedState, type PropagationContext, ReadonlyAttachment, ReadonlyExperiment, type RegisterSandboxOptions, type RegisterSandboxResult, Reporter, type ReporterBody, type SandboxConfig, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span, type SpanContext, type SpanData, SpanFetcher, SpanImpl, type StartSpanArgs, TRACEPARENT_HEADER, TRACESTATE_HEADER, type TemplateFormat, type TemplateRenderer, type TemplateRendererPlugin, TestBackgroundLogger, ToolBuilder, type Trace, type TraceContextCarrier, type TraceContextHeaders, UUIDGenerator, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, iso as _internalIso, _internalSetInitialState, addAzureBlobHeaders, agentAssertionScorer, braintrustAISDKTelemetry, braintrustEveHook, braintrustEveInstrumentation, braintrustFlueInstrumentation, braintrustFlueObserver, braintrustStreamChunkSchema, buildLocalSummary, collectAnthropicSession, completeOpenAIBatchTrace, configureInstrumentation, constructLogs3OverflowRequest, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, deepCopyEvent, exports$1 as default, defaultErrorScoreHandler, defineDurableEval, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, extractTraceContextFromHeaders, flush, getContextManager, getIdGenerator, getPromptVersions, getSpanParentObject, getTemplateRenderer, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, initNodeTestSuite, injectTraceContext, invoke, isTemplateFormat, loadParameters, loadPrompt, log, logError, login, loginToState, logs3OverflowUploadSchema, newId, openaiBatchesRetrieveTraced, openaiFilesCreateTraced, parseCachedHeader, parseTemplateFormat, permalink, pickLogs3OverflowObjectIds, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, registerOtelFlush, registerSandbox, registerTemplatePlugin, renderMessage, renderPromptParams, renderTemplateContent, reportFailures, runEvaluator, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, templateRegistry, ToolFunctionDefinition as toolFunctionDefinitionSchema, traceable, traced, updateSpan, uploadLogs3OverflowPayload, utf8ByteLength, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDK, wrapAISDKModel, wrapAgentClass, wrapAnthropic, wrapBedrockRuntime, wrapClaudeAgentSDK, wrapCloudflareAIChat, wrapCloudflareAgent, wrapCloudflareThink, wrapCohere, wrapCopilotClient, wrapCursorSDK, wrapGenkit, wrapGoogleADK, wrapGoogleGenAI, wrapGroq, wrapHuggingFace, wrapHuggingFaceTransformers, wrapLangSmithClient, wrapLangSmithRunTrees, wrapLangSmithTraceable, wrapMastraAgent, wrapMistral, wrapOllama, wrapOpenAI, wrapOpenAICodexSDK, wrapOpenAIv4, wrapOpenRouter, wrapOpenRouterAgent, wrapPiCodingAgentSDK, wrapStrandsAgentSDK, wrapTraced, wrapVitest, wrapVoyageAI };