braintrust 3.27.0 → 3.29.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 (54) hide show
  1. package/README.md +1 -1
  2. package/dev/dist/index.d.mts +879 -197
  3. package/dev/dist/index.d.ts +879 -197
  4. package/dev/dist/index.js +2960 -1865
  5. package/dev/dist/index.mjs +2217 -1122
  6. package/dist/apply-auto-instrumentation.js +345 -260
  7. package/dist/apply-auto-instrumentation.mjs +137 -52
  8. package/dist/auto-instrumentations/bundler/esbuild.cjs +124 -7
  9. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
  10. package/dist/auto-instrumentations/bundler/next.cjs +124 -7
  11. package/dist/auto-instrumentations/bundler/next.mjs +3 -3
  12. package/dist/auto-instrumentations/bundler/rollup.cjs +124 -7
  13. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
  14. package/dist/auto-instrumentations/bundler/vite.cjs +124 -7
  15. package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
  16. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +124 -7
  17. package/dist/auto-instrumentations/bundler/webpack.cjs +124 -7
  18. package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
  19. package/dist/auto-instrumentations/{chunk-ZNHTSSGI.mjs → chunk-AOIYCVEL.mjs} +34 -3
  20. package/dist/auto-instrumentations/{chunk-XEYKUBLY.mjs → chunk-DKTGDNA7.mjs} +91 -5
  21. package/dist/auto-instrumentations/{chunk-BW33ULMW.mjs → chunk-OMCZ3MV2.mjs} +1 -1
  22. package/dist/auto-instrumentations/hook.mjs +1186 -161
  23. package/dist/auto-instrumentations/index.cjs +34 -3
  24. package/dist/auto-instrumentations/index.mjs +1 -1
  25. package/dist/browser.d.mts +1388 -75
  26. package/dist/browser.d.ts +1388 -75
  27. package/dist/browser.js +3954 -1124
  28. package/dist/browser.mjs +3954 -1124
  29. package/dist/{chunk-MF7NU6BT.js → chunk-6Z5S7VOU.js} +175 -25
  30. package/dist/{chunk-CZM5JIQL.mjs → chunk-7FA6VP2S.mjs} +172 -22
  31. package/dist/{chunk-YKD22IMR.mjs → chunk-M6XPNJC4.mjs} +2102 -1113
  32. package/dist/{chunk-QRHGVBKU.js → chunk-XLLGRXGR.js} +3273 -2284
  33. package/dist/cli.js +6353 -1483
  34. package/dist/edge-light.d.mts +1 -1
  35. package/dist/edge-light.d.ts +1 -1
  36. package/dist/edge-light.js +3954 -1124
  37. package/dist/edge-light.mjs +3954 -1124
  38. package/dist/index.d.mts +1972 -659
  39. package/dist/index.d.ts +1972 -659
  40. package/dist/index.js +2453 -676
  41. package/dist/index.mjs +1973 -196
  42. package/dist/instrumentation/index.d.mts +738 -15
  43. package/dist/instrumentation/index.d.ts +738 -15
  44. package/dist/instrumentation/index.js +2791 -874
  45. package/dist/instrumentation/index.mjs +2791 -874
  46. package/dist/vitest-evals-reporter.js +16 -16
  47. package/dist/vitest-evals-reporter.mjs +2 -2
  48. package/dist/workerd.d.mts +1 -1
  49. package/dist/workerd.d.ts +1 -1
  50. package/dist/workerd.js +3954 -1124
  51. package/dist/workerd.mjs +3954 -1124
  52. package/package.json +2 -3
  53. package/util/dist/index.d.mts +1596 -109
  54. package/util/dist/index.d.ts +1596 -109
package/dist/browser.d.ts CHANGED
@@ -169,16 +169,108 @@ declare const AsyncScoringControl: z.ZodUnion<[z.ZodObject<{
169
169
  token: z.ZodString;
170
170
  function_ids: z.ZodArray<z.ZodUnknown, "many">;
171
171
  skip_logging: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
172
+ triggered_functions: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodObject<{
173
+ triggered_xact_id: z.ZodString;
174
+ completed_xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
175
+ idempotency_key: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
176
+ attempts: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
177
+ scope: z.ZodUnion<[z.ZodObject<{
178
+ type: z.ZodLiteral<"span">;
179
+ }, "strip", z.ZodTypeAny, {
180
+ type: "span";
181
+ }, {
182
+ type: "span";
183
+ }>, z.ZodObject<{
184
+ type: z.ZodLiteral<"trace">;
185
+ }, "strip", z.ZodTypeAny, {
186
+ type: "trace";
187
+ }, {
188
+ type: "trace";
189
+ }>, z.ZodObject<{
190
+ type: z.ZodLiteral<"group">;
191
+ key: z.ZodString;
192
+ value: z.ZodString;
193
+ }, "strip", z.ZodTypeAny, {
194
+ value: string;
195
+ type: "group";
196
+ key: string;
197
+ }, {
198
+ value: string;
199
+ type: "group";
200
+ key: string;
201
+ }>]>;
202
+ }, "strip", z.ZodTypeAny, {
203
+ triggered_xact_id: string;
204
+ attempts: number;
205
+ scope: {
206
+ type: "span";
207
+ } | {
208
+ type: "trace";
209
+ } | {
210
+ value: string;
211
+ type: "group";
212
+ key: string;
213
+ };
214
+ completed_xact_id?: string | null | undefined;
215
+ idempotency_key?: string | null | undefined;
216
+ }, {
217
+ triggered_xact_id: string;
218
+ scope: {
219
+ type: "span";
220
+ } | {
221
+ type: "trace";
222
+ } | {
223
+ value: string;
224
+ type: "group";
225
+ key: string;
226
+ };
227
+ completed_xact_id?: string | null | undefined;
228
+ idempotency_key?: string | null | undefined;
229
+ attempts?: number | undefined;
230
+ }>>, z.ZodNull]>>;
231
+ last_triggered_xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodNull]>>;
172
232
  }, "strip", z.ZodTypeAny, {
173
233
  status: "enabled";
174
234
  token: string;
175
235
  function_ids: unknown[];
176
236
  skip_logging?: boolean | null | undefined;
237
+ triggered_functions?: Record<string, {
238
+ triggered_xact_id: string;
239
+ attempts: number;
240
+ scope: {
241
+ type: "span";
242
+ } | {
243
+ type: "trace";
244
+ } | {
245
+ value: string;
246
+ type: "group";
247
+ key: string;
248
+ };
249
+ completed_xact_id?: string | null | undefined;
250
+ idempotency_key?: string | null | undefined;
251
+ }> | null | undefined;
252
+ last_triggered_xact_id?: string | number | null | undefined;
177
253
  }, {
178
254
  status: "enabled";
179
255
  token: string;
180
256
  function_ids: unknown[];
181
257
  skip_logging?: boolean | null | undefined;
258
+ triggered_functions?: Record<string, {
259
+ triggered_xact_id: string;
260
+ scope: {
261
+ type: "span";
262
+ } | {
263
+ type: "trace";
264
+ } | {
265
+ value: string;
266
+ type: "group";
267
+ key: string;
268
+ };
269
+ completed_xact_id?: string | null | undefined;
270
+ idempotency_key?: string | null | undefined;
271
+ attempts?: number | undefined;
272
+ }> | null | undefined;
273
+ last_triggered_xact_id?: string | number | null | undefined;
182
274
  }>, z.ZodObject<{
183
275
  status: z.ZodLiteral<"disabled">;
184
276
  }, "strip", z.ZodTypeAny, {
@@ -193,6 +285,22 @@ declare const AsyncScoringControl: z.ZodUnion<[z.ZodObject<{
193
285
  token: string;
194
286
  function_ids: unknown[];
195
287
  skip_logging?: boolean | null | undefined;
288
+ triggered_functions?: Record<string, {
289
+ triggered_xact_id: string;
290
+ attempts: number;
291
+ scope: {
292
+ type: "span";
293
+ } | {
294
+ type: "trace";
295
+ } | {
296
+ value: string;
297
+ type: "group";
298
+ key: string;
299
+ };
300
+ completed_xact_id?: string | null | undefined;
301
+ idempotency_key?: string | null | undefined;
302
+ }> | null | undefined;
303
+ last_triggered_xact_id?: string | number | null | undefined;
196
304
  } | {
197
305
  status: "disabled";
198
306
  } | null;
@@ -203,6 +311,22 @@ declare const AsyncScoringControl: z.ZodUnion<[z.ZodObject<{
203
311
  token: string;
204
312
  function_ids: unknown[];
205
313
  skip_logging?: boolean | null | undefined;
314
+ triggered_functions?: Record<string, {
315
+ triggered_xact_id: string;
316
+ scope: {
317
+ type: "span";
318
+ } | {
319
+ type: "trace";
320
+ } | {
321
+ value: string;
322
+ type: "group";
323
+ key: string;
324
+ };
325
+ completed_xact_id?: string | null | undefined;
326
+ idempotency_key?: string | null | undefined;
327
+ attempts?: number | undefined;
328
+ }> | null | undefined;
329
+ last_triggered_xact_id?: string | number | null | undefined;
206
330
  } | {
207
331
  status: "disabled";
208
332
  } | null;
@@ -219,14 +343,62 @@ declare const AsyncScoringControl: z.ZodUnion<[z.ZodObject<{
219
343
  }, {
220
344
  kind: "state_enabled_force_rescore";
221
345
  }>, z.ZodObject<{
222
- kind: z.ZodLiteral<"add_triggered_functions">;
223
- triggered_function_ids: z.ZodArray<z.ZodUnknown, "many">;
346
+ kind: z.ZodLiteral<"trigger_functions">;
347
+ triggered_functions: z.ZodArray<z.ZodObject<{
348
+ function_id: z.ZodOptional<z.ZodUnknown>;
349
+ scope: z.ZodUnion<[z.ZodObject<{
350
+ type: z.ZodLiteral<"span">;
351
+ }, "strip", z.ZodTypeAny, {
352
+ type: "span";
353
+ }, {
354
+ type: "span";
355
+ }>, z.ZodObject<{
356
+ type: z.ZodLiteral<"trace">;
357
+ }, "strip", z.ZodTypeAny, {
358
+ type: "trace";
359
+ }, {
360
+ type: "trace";
361
+ }>]>;
362
+ idempotency_key: z.ZodOptional<z.ZodString>;
363
+ }, "strip", z.ZodTypeAny, {
364
+ scope: {
365
+ type: "span";
366
+ } | {
367
+ type: "trace";
368
+ };
369
+ idempotency_key?: string | undefined;
370
+ function_id?: unknown;
371
+ }, {
372
+ scope: {
373
+ type: "span";
374
+ } | {
375
+ type: "trace";
376
+ };
377
+ idempotency_key?: string | undefined;
378
+ function_id?: unknown;
379
+ }>, "many">;
224
380
  }, "strip", z.ZodTypeAny, {
225
- kind: "add_triggered_functions";
226
- triggered_function_ids: unknown[];
381
+ kind: "trigger_functions";
382
+ triggered_functions: {
383
+ scope: {
384
+ type: "span";
385
+ } | {
386
+ type: "trace";
387
+ };
388
+ idempotency_key?: string | undefined;
389
+ function_id?: unknown;
390
+ }[];
227
391
  }, {
228
- kind: "add_triggered_functions";
229
- triggered_function_ids: unknown[];
392
+ kind: "trigger_functions";
393
+ triggered_functions: {
394
+ scope: {
395
+ type: "span";
396
+ } | {
397
+ type: "trace";
398
+ };
399
+ idempotency_key?: string | undefined;
400
+ function_id?: unknown;
401
+ }[];
230
402
  }>, z.ZodObject<{
231
403
  kind: z.ZodLiteral<"complete_triggered_functions">;
232
404
  function_ids: z.ZodArray<z.ZodUnknown, "many">;
@@ -239,6 +411,15 @@ declare const AsyncScoringControl: z.ZodUnion<[z.ZodObject<{
239
411
  kind: "complete_triggered_functions";
240
412
  triggered_xact_id: string;
241
413
  function_ids: unknown[];
414
+ }>, z.ZodObject<{
415
+ kind: z.ZodLiteral<"mark_attempt_failed">;
416
+ function_ids: z.ZodArray<z.ZodUnknown, "many">;
417
+ }, "strip", z.ZodTypeAny, {
418
+ kind: "mark_attempt_failed";
419
+ function_ids: unknown[];
420
+ }, {
421
+ kind: "mark_attempt_failed";
422
+ function_ids: unknown[];
242
423
  }>]>;
243
424
  type AsyncScoringControlType = z.infer<typeof AsyncScoringControl>;
244
425
  declare const ObjectReference$1: z.ZodObject<{
@@ -849,6 +1030,32 @@ declare const AttachmentStatus: z.ZodObject<{
849
1030
  type AttachmentStatusType = z.infer<typeof AttachmentStatus>;
850
1031
  declare const FunctionTypeEnum: z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet", "classifier", "tag", "parameters", "sandbox"]>;
851
1032
  type FunctionTypeEnumType = z.infer<typeof FunctionTypeEnum>;
1033
+ declare const SavedFunctionId: z.ZodUnion<[z.ZodObject<{
1034
+ type: z.ZodLiteral<"function">;
1035
+ id: z.ZodString;
1036
+ version: z.ZodOptional<z.ZodString>;
1037
+ }, "strip", z.ZodTypeAny, {
1038
+ type: "function";
1039
+ id: string;
1040
+ version?: string | undefined;
1041
+ }, {
1042
+ type: "function";
1043
+ id: string;
1044
+ version?: string | undefined;
1045
+ }>, z.ZodObject<{
1046
+ type: z.ZodLiteral<"global">;
1047
+ name: z.ZodString;
1048
+ function_type: z.ZodDefault<z.ZodOptional<z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet", "classifier", "tag", "parameters", "sandbox"]>>>;
1049
+ }, "strip", z.ZodTypeAny, {
1050
+ type: "global";
1051
+ name: string;
1052
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
1053
+ }, {
1054
+ type: "global";
1055
+ name: string;
1056
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
1057
+ }>]>;
1058
+ type SavedFunctionIdType = z.infer<typeof SavedFunctionId>;
852
1059
  declare const CallEvent: z.ZodUnion<[z.ZodObject<{
853
1060
  id: z.ZodOptional<z.ZodString>;
854
1061
  data: z.ZodString;
@@ -1973,32 +2180,6 @@ declare const ChatCompletionTool: z.ZodObject<{
1973
2180
  type: "function";
1974
2181
  }>;
1975
2182
  type ChatCompletionToolType = z.infer<typeof ChatCompletionTool>;
1976
- declare const SavedFunctionId: z.ZodUnion<[z.ZodObject<{
1977
- type: z.ZodLiteral<"function">;
1978
- id: z.ZodString;
1979
- version: z.ZodOptional<z.ZodString>;
1980
- }, "strip", z.ZodTypeAny, {
1981
- type: "function";
1982
- id: string;
1983
- version?: string | undefined;
1984
- }, {
1985
- type: "function";
1986
- id: string;
1987
- version?: string | undefined;
1988
- }>, z.ZodObject<{
1989
- type: z.ZodLiteral<"global">;
1990
- name: z.ZodString;
1991
- function_type: z.ZodDefault<z.ZodOptional<z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet", "classifier", "tag", "parameters", "sandbox"]>>>;
1992
- }, "strip", z.ZodTypeAny, {
1993
- type: "global";
1994
- name: string;
1995
- function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
1996
- }, {
1997
- type: "global";
1998
- name: string;
1999
- function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
2000
- }>]>;
2001
- type SavedFunctionIdType = z.infer<typeof SavedFunctionId>;
2002
2183
  declare const DatasetSnapshot: z.ZodObject<{
2003
2184
  id: z.ZodString;
2004
2185
  dataset_id: z.ZodString;
@@ -7884,7 +8065,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
7884
8065
  config?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
7885
8066
  }>, z.ZodObject<{
7886
8067
  type: z.ZodLiteral<"facet">;
7887
- preprocessor: z.ZodOptional<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
8068
+ preprocessor: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
7888
8069
  type: z.ZodLiteral<"function">;
7889
8070
  id: z.ZodString;
7890
8071
  version: z.ZodOptional<z.ZodString>;
@@ -7908,7 +8089,16 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
7908
8089
  type: "global";
7909
8090
  name: string;
7910
8091
  function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
7911
- }>, z.ZodNull]>, z.ZodUnknown>>;
8092
+ }>, z.ZodObject<{
8093
+ type: z.ZodLiteral<"inline">;
8094
+ code: z.ZodString;
8095
+ }, "strip", z.ZodTypeAny, {
8096
+ code: string;
8097
+ type: "inline";
8098
+ }, {
8099
+ code: string;
8100
+ type: "inline";
8101
+ }>, z.ZodNull]>>;
7912
8102
  prompt: z.ZodString;
7913
8103
  model: z.ZodOptional<z.ZodString>;
7914
8104
  embedding_model: z.ZodOptional<z.ZodString>;
@@ -7924,6 +8114,9 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
7924
8114
  type: "global";
7925
8115
  name: string;
7926
8116
  function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
8117
+ } | {
8118
+ code: string;
8119
+ type: "inline";
7927
8120
  } | null | undefined;
7928
8121
  embedding_model?: string | undefined;
7929
8122
  model?: string | undefined;
@@ -7939,13 +8132,16 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
7939
8132
  type: "global";
7940
8133
  name: string;
7941
8134
  function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
8135
+ } | {
8136
+ code: string;
8137
+ type: "inline";
7942
8138
  } | null | undefined;
7943
8139
  embedding_model?: string | undefined;
7944
8140
  model?: string | undefined;
7945
8141
  no_match_pattern?: string | undefined;
7946
8142
  }>, z.ZodObject<{
7947
8143
  type: z.ZodLiteral<"batched_facet">;
7948
- preprocessor: z.ZodOptional<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
8144
+ preprocessor: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
7949
8145
  type: z.ZodLiteral<"function">;
7950
8146
  id: z.ZodString;
7951
8147
  version: z.ZodOptional<z.ZodString>;
@@ -7969,7 +8165,16 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
7969
8165
  type: "global";
7970
8166
  name: string;
7971
8167
  function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
7972
- }>, z.ZodNull]>, z.ZodUnknown>>;
8168
+ }>, z.ZodObject<{
8169
+ type: z.ZodLiteral<"inline">;
8170
+ code: z.ZodString;
8171
+ }, "strip", z.ZodTypeAny, {
8172
+ code: string;
8173
+ type: "inline";
8174
+ }, {
8175
+ code: string;
8176
+ type: "inline";
8177
+ }>, z.ZodNull]>>;
7973
8178
  facets: z.ZodArray<z.ZodObject<{
7974
8179
  name: z.ZodString;
7975
8180
  prompt: z.ZodString;
@@ -7995,12 +8200,37 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
7995
8200
  topic_map_data: z.ZodObject<{
7996
8201
  type: z.ZodLiteral<"topic_map">;
7997
8202
  source_facet: z.ZodString;
8203
+ source_facet_function: z.ZodOptional<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
8204
+ type: z.ZodLiteral<"function">;
8205
+ id: z.ZodString;
8206
+ version: z.ZodOptional<z.ZodString>;
8207
+ }, "strip", z.ZodTypeAny, {
8208
+ type: "function";
8209
+ id: string;
8210
+ version?: string | undefined;
8211
+ }, {
8212
+ type: "function";
8213
+ id: string;
8214
+ version?: string | undefined;
8215
+ }>, z.ZodObject<{
8216
+ type: z.ZodLiteral<"global">;
8217
+ name: z.ZodString;
8218
+ function_type: z.ZodDefault<z.ZodOptional<z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet", "classifier", "tag", "parameters", "sandbox"]>>>;
8219
+ }, "strip", z.ZodTypeAny, {
8220
+ type: "global";
8221
+ name: string;
8222
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
8223
+ }, {
8224
+ type: "global";
8225
+ name: string;
8226
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
8227
+ }>]>, z.ZodUnknown>>;
7998
8228
  embedding_model: z.ZodString;
7999
8229
  bundle_key: z.ZodOptional<z.ZodString>;
8000
8230
  report_key: z.ZodOptional<z.ZodString>;
8001
8231
  topic_names: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
8002
8232
  generation_settings: z.ZodOptional<z.ZodObject<{
8003
- algorithm: z.ZodEnum<["hdbscan", "kmeans"]>;
8233
+ algorithm: z.ZodEnum<["hdbscan", "kmeans", "community"]>;
8004
8234
  dimension_reduction: z.ZodEnum<["umap", "pca", "none"]>;
8005
8235
  sample_size: z.ZodOptional<z.ZodNumber>;
8006
8236
  n_clusters: z.ZodOptional<z.ZodNumber>;
@@ -8009,7 +8239,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8009
8239
  hierarchy_threshold: z.ZodOptional<z.ZodNumber>;
8010
8240
  naming_model: z.ZodOptional<z.ZodString>;
8011
8241
  }, "strip", z.ZodTypeAny, {
8012
- algorithm: "hdbscan" | "kmeans";
8242
+ algorithm: "hdbscan" | "kmeans" | "community";
8013
8243
  dimension_reduction: "none" | "umap" | "pca";
8014
8244
  sample_size?: number | undefined;
8015
8245
  n_clusters?: number | undefined;
@@ -8018,7 +8248,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8018
8248
  hierarchy_threshold?: number | undefined;
8019
8249
  naming_model?: string | undefined;
8020
8250
  }, {
8021
- algorithm: "hdbscan" | "kmeans";
8251
+ algorithm: "hdbscan" | "kmeans" | "community";
8022
8252
  dimension_reduction: "none" | "umap" | "pca";
8023
8253
  sample_size?: number | undefined;
8024
8254
  n_clusters?: number | undefined;
@@ -8036,11 +8266,20 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8036
8266
  type: "topic_map";
8037
8267
  source_facet: string;
8038
8268
  embedding_model: string;
8269
+ source_facet_function?: {
8270
+ type: "function";
8271
+ id: string;
8272
+ version?: string | undefined;
8273
+ } | {
8274
+ type: "global";
8275
+ name: string;
8276
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
8277
+ } | undefined;
8039
8278
  bundle_key?: string | undefined;
8040
8279
  report_key?: string | undefined;
8041
8280
  topic_names?: Record<string, string> | undefined;
8042
8281
  generation_settings?: {
8043
- algorithm: "hdbscan" | "kmeans";
8282
+ algorithm: "hdbscan" | "kmeans" | "community";
8044
8283
  dimension_reduction: "none" | "umap" | "pca";
8045
8284
  sample_size?: number | undefined;
8046
8285
  n_clusters?: number | undefined;
@@ -8058,11 +8297,20 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8058
8297
  type: "topic_map";
8059
8298
  source_facet: string;
8060
8299
  embedding_model: string;
8300
+ source_facet_function?: {
8301
+ type: "function";
8302
+ id: string;
8303
+ version?: string | undefined;
8304
+ } | {
8305
+ type: "global";
8306
+ name: string;
8307
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
8308
+ } | undefined;
8061
8309
  bundle_key?: string | undefined;
8062
8310
  report_key?: string | undefined;
8063
8311
  topic_names?: Record<string, string> | undefined;
8064
8312
  generation_settings?: {
8065
- algorithm: "hdbscan" | "kmeans";
8313
+ algorithm: "hdbscan" | "kmeans" | "community";
8066
8314
  dimension_reduction: "none" | "umap" | "pca";
8067
8315
  sample_size?: number | undefined;
8068
8316
  n_clusters?: number | undefined;
@@ -8083,11 +8331,20 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8083
8331
  type: "topic_map";
8084
8332
  source_facet: string;
8085
8333
  embedding_model: string;
8334
+ source_facet_function?: {
8335
+ type: "function";
8336
+ id: string;
8337
+ version?: string | undefined;
8338
+ } | {
8339
+ type: "global";
8340
+ name: string;
8341
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
8342
+ } | undefined;
8086
8343
  bundle_key?: string | undefined;
8087
8344
  report_key?: string | undefined;
8088
8345
  topic_names?: Record<string, string> | undefined;
8089
8346
  generation_settings?: {
8090
- algorithm: "hdbscan" | "kmeans";
8347
+ algorithm: "hdbscan" | "kmeans" | "community";
8091
8348
  dimension_reduction: "none" | "umap" | "pca";
8092
8349
  sample_size?: number | undefined;
8093
8350
  n_clusters?: number | undefined;
@@ -8109,11 +8366,20 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8109
8366
  type: "topic_map";
8110
8367
  source_facet: string;
8111
8368
  embedding_model: string;
8369
+ source_facet_function?: {
8370
+ type: "function";
8371
+ id: string;
8372
+ version?: string | undefined;
8373
+ } | {
8374
+ type: "global";
8375
+ name: string;
8376
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
8377
+ } | undefined;
8112
8378
  bundle_key?: string | undefined;
8113
8379
  report_key?: string | undefined;
8114
8380
  topic_names?: Record<string, string> | undefined;
8115
8381
  generation_settings?: {
8116
- algorithm: "hdbscan" | "kmeans";
8382
+ algorithm: "hdbscan" | "kmeans" | "community";
8117
8383
  dimension_reduction: "none" | "umap" | "pca";
8118
8384
  sample_size?: number | undefined;
8119
8385
  n_clusters?: number | undefined;
@@ -8147,6 +8413,9 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8147
8413
  type: "global";
8148
8414
  name: string;
8149
8415
  function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
8416
+ } | {
8417
+ code: string;
8418
+ type: "inline";
8150
8419
  } | null | undefined;
8151
8420
  topic_maps?: Record<string, {
8152
8421
  function_name: string;
@@ -8154,11 +8423,20 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8154
8423
  type: "topic_map";
8155
8424
  source_facet: string;
8156
8425
  embedding_model: string;
8426
+ source_facet_function?: {
8427
+ type: "function";
8428
+ id: string;
8429
+ version?: string | undefined;
8430
+ } | {
8431
+ type: "global";
8432
+ name: string;
8433
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
8434
+ } | undefined;
8157
8435
  bundle_key?: string | undefined;
8158
8436
  report_key?: string | undefined;
8159
8437
  topic_names?: Record<string, string> | undefined;
8160
8438
  generation_settings?: {
8161
- algorithm: "hdbscan" | "kmeans";
8439
+ algorithm: "hdbscan" | "kmeans" | "community";
8162
8440
  dimension_reduction: "none" | "umap" | "pca";
8163
8441
  sample_size?: number | undefined;
8164
8442
  n_clusters?: number | undefined;
@@ -8192,6 +8470,9 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8192
8470
  type: "global";
8193
8471
  name: string;
8194
8472
  function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
8473
+ } | {
8474
+ code: string;
8475
+ type: "inline";
8195
8476
  } | null | undefined;
8196
8477
  topic_maps?: Record<string, {
8197
8478
  function_name: string;
@@ -8199,11 +8480,20 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8199
8480
  type: "topic_map";
8200
8481
  source_facet: string;
8201
8482
  embedding_model: string;
8483
+ source_facet_function?: {
8484
+ type: "function";
8485
+ id: string;
8486
+ version?: string | undefined;
8487
+ } | {
8488
+ type: "global";
8489
+ name: string;
8490
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
8491
+ } | undefined;
8202
8492
  bundle_key?: string | undefined;
8203
8493
  report_key?: string | undefined;
8204
8494
  topic_names?: Record<string, string> | undefined;
8205
8495
  generation_settings?: {
8206
- algorithm: "hdbscan" | "kmeans";
8496
+ algorithm: "hdbscan" | "kmeans" | "community";
8207
8497
  dimension_reduction: "none" | "umap" | "pca";
8208
8498
  sample_size?: number | undefined;
8209
8499
  n_clusters?: number | undefined;
@@ -8264,12 +8554,37 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8264
8554
  }>, z.ZodIntersection<z.ZodObject<{
8265
8555
  type: z.ZodLiteral<"topic_map">;
8266
8556
  source_facet: z.ZodString;
8557
+ source_facet_function: z.ZodOptional<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
8558
+ type: z.ZodLiteral<"function">;
8559
+ id: z.ZodString;
8560
+ version: z.ZodOptional<z.ZodString>;
8561
+ }, "strip", z.ZodTypeAny, {
8562
+ type: "function";
8563
+ id: string;
8564
+ version?: string | undefined;
8565
+ }, {
8566
+ type: "function";
8567
+ id: string;
8568
+ version?: string | undefined;
8569
+ }>, z.ZodObject<{
8570
+ type: z.ZodLiteral<"global">;
8571
+ name: z.ZodString;
8572
+ function_type: z.ZodDefault<z.ZodOptional<z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet", "classifier", "tag", "parameters", "sandbox"]>>>;
8573
+ }, "strip", z.ZodTypeAny, {
8574
+ type: "global";
8575
+ name: string;
8576
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
8577
+ }, {
8578
+ type: "global";
8579
+ name: string;
8580
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
8581
+ }>]>, z.ZodUnknown>>;
8267
8582
  embedding_model: z.ZodString;
8268
8583
  bundle_key: z.ZodOptional<z.ZodString>;
8269
8584
  report_key: z.ZodOptional<z.ZodString>;
8270
8585
  topic_names: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
8271
8586
  generation_settings: z.ZodOptional<z.ZodObject<{
8272
- algorithm: z.ZodEnum<["hdbscan", "kmeans"]>;
8587
+ algorithm: z.ZodEnum<["hdbscan", "kmeans", "community"]>;
8273
8588
  dimension_reduction: z.ZodEnum<["umap", "pca", "none"]>;
8274
8589
  sample_size: z.ZodOptional<z.ZodNumber>;
8275
8590
  n_clusters: z.ZodOptional<z.ZodNumber>;
@@ -8278,7 +8593,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8278
8593
  hierarchy_threshold: z.ZodOptional<z.ZodNumber>;
8279
8594
  naming_model: z.ZodOptional<z.ZodString>;
8280
8595
  }, "strip", z.ZodTypeAny, {
8281
- algorithm: "hdbscan" | "kmeans";
8596
+ algorithm: "hdbscan" | "kmeans" | "community";
8282
8597
  dimension_reduction: "none" | "umap" | "pca";
8283
8598
  sample_size?: number | undefined;
8284
8599
  n_clusters?: number | undefined;
@@ -8287,7 +8602,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8287
8602
  hierarchy_threshold?: number | undefined;
8288
8603
  naming_model?: string | undefined;
8289
8604
  }, {
8290
- algorithm: "hdbscan" | "kmeans";
8605
+ algorithm: "hdbscan" | "kmeans" | "community";
8291
8606
  dimension_reduction: "none" | "umap" | "pca";
8292
8607
  sample_size?: number | undefined;
8293
8608
  n_clusters?: number | undefined;
@@ -8305,11 +8620,20 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8305
8620
  type: "topic_map";
8306
8621
  source_facet: string;
8307
8622
  embedding_model: string;
8623
+ source_facet_function?: {
8624
+ type: "function";
8625
+ id: string;
8626
+ version?: string | undefined;
8627
+ } | {
8628
+ type: "global";
8629
+ name: string;
8630
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
8631
+ } | undefined;
8308
8632
  bundle_key?: string | undefined;
8309
8633
  report_key?: string | undefined;
8310
8634
  topic_names?: Record<string, string> | undefined;
8311
8635
  generation_settings?: {
8312
- algorithm: "hdbscan" | "kmeans";
8636
+ algorithm: "hdbscan" | "kmeans" | "community";
8313
8637
  dimension_reduction: "none" | "umap" | "pca";
8314
8638
  sample_size?: number | undefined;
8315
8639
  n_clusters?: number | undefined;
@@ -8327,11 +8651,20 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
8327
8651
  type: "topic_map";
8328
8652
  source_facet: string;
8329
8653
  embedding_model: string;
8654
+ source_facet_function?: {
8655
+ type: "function";
8656
+ id: string;
8657
+ version?: string | undefined;
8658
+ } | {
8659
+ type: "global";
8660
+ name: string;
8661
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
8662
+ } | undefined;
8330
8663
  bundle_key?: string | undefined;
8331
8664
  report_key?: string | undefined;
8332
8665
  topic_names?: Record<string, string> | undefined;
8333
8666
  generation_settings?: {
8334
- algorithm: "hdbscan" | "kmeans";
8667
+ algorithm: "hdbscan" | "kmeans" | "community";
8335
8668
  dimension_reduction: "none" | "umap" | "pca";
8336
8669
  sample_size?: number | undefined;
8337
8670
  n_clusters?: number | undefined;
@@ -9711,6 +10044,15 @@ declare const PromptData: z.ZodObject<{
9711
10044
  type: "global";
9712
10045
  name: string;
9713
10046
  function_type?: "preprocessor" | undefined;
10047
+ }>, z.ZodObject<{
10048
+ type: z.ZodLiteral<"inline">;
10049
+ code: z.ZodString;
10050
+ }, "strip", z.ZodTypeAny, {
10051
+ code: string;
10052
+ type: "inline";
10053
+ }, {
10054
+ code: string;
10055
+ type: "inline";
9714
10056
  }>, z.ZodNull]>>;
9715
10057
  tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
9716
10058
  type: z.ZodLiteral<"function">;
@@ -10021,6 +10363,9 @@ declare const PromptData: z.ZodObject<{
10021
10363
  type: "global";
10022
10364
  name: string;
10023
10365
  function_type: "preprocessor";
10366
+ } | {
10367
+ code: string;
10368
+ type: "inline";
10024
10369
  } | null | undefined;
10025
10370
  origin?: {
10026
10371
  project_id?: string | undefined;
@@ -10295,6 +10640,9 @@ declare const PromptData: z.ZodObject<{
10295
10640
  type: "global";
10296
10641
  name: string;
10297
10642
  function_type?: "preprocessor" | undefined;
10643
+ } | {
10644
+ code: string;
10645
+ type: "inline";
10298
10646
  } | null | undefined;
10299
10647
  origin?: {
10300
10648
  project_id?: string | undefined;
@@ -11770,6 +12118,15 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
11770
12118
  type: "global";
11771
12119
  name: string;
11772
12120
  function_type?: "preprocessor" | undefined;
12121
+ }>, z.ZodObject<{
12122
+ type: z.ZodLiteral<"inline">;
12123
+ code: z.ZodString;
12124
+ }, "strip", z.ZodTypeAny, {
12125
+ code: string;
12126
+ type: "inline";
12127
+ }, {
12128
+ code: string;
12129
+ type: "inline";
11773
12130
  }>, z.ZodNull]>>;
11774
12131
  tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
11775
12132
  type: z.ZodLiteral<"function">;
@@ -12080,6 +12437,9 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
12080
12437
  type: "global";
12081
12438
  name: string;
12082
12439
  function_type: "preprocessor";
12440
+ } | {
12441
+ code: string;
12442
+ type: "inline";
12083
12443
  } | null | undefined;
12084
12444
  origin?: {
12085
12445
  project_id?: string | undefined;
@@ -12354,6 +12714,9 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
12354
12714
  type: "global";
12355
12715
  name: string;
12356
12716
  function_type?: "preprocessor" | undefined;
12717
+ } | {
12718
+ code: string;
12719
+ type: "inline";
12357
12720
  } | null | undefined;
12358
12721
  origin?: {
12359
12722
  project_id?: string | undefined;
@@ -12638,6 +13001,9 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
12638
13001
  type: "global";
12639
13002
  name: string;
12640
13003
  function_type: "preprocessor";
13004
+ } | {
13005
+ code: string;
13006
+ type: "inline";
12641
13007
  } | null | undefined;
12642
13008
  origin?: {
12643
13009
  project_id?: string | undefined;
@@ -12919,6 +13285,9 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
12919
13285
  type: "global";
12920
13286
  name: string;
12921
13287
  function_type?: "preprocessor" | undefined;
13288
+ } | {
13289
+ code: string;
13290
+ type: "inline";
12922
13291
  } | null | undefined;
12923
13292
  origin?: {
12924
13293
  project_id?: string | undefined;
@@ -14321,6 +14690,15 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
14321
14690
  type: "global";
14322
14691
  name: string;
14323
14692
  function_type?: "preprocessor" | undefined;
14693
+ }>, z.ZodObject<{
14694
+ type: z.ZodLiteral<"inline">;
14695
+ code: z.ZodString;
14696
+ }, "strip", z.ZodTypeAny, {
14697
+ code: string;
14698
+ type: "inline";
14699
+ }, {
14700
+ code: string;
14701
+ type: "inline";
14324
14702
  }>, z.ZodNull]>>;
14325
14703
  tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
14326
14704
  type: z.ZodLiteral<"function">;
@@ -14631,6 +15009,9 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
14631
15009
  type: "global";
14632
15010
  name: string;
14633
15011
  function_type: "preprocessor";
15012
+ } | {
15013
+ code: string;
15014
+ type: "inline";
14634
15015
  } | null | undefined;
14635
15016
  origin?: {
14636
15017
  project_id?: string | undefined;
@@ -14905,6 +15286,9 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
14905
15286
  type: "global";
14906
15287
  name: string;
14907
15288
  function_type?: "preprocessor" | undefined;
15289
+ } | {
15290
+ code: string;
15291
+ type: "inline";
14908
15292
  } | null | undefined;
14909
15293
  origin?: {
14910
15294
  project_id?: string | undefined;
@@ -15184,6 +15568,9 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
15184
15568
  type: "global";
15185
15569
  name: string;
15186
15570
  function_type: "preprocessor";
15571
+ } | {
15572
+ code: string;
15573
+ type: "inline";
15187
15574
  } | null | undefined;
15188
15575
  origin?: {
15189
15576
  project_id?: string | undefined;
@@ -15461,6 +15848,9 @@ declare const FunctionId: z.ZodUnion<[z.ZodObject<{
15461
15848
  type: "global";
15462
15849
  name: string;
15463
15850
  function_type?: "preprocessor" | undefined;
15851
+ } | {
15852
+ code: string;
15853
+ type: "inline";
15464
15854
  } | null | undefined;
15465
15855
  origin?: {
15466
15856
  project_id?: string | undefined;
@@ -16911,6 +17301,15 @@ declare const Prompt$1: z.ZodObject<{
16911
17301
  type: "global";
16912
17302
  name: string;
16913
17303
  function_type?: "preprocessor" | undefined;
17304
+ }>, z.ZodObject<{
17305
+ type: z.ZodLiteral<"inline">;
17306
+ code: z.ZodString;
17307
+ }, "strip", z.ZodTypeAny, {
17308
+ code: string;
17309
+ type: "inline";
17310
+ }, {
17311
+ code: string;
17312
+ type: "inline";
16914
17313
  }>, z.ZodNull]>>;
16915
17314
  tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
16916
17315
  type: z.ZodLiteral<"function">;
@@ -17221,6 +17620,9 @@ declare const Prompt$1: z.ZodObject<{
17221
17620
  type: "global";
17222
17621
  name: string;
17223
17622
  function_type: "preprocessor";
17623
+ } | {
17624
+ code: string;
17625
+ type: "inline";
17224
17626
  } | null | undefined;
17225
17627
  origin?: {
17226
17628
  project_id?: string | undefined;
@@ -17495,6 +17897,9 @@ declare const Prompt$1: z.ZodObject<{
17495
17897
  type: "global";
17496
17898
  name: string;
17497
17899
  function_type?: "preprocessor" | undefined;
17900
+ } | {
17901
+ code: string;
17902
+ type: "inline";
17498
17903
  } | null | undefined;
17499
17904
  origin?: {
17500
17905
  project_id?: string | undefined;
@@ -17786,6 +18191,9 @@ declare const Prompt$1: z.ZodObject<{
17786
18191
  type: "global";
17787
18192
  name: string;
17788
18193
  function_type: "preprocessor";
18194
+ } | {
18195
+ code: string;
18196
+ type: "inline";
17789
18197
  } | null | undefined;
17790
18198
  origin?: {
17791
18199
  project_id?: string | undefined;
@@ -18074,6 +18482,9 @@ declare const Prompt$1: z.ZodObject<{
18074
18482
  type: "global";
18075
18483
  name: string;
18076
18484
  function_type?: "preprocessor" | undefined;
18485
+ } | {
18486
+ code: string;
18487
+ type: "inline";
18077
18488
  } | null | undefined;
18078
18489
  origin?: {
18079
18490
  project_id?: string | undefined;
@@ -18338,7 +18749,6 @@ declare const registerTemplatePlugin: (plugin: TemplateRendererPlugin) => void;
18338
18749
  declare const getTemplateRenderer: (name: string) => TemplateRenderer | undefined;
18339
18750
 
18340
18751
  interface GlobalHookAsyncLocalStorage<T> {
18341
- enterWith(store: T): void;
18342
18752
  run<R>(store: T | undefined, callback: () => R): R;
18343
18753
  getStore(): T | undefined;
18344
18754
  }
@@ -18419,7 +18829,7 @@ interface Common {
18419
18829
  mkdir?: (path: string, opts?: {
18420
18830
  recursive?: boolean;
18421
18831
  }) => Promise<string | undefined>;
18422
- writeFile?: (filename: string, data: string) => Promise<void>;
18832
+ writeFile?: (filename: string, data: string | Uint8Array) => Promise<void>;
18423
18833
  readFile?: (filename: string) => Promise<Uint8Array>;
18424
18834
  readdir?: (path: string) => Promise<string[]>;
18425
18835
  utimes?: (path: string, atime: Date, mtime: Date) => Promise<void>;
@@ -18597,6 +19007,14 @@ interface PromptKey {
18597
19007
  */
18598
19008
  id?: string;
18599
19009
  }
19010
+ type PromptMemoryCacheEntry = {
19011
+ value: Prompt;
19012
+ resolvedOrgIdentity?: string;
19013
+ };
19014
+ type PromptDiskCacheEntry = {
19015
+ value: ReturnType<Prompt["_internalSerializeForCache"]>;
19016
+ resolvedOrgIdentity?: string;
19017
+ };
18600
19018
  /**
18601
19019
  * A configurable cache for Braintrust prompts with optional in-memory and filesystem storage.
18602
19020
  *
@@ -18605,10 +19023,19 @@ interface PromptKey {
18605
19023
  declare class PromptCache {
18606
19024
  private readonly memoryCache?;
18607
19025
  private readonly diskCache?;
19026
+ private readonly namespace?;
19027
+ private readonly expectedResolvedOrgIdentity?;
18608
19028
  constructor(options: {
18609
- memoryCache?: LRUCache<string, Prompt>;
18610
- diskCache?: DiskCache<Prompt>;
19029
+ memoryCache?: LRUCache<string, PromptMemoryCacheEntry>;
19030
+ diskCache?: DiskCache<PromptDiskCacheEntry>;
19031
+ namespace?: string;
19032
+ expectedResolvedOrgIdentity?: string;
18611
19033
  });
19034
+ /**
19035
+ * Returns a cache view that shares the same storage layers but isolates all
19036
+ * entries under the provided namespace.
19037
+ */
19038
+ withNamespace(namespace: string, expectedResolvedOrgIdentity?: string): PromptCache;
18612
19039
  /**
18613
19040
  * Retrieves a prompt from the cache.
18614
19041
  * First checks the in-memory LRU cache, then falls back to checking the disk cache if available.
@@ -18632,13 +19059,26 @@ interface ParametersKey {
18632
19059
  projectName?: string;
18633
19060
  id?: string;
18634
19061
  }
19062
+ type ParametersMemoryCacheEntry = {
19063
+ value: RemoteEvalParameters;
19064
+ resolvedOrgIdentity?: string;
19065
+ };
19066
+ type ParametersDiskCacheEntry = {
19067
+ value: ReturnType<RemoteEvalParameters["_internalSerializeForCache"]>;
19068
+ resolvedOrgIdentity?: string;
19069
+ };
18635
19070
  declare class ParametersCache {
18636
19071
  private readonly memoryCache?;
18637
19072
  private readonly diskCache?;
19073
+ private readonly namespace?;
19074
+ private readonly expectedResolvedOrgIdentity?;
18638
19075
  constructor(options: {
18639
- memoryCache?: LRUCache<string, RemoteEvalParameters>;
18640
- diskCache?: DiskCache<RemoteEvalParameters>;
19076
+ memoryCache?: LRUCache<string, ParametersMemoryCacheEntry>;
19077
+ diskCache?: DiskCache<ParametersDiskCacheEntry>;
19078
+ namespace?: string;
19079
+ expectedResolvedOrgIdentity?: string;
18641
19080
  });
19081
+ withNamespace(namespace: string, expectedResolvedOrgIdentity?: string): ParametersCache;
18642
19082
  get(key: ParametersKey): Promise<RemoteEvalParameters | undefined>;
18643
19083
  set(key: ParametersKey, value: RemoteEvalParameters): Promise<void>;
18644
19084
  }
@@ -20741,9 +21181,11 @@ type SetCurrentArg = {
20741
21181
  };
20742
21182
  type StartSpanEventArgs = ExperimentLogPartialArgs & Partial<IdField>;
20743
21183
  declare const INITIAL_SPAN_WRITE_AS_MERGE: unique symbol;
21184
+ declare const RESUME_SPAN_WITHOUT_INITIAL_WRITE: unique symbol;
20744
21185
  declare const INTERNAL_SPAN_CONTEXT: unique symbol;
20745
21186
  type InitialSpanWriteAsMergeArg = {
20746
21187
  readonly [INITIAL_SPAN_WRITE_AS_MERGE]?: true;
21188
+ readonly [RESUME_SPAN_WITHOUT_INITIAL_WRITE]?: true;
20747
21189
  };
20748
21190
  type InternalSpanContextArg = {
20749
21191
  readonly [INTERNAL_SPAN_CONTEXT]?: Record<string, unknown>;
@@ -21038,8 +21480,17 @@ declare const loginSchema: z.ZodObject<{
21038
21480
  debugLogLevelDisabled?: boolean | undefined;
21039
21481
  }>;
21040
21482
  type SerializedBraintrustState = z.infer<typeof loginSchema>;
21483
+ type ResolvedLoaderLoginOptions = Required<Pick<LoginOptions, "apiKey" | "appUrl" | "fetch">> & Pick<LoginOptions, "orgName"> & {
21484
+ forceLogin?: boolean;
21485
+ credentialCacheNamespace: string;
21486
+ existingState?: BraintrustState;
21487
+ };
21488
+ type LoaderCacheViews = {
21489
+ promptCache: PromptCache;
21490
+ parametersCache: ParametersCache;
21491
+ };
21492
+ type LoaderRequestState = Pick<BraintrustState, "appUrl" | "orgId" | "apiConn">;
21041
21493
  declare class BraintrustState {
21042
- private loginParams;
21043
21494
  id: string;
21044
21495
  currentExperiment: Experiment | undefined;
21045
21496
  currentLogger: Logger<false> | undefined;
@@ -21070,12 +21521,23 @@ declare class BraintrustState {
21070
21521
  private _otelFlushCallback;
21071
21522
  spanOriginEnvironment: SpanOriginEnvironment | undefined;
21072
21523
  private traceContextSigningSecret;
21524
+ private loaderLoginCache;
21525
+ private readonly loginParams;
21526
+ private activeLoginOrgNameSelector;
21073
21527
  constructor(loginParams: LoginOptions);
21074
21528
  /** @internal */
21075
21529
  _internalSetTraceContextSigningSecret(secret: string | undefined): void;
21076
21530
  /** @internal */
21077
21531
  _internalGetTraceContextSigningSecret(): string | undefined;
21078
21532
  resetLoginInfo(): void;
21533
+ /** @internal */
21534
+ _internalResolveLoaderLoginOptions({ apiKey, appUrl, orgName, fetch, forceLogin, }: Pick<LoginOptions, "apiKey" | "appUrl" | "orgName" | "fetch"> & {
21535
+ forceLogin?: boolean;
21536
+ }): Promise<ResolvedLoaderLoginOptions>;
21537
+ /** @internal */
21538
+ _internalGetLoaderCacheViews(loginOptions: ResolvedLoaderLoginOptions, requestState?: LoaderRequestState): LoaderCacheViews;
21539
+ /** @internal */
21540
+ _internalGetLoaderState({ apiKey, appUrl, orgName, fetch, forceLogin, existingState, }: ResolvedLoaderLoginOptions): Promise<LoaderRequestState>;
21079
21541
  resetIdGenState(): void;
21080
21542
  [RESET_CONTEXT_MANAGER_STATE](): void;
21081
21543
  get idGenerator(): IDGenerator;
@@ -21145,14 +21607,16 @@ declare class FailedHTTPResponse extends Error {
21145
21607
  status: number;
21146
21608
  text: string;
21147
21609
  data: string;
21148
- constructor(status: number, text: string, data: string);
21610
+ readonly cause?: unknown;
21611
+ constructor(status: number, text: string, data: string, cause?: unknown);
21149
21612
  }
21150
21613
  declare class HTTPConnection {
21614
+ private readonly classifyTransportErrors;
21151
21615
  base_url: string;
21152
21616
  token: string | null;
21153
21617
  headers: Record<string, string>;
21154
21618
  fetch: typeof globalThis.fetch;
21155
- constructor(base_url: string, fetch: typeof globalThis.fetch);
21619
+ constructor(base_url: string, fetch: typeof globalThis.fetch, classifyTransportErrors?: boolean);
21156
21620
  setFetch(fetch: typeof globalThis.fetch): void;
21157
21621
  ping(): Promise<boolean>;
21158
21622
  make_long_lived(): void;
@@ -21806,6 +22270,7 @@ declare global {
21806
22270
  }
21807
22271
  type InitDatasetOptions<IsLegacyDataset extends boolean> = FullLoginOptions & {
21808
22272
  dataset?: string;
22273
+ datasetId?: string;
21809
22274
  description?: string;
21810
22275
  version?: string;
21811
22276
  environment?: string;
@@ -21819,22 +22284,23 @@ type FullInitDatasetOptions<IsLegacyDataset extends boolean> = {
21819
22284
  project?: string;
21820
22285
  } & InitDatasetOptions<IsLegacyDataset>;
21821
22286
  /**
21822
- * Create a new dataset in a specified project. If the project does not exist, it will be created.
22287
+ * Initialize a dataset by name or ID. When initializing by name, the dataset and its project will be created if they do not exist.
21823
22288
  *
21824
22289
  * @param options Options for configuring initDataset().
21825
- * @param options.project The name of the project to create the dataset in. Must specify at least one of `project` or `projectId`.
21826
- * @param options.dataset The name of the dataset to create. If not specified, a name will be generated automatically.
21827
- * @param options.description An optional description of the dataset.
22290
+ * @param options.project The name of the project to create the dataset in. Must specify at least one of `project` or `projectId` unless `datasetId` is provided.
22291
+ * @param options.dataset The name of the dataset to create. If not specified, a name will be generated automatically. Ignored if `datasetId` is provided.
22292
+ * @param options.datasetId The ID of an existing dataset. Takes precedence over `dataset` and does not require `project` or `projectId`.
22293
+ * @param options.description An optional description when initializing a dataset by name. Cannot be used with `datasetId`.
21828
22294
  * @param options.version Pin the dataset to a specific version xact_id. If `snapshotName` or `environment` are also provided, `version` takes precedence.
21829
22295
  * @param options.snapshotName Pin the dataset to the version captured by this named snapshot. If `environment` is also provided, `snapshotName` takes precedence.
21830
22296
  * @param options.environment Pin the dataset to the version tagged with this environment slug.
21831
22297
  * @param options.appUrl The URL of the Braintrust App. Defaults to https://www.braintrust.dev.
21832
22298
  * @param options.apiKey The API key to use. If the parameter is not specified, will try to use the `BRAINTRUST_API_KEY` environment variable. In Node.js, if that is unset, will try the nearest `.env.braintrust` file in the current working directory or parent directories. If no API key is specified, will prompt the user to login.
21833
22299
  * @param options.orgName (Optional) The name of a specific organization to connect to. This is useful if you belong to multiple.
21834
- * @param options.projectId The id of the project to create the dataset in. This takes precedence over `project` if specified.
21835
- * @param options.metadata A dictionary with additional data about the dataset. The values in `metadata` can be any JSON-serializable type, but its keys must be strings.
22300
+ * @param options.projectId The id of the project to create the dataset in. This takes precedence over `project` if specified and is not required when `datasetId` is provided.
22301
+ * @param options.metadata A dictionary with additional data when initializing a dataset by name. Cannot be used with `datasetId`. The values in `metadata` can be any JSON-serializable type, but its keys must be strings.
21836
22302
  * @param options.useOutput (Deprecated) If true, records will be fetched from this dataset in the legacy format, with the "expected" field renamed to "output". This option will be removed in a future version of Braintrust.
21837
- * @returns The newly created Dataset.
22303
+ * @returns The initialized Dataset.
21838
22304
  */
21839
22305
  declare function initDataset<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY_DATASET>(options: Readonly<FullInitDatasetOptions<IsLegacyDataset>>): Dataset<IsLegacyDataset>;
21840
22306
  /**
@@ -21934,7 +22400,7 @@ type LoadParametersByProjectIdWithEnvOptions = LoadParametersBaseOptions & {
21934
22400
  * @param options.defaults (Optional) A dictionary of default values to use when rendering the prompt. Prompt values will override these defaults.
21935
22401
  * @param options.noTrace If true, do not include logging metadata for this prompt when build() is called.
21936
22402
  * @param options.appUrl The URL of the Braintrust App. Defaults to https://www.braintrust.dev.
21937
- * @param options.apiKey The API key to use. If the parameter is not specified, will try to use the `BRAINTRUST_API_KEY` environment variable. In Node.js,
22403
+ * @param options.apiKey The API key to use for this request, independently of any existing global login. If the parameter is not specified, will use an existing login or try the `BRAINTRUST_API_KEY` environment variable. In Node.js,
21938
22404
  * if that is unset, will try the nearest `.env.braintrust` file in the current working directory or parent directories. If no API key is specified, will prompt the user to login.
21939
22405
  * @param options.orgName (Optional) The name of a specific organization to connect to. This is useful if you belong to multiple.
21940
22406
  * @returns The prompt object.
@@ -21961,7 +22427,7 @@ declare function loadPrompt({ projectName, projectId, slug, version, environment
21961
22427
  * @param options.environment Fetch the version of the parameters assigned to the specified environment (e.g. "production", "staging"). If both `version` and `environment` are provided, `version` takes precedence.
21962
22428
  * @param options.id The id of specific parameters to load. If specified, this takes precedence over all other parameters (project and slug).
21963
22429
  * @param options.appUrl The URL of the Braintrust App. Defaults to https://www.braintrust.dev.
21964
- * @param options.apiKey The API key to use. If the parameter is not specified, will try to use the `BRAINTRUST_API_KEY` environment variable. In Node.js, if that is unset, will try the nearest `.env.braintrust` file in the current working directory or parent directories.
22430
+ * @param options.apiKey The API key to use for this request, independently of any existing global login. If the parameter is not specified, will use an existing login or try the `BRAINTRUST_API_KEY` environment variable. In Node.js, if that is unset, will try the nearest `.env.braintrust` file in the current working directory or parent directories.
21965
22431
  * @param options.orgName (Optional) The name of a specific organization to connect to. This is useful if you belong to multiple.
21966
22432
  * @returns The parameters object.
21967
22433
  * @throws If the parameters are not found.
@@ -22740,6 +23206,251 @@ declare class Prompt<HasId extends boolean = true, HasVersion extends boolean =
22740
23206
  }): PromptBlockDataType;
22741
23207
  private getParsedPromptData;
22742
23208
  static isPrompt(data: unknown): data is Prompt<boolean, boolean>;
23209
+ /** @internal */
23210
+ _internalSerializeForCache(): {
23211
+ metadata: {
23212
+ id: string;
23213
+ created: string;
23214
+ project_id: string;
23215
+ _xact_id: string;
23216
+ prompt_session_id: string;
23217
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | null | undefined;
23218
+ tags?: string[] | null | undefined;
23219
+ _pagination_key?: string | null | undefined;
23220
+ completion?: unknown;
23221
+ prompt_data?: unknown;
23222
+ function_data?: unknown;
23223
+ prompt_session_data?: unknown;
23224
+ object_data?: unknown;
23225
+ } | PromptRowWithId<HasId, HasVersion>;
23226
+ defaults: Partial<Omit<z.objectOutputType<{
23227
+ use_cache: z.ZodOptional<z.ZodBoolean>;
23228
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
23229
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
23230
+ temperature: z.ZodOptional<z.ZodNumber>;
23231
+ top_p: z.ZodOptional<z.ZodNumber>;
23232
+ max_tokens: z.ZodOptional<z.ZodNumber>;
23233
+ max_completion_tokens: z.ZodOptional<z.ZodNumber>;
23234
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
23235
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
23236
+ response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
23237
+ type: z.ZodLiteral<"json_object">;
23238
+ }, "strip", z.ZodTypeAny, {
23239
+ type: "json_object";
23240
+ }, {
23241
+ type: "json_object";
23242
+ }>, z.ZodObject<{
23243
+ type: z.ZodLiteral<"json_schema">;
23244
+ json_schema: z.ZodObject<{
23245
+ name: z.ZodString;
23246
+ description: z.ZodOptional<z.ZodString>;
23247
+ schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
23248
+ strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
23249
+ }, "strip", z.ZodTypeAny, {
23250
+ name: string;
23251
+ description?: string | undefined;
23252
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
23253
+ strict?: boolean | null | undefined;
23254
+ }, {
23255
+ name: string;
23256
+ description?: string | undefined;
23257
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
23258
+ strict?: boolean | null | undefined;
23259
+ }>;
23260
+ }, "strip", z.ZodTypeAny, {
23261
+ type: "json_schema";
23262
+ json_schema: {
23263
+ name: string;
23264
+ description?: string | undefined;
23265
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
23266
+ strict?: boolean | null | undefined;
23267
+ };
23268
+ }, {
23269
+ type: "json_schema";
23270
+ json_schema: {
23271
+ name: string;
23272
+ description?: string | undefined;
23273
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
23274
+ strict?: boolean | null | undefined;
23275
+ };
23276
+ }>, z.ZodObject<{
23277
+ type: z.ZodLiteral<"text">;
23278
+ }, "strip", z.ZodTypeAny, {
23279
+ type: "text";
23280
+ }, {
23281
+ type: "text";
23282
+ }>, z.ZodNull]>>;
23283
+ tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
23284
+ type: z.ZodLiteral<"function">;
23285
+ function: z.ZodObject<{
23286
+ name: z.ZodString;
23287
+ }, "strip", z.ZodTypeAny, {
23288
+ name: string;
23289
+ }, {
23290
+ name: string;
23291
+ }>;
23292
+ }, "strip", z.ZodTypeAny, {
23293
+ function: {
23294
+ name: string;
23295
+ };
23296
+ type: "function";
23297
+ }, {
23298
+ function: {
23299
+ name: string;
23300
+ };
23301
+ type: "function";
23302
+ }>]>>;
23303
+ function_call: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodObject<{
23304
+ name: z.ZodString;
23305
+ }, "strip", z.ZodTypeAny, {
23306
+ name: string;
23307
+ }, {
23308
+ name: string;
23309
+ }>]>>;
23310
+ n: z.ZodOptional<z.ZodNumber>;
23311
+ stop: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
23312
+ reasoning_effort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high"]>>;
23313
+ verbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
23314
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
23315
+ use_cache: z.ZodOptional<z.ZodBoolean>;
23316
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
23317
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
23318
+ max_tokens: z.ZodNumber;
23319
+ temperature: z.ZodNumber;
23320
+ top_p: z.ZodOptional<z.ZodNumber>;
23321
+ top_k: z.ZodOptional<z.ZodNumber>;
23322
+ stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
23323
+ max_tokens_to_sample: z.ZodOptional<z.ZodNumber>;
23324
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
23325
+ use_cache: z.ZodOptional<z.ZodBoolean>;
23326
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
23327
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
23328
+ temperature: z.ZodOptional<z.ZodNumber>;
23329
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
23330
+ topP: z.ZodOptional<z.ZodNumber>;
23331
+ topK: z.ZodOptional<z.ZodNumber>;
23332
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
23333
+ use_cache: z.ZodOptional<z.ZodBoolean>;
23334
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
23335
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
23336
+ temperature: z.ZodOptional<z.ZodNumber>;
23337
+ topK: z.ZodOptional<z.ZodNumber>;
23338
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
23339
+ use_cache: z.ZodOptional<z.ZodBoolean>;
23340
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
23341
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
23342
+ }, z.ZodTypeAny, "passthrough"> | undefined, "response_format" | "reasoning_effort" | "use_cache"> & Omit<{
23343
+ max_tokens: number;
23344
+ temperature?: number | undefined;
23345
+ top_p?: number | undefined;
23346
+ max_completion_tokens?: number | undefined;
23347
+ frequency_penalty?: number | undefined;
23348
+ presence_penalty?: number | undefined;
23349
+ response_format?: {
23350
+ type: "json_object";
23351
+ } | {
23352
+ type: "json_schema";
23353
+ json_schema: {
23354
+ name: string;
23355
+ description?: string | undefined;
23356
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
23357
+ strict?: boolean | null | undefined;
23358
+ };
23359
+ } | {
23360
+ type: "text";
23361
+ } | null | undefined;
23362
+ tool_choice?: "auto" | "none" | "required" | {
23363
+ function: {
23364
+ name: string;
23365
+ };
23366
+ type: "function";
23367
+ } | undefined;
23368
+ function_call?: "auto" | "none" | {
23369
+ name: string;
23370
+ } | undefined;
23371
+ n?: number | undefined;
23372
+ stop?: string[] | undefined;
23373
+ reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | undefined;
23374
+ verbosity?: "low" | "medium" | "high" | undefined;
23375
+ top_k?: number | undefined;
23376
+ stop_sequences?: string[] | undefined;
23377
+ reasoning_enabled?: boolean | undefined;
23378
+ reasoning_budget?: number | undefined;
23379
+ max_tokens_to_sample?: number | undefined;
23380
+ maxOutputTokens?: number | undefined;
23381
+ topP?: number | undefined;
23382
+ topK?: number | undefined;
23383
+ use_cache?: boolean | undefined;
23384
+ }, "response_format" | "reasoning_effort" | "use_cache"> & {
23385
+ reasoning_effort?: CompiledPromptReasoningEffort;
23386
+ response_format?: {
23387
+ type: "json_object";
23388
+ } | {
23389
+ type: "text";
23390
+ } | (Omit<{
23391
+ type: "json_schema";
23392
+ json_schema: {
23393
+ name: string;
23394
+ description?: string | undefined;
23395
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
23396
+ strict?: boolean | null | undefined;
23397
+ };
23398
+ }, "json_schema"> & {
23399
+ json_schema: Omit<{
23400
+ name: string;
23401
+ description?: string | undefined;
23402
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
23403
+ strict?: boolean | null | undefined;
23404
+ }, "schema"> & {
23405
+ schema?: Record<string, unknown> | undefined;
23406
+ };
23407
+ }) | undefined;
23408
+ model: string;
23409
+ } & {
23410
+ max_tokens: number;
23411
+ temperature?: number | undefined;
23412
+ top_p?: number | undefined;
23413
+ max_completion_tokens?: number | undefined;
23414
+ frequency_penalty?: number | undefined;
23415
+ presence_penalty?: number | undefined;
23416
+ response_format?: {
23417
+ type: "json_object";
23418
+ } | {
23419
+ type: "json_schema";
23420
+ json_schema: {
23421
+ name: string;
23422
+ description?: string | undefined;
23423
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
23424
+ strict?: boolean | null | undefined;
23425
+ };
23426
+ } | {
23427
+ type: "text";
23428
+ } | null | undefined;
23429
+ tool_choice?: "auto" | "none" | "required" | {
23430
+ function: {
23431
+ name: string;
23432
+ };
23433
+ type: "function";
23434
+ } | undefined;
23435
+ function_call?: "auto" | "none" | {
23436
+ name: string;
23437
+ } | undefined;
23438
+ n?: number | undefined;
23439
+ stop?: string[] | undefined;
23440
+ reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | undefined;
23441
+ verbosity?: "low" | "medium" | "high" | undefined;
23442
+ top_k?: number | undefined;
23443
+ stop_sequences?: string[] | undefined;
23444
+ reasoning_enabled?: boolean | undefined;
23445
+ reasoning_budget?: number | undefined;
23446
+ max_tokens_to_sample?: number | undefined;
23447
+ maxOutputTokens?: number | undefined;
23448
+ topP?: number | undefined;
23449
+ topK?: number | undefined;
23450
+ use_cache?: boolean | undefined;
23451
+ } & ChatPrompt & CompletionPrompt>;
23452
+ noTrace: boolean;
23453
+ };
22743
23454
  static fromPromptData(name: string, promptData: PromptDataType): Prompt<false, false>;
22744
23455
  }
22745
23456
  declare class RemoteEvalParameters<HasId extends boolean = true, HasVersion extends boolean = true, T extends Record<string, unknown> = Record<string, unknown>> {
@@ -22753,6 +23464,24 @@ declare class RemoteEvalParameters<HasId extends boolean = true, HasVersion exte
22753
23464
  get version(): HasVersion extends true ? TransactionId : TransactionId | undefined;
22754
23465
  get schema(): Record<string, unknown>;
22755
23466
  get data(): T;
23467
+ /** @internal */
23468
+ _internalSerializeForCache(): {
23469
+ metadata: {
23470
+ id: string;
23471
+ project_id: string;
23472
+ name: string;
23473
+ slug: string;
23474
+ function_type: "parameters";
23475
+ _xact_id: string;
23476
+ function_data: {
23477
+ type: "parameters";
23478
+ __schema: Record<string, unknown>;
23479
+ data?: Record<string, unknown> | undefined;
23480
+ };
23481
+ description?: string | null | undefined;
23482
+ metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
23483
+ };
23484
+ };
22756
23485
  validate(data: unknown): boolean;
22757
23486
  static isParameters(x: unknown): x is RemoteEvalParameters<boolean, boolean, Record<string, unknown>>;
22758
23487
  }
@@ -23411,12 +24140,24 @@ interface OpenAIChatToolFunction {
23411
24140
  name?: string;
23412
24141
  [key: string]: unknown;
23413
24142
  }
24143
+ interface OpenAIChatToolFunctionDelta {
24144
+ arguments?: string;
24145
+ name?: string;
24146
+ [key: string]: unknown;
24147
+ }
23414
24148
  interface OpenAIChatToolCall {
23415
24149
  id?: string;
23416
24150
  type?: string;
23417
24151
  function: OpenAIChatToolFunction;
23418
24152
  [key: string]: unknown;
23419
24153
  }
24154
+ interface OpenAIChatToolCallDelta {
24155
+ index: number;
24156
+ id?: string;
24157
+ type?: string;
24158
+ function?: OpenAIChatToolFunctionDelta;
24159
+ [key: string]: unknown;
24160
+ }
23420
24161
  interface OpenAIChatMessage {
23421
24162
  role?: string;
23422
24163
  content?: unknown;
@@ -23452,11 +24193,12 @@ interface OpenAIChatDelta {
23452
24193
  role?: string;
23453
24194
  content?: string;
23454
24195
  refusal?: string;
23455
- tool_calls?: OpenAIChatToolCall[];
24196
+ tool_calls?: OpenAIChatToolCallDelta[];
23456
24197
  finish_reason?: string | null;
23457
24198
  [key: string]: unknown;
23458
24199
  }
23459
24200
  interface OpenAIChatChunkChoice {
24201
+ index: number;
23460
24202
  delta?: OpenAIChatDelta;
23461
24203
  finish_reason?: string | null;
23462
24204
  logprobs?: OpenAIChatLogprobs | null;
@@ -24013,7 +24755,7 @@ type EveModelMessage = EveSystemModelMessage | {
24013
24755
  readonly role: "tool";
24014
24756
  };
24015
24757
  interface EveInstrumentationModelInput {
24016
- readonly instructions?: string | readonly EveSystemModelMessage[];
24758
+ readonly instructions?: string | EveSystemModelMessage | readonly EveSystemModelMessage[];
24017
24759
  readonly messages: readonly EveModelMessage[];
24018
24760
  }
24019
24761
  interface EveInstrumentationStepStartedEventInput {
@@ -24042,6 +24784,183 @@ interface EveInstrumentationDefinition {
24042
24784
  readonly recordOutputs?: boolean;
24043
24785
  readonly setup?: (context: EveInstrumentationSetupContext) => void;
24044
24786
  }
24787
+ /**
24788
+ * Vendored types for Eve's instrumentation-provider API, introduced in
24789
+ * eve@0.34.0. Keep this limited to lifecycle events consumed by Braintrust.
24790
+ */
24791
+ interface EveProviderSetupContext {
24792
+ readonly agentName: string;
24793
+ readonly environment?: "development" | "preview" | "production";
24794
+ readonly evaluation?: {
24795
+ readonly runId: string;
24796
+ };
24797
+ readonly frameworkVersion?: string;
24798
+ }
24799
+ interface EveProviderState {
24800
+ get(): EveJsonValue | undefined;
24801
+ set(value: EveJsonValue | undefined): void;
24802
+ }
24803
+ interface EveProviderContext {
24804
+ readonly state: EveProviderState;
24805
+ }
24806
+ interface EveInstrumentationAttemptScope {
24807
+ readonly attemptId: string;
24808
+ readonly attemptIndex: number;
24809
+ readonly functionId?: string;
24810
+ readonly rootSessionId?: string;
24811
+ readonly sessionId: string;
24812
+ readonly stepIndex: number;
24813
+ readonly turnId: string;
24814
+ }
24815
+ interface EveInstrumentationParentLineage {
24816
+ readonly callId: string;
24817
+ readonly sessionId: string;
24818
+ readonly subagentName?: string;
24819
+ readonly turnId: string;
24820
+ }
24821
+ interface EveInstrumentationTraceContext {
24822
+ readonly isRemote?: boolean;
24823
+ readonly spanId: string;
24824
+ readonly traceFlags: number;
24825
+ readonly traceId: string;
24826
+ }
24827
+ interface EveProviderTurnStartedEvent {
24828
+ readonly idempotencyKey: string;
24829
+ readonly parentLineage?: EveInstrumentationParentLineage;
24830
+ readonly parentTraceContext?: EveInstrumentationTraceContext;
24831
+ readonly rootSessionId: string;
24832
+ readonly sequence: number;
24833
+ readonly sessionId: string;
24834
+ readonly turnId: string;
24835
+ readonly type: "turn.started";
24836
+ }
24837
+ type EveProviderTurnTerminalEvent = {
24838
+ readonly idempotencyKey: string;
24839
+ readonly sessionId: string;
24840
+ readonly turnId: string;
24841
+ readonly type: "turn.cancelled" | "turn.completed";
24842
+ } | {
24843
+ readonly error?: unknown;
24844
+ readonly idempotencyKey: string;
24845
+ readonly sessionId: string;
24846
+ readonly turnId: string;
24847
+ readonly type: "turn.failed";
24848
+ };
24849
+ interface EveProviderModelCallStartedEvent {
24850
+ readonly idempotencyKey: string;
24851
+ readonly input?: EveInstrumentationModelInput;
24852
+ readonly model: {
24853
+ readonly modelId: string;
24854
+ readonly provider: string;
24855
+ };
24856
+ readonly scope: EveInstrumentationAttemptScope;
24857
+ readonly type: "model.call.started";
24858
+ }
24859
+ type EveProviderContentPart = {
24860
+ readonly text: string;
24861
+ readonly type: "text";
24862
+ } | {
24863
+ readonly text: string;
24864
+ readonly type: "reasoning";
24865
+ } | {
24866
+ readonly callId: string;
24867
+ readonly input: unknown;
24868
+ readonly toolName: string;
24869
+ readonly type: "tool-call";
24870
+ } | {
24871
+ readonly callId: string;
24872
+ readonly input: unknown;
24873
+ readonly output: unknown;
24874
+ readonly toolName: string;
24875
+ readonly type: "tool-result";
24876
+ } | {
24877
+ readonly callId: string;
24878
+ readonly error: unknown;
24879
+ readonly input: unknown;
24880
+ readonly toolName: string;
24881
+ readonly type: "tool-error";
24882
+ };
24883
+ interface EveProviderUsage {
24884
+ readonly inputTokenDetails?: {
24885
+ readonly cacheReadTokens?: number;
24886
+ readonly cacheWriteTokens?: number;
24887
+ };
24888
+ readonly inputTokens?: number;
24889
+ readonly outputTokens?: number;
24890
+ }
24891
+ type EveProviderModelCallTerminalEvent = {
24892
+ readonly content?: readonly EveProviderContentPart[];
24893
+ readonly finishReason: string;
24894
+ readonly idempotencyKey: string;
24895
+ readonly scope: EveInstrumentationAttemptScope;
24896
+ readonly type: "model.call.completed";
24897
+ readonly usage: EveProviderUsage;
24898
+ } | {
24899
+ readonly error?: unknown;
24900
+ readonly idempotencyKey: string;
24901
+ readonly scope: EveInstrumentationAttemptScope;
24902
+ readonly type: "model.call.failed";
24903
+ };
24904
+ type EveProviderActionKind = "load-skill" | "remote-agent-call" | "subagent-call" | "tool-call";
24905
+ interface EveProviderActionStartedEvent {
24906
+ readonly callId: string;
24907
+ readonly idempotencyKey: string;
24908
+ readonly input?: unknown;
24909
+ readonly kind: EveProviderActionKind;
24910
+ readonly name: string;
24911
+ readonly scope: EveInstrumentationAttemptScope;
24912
+ readonly type: "action.started";
24913
+ }
24914
+ type EveProviderActionTerminalEvent = {
24915
+ readonly acceptedAtMs?: number;
24916
+ readonly idempotencyKey: string;
24917
+ readonly outcome: "completed";
24918
+ readonly output: {
24919
+ readonly output?: unknown;
24920
+ readonly type: "result";
24921
+ } | {
24922
+ readonly error?: unknown;
24923
+ readonly type: "error";
24924
+ };
24925
+ readonly scope: EveInstrumentationAttemptScope;
24926
+ readonly type: "action.completed";
24927
+ readonly usage?: EveProviderUsage;
24928
+ } | {
24929
+ readonly acceptedAtMs?: number;
24930
+ readonly error?: unknown;
24931
+ readonly errorCode?: string;
24932
+ readonly idempotencyKey: string;
24933
+ readonly outcome: "abandoned" | "cancelled" | "failed" | "rejected";
24934
+ readonly scope: EveInstrumentationAttemptScope;
24935
+ readonly type: "action.failed";
24936
+ };
24937
+ type EveProviderStepAttemptTerminalEvent = {
24938
+ readonly error?: unknown;
24939
+ readonly idempotencyKey: string;
24940
+ readonly scope: EveInstrumentationAttemptScope;
24941
+ readonly type: "step.attempt.completed" | "step.attempt.failed";
24942
+ };
24943
+ type EveProviderHandler<TEvent> = (event: TEvent, context: EveProviderContext) => void | PromiseLike<void>;
24944
+ interface EveProviderDefinition {
24945
+ readonly capture?: "content" | "metadata";
24946
+ readonly events?: {
24947
+ readonly "action.completed"?: EveProviderHandler<EveProviderActionTerminalEvent>;
24948
+ readonly "action.failed"?: EveProviderHandler<EveProviderActionTerminalEvent>;
24949
+ readonly "action.started"?: EveProviderHandler<EveProviderActionStartedEvent>;
24950
+ readonly "model.call.completed"?: EveProviderHandler<EveProviderModelCallTerminalEvent>;
24951
+ readonly "model.call.failed"?: EveProviderHandler<EveProviderModelCallTerminalEvent>;
24952
+ readonly "model.call.started"?: EveProviderHandler<EveProviderModelCallStartedEvent>;
24953
+ readonly "step.attempt.completed"?: EveProviderHandler<EveProviderStepAttemptTerminalEvent>;
24954
+ readonly "step.attempt.failed"?: EveProviderHandler<EveProviderStepAttemptTerminalEvent>;
24955
+ readonly "turn.cancelled"?: EveProviderHandler<EveProviderTurnTerminalEvent>;
24956
+ readonly "turn.completed"?: EveProviderHandler<EveProviderTurnTerminalEvent>;
24957
+ readonly "turn.failed"?: EveProviderHandler<EveProviderTurnTerminalEvent>;
24958
+ readonly "turn.started"?: EveProviderHandler<EveProviderTurnStartedEvent>;
24959
+ };
24960
+ readonly flush?: () => void | PromiseLike<void>;
24961
+ readonly setup?: (context: EveProviderSetupContext) => void | PromiseLike<void>;
24962
+ readonly shutdown?: () => void | PromiseLike<void>;
24963
+ }
24045
24964
 
24046
24965
  type EveStateHandle<T> = {
24047
24966
  get(): T;
@@ -24053,7 +24972,20 @@ declare function braintrustEveHook(options: {
24053
24972
  defineState: EveDefineState;
24054
24973
  metadata?: Record<string, unknown>;
24055
24974
  }): EveHookDefinition;
24056
- /** Eve instrumentation helper for logger setup and durable LLM input capture. */
24975
+
24976
+ type EveProviderInstrumentationOptions = {
24977
+ metadata?: Record<string, unknown>;
24978
+ setup?: EveProviderDefinition["setup"];
24979
+ };
24980
+ /**
24981
+ * Braintrust instrumentation for Eve.
24982
+ *
24983
+ * Pass `defineState` when using Eve's legacy authored instrumentation API.
24984
+ * With Eve 0.34+, omit `defineState` to use the instrumentation-provider
24985
+ * lifecycle and enable `experimental.instrumentationProviders` on the agent.
24986
+ * The result is ready to export directly from the instrumentation module.
24987
+ */
24988
+ declare function braintrustEveInstrumentation(options: EveProviderInstrumentationOptions): EveProviderDefinition;
24057
24989
  declare function braintrustEveInstrumentation(options: {
24058
24990
  defineState: EveDefineState;
24059
24991
  setup?: EveInstrumentationDefinition["setup"];
@@ -24258,8 +25190,8 @@ declare function wrapPiCodingAgentSDK<T>(sdk: T): T;
24258
25190
  declare function wrapCloudflareAgent<T>(Agent: T): T;
24259
25191
 
24260
25192
  /**
24261
- * Wraps the Strands Agent SDK with Braintrust tracing. The wrapper emits
24262
- * diagnostics-channel events; the Strands plugin owns span lifecycle.
25193
+ * Wraps the Strands Agent SDK with Braintrust tracing. The wrapper invokes
25194
+ * typed instrumentation channels; the Strands plugin owns span lifecycle.
24263
25195
  */
24264
25196
  declare function wrapStrandsAgentSDK<T>(sdk: T): T;
24265
25197
 
@@ -24528,6 +25460,12 @@ declare function wrapOllama<T>(ollama: T): T;
24528
25460
  */
24529
25461
  declare function wrapCohere<T>(cohere: T): T;
24530
25462
 
25463
+ /**
25464
+ * Wrap a Voyage AI client so method calls pass through the Braintrust
25465
+ * instrumentation hooks.
25466
+ */
25467
+ declare function wrapVoyageAI<T>(client: T): T;
25468
+
24531
25469
  /**
24532
25470
  * Wrap a Groq client (created with `new Groq(...)`) with Braintrust tracing.
24533
25471
  */
@@ -29951,6 +30889,15 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
29951
30889
  type: "global";
29952
30890
  name: string;
29953
30891
  function_type?: "preprocessor" | undefined;
30892
+ }>, z.ZodObject<{
30893
+ type: z.ZodLiteral<"inline">;
30894
+ code: z.ZodString;
30895
+ }, "strip", z.ZodTypeAny, {
30896
+ code: string;
30897
+ type: "inline";
30898
+ }, {
30899
+ code: string;
30900
+ type: "inline";
29954
30901
  }>, z.ZodNull]>>;
29955
30902
  tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
29956
30903
  type: z.ZodLiteral<"function">;
@@ -30261,6 +31208,9 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
30261
31208
  type: "global";
30262
31209
  name: string;
30263
31210
  function_type: "preprocessor";
31211
+ } | {
31212
+ code: string;
31213
+ type: "inline";
30264
31214
  } | null | undefined;
30265
31215
  origin?: {
30266
31216
  project_id?: string | undefined;
@@ -30535,6 +31485,9 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
30535
31485
  type: "global";
30536
31486
  name: string;
30537
31487
  function_type?: "preprocessor" | undefined;
31488
+ } | {
31489
+ code: string;
31490
+ type: "inline";
30538
31491
  } | null | undefined;
30539
31492
  origin?: {
30540
31493
  project_id?: string | undefined;
@@ -30814,6 +31767,9 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
30814
31767
  type: "global";
30815
31768
  name: string;
30816
31769
  function_type: "preprocessor";
31770
+ } | {
31771
+ code: string;
31772
+ type: "inline";
30817
31773
  } | null | undefined;
30818
31774
  origin?: {
30819
31775
  project_id?: string | undefined;
@@ -31092,6 +32048,9 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
31092
32048
  type: "global";
31093
32049
  name: string;
31094
32050
  function_type?: "preprocessor" | undefined;
32051
+ } | {
32052
+ code: string;
32053
+ type: "inline";
31095
32054
  } | null | undefined;
31096
32055
  origin?: {
31097
32056
  project_id?: string | undefined;
@@ -32614,6 +33573,15 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
32614
33573
  type: "global";
32615
33574
  name: string;
32616
33575
  function_type?: "preprocessor" | undefined;
33576
+ }>, z.ZodObject<{
33577
+ type: z.ZodLiteral<"inline">;
33578
+ code: z.ZodString;
33579
+ }, "strip", z.ZodTypeAny, {
33580
+ code: string;
33581
+ type: "inline";
33582
+ }, {
33583
+ code: string;
33584
+ type: "inline";
32617
33585
  }>, z.ZodNull]>>;
32618
33586
  tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
32619
33587
  type: z.ZodLiteral<"function">;
@@ -32924,6 +33892,9 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
32924
33892
  type: "global";
32925
33893
  name: string;
32926
33894
  function_type: "preprocessor";
33895
+ } | {
33896
+ code: string;
33897
+ type: "inline";
32927
33898
  } | null | undefined;
32928
33899
  origin?: {
32929
33900
  project_id?: string | undefined;
@@ -33198,6 +34169,9 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
33198
34169
  type: "global";
33199
34170
  name: string;
33200
34171
  function_type?: "preprocessor" | undefined;
34172
+ } | {
34173
+ code: string;
34174
+ type: "inline";
33201
34175
  } | null | undefined;
33202
34176
  origin?: {
33203
34177
  project_id?: string | undefined;
@@ -33477,6 +34451,9 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
33477
34451
  type: "global";
33478
34452
  name: string;
33479
34453
  function_type: "preprocessor";
34454
+ } | {
34455
+ code: string;
34456
+ type: "inline";
33480
34457
  } | null | undefined;
33481
34458
  origin?: {
33482
34459
  project_id?: string | undefined;
@@ -33755,6 +34732,9 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
33755
34732
  type: "global";
33756
34733
  name: string;
33757
34734
  function_type?: "preprocessor" | undefined;
34735
+ } | {
34736
+ code: string;
34737
+ type: "inline";
33758
34738
  } | null | undefined;
33759
34739
  origin?: {
33760
34740
  project_id?: string | undefined;
@@ -34064,6 +35044,9 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
34064
35044
  type: "global";
34065
35045
  name: string;
34066
35046
  function_type: "preprocessor";
35047
+ } | {
35048
+ code: string;
35049
+ type: "inline";
34067
35050
  } | null | undefined;
34068
35051
  origin?: {
34069
35052
  project_id?: string | undefined;
@@ -34355,6 +35338,9 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
34355
35338
  type: "global";
34356
35339
  name: string;
34357
35340
  function_type?: "preprocessor" | undefined;
35341
+ } | {
35342
+ code: string;
35343
+ type: "inline";
34358
35344
  } | null | undefined;
34359
35345
  origin?: {
34360
35346
  project_id?: string | undefined;
@@ -35769,6 +36755,15 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
35769
36755
  type: "global";
35770
36756
  name: string;
35771
36757
  function_type?: "preprocessor" | undefined;
36758
+ }>, z.ZodObject<{
36759
+ type: z.ZodLiteral<"inline">;
36760
+ code: z.ZodString;
36761
+ }, "strip", z.ZodTypeAny, {
36762
+ code: string;
36763
+ type: "inline";
36764
+ }, {
36765
+ code: string;
36766
+ type: "inline";
35772
36767
  }>, z.ZodNull]>>;
35773
36768
  tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
35774
36769
  type: z.ZodLiteral<"function">;
@@ -36079,6 +37074,9 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
36079
37074
  type: "global";
36080
37075
  name: string;
36081
37076
  function_type: "preprocessor";
37077
+ } | {
37078
+ code: string;
37079
+ type: "inline";
36082
37080
  } | null | undefined;
36083
37081
  origin?: {
36084
37082
  project_id?: string | undefined;
@@ -36353,6 +37351,9 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
36353
37351
  type: "global";
36354
37352
  name: string;
36355
37353
  function_type?: "preprocessor" | undefined;
37354
+ } | {
37355
+ code: string;
37356
+ type: "inline";
36356
37357
  } | null | undefined;
36357
37358
  origin?: {
36358
37359
  project_id?: string | undefined;
@@ -36632,6 +37633,9 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
36632
37633
  type: "global";
36633
37634
  name: string;
36634
37635
  function_type: "preprocessor";
37636
+ } | {
37637
+ code: string;
37638
+ type: "inline";
36635
37639
  } | null | undefined;
36636
37640
  origin?: {
36637
37641
  project_id?: string | undefined;
@@ -36910,6 +37914,9 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
36910
37914
  type: "global";
36911
37915
  name: string;
36912
37916
  function_type?: "preprocessor" | undefined;
37917
+ } | {
37918
+ code: string;
37919
+ type: "inline";
36913
37920
  } | null | undefined;
36914
37921
  origin?: {
36915
37922
  project_id?: string | undefined;
@@ -37231,6 +38238,9 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
37231
38238
  type: "global";
37232
38239
  name: string;
37233
38240
  function_type: "preprocessor";
38241
+ } | {
38242
+ code: string;
38243
+ type: "inline";
37234
38244
  } | null | undefined;
37235
38245
  origin?: {
37236
38246
  project_id?: string | undefined;
@@ -37535,6 +38545,9 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
37535
38545
  type: "global";
37536
38546
  name: string;
37537
38547
  function_type: "preprocessor";
38548
+ } | {
38549
+ code: string;
38550
+ type: "inline";
37538
38551
  } | null | undefined;
37539
38552
  origin?: {
37540
38553
  project_id?: string | undefined;
@@ -37832,6 +38845,9 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
37832
38845
  type: "global";
37833
38846
  name: string;
37834
38847
  function_type?: "preprocessor" | undefined;
38848
+ } | {
38849
+ code: string;
38850
+ type: "inline";
37835
38851
  } | null | undefined;
37836
38852
  origin?: {
37837
38853
  project_id?: string | undefined;
@@ -38136,6 +39152,9 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
38136
39152
  type: "global";
38137
39153
  name: string;
38138
39154
  function_type?: "preprocessor" | undefined;
39155
+ } | {
39156
+ code: string;
39157
+ type: "inline";
38139
39158
  } | null | undefined;
38140
39159
  origin?: {
38141
39160
  project_id?: string | undefined;
@@ -39629,6 +40648,15 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
39629
40648
  type: "global";
39630
40649
  name: string;
39631
40650
  function_type?: "preprocessor" | undefined;
40651
+ }>, z.ZodObject<{
40652
+ type: z.ZodLiteral<"inline">;
40653
+ code: z.ZodString;
40654
+ }, "strip", z.ZodTypeAny, {
40655
+ code: string;
40656
+ type: "inline";
40657
+ }, {
40658
+ code: string;
40659
+ type: "inline";
39632
40660
  }>, z.ZodNull]>>;
39633
40661
  tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
39634
40662
  type: z.ZodLiteral<"function">;
@@ -39939,6 +40967,9 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
39939
40967
  type: "global";
39940
40968
  name: string;
39941
40969
  function_type: "preprocessor";
40970
+ } | {
40971
+ code: string;
40972
+ type: "inline";
39942
40973
  } | null | undefined;
39943
40974
  origin?: {
39944
40975
  project_id?: string | undefined;
@@ -40213,6 +41244,9 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
40213
41244
  type: "global";
40214
41245
  name: string;
40215
41246
  function_type?: "preprocessor" | undefined;
41247
+ } | {
41248
+ code: string;
41249
+ type: "inline";
40216
41250
  } | null | undefined;
40217
41251
  origin?: {
40218
41252
  project_id?: string | undefined;
@@ -40492,6 +41526,9 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
40492
41526
  type: "global";
40493
41527
  name: string;
40494
41528
  function_type: "preprocessor";
41529
+ } | {
41530
+ code: string;
41531
+ type: "inline";
40495
41532
  } | null | undefined;
40496
41533
  origin?: {
40497
41534
  project_id?: string | undefined;
@@ -40770,6 +41807,9 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
40770
41807
  type: "global";
40771
41808
  name: string;
40772
41809
  function_type?: "preprocessor" | undefined;
41810
+ } | {
41811
+ code: string;
41812
+ type: "inline";
40773
41813
  } | null | undefined;
40774
41814
  origin?: {
40775
41815
  project_id?: string | undefined;
@@ -41079,6 +42119,9 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
41079
42119
  type: "global";
41080
42120
  name: string;
41081
42121
  function_type: "preprocessor";
42122
+ } | {
42123
+ code: string;
42124
+ type: "inline";
41082
42125
  } | null | undefined;
41083
42126
  origin?: {
41084
42127
  project_id?: string | undefined;
@@ -41370,6 +42413,9 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
41370
42413
  type: "global";
41371
42414
  name: string;
41372
42415
  function_type?: "preprocessor" | undefined;
42416
+ } | {
42417
+ code: string;
42418
+ type: "inline";
41373
42419
  } | null | undefined;
41374
42420
  origin?: {
41375
42421
  project_id?: string | undefined;
@@ -42784,6 +43830,15 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
42784
43830
  type: "global";
42785
43831
  name: string;
42786
43832
  function_type?: "preprocessor" | undefined;
43833
+ }>, z.ZodObject<{
43834
+ type: z.ZodLiteral<"inline">;
43835
+ code: z.ZodString;
43836
+ }, "strip", z.ZodTypeAny, {
43837
+ code: string;
43838
+ type: "inline";
43839
+ }, {
43840
+ code: string;
43841
+ type: "inline";
42787
43842
  }>, z.ZodNull]>>;
42788
43843
  tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
42789
43844
  type: z.ZodLiteral<"function">;
@@ -43094,6 +44149,9 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
43094
44149
  type: "global";
43095
44150
  name: string;
43096
44151
  function_type: "preprocessor";
44152
+ } | {
44153
+ code: string;
44154
+ type: "inline";
43097
44155
  } | null | undefined;
43098
44156
  origin?: {
43099
44157
  project_id?: string | undefined;
@@ -43368,6 +44426,9 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
43368
44426
  type: "global";
43369
44427
  name: string;
43370
44428
  function_type?: "preprocessor" | undefined;
44429
+ } | {
44430
+ code: string;
44431
+ type: "inline";
43371
44432
  } | null | undefined;
43372
44433
  origin?: {
43373
44434
  project_id?: string | undefined;
@@ -43647,6 +44708,9 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
43647
44708
  type: "global";
43648
44709
  name: string;
43649
44710
  function_type: "preprocessor";
44711
+ } | {
44712
+ code: string;
44713
+ type: "inline";
43650
44714
  } | null | undefined;
43651
44715
  origin?: {
43652
44716
  project_id?: string | undefined;
@@ -43925,6 +44989,9 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
43925
44989
  type: "global";
43926
44990
  name: string;
43927
44991
  function_type?: "preprocessor" | undefined;
44992
+ } | {
44993
+ code: string;
44994
+ type: "inline";
43928
44995
  } | null | undefined;
43929
44996
  origin?: {
43930
44997
  project_id?: string | undefined;
@@ -44246,6 +45313,9 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
44246
45313
  type: "global";
44247
45314
  name: string;
44248
45315
  function_type: "preprocessor";
45316
+ } | {
45317
+ code: string;
45318
+ type: "inline";
44249
45319
  } | null | undefined;
44250
45320
  origin?: {
44251
45321
  project_id?: string | undefined;
@@ -44550,6 +45620,9 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
44550
45620
  type: "global";
44551
45621
  name: string;
44552
45622
  function_type: "preprocessor";
45623
+ } | {
45624
+ code: string;
45625
+ type: "inline";
44553
45626
  } | null | undefined;
44554
45627
  origin?: {
44555
45628
  project_id?: string | undefined;
@@ -44847,6 +45920,9 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
44847
45920
  type: "global";
44848
45921
  name: string;
44849
45922
  function_type?: "preprocessor" | undefined;
45923
+ } | {
45924
+ code: string;
45925
+ type: "inline";
44850
45926
  } | null | undefined;
44851
45927
  origin?: {
44852
45928
  project_id?: string | undefined;
@@ -45151,6 +46227,9 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
45151
46227
  type: "global";
45152
46228
  name: string;
45153
46229
  function_type?: "preprocessor" | undefined;
46230
+ } | {
46231
+ code: string;
46232
+ type: "inline";
45154
46233
  } | null | undefined;
45155
46234
  origin?: {
45156
46235
  project_id?: string | undefined;
@@ -45773,6 +46852,228 @@ type ScoreAccumulator = {
45773
46852
  declare function buildLocalSummary(evaluator: EvaluatorDef<any, any, any, any>, results: EvalResult<any, any, any, any>[], precomputedScores?: ScoreAccumulator): ExperimentSummary;
45774
46853
  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;
45775
46854
 
46855
+ declare const BATCH_TASK_KIND = "braintrust.durable.batch-task";
46856
+ declare const BATCH_SCORER_KIND = "braintrust.durable.batch-scorer";
46857
+ type JsonPrimitive = string | number | boolean | null;
46858
+ type JsonValue = JsonPrimitive | JsonValue[] | {
46859
+ [key: string]: JsonValue;
46860
+ };
46861
+ /**
46862
+ * Minimal persistence used to reconnect provider webhooks with submitted
46863
+ * batches. Each run, case, and batch is stored under its own key. Durable
46864
+ * evaluations do not require any Braintrust backend changes.
46865
+ *
46866
+ * @experimental - The API for this interface is not yet stabilized and may change or be removed across non-major versions. Functionality is not guaranteed.
46867
+ */
46868
+ interface DurableEvalStore {
46869
+ read(key: string): Promise<Uint8Array | undefined>;
46870
+ write(key: string, value: Uint8Array): Promise<void>;
46871
+ /** Atomically stores `value` when `key` is absent and returns its stored value. */
46872
+ getOrSet(key: string, value: Uint8Array): Promise<{
46873
+ value: Uint8Array;
46874
+ created: boolean;
46875
+ }>;
46876
+ }
46877
+ /**
46878
+ * Stores durable evaluation state in memory. State is lost when the current
46879
+ * JavaScript process exits.
46880
+ *
46881
+ * @experimental - The API for this class is not yet stabilized and may change or be removed across non-major versions. Functionality is not guaranteed.
46882
+ */
46883
+ declare class DurableEvalMemoryStore implements DurableEvalStore {
46884
+ private readonly values;
46885
+ read(key: string): Promise<Uint8Array | undefined>;
46886
+ write(key: string, value: Uint8Array): Promise<void>;
46887
+ getOrSet(key: string, value: Uint8Array): Promise<{
46888
+ value: Uint8Array;
46889
+ created: boolean;
46890
+ }>;
46891
+ }
46892
+ /**
46893
+ * Stores durable evaluation state in Redis using an existing Redis client.
46894
+ * Values are base64 encoded so only string `GET` and `SET` operations are
46895
+ * required from the client. Clients from `redis` (node-redis), `ioredis`, and
46896
+ * `@upstash/redis` can be passed directly.
46897
+ *
46898
+ * @experimental - The API for this class is not yet stabilized and may change or be removed across non-major versions. Functionality is not guaranteed.
46899
+ */
46900
+ declare class DurableEvalRedisStore implements DurableEvalStore {
46901
+ private readonly client;
46902
+ private readonly keyPrefix;
46903
+ private readonly ttlMs;
46904
+ constructor(options: {
46905
+ /** A connected node-redis, ioredis, or Upstash Redis client. */
46906
+ client: {
46907
+ get(key: string): Promise<unknown>;
46908
+ set(key: string, value: string): Promise<unknown>;
46909
+ };
46910
+ /** Prefix for Redis keys. Defaults to `braintrust-eval:`. */
46911
+ keyPrefix?: string;
46912
+ /** Entry lifetime in milliseconds. Defaults to seven days. */
46913
+ ttlMs?: number;
46914
+ });
46915
+ read(key: string): Promise<Uint8Array | undefined>;
46916
+ write(key: string, value: Uint8Array): Promise<void>;
46917
+ getOrSet(key: string, value: Uint8Array): Promise<{
46918
+ value: Uint8Array;
46919
+ created: boolean;
46920
+ }>;
46921
+ }
46922
+ interface DurableBatchContext {
46923
+ runId: string;
46924
+ batchId: string;
46925
+ }
46926
+ type DurableBatchPoll = {
46927
+ status: "pending";
46928
+ } | {
46929
+ status: "complete";
46930
+ } | {
46931
+ status: "failed";
46932
+ error: unknown;
46933
+ };
46934
+ type DurableBatchCompletion<SubmissionData extends JsonValue> = {
46935
+ mode: "poll";
46936
+ /** Checks whether the submitted provider batch is ready to collect. */
46937
+ poll(submissionData: SubmissionData, context: DurableBatchContext): Promise<DurableBatchPoll>;
46938
+ } | {
46939
+ mode: "webhook";
46940
+ /** Returns the provider ID used to match an incoming webhook to this batch. */
46941
+ getExternalId(submissionData: SubmissionData, context: DurableBatchContext): string;
46942
+ };
46943
+ interface DurableBatchTaskItem<Input, Expected, Metadata extends BaseMetadata, Parameters extends EvalParameters> {
46944
+ /** Stable identifier for this case and trial within the durable run. */
46945
+ id: string;
46946
+ /** Input value from the evaluation case. */
46947
+ input: Input;
46948
+ /** Expected value from the evaluation case. */
46949
+ expected: Expected;
46950
+ /** Metadata associated with the evaluation case. */
46951
+ metadata: Metadata;
46952
+ /** Tags associated with the evaluation case. */
46953
+ tags: string[] | undefined;
46954
+ /** Parameters supplied when the durable evaluation started. */
46955
+ parameters: InferParameters<Parameters>;
46956
+ /** Zero-based trial index for this case. */
46957
+ trialIndex: number;
46958
+ }
46959
+ type DurableBatchTaskResult<Output, Metadata extends BaseMetadata> = {
46960
+ /** ID of the submitted item this result belongs to. */
46961
+ id: string;
46962
+ /** Task output for the item. */
46963
+ output: Output;
46964
+ /** Metadata to merge into the evaluation case. */
46965
+ metadata?: Metadata;
46966
+ /** Tags to replace those from the evaluation case. */
46967
+ tags?: string[];
46968
+ };
46969
+ type DurableBatchScorerItem<Input, Output, Expected, Metadata extends BaseMetadata> = EvalScorerArgs<Input, Output, Expected, Metadata> & {
46970
+ /** Stable identifier for this case and trial within the durable run. */
46971
+ id: string;
46972
+ /** Zero-based trial index for this case. */
46973
+ trialIndex: number;
46974
+ };
46975
+ type DurableBatchScorerResult = {
46976
+ /** ID of the submitted item this result belongs to. */
46977
+ id: string;
46978
+ /** Score or named scores produced for the item. */
46979
+ score: OneOrMoreScores;
46980
+ };
46981
+ interface DurableBatchProcessor<Item, Result, SubmissionData extends JsonValue> {
46982
+ /** Maximum items submitted in one provider batch. Defaults to 1,000. */
46983
+ batchSize?: number;
46984
+ /** Submits a batch and returns the provider-specific submission data. */
46985
+ submit(items: Item[], context: DurableBatchContext): Promise<SubmissionData>;
46986
+ /** Configures how the SDK learns that the submitted batch completed. */
46987
+ completion: DurableBatchCompletion<SubmissionData>;
46988
+ /** Collects one result for every item in a completed provider batch. */
46989
+ collect(submissionData: SubmissionData, context: DurableBatchContext): Promise<Result[]>;
46990
+ }
46991
+ interface DurableBatchTask<Input, Output, Expected, Metadata extends BaseMetadata, Parameters extends EvalParameters, SubmissionData extends JsonValue> {
46992
+ readonly kind: typeof BATCH_TASK_KIND;
46993
+ readonly processor: DurableBatchProcessor<DurableBatchTaskItem<Input, Expected, Metadata, Parameters>, DurableBatchTaskResult<Output, Metadata>, SubmissionData>;
46994
+ }
46995
+ interface DurableBatchScorer<Input, Output, Expected, Metadata extends BaseMetadata, SubmissionData extends JsonValue> {
46996
+ readonly kind: typeof BATCH_SCORER_KIND;
46997
+ name: string;
46998
+ readonly processor: DurableBatchProcessor<DurableBatchScorerItem<Input, Output, Expected, Metadata>, DurableBatchScorerResult, SubmissionData>;
46999
+ }
47000
+ /**
47001
+ * Defines a task that runs through asynchronous provider batch operations.
47002
+ *
47003
+ * @experimental - The API for this class is not yet stabilized and may change or be removed across non-major versions. Functionality is not guaranteed.
47004
+ */
47005
+ declare class BatchTask<Input, Output, Expected = void, Metadata extends BaseMetadata = DefaultMetadataType, Parameters extends EvalParameters = EvalParameters, SubmissionData extends JsonValue = JsonValue> implements DurableBatchTask<Input, Output, Expected, Metadata, Parameters, SubmissionData> {
47006
+ readonly processor: DurableBatchProcessor<DurableBatchTaskItem<Input, Expected, Metadata, Parameters>, DurableBatchTaskResult<Output, Metadata>, SubmissionData>;
47007
+ readonly kind: typeof BATCH_TASK_KIND;
47008
+ constructor(processor: DurableBatchProcessor<DurableBatchTaskItem<Input, Expected, Metadata, Parameters>, DurableBatchTaskResult<Output, Metadata>, SubmissionData>);
47009
+ }
47010
+ /**
47011
+ * Defines a scorer that runs through asynchronous provider batch operations.
47012
+ *
47013
+ * @experimental - The API for this class is not yet stabilized and may change or be removed across non-major versions. Functionality is not guaranteed.
47014
+ */
47015
+ declare class BatchScorer<Input, Output, Expected = void, Metadata extends BaseMetadata = DefaultMetadataType, SubmissionData extends JsonValue = JsonValue> implements DurableBatchScorer<Input, Output, Expected, Metadata, SubmissionData> {
47016
+ readonly processor: DurableBatchProcessor<DurableBatchScorerItem<Input, Output, Expected, Metadata>, DurableBatchScorerResult, SubmissionData> & {
47017
+ name: string;
47018
+ };
47019
+ readonly kind: typeof BATCH_SCORER_KIND;
47020
+ readonly name: string;
47021
+ constructor(processor: DurableBatchProcessor<DurableBatchScorerItem<Input, Output, Expected, Metadata>, DurableBatchScorerResult, SubmissionData> & {
47022
+ name: string;
47023
+ });
47024
+ }
47025
+ type DurableEvaluator<Input, Output, Expected = void, Metadata extends BaseMetadata = DefaultMetadataType, Parameters extends EvalParameters = EvalParameters> = Omit<Evaluator<Input, Output, Expected, Metadata, Parameters>, "task" | "scores" | "timeout" | "signal" | "maxConcurrency" | "update"> & {
47026
+ store: DurableEvalStore;
47027
+ /**
47028
+ * Returns a stable case ID when a data item has neither `id` nor `upsert_id`.
47029
+ * The ID is shared by all trials of the same case.
47030
+ */
47031
+ caseId?: (datum: EvalCase<Input, Expected, Metadata>) => string | Promise<string>;
47032
+ task: EvalTask<Input, Output, Expected, Metadata, Parameters> | DurableBatchTask<Input, Output, Expected, Metadata, Parameters, JsonValue>;
47033
+ scores?: Array<EvalScorer<Input, Output, Expected, Metadata> | DurableBatchScorer<Input, Output, Expected, Metadata, JsonValue>>;
47034
+ };
47035
+ interface DurableEvalStartOptions<Parameters extends EvalParameters = EvalParameters> {
47036
+ parameters?: InferParameters<Parameters>;
47037
+ noSendLogs?: boolean;
47038
+ }
47039
+ type DurableBatchResult = {
47040
+ runId: string;
47041
+ batchId?: string;
47042
+ externalId?: string;
47043
+ };
47044
+ type DurableEvalResult = {
47045
+ status: "waiting";
47046
+ runId: string;
47047
+ pending: {
47048
+ poll: number;
47049
+ webhook: number;
47050
+ };
47051
+ } | {
47052
+ status: "completed";
47053
+ runId: string;
47054
+ pending: {
47055
+ poll: 0;
47056
+ webhook: 0;
47057
+ };
47058
+ summary: ExperimentSummary;
47059
+ };
47060
+ interface DurableEvalDefinition<Parameters extends EvalParameters> {
47061
+ start(options?: DurableEvalStartOptions<Parameters>): Promise<DurableEvalResult>;
47062
+ status(options: {
47063
+ runId: string;
47064
+ }): Promise<DurableEvalResult>;
47065
+ poll(options: {
47066
+ runId: string;
47067
+ }): Promise<DurableEvalResult>;
47068
+ processBatchResult(result: DurableBatchResult): Promise<DurableEvalResult>;
47069
+ }
47070
+ /**
47071
+ * Defines a durable evaluation backed by a user-provided store.
47072
+ *
47073
+ * @experimental - The API for this function is not yet stabilized and may change or be removed across non-major versions. Functionality is not guaranteed.
47074
+ */
47075
+ declare function defineDurableEval<Input, Output, Expected = void, Metadata extends BaseMetadata = DefaultMetadataType, Parameters extends EvalParameters = EvalParameters>(projectName: string, evaluator: DurableEvaluator<Input, Output, Expected, Metadata, Parameters>): DurableEvalDefinition<Parameters>;
47076
+
45776
47077
  type MaybePromise<T> = T | Promise<T>;
45777
47078
  type AssertionMatcher = RegExp | ((value: unknown) => boolean) | readonly AssertionMatcher[] | {
45778
47079
  [key: string]: AssertionMatcher;
@@ -46081,6 +47382,7 @@ interface InstrumentationIntegrationsConfig {
46081
47382
  langchain?: boolean;
46082
47383
  langgraph?: boolean;
46083
47384
  langsmith?: boolean;
47385
+ voyageai?: boolean;
46084
47386
  }
46085
47387
  interface InstrumentationConfig {
46086
47388
  /**
@@ -46217,6 +47519,10 @@ type exports$1_BaseAttachment = BaseAttachment;
46217
47519
  declare const exports$1_BaseAttachment: typeof BaseAttachment;
46218
47520
  declare const exports$1_BaseExperiment: typeof BaseExperiment;
46219
47521
  type exports$1_BaseMetadata = BaseMetadata;
47522
+ type exports$1_BatchScorer<Input, Output, Expected = void, Metadata extends BaseMetadata = DefaultMetadataType, SubmissionData extends JsonValue = JsonValue> = BatchScorer<Input, Output, Expected, Metadata, SubmissionData>;
47523
+ declare const exports$1_BatchScorer: typeof BatchScorer;
47524
+ type exports$1_BatchTask<Input, Output, Expected = void, Metadata extends BaseMetadata = DefaultMetadataType, Parameters extends EvalParameters = EvalParameters, SubmissionData extends JsonValue = JsonValue> = BatchTask<Input, Output, Expected, Metadata, Parameters, SubmissionData>;
47525
+ declare const exports$1_BatchTask: typeof BatchTask;
46220
47526
  type exports$1_BraintrustLangChainCallbackHandler<IsAsyncFlush extends boolean = true> = BraintrustLangChainCallbackHandler<IsAsyncFlush>;
46221
47527
  declare const exports$1_BraintrustLangChainCallbackHandler: typeof BraintrustLangChainCallbackHandler;
46222
47528
  declare const exports$1_BraintrustMiddleware: typeof BraintrustMiddleware;
@@ -46256,6 +47562,11 @@ type exports$1_DatasetRestoreResult = DatasetRestoreResult;
46256
47562
  type exports$1_DatasetSummary = DatasetSummary;
46257
47563
  type exports$1_DefaultMetadataType = DefaultMetadataType;
46258
47564
  type exports$1_DefaultPromptArgs = DefaultPromptArgs;
47565
+ type exports$1_DurableEvalMemoryStore = DurableEvalMemoryStore;
47566
+ declare const exports$1_DurableEvalMemoryStore: typeof DurableEvalMemoryStore;
47567
+ type exports$1_DurableEvalRedisStore = DurableEvalRedisStore;
47568
+ declare const exports$1_DurableEvalRedisStore: typeof DurableEvalRedisStore;
47569
+ type exports$1_DurableEvalStore = DurableEvalStore;
46259
47570
  declare const exports$1_ERR_PERMALINK: typeof ERR_PERMALINK;
46260
47571
  type exports$1_EndSpanArgs = EndSpanArgs;
46261
47572
  declare const exports$1_Eval: typeof Eval;
@@ -46414,6 +47725,7 @@ declare const exports$1_currentLogger: typeof currentLogger;
46414
47725
  declare const exports$1_currentSpan: typeof currentSpan;
46415
47726
  declare const exports$1_deepCopyEvent: typeof deepCopyEvent;
46416
47727
  declare const exports$1_defaultErrorScoreHandler: typeof defaultErrorScoreHandler;
47728
+ declare const exports$1_defineDurableEval: typeof defineDurableEval;
46417
47729
  declare const exports$1_deserializePlainStringAsJSON: typeof deserializePlainStringAsJSON;
46418
47730
  declare const exports$1_devNullWritableStream: typeof devNullWritableStream;
46419
47731
  declare const exports$1_evaluatorDefinitionSchema: typeof evaluatorDefinitionSchema;
@@ -46508,8 +47820,9 @@ declare const exports$1_wrapPiCodingAgentSDK: typeof wrapPiCodingAgentSDK;
46508
47820
  declare const exports$1_wrapStrandsAgentSDK: typeof wrapStrandsAgentSDK;
46509
47821
  declare const exports$1_wrapTraced: typeof wrapTraced;
46510
47822
  declare const exports$1_wrapVitest: typeof wrapVitest;
47823
+ declare const exports$1_wrapVoyageAI: typeof wrapVoyageAI;
46511
47824
  declare namespace exports$1 {
46512
- 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_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_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_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 };
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 };
46513
47826
  }
46514
47827
 
46515
- 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, 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, 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, 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 };
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 };