braintrust 3.4.0 → 3.6.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 (58) hide show
  1. package/dev/dist/index.d.mts +49 -7
  2. package/dev/dist/index.d.ts +49 -7
  3. package/dev/dist/index.js +2383 -494
  4. package/dev/dist/index.mjs +2213 -324
  5. package/dist/auto-instrumentations/bundler/esbuild.cjs +289 -10
  6. package/dist/auto-instrumentations/bundler/esbuild.d.mts +2 -2
  7. package/dist/auto-instrumentations/bundler/esbuild.d.ts +2 -2
  8. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
  9. package/dist/auto-instrumentations/bundler/rollup.cjs +289 -10
  10. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
  11. package/dist/auto-instrumentations/bundler/vite.cjs +289 -10
  12. package/dist/auto-instrumentations/bundler/vite.d.mts +2 -2
  13. package/dist/auto-instrumentations/bundler/vite.d.ts +2 -2
  14. package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
  15. package/dist/auto-instrumentations/bundler/webpack.cjs +289 -10
  16. package/dist/auto-instrumentations/bundler/webpack.d.mts +2 -2
  17. package/dist/auto-instrumentations/bundler/webpack.d.ts +2 -2
  18. package/dist/auto-instrumentations/bundler/webpack.mjs +2 -2
  19. package/dist/auto-instrumentations/chunk-EVUKFMHG.mjs +41 -0
  20. package/dist/auto-instrumentations/{chunk-LVWWLUMN.mjs → chunk-F7WAXFNM.mjs} +290 -11
  21. package/dist/auto-instrumentations/chunk-VLEJ5AEK.mjs +41 -0
  22. package/dist/auto-instrumentations/{chunk-D5ZPIUEL.mjs → chunk-WOUC73KB.mjs} +3 -1
  23. package/dist/auto-instrumentations/hook.mjs +358 -48
  24. package/dist/auto-instrumentations/index.cjs +290 -10
  25. package/dist/auto-instrumentations/index.d.mts +3 -1
  26. package/dist/auto-instrumentations/index.d.ts +3 -1
  27. package/dist/auto-instrumentations/index.mjs +3 -1
  28. package/dist/auto-instrumentations/loader/cjs-patch.cjs +32 -10
  29. package/dist/auto-instrumentations/loader/cjs-patch.mjs +10 -5
  30. package/dist/auto-instrumentations/loader/esm-hook.mjs +4 -4
  31. package/dist/auto-instrumentations/loader/get-package-version.cjs +28 -8
  32. package/dist/auto-instrumentations/loader/get-package-version.d.mts +2 -1
  33. package/dist/auto-instrumentations/loader/get-package-version.d.ts +2 -1
  34. package/dist/auto-instrumentations/loader/get-package-version.mjs +3 -1
  35. package/dist/browser.d.mts +357 -271
  36. package/dist/browser.d.ts +357 -271
  37. package/dist/browser.js +2345 -343
  38. package/dist/browser.mjs +2345 -343
  39. package/dist/cli.js +2296 -414
  40. package/dist/edge-light.d.mts +1 -1
  41. package/dist/edge-light.d.ts +1 -1
  42. package/dist/edge-light.js +2292 -315
  43. package/dist/edge-light.mjs +2292 -315
  44. package/dist/index.d.mts +370 -284
  45. package/dist/index.d.ts +370 -284
  46. package/dist/index.js +2642 -638
  47. package/dist/index.mjs +2385 -381
  48. package/dist/instrumentation/index.d.mts +3 -0
  49. package/dist/instrumentation/index.d.ts +3 -0
  50. package/dist/instrumentation/index.js +1955 -198
  51. package/dist/instrumentation/index.mjs +1955 -198
  52. package/dist/workerd.d.mts +1 -1
  53. package/dist/workerd.d.ts +1 -1
  54. package/dist/workerd.js +2292 -315
  55. package/dist/workerd.mjs +2292 -315
  56. package/package.json +22 -6
  57. package/dist/auto-instrumentations/chunk-XDBPUTVE.mjs +0 -22
  58. package/dist/auto-instrumentations/chunk-ZEC7BCL4.mjs +0 -22
@@ -363,6 +363,23 @@ declare class SpanComponentsV4 {
363
363
  declare const spanTypeAttributeValues: readonly ["llm", "score", "function", "eval", "task", "tool", "automation", "facet", "preprocessor", "classifier", "review"];
364
364
  type SpanType = (typeof spanTypeAttributeValues)[number];
365
365
 
366
+ declare const ResponseFormatJsonSchema: z.ZodObject<{
367
+ name: z.ZodString;
368
+ description: z.ZodOptional<z.ZodString>;
369
+ schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
370
+ strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
371
+ }, "strip", z.ZodTypeAny, {
372
+ name: string;
373
+ description?: string | undefined;
374
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
375
+ strict?: boolean | null | undefined;
376
+ }, {
377
+ name: string;
378
+ description?: string | undefined;
379
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
380
+ strict?: boolean | null | undefined;
381
+ }>;
382
+ type ResponseFormatJsonSchemaType = z.infer<typeof ResponseFormatJsonSchema>;
366
383
  declare const AnyModelParams: z.ZodObject<{
367
384
  temperature: z.ZodOptional<z.ZodNumber>;
368
385
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -3413,21 +3430,21 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
3413
3430
  node: string;
3414
3431
  variable: string;
3415
3432
  };
3433
+ purpose: "data" | "messages" | "control";
3416
3434
  target: {
3417
3435
  node: string;
3418
3436
  variable: string;
3419
3437
  };
3420
- purpose: "data" | "messages" | "control";
3421
3438
  }, {
3422
3439
  source: {
3423
3440
  node: string;
3424
3441
  variable: string;
3425
3442
  };
3443
+ purpose: "data" | "messages" | "control";
3426
3444
  target: {
3427
3445
  node: string;
3428
3446
  variable: string;
3429
3447
  };
3430
- purpose: "data" | "messages" | "control";
3431
3448
  }>>;
3432
3449
  }, "strip", z.ZodTypeAny, {
3433
3450
  type: "graph";
@@ -3593,11 +3610,11 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
3593
3610
  node: string;
3594
3611
  variable: string;
3595
3612
  };
3613
+ purpose: "data" | "messages" | "control";
3596
3614
  target: {
3597
3615
  node: string;
3598
3616
  variable: string;
3599
3617
  };
3600
- purpose: "data" | "messages" | "control";
3601
3618
  }>;
3602
3619
  }, {
3603
3620
  type: "graph";
@@ -3763,11 +3780,11 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
3763
3780
  node: string;
3764
3781
  variable: string;
3765
3782
  };
3783
+ purpose: "data" | "messages" | "control";
3766
3784
  target: {
3767
3785
  node: string;
3768
3786
  variable: string;
3769
3787
  };
3770
- purpose: "data" | "messages" | "control";
3771
3788
  }>;
3772
3789
  }>, z.ZodObject<{
3773
3790
  type: z.ZodLiteral<"remote_eval">;
@@ -8317,7 +8334,7 @@ declare const SSEProgressEventData: z.ZodObject<{
8317
8334
  object_type: "prompt" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "parameters" | "sandbox" | "workflow";
8318
8335
  name: string;
8319
8336
  data: string;
8320
- event: "done" | "error" | "text_delta" | "reasoning_delta" | "json_delta" | "progress" | "console" | "start";
8337
+ event: "start" | "error" | "done" | "text_delta" | "reasoning_delta" | "json_delta" | "progress" | "console";
8321
8338
  format: "code" | "llm" | "global" | "topic_map" | "graph";
8322
8339
  output_type: "facet" | "score" | "completion" | "classification" | "any";
8323
8340
  origin?: {
@@ -8332,7 +8349,7 @@ declare const SSEProgressEventData: z.ZodObject<{
8332
8349
  object_type: "prompt" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "parameters" | "sandbox" | "workflow";
8333
8350
  name: string;
8334
8351
  data: string;
8335
- event: "done" | "error" | "text_delta" | "reasoning_delta" | "json_delta" | "progress" | "console" | "start";
8352
+ event: "start" | "error" | "done" | "text_delta" | "reasoning_delta" | "json_delta" | "progress" | "console";
8336
8353
  format: "code" | "llm" | "global" | "topic_map" | "graph";
8337
8354
  output_type: "facet" | "score" | "completion" | "classification" | "any";
8338
8355
  origin?: {
@@ -9689,6 +9706,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
9689
9706
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
9690
9707
  }, z.ZodTypeAny, "passthrough">>]>>;
9691
9708
  templateFormat: z.ZodOptional<z.ZodEnum<["mustache", "nunjucks", "none"]>>;
9709
+ environments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9692
9710
  }, "strip", z.ZodTypeAny, {
9693
9711
  model: string;
9694
9712
  params?: z.objectOutputType<{
@@ -9809,6 +9827,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
9809
9827
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
9810
9828
  }, z.ZodTypeAny, "passthrough"> | undefined;
9811
9829
  templateFormat?: "none" | "mustache" | "nunjucks" | undefined;
9830
+ environments?: string[] | undefined;
9812
9831
  }, {
9813
9832
  model: string;
9814
9833
  params?: z.objectInputType<{
@@ -9929,6 +9948,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
9929
9948
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
9930
9949
  }, z.ZodTypeAny, "passthrough"> | undefined;
9931
9950
  templateFormat?: "none" | "mustache" | "nunjucks" | undefined;
9951
+ environments?: string[] | undefined;
9932
9952
  }>>, z.ZodObject<{
9933
9953
  tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
9934
9954
  type: z.ZodLiteral<"function">;
@@ -10200,6 +10220,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
10200
10220
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
10201
10221
  }, z.ZodTypeAny, "passthrough"> | undefined;
10202
10222
  templateFormat?: "none" | "mustache" | "nunjucks" | undefined;
10223
+ environments?: string[] | undefined;
10203
10224
  }) & {
10204
10225
  tools?: {
10205
10226
  function: {
@@ -10424,6 +10445,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
10424
10445
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
10425
10446
  }, z.ZodTypeAny, "passthrough"> | undefined;
10426
10447
  templateFormat?: "none" | "mustache" | "nunjucks" | undefined;
10448
+ environments?: string[] | undefined;
10427
10449
  }) & {
10428
10450
  tools?: {
10429
10451
  function: {
@@ -10458,6 +10480,7 @@ type InferParameters<T extends EvalParameters> = {
10458
10480
  [K in keyof T]: InferParameterValue<T[K]>;
10459
10481
  };
10460
10482
 
10483
+ declare const RESET_CONTEXT_MANAGER_STATE: unique symbol;
10461
10484
  declare const parametersRowSchema: z.ZodObject<{
10462
10485
  id: z.ZodString;
10463
10486
  _xact_id: z.ZodString;
@@ -10796,6 +10819,7 @@ declare class BraintrustState {
10796
10819
  constructor(loginParams: LoginOptions);
10797
10820
  resetLoginInfo(): void;
10798
10821
  resetIdGenState(): void;
10822
+ [RESET_CONTEXT_MANAGER_STATE](): void;
10799
10823
  get idGenerator(): IDGenerator;
10800
10824
  get contextManager(): ContextManager;
10801
10825
  /**
@@ -11347,7 +11371,18 @@ declare class Dataset<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY
11347
11371
  close(): Promise<string>;
11348
11372
  static isDataset(data: unknown): data is Dataset;
11349
11373
  }
11350
- type CompiledPromptParams = Omit<NonNullable<PromptDataType["options"]>["params"], "use_cache"> & {
11374
+ type CompiledPromptResponseFormat = Exclude<AnyModelParamsType["response_format"], null> extends infer ResponseFormat ? ResponseFormat extends {
11375
+ type: "json_schema";
11376
+ json_schema: infer JsonSchema;
11377
+ } ? Omit<ResponseFormat, "json_schema"> & {
11378
+ json_schema: Omit<Extract<JsonSchema, ResponseFormatJsonSchemaType>, "schema"> & {
11379
+ schema?: Record<string, unknown>;
11380
+ };
11381
+ } : ResponseFormat : never;
11382
+ type CompiledPromptReasoningEffort = Exclude<AnyModelParamsType["reasoning_effort"], "none">;
11383
+ type CompiledPromptParams = Omit<NonNullable<PromptDataType["options"]>["params"], "use_cache" | "response_format" | "reasoning_effort"> & Omit<AnyModelParamsType, "use_cache" | "response_format" | "reasoning_effort"> & {
11384
+ reasoning_effort?: CompiledPromptReasoningEffort;
11385
+ response_format?: CompiledPromptResponseFormat;
11351
11386
  model: NonNullable<NonNullable<PromptDataType["options"]>["model"]>;
11352
11387
  };
11353
11388
  type ChatPrompt = {
@@ -12526,6 +12561,7 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
12526
12561
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
12527
12562
  }, z.ZodTypeAny, "passthrough">>]>>;
12528
12563
  templateFormat: z.ZodOptional<z.ZodEnum<["mustache", "nunjucks", "none"]>>;
12564
+ environments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
12529
12565
  }, "strip", z.ZodTypeAny, {
12530
12566
  model: string;
12531
12567
  params?: z.objectOutputType<{
@@ -12646,6 +12682,7 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
12646
12682
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
12647
12683
  }, z.ZodTypeAny, "passthrough"> | undefined;
12648
12684
  templateFormat?: "none" | "mustache" | "nunjucks" | undefined;
12685
+ environments?: string[] | undefined;
12649
12686
  }, {
12650
12687
  model: string;
12651
12688
  params?: z.objectInputType<{
@@ -12766,6 +12803,7 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
12766
12803
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
12767
12804
  }, z.ZodTypeAny, "passthrough"> | undefined;
12768
12805
  templateFormat?: "none" | "mustache" | "nunjucks" | undefined;
12806
+ environments?: string[] | undefined;
12769
12807
  }>>;
12770
12808
  type PromptDefinition = z.infer<typeof promptDefinitionSchema>;
12771
12809
 
@@ -12877,6 +12915,7 @@ declare class CodePrompt {
12877
12915
  readonly toolFunctions: (SavedFunctionIdType | GenericCodeFunction)[];
12878
12916
  readonly tags?: string[];
12879
12917
  readonly metadata?: Record<string, unknown>;
12918
+ readonly environmentSlugs?: string[];
12880
12919
  constructor(project: Project, prompt: PromptDataType, toolFunctions: (SavedFunctionIdType | GenericCodeFunction)[], opts: Omit<PromptOpts<false, false, false, false>, "name" | "slug"> & {
12881
12920
  name: string;
12882
12921
  slug: string;
@@ -12945,6 +12984,9 @@ interface FunctionEvent {
12945
12984
  if_exists?: IfExistsType;
12946
12985
  tags?: string[];
12947
12986
  metadata?: Record<string, unknown>;
12987
+ environments?: {
12988
+ slug: string;
12989
+ }[];
12948
12990
  }
12949
12991
  declare class ProjectNameIdMap {
12950
12992
  private nameToId;
@@ -363,6 +363,23 @@ declare class SpanComponentsV4 {
363
363
  declare const spanTypeAttributeValues: readonly ["llm", "score", "function", "eval", "task", "tool", "automation", "facet", "preprocessor", "classifier", "review"];
364
364
  type SpanType = (typeof spanTypeAttributeValues)[number];
365
365
 
366
+ declare const ResponseFormatJsonSchema: z.ZodObject<{
367
+ name: z.ZodString;
368
+ description: z.ZodOptional<z.ZodString>;
369
+ schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
370
+ strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
371
+ }, "strip", z.ZodTypeAny, {
372
+ name: string;
373
+ description?: string | undefined;
374
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
375
+ strict?: boolean | null | undefined;
376
+ }, {
377
+ name: string;
378
+ description?: string | undefined;
379
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
380
+ strict?: boolean | null | undefined;
381
+ }>;
382
+ type ResponseFormatJsonSchemaType = z.infer<typeof ResponseFormatJsonSchema>;
366
383
  declare const AnyModelParams: z.ZodObject<{
367
384
  temperature: z.ZodOptional<z.ZodNumber>;
368
385
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -3413,21 +3430,21 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
3413
3430
  node: string;
3414
3431
  variable: string;
3415
3432
  };
3433
+ purpose: "data" | "messages" | "control";
3416
3434
  target: {
3417
3435
  node: string;
3418
3436
  variable: string;
3419
3437
  };
3420
- purpose: "data" | "messages" | "control";
3421
3438
  }, {
3422
3439
  source: {
3423
3440
  node: string;
3424
3441
  variable: string;
3425
3442
  };
3443
+ purpose: "data" | "messages" | "control";
3426
3444
  target: {
3427
3445
  node: string;
3428
3446
  variable: string;
3429
3447
  };
3430
- purpose: "data" | "messages" | "control";
3431
3448
  }>>;
3432
3449
  }, "strip", z.ZodTypeAny, {
3433
3450
  type: "graph";
@@ -3593,11 +3610,11 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
3593
3610
  node: string;
3594
3611
  variable: string;
3595
3612
  };
3613
+ purpose: "data" | "messages" | "control";
3596
3614
  target: {
3597
3615
  node: string;
3598
3616
  variable: string;
3599
3617
  };
3600
- purpose: "data" | "messages" | "control";
3601
3618
  }>;
3602
3619
  }, {
3603
3620
  type: "graph";
@@ -3763,11 +3780,11 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
3763
3780
  node: string;
3764
3781
  variable: string;
3765
3782
  };
3783
+ purpose: "data" | "messages" | "control";
3766
3784
  target: {
3767
3785
  node: string;
3768
3786
  variable: string;
3769
3787
  };
3770
- purpose: "data" | "messages" | "control";
3771
3788
  }>;
3772
3789
  }>, z.ZodObject<{
3773
3790
  type: z.ZodLiteral<"remote_eval">;
@@ -8317,7 +8334,7 @@ declare const SSEProgressEventData: z.ZodObject<{
8317
8334
  object_type: "prompt" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "parameters" | "sandbox" | "workflow";
8318
8335
  name: string;
8319
8336
  data: string;
8320
- event: "done" | "error" | "text_delta" | "reasoning_delta" | "json_delta" | "progress" | "console" | "start";
8337
+ event: "start" | "error" | "done" | "text_delta" | "reasoning_delta" | "json_delta" | "progress" | "console";
8321
8338
  format: "code" | "llm" | "global" | "topic_map" | "graph";
8322
8339
  output_type: "facet" | "score" | "completion" | "classification" | "any";
8323
8340
  origin?: {
@@ -8332,7 +8349,7 @@ declare const SSEProgressEventData: z.ZodObject<{
8332
8349
  object_type: "prompt" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "parameters" | "sandbox" | "workflow";
8333
8350
  name: string;
8334
8351
  data: string;
8335
- event: "done" | "error" | "text_delta" | "reasoning_delta" | "json_delta" | "progress" | "console" | "start";
8352
+ event: "start" | "error" | "done" | "text_delta" | "reasoning_delta" | "json_delta" | "progress" | "console";
8336
8353
  format: "code" | "llm" | "global" | "topic_map" | "graph";
8337
8354
  output_type: "facet" | "score" | "completion" | "classification" | "any";
8338
8355
  origin?: {
@@ -9689,6 +9706,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
9689
9706
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
9690
9707
  }, z.ZodTypeAny, "passthrough">>]>>;
9691
9708
  templateFormat: z.ZodOptional<z.ZodEnum<["mustache", "nunjucks", "none"]>>;
9709
+ environments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9692
9710
  }, "strip", z.ZodTypeAny, {
9693
9711
  model: string;
9694
9712
  params?: z.objectOutputType<{
@@ -9809,6 +9827,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
9809
9827
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
9810
9828
  }, z.ZodTypeAny, "passthrough"> | undefined;
9811
9829
  templateFormat?: "none" | "mustache" | "nunjucks" | undefined;
9830
+ environments?: string[] | undefined;
9812
9831
  }, {
9813
9832
  model: string;
9814
9833
  params?: z.objectInputType<{
@@ -9929,6 +9948,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
9929
9948
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
9930
9949
  }, z.ZodTypeAny, "passthrough"> | undefined;
9931
9950
  templateFormat?: "none" | "mustache" | "nunjucks" | undefined;
9951
+ environments?: string[] | undefined;
9932
9952
  }>>, z.ZodObject<{
9933
9953
  tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
9934
9954
  type: z.ZodLiteral<"function">;
@@ -10200,6 +10220,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
10200
10220
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
10201
10221
  }, z.ZodTypeAny, "passthrough"> | undefined;
10202
10222
  templateFormat?: "none" | "mustache" | "nunjucks" | undefined;
10223
+ environments?: string[] | undefined;
10203
10224
  }) & {
10204
10225
  tools?: {
10205
10226
  function: {
@@ -10424,6 +10445,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
10424
10445
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
10425
10446
  }, z.ZodTypeAny, "passthrough"> | undefined;
10426
10447
  templateFormat?: "none" | "mustache" | "nunjucks" | undefined;
10448
+ environments?: string[] | undefined;
10427
10449
  }) & {
10428
10450
  tools?: {
10429
10451
  function: {
@@ -10458,6 +10480,7 @@ type InferParameters<T extends EvalParameters> = {
10458
10480
  [K in keyof T]: InferParameterValue<T[K]>;
10459
10481
  };
10460
10482
 
10483
+ declare const RESET_CONTEXT_MANAGER_STATE: unique symbol;
10461
10484
  declare const parametersRowSchema: z.ZodObject<{
10462
10485
  id: z.ZodString;
10463
10486
  _xact_id: z.ZodString;
@@ -10796,6 +10819,7 @@ declare class BraintrustState {
10796
10819
  constructor(loginParams: LoginOptions);
10797
10820
  resetLoginInfo(): void;
10798
10821
  resetIdGenState(): void;
10822
+ [RESET_CONTEXT_MANAGER_STATE](): void;
10799
10823
  get idGenerator(): IDGenerator;
10800
10824
  get contextManager(): ContextManager;
10801
10825
  /**
@@ -11347,7 +11371,18 @@ declare class Dataset<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY
11347
11371
  close(): Promise<string>;
11348
11372
  static isDataset(data: unknown): data is Dataset;
11349
11373
  }
11350
- type CompiledPromptParams = Omit<NonNullable<PromptDataType["options"]>["params"], "use_cache"> & {
11374
+ type CompiledPromptResponseFormat = Exclude<AnyModelParamsType["response_format"], null> extends infer ResponseFormat ? ResponseFormat extends {
11375
+ type: "json_schema";
11376
+ json_schema: infer JsonSchema;
11377
+ } ? Omit<ResponseFormat, "json_schema"> & {
11378
+ json_schema: Omit<Extract<JsonSchema, ResponseFormatJsonSchemaType>, "schema"> & {
11379
+ schema?: Record<string, unknown>;
11380
+ };
11381
+ } : ResponseFormat : never;
11382
+ type CompiledPromptReasoningEffort = Exclude<AnyModelParamsType["reasoning_effort"], "none">;
11383
+ type CompiledPromptParams = Omit<NonNullable<PromptDataType["options"]>["params"], "use_cache" | "response_format" | "reasoning_effort"> & Omit<AnyModelParamsType, "use_cache" | "response_format" | "reasoning_effort"> & {
11384
+ reasoning_effort?: CompiledPromptReasoningEffort;
11385
+ response_format?: CompiledPromptResponseFormat;
11351
11386
  model: NonNullable<NonNullable<PromptDataType["options"]>["model"]>;
11352
11387
  };
11353
11388
  type ChatPrompt = {
@@ -12526,6 +12561,7 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
12526
12561
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
12527
12562
  }, z.ZodTypeAny, "passthrough">>]>>;
12528
12563
  templateFormat: z.ZodOptional<z.ZodEnum<["mustache", "nunjucks", "none"]>>;
12564
+ environments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
12529
12565
  }, "strip", z.ZodTypeAny, {
12530
12566
  model: string;
12531
12567
  params?: z.objectOutputType<{
@@ -12646,6 +12682,7 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
12646
12682
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
12647
12683
  }, z.ZodTypeAny, "passthrough"> | undefined;
12648
12684
  templateFormat?: "none" | "mustache" | "nunjucks" | undefined;
12685
+ environments?: string[] | undefined;
12649
12686
  }, {
12650
12687
  model: string;
12651
12688
  params?: z.objectInputType<{
@@ -12766,6 +12803,7 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
12766
12803
  reasoning_budget: z.ZodOptional<z.ZodNumber>;
12767
12804
  }, z.ZodTypeAny, "passthrough"> | undefined;
12768
12805
  templateFormat?: "none" | "mustache" | "nunjucks" | undefined;
12806
+ environments?: string[] | undefined;
12769
12807
  }>>;
12770
12808
  type PromptDefinition = z.infer<typeof promptDefinitionSchema>;
12771
12809
 
@@ -12877,6 +12915,7 @@ declare class CodePrompt {
12877
12915
  readonly toolFunctions: (SavedFunctionIdType | GenericCodeFunction)[];
12878
12916
  readonly tags?: string[];
12879
12917
  readonly metadata?: Record<string, unknown>;
12918
+ readonly environmentSlugs?: string[];
12880
12919
  constructor(project: Project, prompt: PromptDataType, toolFunctions: (SavedFunctionIdType | GenericCodeFunction)[], opts: Omit<PromptOpts<false, false, false, false>, "name" | "slug"> & {
12881
12920
  name: string;
12882
12921
  slug: string;
@@ -12945,6 +12984,9 @@ interface FunctionEvent {
12945
12984
  if_exists?: IfExistsType;
12946
12985
  tags?: string[];
12947
12986
  metadata?: Record<string, unknown>;
12987
+ environments?: {
12988
+ slug: string;
12989
+ }[];
12948
12990
  }
12949
12991
  declare class ProjectNameIdMap {
12950
12992
  private nameToId;