braintrust 3.29.0 → 3.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dev/dist/index.d.mts +4 -1
  2. package/dev/dist/index.d.ts +4 -1
  3. package/dev/dist/index.js +1492 -887
  4. package/dev/dist/index.mjs +836 -231
  5. package/dist/apply-auto-instrumentation.js +217 -217
  6. package/dist/apply-auto-instrumentation.mjs +2 -2
  7. package/dist/auto-instrumentations/bundler/esbuild.cjs +13 -1
  8. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
  9. package/dist/auto-instrumentations/bundler/next.cjs +22 -4
  10. package/dist/auto-instrumentations/bundler/next.mjs +12 -6
  11. package/dist/auto-instrumentations/bundler/rollup.cjs +13 -1
  12. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
  13. package/dist/auto-instrumentations/bundler/vite.cjs +13 -1
  14. package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
  15. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +13 -1
  16. package/dist/auto-instrumentations/bundler/webpack.cjs +13 -1
  17. package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
  18. package/dist/auto-instrumentations/{chunk-DKTGDNA7.mjs → chunk-LW4HDHXT.mjs} +1 -1
  19. package/dist/auto-instrumentations/{chunk-OMCZ3MV2.mjs → chunk-OXINGIEZ.mjs} +1 -1
  20. package/dist/auto-instrumentations/{chunk-AOIYCVEL.mjs → chunk-U64OYU4Q.mjs} +13 -1
  21. package/dist/auto-instrumentations/hook.mjs +18 -4
  22. package/dist/auto-instrumentations/index.cjs +13 -1
  23. package/dist/auto-instrumentations/index.mjs +1 -1
  24. package/dist/browser.d.mts +614 -480
  25. package/dist/browser.d.ts +614 -480
  26. package/dist/browser.js +1172 -305
  27. package/dist/browser.mjs +1172 -305
  28. package/dist/{chunk-6Z5S7VOU.js → chunk-4AQGZS6X.js} +13 -1
  29. package/dist/{chunk-M6XPNJC4.mjs → chunk-AJT4FR25.mjs} +703 -120
  30. package/dist/{chunk-7FA6VP2S.mjs → chunk-CE3BLB2L.mjs} +13 -1
  31. package/dist/{chunk-XLLGRXGR.js → chunk-V32LW47Z.js} +1819 -1236
  32. package/dist/cli.js +846 -241
  33. package/dist/edge-light.d.mts +1 -1
  34. package/dist/edge-light.d.ts +1 -1
  35. package/dist/edge-light.js +1172 -305
  36. package/dist/edge-light.mjs +1172 -305
  37. package/dist/index.d.mts +614 -480
  38. package/dist/index.d.ts +614 -480
  39. package/dist/index.js +915 -643
  40. package/dist/index.mjs +349 -77
  41. package/dist/instrumentation/index.d.mts +15 -0
  42. package/dist/instrumentation/index.d.ts +15 -0
  43. package/dist/instrumentation/index.js +836 -230
  44. package/dist/instrumentation/index.mjs +836 -230
  45. package/dist/vitest-evals-reporter.js +16 -16
  46. package/dist/vitest-evals-reporter.mjs +2 -2
  47. package/dist/workerd.d.mts +1 -1
  48. package/dist/workerd.d.ts +1 -1
  49. package/dist/workerd.js +1172 -305
  50. package/dist/workerd.mjs +1172 -305
  51. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -143,7 +143,7 @@
143
143
 
144
144
 
145
145
 
146
- var _chunkXLLGRXGRjs = require('./chunk-XLLGRXGR.js');
146
+ var _chunkV32LW47Zjs = require('./chunk-V32LW47Z.js');
147
147
 
148
148
 
149
149
 
@@ -177,157 +177,160 @@ var _chunkXLLGRXGRjs = require('./chunk-XLLGRXGR.js');
177
177
 
178
178
 
179
179
 
180
- var _chunk6Z5S7VOUjs = require('./chunk-6Z5S7VOU.js');
180
+ var _chunk4AQGZS6Xjs = require('./chunk-4AQGZS6X.js');
181
181
 
182
182
  // src/exports.ts
183
183
  var exports_exports = {};
184
- _chunk6Z5S7VOUjs.__export.call(void 0, exports_exports, {
185
- Attachment: () => _chunkXLLGRXGRjs.Attachment,
186
- AttachmentReference: () => _chunkXLLGRXGRjs.AttachmentReference,
187
- BAGGAGE_HEADER: () => _chunkXLLGRXGRjs.BAGGAGE_HEADER,
188
- BRAINTRUST_CURRENT_SPAN_STORE: () => _chunkXLLGRXGRjs.BRAINTRUST_CURRENT_SPAN_STORE,
189
- BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME: () => _chunkXLLGRXGRjs.BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME,
190
- BRAINTRUST_PARENT_KEY: () => _chunkXLLGRXGRjs.BRAINTRUST_PARENT_KEY,
191
- BaseAttachment: () => _chunkXLLGRXGRjs.BaseAttachment,
184
+ _chunk4AQGZS6Xjs.__export.call(void 0, exports_exports, {
185
+ Attachment: () => _chunkV32LW47Zjs.Attachment,
186
+ AttachmentReference: () => _chunkV32LW47Zjs.AttachmentReference,
187
+ BAGGAGE_HEADER: () => _chunkV32LW47Zjs.BAGGAGE_HEADER,
188
+ BRAINTRUST_CURRENT_SPAN_STORE: () => _chunkV32LW47Zjs.BRAINTRUST_CURRENT_SPAN_STORE,
189
+ BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME: () => _chunkV32LW47Zjs.BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME,
190
+ BRAINTRUST_PARENT_KEY: () => _chunkV32LW47Zjs.BRAINTRUST_PARENT_KEY,
191
+ BaseAttachment: () => _chunkV32LW47Zjs.BaseAttachment,
192
192
  BaseExperiment: () => BaseExperiment,
193
193
  BatchScorer: () => BatchScorer,
194
194
  BatchTask: () => BatchTask,
195
- BraintrustLangChainCallbackHandler: () => _chunkXLLGRXGRjs.BraintrustLangChainCallbackHandler,
195
+ BraintrustLangChainCallbackHandler: () => _chunkV32LW47Zjs.BraintrustLangChainCallbackHandler,
196
196
  BraintrustMiddleware: () => BraintrustMiddleware,
197
- BraintrustObservabilityExporter: () => _chunkXLLGRXGRjs.BraintrustObservabilityExporter,
198
- BraintrustState: () => _chunkXLLGRXGRjs.BraintrustState,
199
- BraintrustStream: () => _chunkXLLGRXGRjs.BraintrustStream,
197
+ BraintrustObservabilityExporter: () => _chunkV32LW47Zjs.BraintrustObservabilityExporter,
198
+ BraintrustState: () => _chunkV32LW47Zjs.BraintrustState,
199
+ BraintrustStream: () => _chunkV32LW47Zjs.BraintrustStream,
200
200
  CachedSpanFetcher: () => CachedSpanFetcher,
201
201
  CodeFunction: () => CodeFunction,
202
202
  CodePrompt: () => CodePrompt,
203
- ContextManager: () => _chunkXLLGRXGRjs.ContextManager,
204
- DEFAULT_FETCH_BATCH_SIZE: () => _chunkXLLGRXGRjs.DEFAULT_FETCH_BATCH_SIZE,
205
- DEFAULT_MAX_REQUEST_SIZE: () => _chunkXLLGRXGRjs.DEFAULT_MAX_REQUEST_SIZE,
206
- Dataset: () => _chunkXLLGRXGRjs.Dataset,
203
+ ContextManager: () => _chunkV32LW47Zjs.ContextManager,
204
+ DEFAULT_FETCH_BATCH_SIZE: () => _chunkV32LW47Zjs.DEFAULT_FETCH_BATCH_SIZE,
205
+ DEFAULT_MAX_REQUEST_SIZE: () => _chunkV32LW47Zjs.DEFAULT_MAX_REQUEST_SIZE,
206
+ Dataset: () => _chunkV32LW47Zjs.Dataset,
207
207
  DatasetPipeline: () => DatasetPipeline,
208
208
  DurableEvalMemoryStore: () => DurableEvalMemoryStore,
209
209
  DurableEvalRedisStore: () => DurableEvalRedisStore,
210
- ERR_PERMALINK: () => _chunkXLLGRXGRjs.ERR_PERMALINK,
210
+ ERR_PERMALINK: () => _chunkV32LW47Zjs.ERR_PERMALINK,
211
211
  Eval: () => Eval,
212
212
  EvalResultWithSummary: () => EvalResultWithSummary,
213
- Experiment: () => _chunkXLLGRXGRjs.Experiment,
214
- ExternalAttachment: () => _chunkXLLGRXGRjs.ExternalAttachment,
215
- FailedHTTPResponse: () => _chunkXLLGRXGRjs.FailedHTTPResponse,
216
- IDGenerator: () => _chunkXLLGRXGRjs.IDGenerator,
217
- JSONAttachment: () => _chunkXLLGRXGRjs.JSONAttachment,
218
- LEGACY_CACHED_HEADER: () => _chunkXLLGRXGRjs.LEGACY_CACHED_HEADER,
219
- LOGS3_OVERFLOW_REFERENCE_TYPE: () => _chunkXLLGRXGRjs.LOGS3_OVERFLOW_REFERENCE_TYPE,
220
- LazyValue: () => _chunkXLLGRXGRjs.LazyValue,
213
+ Experiment: () => _chunkV32LW47Zjs.Experiment,
214
+ ExternalAttachment: () => _chunkV32LW47Zjs.ExternalAttachment,
215
+ FailedHTTPResponse: () => _chunkV32LW47Zjs.FailedHTTPResponse,
216
+ IDGenerator: () => _chunkV32LW47Zjs.IDGenerator,
217
+ JSONAttachment: () => _chunkV32LW47Zjs.JSONAttachment,
218
+ LEGACY_CACHED_HEADER: () => _chunkV32LW47Zjs.LEGACY_CACHED_HEADER,
219
+ LOGS3_OVERFLOW_REFERENCE_TYPE: () => _chunkV32LW47Zjs.LOGS3_OVERFLOW_REFERENCE_TYPE,
220
+ LazyValue: () => _chunkV32LW47Zjs.LazyValue,
221
221
  LocalTrace: () => LocalTrace,
222
- Logger: () => _chunkXLLGRXGRjs.Logger,
223
- LoginInvalidOrgError: () => _chunkXLLGRXGRjs.LoginInvalidOrgError,
224
- NOOP_SPAN: () => _chunkXLLGRXGRjs.NOOP_SPAN,
225
- NOOP_SPAN_PERMALINK: () => _chunkXLLGRXGRjs.NOOP_SPAN_PERMALINK,
226
- NoopSpan: () => _chunkXLLGRXGRjs.NoopSpan,
227
- OTELIDGenerator: () => _chunkXLLGRXGRjs.OTELIDGenerator,
228
- ObjectFetcher: () => _chunkXLLGRXGRjs.ObjectFetcher,
222
+ Logger: () => _chunkV32LW47Zjs.Logger,
223
+ LoginInvalidOrgError: () => _chunkV32LW47Zjs.LoginInvalidOrgError,
224
+ NOOP_SPAN: () => _chunkV32LW47Zjs.NOOP_SPAN,
225
+ NOOP_SPAN_PERMALINK: () => _chunkV32LW47Zjs.NOOP_SPAN_PERMALINK,
226
+ NoopSpan: () => _chunkV32LW47Zjs.NoopSpan,
227
+ OTELIDGenerator: () => _chunkV32LW47Zjs.OTELIDGenerator,
228
+ ObjectFetcher: () => _chunkV32LW47Zjs.ObjectFetcher,
229
229
  Project: () => Project2,
230
230
  ProjectNameIdMap: () => ProjectNameIdMap,
231
- Prompt: () => _chunkXLLGRXGRjs.Prompt,
231
+ Prompt: () => _chunkV32LW47Zjs.Prompt,
232
232
  PromptBuilder: () => PromptBuilder,
233
- ReadonlyAttachment: () => _chunkXLLGRXGRjs.ReadonlyAttachment,
234
- ReadonlyExperiment: () => _chunkXLLGRXGRjs.ReadonlyExperiment,
233
+ ReadonlyAttachment: () => _chunkV32LW47Zjs.ReadonlyAttachment,
234
+ ReadonlyExperiment: () => _chunkV32LW47Zjs.ReadonlyExperiment,
235
235
  Reporter: () => Reporter,
236
236
  ScorerBuilder: () => ScorerBuilder,
237
237
  SpanFetcher: () => SpanFetcher,
238
- SpanImpl: () => _chunkXLLGRXGRjs.SpanImpl,
239
- TRACEPARENT_HEADER: () => _chunkXLLGRXGRjs.TRACEPARENT_HEADER,
240
- TRACESTATE_HEADER: () => _chunkXLLGRXGRjs.TRACESTATE_HEADER,
241
- TestBackgroundLogger: () => _chunkXLLGRXGRjs.TestBackgroundLogger,
238
+ SpanImpl: () => _chunkV32LW47Zjs.SpanImpl,
239
+ TRACEPARENT_HEADER: () => _chunkV32LW47Zjs.TRACEPARENT_HEADER,
240
+ TRACESTATE_HEADER: () => _chunkV32LW47Zjs.TRACESTATE_HEADER,
241
+ TestBackgroundLogger: () => _chunkV32LW47Zjs.TestBackgroundLogger,
242
242
  ToolBuilder: () => ToolBuilder,
243
- UUIDGenerator: () => _chunkXLLGRXGRjs.UUIDGenerator,
244
- X_CACHED_HEADER: () => _chunkXLLGRXGRjs.X_CACHED_HEADER,
245
- _exportsForTestingOnly: () => _chunkXLLGRXGRjs._exportsForTestingOnly,
246
- _internalGetGlobalState: () => _chunkXLLGRXGRjs._internalGetGlobalState,
247
- _internalIso: () => _chunk6Z5S7VOUjs.isomorph_default,
248
- _internalSetInitialState: () => _chunkXLLGRXGRjs._internalSetInitialState,
249
- addAzureBlobHeaders: () => _chunkXLLGRXGRjs.addAzureBlobHeaders,
243
+ UUIDGenerator: () => _chunkV32LW47Zjs.UUIDGenerator,
244
+ X_CACHED_HEADER: () => _chunkV32LW47Zjs.X_CACHED_HEADER,
245
+ _exportsForTestingOnly: () => _chunkV32LW47Zjs._exportsForTestingOnly,
246
+ _internalGetGlobalState: () => _chunkV32LW47Zjs._internalGetGlobalState,
247
+ _internalIso: () => _chunk4AQGZS6Xjs.isomorph_default,
248
+ _internalSetInitialState: () => _chunkV32LW47Zjs._internalSetInitialState,
249
+ addAzureBlobHeaders: () => _chunkV32LW47Zjs.addAzureBlobHeaders,
250
250
  agentAssertionScorer: () => agentAssertionScorer,
251
- braintrustAISDKTelemetry: () => _chunkXLLGRXGRjs.braintrustAISDKTelemetry,
251
+ braintrustAISDKTelemetry: () => _chunkV32LW47Zjs.braintrustAISDKTelemetry,
252
252
  braintrustEveHook: () => braintrustEveHook,
253
253
  braintrustEveInstrumentation: () => braintrustEveInstrumentation,
254
- braintrustFlueInstrumentation: () => _chunkXLLGRXGRjs.braintrustFlueInstrumentation,
255
- braintrustFlueObserver: () => _chunkXLLGRXGRjs.braintrustFlueObserver,
256
- braintrustStreamChunkSchema: () => _chunkXLLGRXGRjs.braintrustStreamChunkSchema,
254
+ braintrustFlueInstrumentation: () => _chunkV32LW47Zjs.braintrustFlueInstrumentation,
255
+ braintrustFlueObserver: () => _chunkV32LW47Zjs.braintrustFlueObserver,
256
+ braintrustStreamChunkSchema: () => _chunkV32LW47Zjs.braintrustStreamChunkSchema,
257
257
  buildLocalSummary: () => buildLocalSummary,
258
- collectAnthropicSession: () => _chunkXLLGRXGRjs.collectAnthropicSession,
259
- configureInstrumentation: () => _chunkXLLGRXGRjs.configureInstrumentation,
260
- constructLogs3OverflowRequest: () => _chunkXLLGRXGRjs.constructLogs3OverflowRequest,
261
- createFinalValuePassThroughStream: () => _chunkXLLGRXGRjs.createFinalValuePassThroughStream,
262
- currentExperiment: () => _chunkXLLGRXGRjs.currentExperiment,
263
- currentLogger: () => _chunkXLLGRXGRjs.currentLogger,
264
- currentSpan: () => _chunkXLLGRXGRjs.currentSpan,
265
- deepCopyEvent: () => _chunkXLLGRXGRjs.deepCopyEvent,
258
+ collectAnthropicSession: () => _chunkV32LW47Zjs.collectAnthropicSession,
259
+ completeOpenAIBatchTrace: () => completeOpenAIBatchTrace,
260
+ configureInstrumentation: () => _chunkV32LW47Zjs.configureInstrumentation,
261
+ constructLogs3OverflowRequest: () => _chunkV32LW47Zjs.constructLogs3OverflowRequest,
262
+ createFinalValuePassThroughStream: () => _chunkV32LW47Zjs.createFinalValuePassThroughStream,
263
+ currentExperiment: () => _chunkV32LW47Zjs.currentExperiment,
264
+ currentLogger: () => _chunkV32LW47Zjs.currentLogger,
265
+ currentSpan: () => _chunkV32LW47Zjs.currentSpan,
266
+ deepCopyEvent: () => _chunkV32LW47Zjs.deepCopyEvent,
266
267
  defaultErrorScoreHandler: () => defaultErrorScoreHandler,
267
268
  defineDurableEval: () => defineDurableEval,
268
- deserializePlainStringAsJSON: () => _chunkXLLGRXGRjs.deserializePlainStringAsJSON,
269
- devNullWritableStream: () => _chunkXLLGRXGRjs.devNullWritableStream,
269
+ deserializePlainStringAsJSON: () => _chunkV32LW47Zjs.deserializePlainStringAsJSON,
270
+ devNullWritableStream: () => _chunkV32LW47Zjs.devNullWritableStream,
270
271
  evaluatorDefinitionSchema: () => evaluatorDefinitionSchema,
271
272
  evaluatorDefinitionsSchema: () => evaluatorDefinitionsSchema,
272
- extractTraceContextFromHeaders: () => _chunkXLLGRXGRjs.extractTraceContextFromHeaders,
273
- flush: () => _chunkXLLGRXGRjs.flush,
274
- getContextManager: () => _chunkXLLGRXGRjs.getContextManager,
275
- getIdGenerator: () => _chunkXLLGRXGRjs.getIdGenerator,
276
- getPromptVersions: () => _chunkXLLGRXGRjs.getPromptVersions,
277
- getSpanParentObject: () => _chunkXLLGRXGRjs.getSpanParentObject,
278
- getTemplateRenderer: () => _chunkXLLGRXGRjs.getTemplateRenderer,
273
+ extractTraceContextFromHeaders: () => _chunkV32LW47Zjs.extractTraceContextFromHeaders,
274
+ flush: () => _chunkV32LW47Zjs.flush,
275
+ getContextManager: () => _chunkV32LW47Zjs.getContextManager,
276
+ getIdGenerator: () => _chunkV32LW47Zjs.getIdGenerator,
277
+ getPromptVersions: () => _chunkV32LW47Zjs.getPromptVersions,
278
+ getSpanParentObject: () => _chunkV32LW47Zjs.getSpanParentObject,
279
+ getTemplateRenderer: () => _chunkV32LW47Zjs.getTemplateRenderer,
279
280
  graph: () => graph_framework_exports,
280
- init: () => _chunkXLLGRXGRjs.init,
281
- initDataset: () => _chunkXLLGRXGRjs.initDataset,
282
- initExperiment: () => _chunkXLLGRXGRjs.initExperiment,
281
+ init: () => _chunkV32LW47Zjs.init,
282
+ initDataset: () => _chunkV32LW47Zjs.initDataset,
283
+ initExperiment: () => _chunkV32LW47Zjs.initExperiment,
283
284
  initFunction: () => initFunction,
284
- initLogger: () => _chunkXLLGRXGRjs.initLogger,
285
+ initLogger: () => _chunkV32LW47Zjs.initLogger,
285
286
  initNodeTestSuite: () => initNodeTestSuite,
286
- injectTraceContext: () => _chunkXLLGRXGRjs.injectTraceContext,
287
+ injectTraceContext: () => _chunkV32LW47Zjs.injectTraceContext,
287
288
  invoke: () => invoke,
288
- isTemplateFormat: () => _chunkXLLGRXGRjs.isTemplateFormat,
289
- loadParameters: () => _chunkXLLGRXGRjs.loadParameters,
290
- loadPrompt: () => _chunkXLLGRXGRjs.loadPrompt,
291
- log: () => _chunkXLLGRXGRjs.log,
292
- logError: () => _chunkXLLGRXGRjs.logError,
293
- login: () => _chunkXLLGRXGRjs.login,
294
- loginToState: () => _chunkXLLGRXGRjs.loginToState,
295
- logs3OverflowUploadSchema: () => _chunkXLLGRXGRjs.logs3OverflowUploadSchema,
296
- newId: () => _chunkXLLGRXGRjs.newId,
297
- parseCachedHeader: () => _chunkXLLGRXGRjs.parseCachedHeader,
298
- parseTemplateFormat: () => _chunkXLLGRXGRjs.parseTemplateFormat,
299
- permalink: () => _chunkXLLGRXGRjs.permalink,
300
- pickLogs3OverflowObjectIds: () => _chunkXLLGRXGRjs.pickLogs3OverflowObjectIds,
289
+ isTemplateFormat: () => _chunkV32LW47Zjs.isTemplateFormat,
290
+ loadParameters: () => _chunkV32LW47Zjs.loadParameters,
291
+ loadPrompt: () => _chunkV32LW47Zjs.loadPrompt,
292
+ log: () => _chunkV32LW47Zjs.log,
293
+ logError: () => _chunkV32LW47Zjs.logError,
294
+ login: () => _chunkV32LW47Zjs.login,
295
+ loginToState: () => _chunkV32LW47Zjs.loginToState,
296
+ logs3OverflowUploadSchema: () => _chunkV32LW47Zjs.logs3OverflowUploadSchema,
297
+ newId: () => _chunkV32LW47Zjs.newId,
298
+ openaiBatchesRetrieveTraced: () => openaiBatchesRetrieveTraced,
299
+ openaiFilesCreateTraced: () => openaiFilesCreateTraced,
300
+ parseCachedHeader: () => _chunkV32LW47Zjs.parseCachedHeader,
301
+ parseTemplateFormat: () => _chunkV32LW47Zjs.parseTemplateFormat,
302
+ permalink: () => _chunkV32LW47Zjs.permalink,
303
+ pickLogs3OverflowObjectIds: () => _chunkV32LW47Zjs.pickLogs3OverflowObjectIds,
301
304
  projects: () => projects,
302
305
  promptContentsSchema: () => promptContentsSchema,
303
306
  promptDefinitionSchema: () => promptDefinitionSchema,
304
307
  promptDefinitionToPromptData: () => promptDefinitionToPromptData,
305
308
  promptDefinitionWithToolsSchema: () => promptDefinitionWithToolsSchema,
306
- registerOtelFlush: () => _chunkXLLGRXGRjs.registerOtelFlush,
309
+ registerOtelFlush: () => _chunkV32LW47Zjs.registerOtelFlush,
307
310
  registerSandbox: () => registerSandbox,
308
- registerTemplatePlugin: () => _chunkXLLGRXGRjs.registerTemplatePlugin,
309
- renderMessage: () => _chunkXLLGRXGRjs.renderMessage,
310
- renderPromptParams: () => _chunkXLLGRXGRjs.renderPromptParams,
311
- renderTemplateContent: () => _chunkXLLGRXGRjs.renderTemplateContent,
311
+ registerTemplatePlugin: () => _chunkV32LW47Zjs.registerTemplatePlugin,
312
+ renderMessage: () => _chunkV32LW47Zjs.renderMessage,
313
+ renderPromptParams: () => _chunkV32LW47Zjs.renderPromptParams,
314
+ renderTemplateContent: () => _chunkV32LW47Zjs.renderTemplateContent,
312
315
  reportFailures: () => reportFailures,
313
316
  runEvaluator: () => runEvaluator,
314
- setFetch: () => _chunkXLLGRXGRjs.setFetch,
315
- setMaskingFunction: () => _chunkXLLGRXGRjs.setMaskingFunction,
316
- spanComponentsToObjectId: () => _chunkXLLGRXGRjs.spanComponentsToObjectId,
317
- startSpan: () => _chunkXLLGRXGRjs.startSpan,
318
- summarize: () => _chunkXLLGRXGRjs.summarize,
319
- templateRegistry: () => _chunkXLLGRXGRjs.templateRegistry,
320
- toolFunctionDefinitionSchema: () => _chunkXLLGRXGRjs.ToolFunctionDefinition,
321
- traceable: () => _chunkXLLGRXGRjs.traceable,
322
- traced: () => _chunkXLLGRXGRjs.traced,
323
- updateSpan: () => _chunkXLLGRXGRjs.updateSpan,
324
- uploadLogs3OverflowPayload: () => _chunkXLLGRXGRjs.uploadLogs3OverflowPayload,
325
- utf8ByteLength: () => _chunkXLLGRXGRjs.utf8ByteLength,
326
- withCurrent: () => _chunkXLLGRXGRjs.withCurrent,
327
- withDataset: () => _chunkXLLGRXGRjs.withDataset,
328
- withExperiment: () => _chunkXLLGRXGRjs.withExperiment,
329
- withLogger: () => _chunkXLLGRXGRjs.withLogger,
330
- withParent: () => _chunkXLLGRXGRjs.withParent,
317
+ setFetch: () => _chunkV32LW47Zjs.setFetch,
318
+ setMaskingFunction: () => _chunkV32LW47Zjs.setMaskingFunction,
319
+ spanComponentsToObjectId: () => _chunkV32LW47Zjs.spanComponentsToObjectId,
320
+ startSpan: () => _chunkV32LW47Zjs.startSpan,
321
+ summarize: () => _chunkV32LW47Zjs.summarize,
322
+ templateRegistry: () => _chunkV32LW47Zjs.templateRegistry,
323
+ toolFunctionDefinitionSchema: () => _chunkV32LW47Zjs.ToolFunctionDefinition,
324
+ traceable: () => _chunkV32LW47Zjs.traceable,
325
+ traced: () => _chunkV32LW47Zjs.traced,
326
+ updateSpan: () => _chunkV32LW47Zjs.updateSpan,
327
+ uploadLogs3OverflowPayload: () => _chunkV32LW47Zjs.uploadLogs3OverflowPayload,
328
+ utf8ByteLength: () => _chunkV32LW47Zjs.utf8ByteLength,
329
+ withCurrent: () => _chunkV32LW47Zjs.withCurrent,
330
+ withDataset: () => _chunkV32LW47Zjs.withDataset,
331
+ withExperiment: () => _chunkV32LW47Zjs.withExperiment,
332
+ withLogger: () => _chunkV32LW47Zjs.withLogger,
333
+ withParent: () => _chunkV32LW47Zjs.withParent,
331
334
  wrapAISDK: () => wrapAISDK,
332
335
  wrapAISDKModel: () => wrapAISDKModel,
333
336
  wrapAgentClass: () => wrapAgentClass,
@@ -349,7 +352,7 @@ _chunk6Z5S7VOUjs.__export.call(void 0, exports_exports, {
349
352
  wrapLangSmithClient: () => wrapLangSmithClient,
350
353
  wrapLangSmithRunTrees: () => wrapLangSmithRunTrees,
351
354
  wrapLangSmithTraceable: () => wrapLangSmithTraceable,
352
- wrapMastraAgent: () => _chunkXLLGRXGRjs.wrapMastraAgent,
355
+ wrapMastraAgent: () => _chunkV32LW47Zjs.wrapMastraAgent,
353
356
  wrapMistral: () => wrapMistral,
354
357
  wrapOllama: () => wrapOllama,
355
358
  wrapOpenAI: () => wrapOpenAI,
@@ -359,7 +362,7 @@ _chunk6Z5S7VOUjs.__export.call(void 0, exports_exports, {
359
362
  wrapOpenRouterAgent: () => wrapOpenRouterAgent,
360
363
  wrapPiCodingAgentSDK: () => wrapPiCodingAgentSDK,
361
364
  wrapStrandsAgentSDK: () => wrapStrandsAgentSDK,
362
- wrapTraced: () => _chunkXLLGRXGRjs.wrapTraced,
365
+ wrapTraced: () => _chunkV32LW47Zjs.wrapTraced,
363
366
  wrapVitest: () => wrapVitest,
364
367
  wrapVoyageAI: () => wrapVoyageAI
365
368
  });
@@ -368,7 +371,7 @@ _chunk6Z5S7VOUjs.__export.call(void 0, exports_exports, {
368
371
  var _v3 = require('zod/v3');
369
372
  var SANDBOX_GROUP_NAME_METADATA_KEY = "_bt_sandbox_group_name";
370
373
  async function registerSandbox(options) {
371
- const state = _nullishCoalesce(options.state, () => ( _chunkXLLGRXGRjs._internalGetGlobalState.call(void 0, )));
374
+ const state = _nullishCoalesce(options.state, () => ( _chunkV32LW47Zjs._internalGetGlobalState.call(void 0, )));
372
375
  await state.login({
373
376
  apiKey: options.apiKey,
374
377
  appUrl: options.appUrl,
@@ -409,7 +412,7 @@ async function registerSandbox(options) {
409
412
  evaluatorDefinitions
410
413
  )) {
411
414
  const functionName = evalName;
412
- const functionSlug = _chunkXLLGRXGRjs.slugify.call(void 0, evalName, { lower: true, strict: true });
415
+ const functionSlug = _chunkV32LW47Zjs.slugify.call(void 0, evalName, { lower: true, strict: true });
413
416
  const functionDef = {
414
417
  project_id: projectId,
415
418
  org_name: state.orgName,
@@ -458,6 +461,260 @@ async function registerSandbox(options) {
458
461
  };
459
462
  }
460
463
 
464
+ // src/wrappers/openai-promise-utils.ts
465
+ function splitSpanInfo(allParams) {
466
+ const { span_info, ...params } = allParams;
467
+ return {
468
+ params,
469
+ span_info
470
+ };
471
+ }
472
+ function createChannelContext(_channel, params, span_info) {
473
+ return {
474
+ arguments: (
475
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
476
+ [params]
477
+ ),
478
+ span_info
479
+ };
480
+ }
481
+ async function tracePromiseWithResponse(channel, traceContext, apiPromise) {
482
+ let enhancedResponse;
483
+ const tracePromise = (
484
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
485
+ channel.tracePromise
486
+ );
487
+ const data = await tracePromise(async () => {
488
+ enhancedResponse = await apiPromise.withResponse();
489
+ traceContext.response = enhancedResponse.response;
490
+ return enhancedResponse.data;
491
+ }, traceContext);
492
+ if (!enhancedResponse) {
493
+ throw new Error("Expected withResponse() to provide response");
494
+ }
495
+ return {
496
+ data,
497
+ response: enhancedResponse.response,
498
+ request_id: enhancedResponse.request_id
499
+ };
500
+ }
501
+ async function tracePromiseAsResponse(channel, traceContext, apiPromise) {
502
+ const tracePromise = (
503
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
504
+ channel.tracePromise
505
+ );
506
+ let response;
507
+ await tracePromise(async () => {
508
+ response = await apiPromise.asResponse();
509
+ traceContext.response = response;
510
+ return void 0;
511
+ }, traceContext);
512
+ if (!response) {
513
+ throw new Error("Expected asResponse() to provide response");
514
+ }
515
+ return response;
516
+ }
517
+ function createLazyAPIPromise(ensureExecuted, ensureResponse, getAPIPromise) {
518
+ let firstConsumption;
519
+ let enhancedResponsePromise;
520
+ let dataPromise;
521
+ let responsePromise;
522
+ const withResponse = () => {
523
+ firstConsumption ??= "data";
524
+ enhancedResponsePromise ??= firstConsumption === "data" ? ensureExecuted() : getAPIPromise().withResponse();
525
+ return enhancedResponsePromise;
526
+ };
527
+ const asResponse = () => {
528
+ firstConsumption ??= "response";
529
+ responsePromise ??= firstConsumption === "response" ? ensureResponse() : getAPIPromise().asResponse();
530
+ return responsePromise;
531
+ };
532
+ return new Proxy({}, {
533
+ get(target, prop, receiver) {
534
+ if (prop === "withResponse") {
535
+ return withResponse;
536
+ }
537
+ if (prop === "asResponse") {
538
+ return asResponse;
539
+ }
540
+ if (prop === "then" || prop === "catch" || prop === "finally" || prop in Promise.prototype) {
541
+ dataPromise ??= withResponse().then((result) => result.data);
542
+ const value = Reflect.get(dataPromise, prop, receiver);
543
+ return typeof value === "function" ? value.bind(dataPromise) : value;
544
+ }
545
+ return Reflect.get(target, prop, receiver);
546
+ }
547
+ });
548
+ }
549
+
550
+ // src/openai-batch.ts
551
+ function read(value, key) {
552
+ if (value === null || typeof value !== "object" && typeof value !== "function") {
553
+ return void 0;
554
+ }
555
+ try {
556
+ return Reflect.get(value, key);
557
+ } catch (e2) {
558
+ return void 0;
559
+ }
560
+ }
561
+ function isAsyncIterable(value) {
562
+ return typeof read(value, Symbol.asyncIterator) === "function";
563
+ }
564
+ function teeAsyncIterable(source) {
565
+ const iterator = source[Symbol.asyncIterator]();
566
+ const stream = new ReadableStream({
567
+ async pull(controller) {
568
+ try {
569
+ const result = await iterator.next();
570
+ if (result.done) {
571
+ controller.close();
572
+ return;
573
+ }
574
+ if (!(result.value instanceof Uint8Array)) {
575
+ throw new TypeError(
576
+ "OpenAI upload streams must yield Uint8Array chunks"
577
+ );
578
+ }
579
+ controller.enqueue(result.value);
580
+ } catch (error) {
581
+ controller.error(error);
582
+ }
583
+ },
584
+ async cancel(reason) {
585
+ await _optionalChain([iterator, 'access', _2 => _2.return, 'optionalCall', _3 => _3(reason)]);
586
+ }
587
+ });
588
+ const [uploadStream, trace] = stream.tee();
589
+ const upload = {
590
+ async *[Symbol.asyncIterator]() {
591
+ const reader = uploadStream.getReader();
592
+ try {
593
+ while (true) {
594
+ const result = await reader.read();
595
+ if (result.done) {
596
+ return;
597
+ }
598
+ yield result.value;
599
+ }
600
+ } finally {
601
+ reader.releaseLock();
602
+ }
603
+ }
604
+ };
605
+ const path = read(source, "path");
606
+ if (typeof path === "string") {
607
+ Object.defineProperty(upload, "path", { value: path });
608
+ }
609
+ return { upload, trace: new Response(trace) };
610
+ }
611
+ function teeUpload(upload) {
612
+ if (upload instanceof Blob) {
613
+ return { upload, trace: new Response(upload) };
614
+ }
615
+ if (upload instanceof Response) {
616
+ return { upload, trace: upload.clone() };
617
+ }
618
+ if (isAsyncIterable(upload)) {
619
+ return teeAsyncIterable(upload);
620
+ }
621
+ return void 0;
622
+ }
623
+ function openaiFilesCreateTraced(files) {
624
+ return (params, options) => {
625
+ const parent = _chunkV32LW47Zjs.getSpanParentObject.call(void 0, );
626
+ const purpose = read(params, "purpose");
627
+ const file = read(params, "file");
628
+ if (purpose !== "batch") {
629
+ return files.create(params, options);
630
+ }
631
+ let branches;
632
+ try {
633
+ branches = teeUpload(file);
634
+ } catch (e3) {
635
+ return files.create(params, options);
636
+ }
637
+ if (!branches) {
638
+ return files.create(params, options);
639
+ }
640
+ const tracedParams = {
641
+ ...Object(params),
642
+ file: branches.upload
643
+ };
644
+ const apiPromise = files.create(tracedParams, options);
645
+ let enhancedResponse;
646
+ const tracedResponse = _chunk4AQGZS6Xjs.openAIChannels.filesCreateTraced.invoke(
647
+ async () => {
648
+ enhancedResponse = await apiPromise.withResponse();
649
+ return enhancedResponse.data;
650
+ },
651
+ files,
652
+ [{ params, inputFileContent: branches.trace, parent }],
653
+ {}
654
+ ).then((data) => {
655
+ if (!enhancedResponse) {
656
+ throw new Error(
657
+ "Expected OpenAI withResponse() to provide a response"
658
+ );
659
+ }
660
+ return { ...enhancedResponse, data };
661
+ });
662
+ return createLazyAPIPromise(
663
+ () => tracedResponse,
664
+ () => tracedResponse.then(({ response }) => response),
665
+ () => apiPromise
666
+ );
667
+ };
668
+ }
669
+ function openaiBatchesRetrieveTraced(batches) {
670
+ return (batchId, options) => {
671
+ const apiPromise = batches.retrieve(batchId, options);
672
+ let enhancedResponse;
673
+ const tracedResponse = _chunk4AQGZS6Xjs.openAIChannels.batchesRetrieveTraced.invoke(
674
+ async () => {
675
+ enhancedResponse = await apiPromise.withResponse();
676
+ return enhancedResponse.data;
677
+ },
678
+ batches,
679
+ [{ batchId }],
680
+ {}
681
+ ).then((data) => {
682
+ if (!enhancedResponse) {
683
+ throw new Error(
684
+ "Expected OpenAI withResponse() to provide a response"
685
+ );
686
+ }
687
+ return { ...enhancedResponse, data };
688
+ });
689
+ return createLazyAPIPromise(
690
+ () => tracedResponse,
691
+ () => tracedResponse.then(({ response }) => response),
692
+ () => apiPromise
693
+ );
694
+ };
695
+ }
696
+ async function completeOpenAIBatchTrace(args) {
697
+ const inputFileContent = Promise.resolve(args.inputFileContent);
698
+ const outputFileContent = args.outputFileContent === void 0 ? void 0 : Promise.resolve(args.outputFileContent);
699
+ const errorFileContent = args.errorFileContent === void 0 ? void 0 : Promise.resolve(args.errorFileContent);
700
+ void inputFileContent.catch(() => void 0);
701
+ void _optionalChain([outputFileContent, 'optionalAccess', _4 => _4.catch, 'call', _5 => _5(() => void 0)]);
702
+ void _optionalChain([errorFileContent, 'optionalAccess', _6 => _6.catch, 'call', _7 => _7(() => void 0)]);
703
+ await _chunk4AQGZS6Xjs.openAIChannels.batchesCompleteTrace.invoke(
704
+ async () => void 0,
705
+ void 0,
706
+ [
707
+ {
708
+ ...args,
709
+ inputFileContent,
710
+ outputFileContent,
711
+ errorFileContent
712
+ }
713
+ ],
714
+ {}
715
+ );
716
+ }
717
+
461
718
  // src/functions/invoke.ts
462
719
  async function invoke(args) {
463
720
  const {
@@ -480,7 +737,7 @@ async function invoke(args) {
480
737
  projectId,
481
738
  ...functionIdArgs
482
739
  } = args;
483
- const state = _nullishCoalesce(stateArg, () => ( _chunkXLLGRXGRjs._internalGetGlobalState.call(void 0, )));
740
+ const state = _nullishCoalesce(stateArg, () => ( _chunkV32LW47Zjs._internalGetGlobalState.call(void 0, )));
484
741
  await state.login({
485
742
  orgName,
486
743
  apiKey,
@@ -488,8 +745,8 @@ async function invoke(args) {
488
745
  forceLogin,
489
746
  fetch
490
747
  });
491
- const parent = parentArg ? typeof parentArg === "string" ? parentArg : await parentArg.export() : await _chunkXLLGRXGRjs.getSpanParentObject.call(void 0, ).export();
492
- const functionId = _chunkXLLGRXGRjs.FunctionId.safeParse({
748
+ const parent = parentArg ? typeof parentArg === "string" ? parentArg : await parentArg.export() : await _chunkV32LW47Zjs.getSpanParentObject.call(void 0, ).export();
749
+ const functionId = _chunkV32LW47Zjs.FunctionId.safeParse({
493
750
  function_id: functionIdArgs.function_id,
494
751
  project_name: functionIdArgs.projectName,
495
752
  slug: functionIdArgs.slug,
@@ -532,7 +789,7 @@ async function invoke(args) {
532
789
  if (!resp.body) {
533
790
  throw new Error("Received empty stream body");
534
791
  }
535
- return new (0, _chunkXLLGRXGRjs.BraintrustStream)(resp.body);
792
+ return new (0, _chunkV32LW47Zjs.BraintrustStream)(resp.body);
536
793
  } else {
537
794
  const data = await resp.json();
538
795
  return schema ? schema.parse(data) : data;
@@ -544,8 +801,8 @@ function initFunction({
544
801
  version,
545
802
  state
546
803
  }) {
547
- const s = _nullishCoalesce(state, () => ( _chunkXLLGRXGRjs._internalGetGlobalState.call(void 0, )));
548
- _optionalChain([s, 'optionalAccess', _2 => _2.spanCache, 'optionalAccess', _3 => _3.disable, 'call', _4 => _4()]);
804
+ const s = _nullishCoalesce(state, () => ( _chunkV32LW47Zjs._internalGetGlobalState.call(void 0, )));
805
+ _optionalChain([s, 'optionalAccess', _8 => _8.spanCache, 'optionalAccess', _9 => _9.disable, 'call', _10 => _10()]);
549
806
  const f = async (input) => {
550
807
  return await invoke({
551
808
  projectName,
@@ -560,58 +817,6 @@ function initFunction({
560
817
  return f;
561
818
  }
562
819
 
563
- // src/wrappers/openai-promise-utils.ts
564
- function splitSpanInfo(allParams) {
565
- const { span_info, ...params } = allParams;
566
- return {
567
- params,
568
- span_info
569
- };
570
- }
571
- function createChannelContext(_channel, params, span_info) {
572
- return {
573
- arguments: (
574
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
575
- [params]
576
- ),
577
- span_info
578
- };
579
- }
580
- async function tracePromiseWithResponse(channel, traceContext, apiPromise) {
581
- let enhancedResponse;
582
- const tracePromise = (
583
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
584
- channel.tracePromise
585
- );
586
- const data = await tracePromise(async () => {
587
- enhancedResponse = await apiPromise.withResponse();
588
- traceContext.response = enhancedResponse.response;
589
- return enhancedResponse.data;
590
- }, traceContext);
591
- if (!enhancedResponse) {
592
- throw new Error("Expected withResponse() to provide response");
593
- }
594
- return { data, response: enhancedResponse.response };
595
- }
596
- function createLazyAPIPromise(ensureExecuted) {
597
- let dataPromise = null;
598
- return new Proxy({}, {
599
- get(target, prop, receiver) {
600
- if (prop === "withResponse") {
601
- return () => ensureExecuted();
602
- }
603
- if (prop === "then" || prop === "catch" || prop === "finally" || prop in Promise.prototype) {
604
- if (!dataPromise) {
605
- dataPromise = ensureExecuted().then((result) => result.data);
606
- }
607
- const value = Reflect.get(dataPromise, prop, receiver);
608
- return typeof value === "function" ? value.bind(dataPromise) : value;
609
- }
610
- return Reflect.get(target, prop, receiver);
611
- }
612
- });
613
- }
614
-
615
820
  // src/wrappers/oai_responses.ts
616
821
  function responsesProxy(openai) {
617
822
  if (!openai.responses) {
@@ -622,22 +827,22 @@ function responsesProxy(openai) {
622
827
  if (name === "create" && typeof target.create === "function") {
623
828
  return wrapResponsesAsync(
624
829
  target.create.bind(target),
625
- _chunk6Z5S7VOUjs.openAIChannels.responsesCreate
830
+ _chunk4AQGZS6Xjs.openAIChannels.responsesCreate
626
831
  );
627
832
  } else if (name === "stream" && typeof target.stream === "function") {
628
833
  return wrapResponsesSyncStream(
629
834
  target.stream.bind(target),
630
- _chunk6Z5S7VOUjs.openAIChannels.responsesStream
835
+ _chunk4AQGZS6Xjs.openAIChannels.responsesStream
631
836
  );
632
837
  } else if (name === "parse" && typeof target.parse === "function") {
633
838
  return wrapResponsesAsync(
634
839
  target.parse.bind(target),
635
- _chunk6Z5S7VOUjs.openAIChannels.responsesParse
840
+ _chunk4AQGZS6Xjs.openAIChannels.responsesParse
636
841
  );
637
842
  } else if (name === "compact" && typeof target.compact === "function") {
638
843
  return wrapResponsesAsync(
639
844
  target.compact.bind(target),
640
- _chunk6Z5S7VOUjs.openAIChannels.responsesCompact
845
+ _chunk4AQGZS6Xjs.openAIChannels.responsesCompact
641
846
  );
642
847
  }
643
848
  return Reflect.get(target, name, receiver);
@@ -648,17 +853,33 @@ function wrapResponsesAsync(target, channel) {
648
853
  return (allParams, options) => {
649
854
  const { span_info, params } = splitSpanInfo(allParams);
650
855
  let executionPromise = null;
856
+ let apiPromise = null;
857
+ const getAPIPromise = () => {
858
+ apiPromise ??= target(params, options);
859
+ return apiPromise;
860
+ };
651
861
  const ensureExecuted = () => {
652
862
  if (!executionPromise) {
653
863
  executionPromise = (async () => {
654
864
  const traceContext = createChannelContext(channel, params, span_info);
655
- const apiPromise = target(params, options);
656
- return tracePromiseWithResponse(channel, traceContext, apiPromise);
865
+ return tracePromiseWithResponse(
866
+ channel,
867
+ traceContext,
868
+ getAPIPromise()
869
+ );
657
870
  })();
658
871
  }
659
872
  return executionPromise;
660
873
  };
661
- return createLazyAPIPromise(ensureExecuted);
874
+ return createLazyAPIPromise(
875
+ ensureExecuted,
876
+ () => tracePromiseAsResponse(
877
+ channel,
878
+ createChannelContext(channel, params, span_info),
879
+ getAPIPromise()
880
+ ),
881
+ getAPIPromise
882
+ );
662
883
  };
663
884
  }
664
885
  function wrapResponsesSyncStream(target, channel) {
@@ -710,9 +931,9 @@ function wrapOpenAIv4(openai) {
710
931
  const embeddingProxy = createEndpointProxy(typedOpenai.embeddings, wrapEmbeddings);
711
932
  const moderationProxy = createEndpointProxy(typedOpenai.moderations, wrapModerations);
712
933
  let betaProxy3;
713
- if (_optionalChain([typedOpenai, 'access', _5 => _5.beta, 'optionalAccess', _6 => _6.chat, 'optionalAccess', _7 => _7.completions, 'optionalAccess', _8 => _8.stream])) {
934
+ if (_optionalChain([typedOpenai, 'access', _11 => _11.beta, 'optionalAccess', _12 => _12.chat, 'optionalAccess', _13 => _13.completions, 'optionalAccess', _14 => _14.stream])) {
714
935
  const betaChatCompletionProxy = new Proxy(
715
- _optionalChain([typedOpenai, 'optionalAccess', _9 => _9.beta, 'optionalAccess', _10 => _10.chat, 'access', _11 => _11.completions]),
936
+ _optionalChain([typedOpenai, 'optionalAccess', _15 => _15.beta, 'optionalAccess', _16 => _16.chat, 'access', _17 => _17.completions]),
716
937
  {
717
938
  get(target, name, receiver) {
718
939
  const baseVal = Reflect.get(target, name, receiver);
@@ -781,7 +1002,7 @@ function wrapBetaChatCompletionParse(completion) {
781
1002
  const { span_info, params } = splitSpanInfo(
782
1003
  allParams
783
1004
  );
784
- return _chunk6Z5S7VOUjs.openAIChannels.betaChatCompletionsParse.tracePromise(
1005
+ return _chunk4AQGZS6Xjs.openAIChannels.betaChatCompletionsParse.tracePromise(
785
1006
  async () => await completion(params),
786
1007
  { arguments: [params], span_info }
787
1008
  );
@@ -792,7 +1013,7 @@ function wrapBetaChatCompletionStream(completion) {
792
1013
  const { span_info, params } = splitSpanInfo(
793
1014
  allParams
794
1015
  );
795
- return _chunk6Z5S7VOUjs.openAIChannels.betaChatCompletionsStream.traceSync(
1016
+ return _chunk4AQGZS6Xjs.openAIChannels.betaChatCompletionsStream.traceSync(
796
1017
  () => completion(params),
797
1018
  { arguments: [params], span_info }
798
1019
  );
@@ -804,41 +1025,58 @@ function wrapChatCompletion(completion) {
804
1025
  allParams
805
1026
  );
806
1027
  let executionPromise = null;
1028
+ let apiPromise = null;
1029
+ const getAPIPromise = () => {
1030
+ apiPromise ??= completion(params, options);
1031
+ return apiPromise;
1032
+ };
807
1033
  const ensureExecuted = () => {
808
1034
  if (!executionPromise) {
809
1035
  executionPromise = (async () => {
810
1036
  const traceContext = createChannelContext(
811
- _chunk6Z5S7VOUjs.openAIChannels.chatCompletionsCreate,
1037
+ _chunk4AQGZS6Xjs.openAIChannels.chatCompletionsCreate,
812
1038
  params,
813
1039
  span_info
814
1040
  );
815
1041
  if (params.stream) {
816
- const completionPromise = completion(
817
- params,
818
- options
1042
+ const completionPromise = (
1043
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1044
+ getAPIPromise()
819
1045
  );
820
- const { data: data2, response: response2 } = await tracePromiseWithResponse(
821
- _chunk6Z5S7VOUjs.openAIChannels.chatCompletionsCreate,
1046
+ const { data: data2, response: response2, request_id: request_id2 } = await tracePromiseWithResponse(
1047
+ _chunk4AQGZS6Xjs.openAIChannels.chatCompletionsCreate,
822
1048
  traceContext,
823
1049
  completionPromise
824
1050
  );
825
- return { data: data2, response: response2 };
1051
+ return { data: data2, response: response2, request_id: request_id2 };
826
1052
  }
827
- const completionResponse = completion(
828
- params,
829
- options
1053
+ const completionResponse = (
1054
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
1055
+ getAPIPromise()
830
1056
  );
831
- const { data, response } = await tracePromiseWithResponse(
832
- _chunk6Z5S7VOUjs.openAIChannels.chatCompletionsCreate,
1057
+ const { data, response, request_id } = await tracePromiseWithResponse(
1058
+ _chunk4AQGZS6Xjs.openAIChannels.chatCompletionsCreate,
833
1059
  traceContext,
834
1060
  completionResponse
835
1061
  );
836
- return { data, response };
1062
+ return { data, response, request_id };
837
1063
  })();
838
1064
  }
839
1065
  return executionPromise;
840
1066
  };
841
- return createLazyAPIPromise(ensureExecuted);
1067
+ return createLazyAPIPromise(
1068
+ ensureExecuted,
1069
+ () => tracePromiseAsResponse(
1070
+ _chunk4AQGZS6Xjs.openAIChannels.chatCompletionsCreate,
1071
+ createChannelContext(
1072
+ _chunk4AQGZS6Xjs.openAIChannels.chatCompletionsCreate,
1073
+ params,
1074
+ span_info
1075
+ ),
1076
+ getAPIPromise()
1077
+ ),
1078
+ getAPIPromise
1079
+ );
842
1080
  };
843
1081
  }
844
1082
  function createEndpointProxy(target, wrapperFn) {
@@ -856,6 +1094,11 @@ function wrapApiCreateWithChannel(create, channel) {
856
1094
  return (allParams, options) => {
857
1095
  const { span_info, params } = splitSpanInfo(allParams);
858
1096
  let executionPromise = null;
1097
+ let apiPromise = null;
1098
+ const getAPIPromise = () => {
1099
+ apiPromise ??= create(params, options);
1100
+ return apiPromise;
1101
+ };
859
1102
  const ensureExecuted = () => {
860
1103
  if (!executionPromise) {
861
1104
  executionPromise = (async () => {
@@ -863,24 +1106,32 @@ function wrapApiCreateWithChannel(create, channel) {
863
1106
  return tracePromiseWithResponse(
864
1107
  channel,
865
1108
  traceContext,
866
- create(params, options)
1109
+ getAPIPromise()
867
1110
  );
868
1111
  })();
869
1112
  }
870
1113
  return executionPromise;
871
1114
  };
872
- return createLazyAPIPromise(ensureExecuted);
1115
+ return createLazyAPIPromise(
1116
+ ensureExecuted,
1117
+ () => tracePromiseAsResponse(
1118
+ channel,
1119
+ createChannelContext(channel, params, span_info),
1120
+ getAPIPromise()
1121
+ ),
1122
+ getAPIPromise
1123
+ );
873
1124
  };
874
1125
  }
875
- var wrapEmbeddings = (create) => wrapApiCreateWithChannel(create, _chunk6Z5S7VOUjs.openAIChannels.embeddingsCreate);
876
- var wrapModerations = (create) => wrapApiCreateWithChannel(create, _chunk6Z5S7VOUjs.openAIChannels.moderationsCreate);
1126
+ var wrapEmbeddings = (create) => wrapApiCreateWithChannel(create, _chunk4AQGZS6Xjs.openAIChannels.embeddingsCreate);
1127
+ var wrapModerations = (create) => wrapApiCreateWithChannel(create, _chunk4AQGZS6Xjs.openAIChannels.moderationsCreate);
877
1128
 
878
1129
  // src/wrappers/ai-sdk/ai-sdk.ts
879
1130
  function isModuleNamespace(obj) {
880
1131
  if (!obj || typeof obj !== "object") {
881
1132
  return false;
882
1133
  }
883
- if (_optionalChain([obj, 'access', _12 => _12.constructor, 'optionalAccess', _13 => _13.name]) === "Module") {
1134
+ if (_optionalChain([obj, 'access', _18 => _18.constructor, 'optionalAccess', _19 => _19.name]) === "Module") {
884
1135
  return true;
885
1136
  }
886
1137
  try {
@@ -889,7 +1140,7 @@ function isModuleNamespace(obj) {
889
1140
  const firstKey = keys[0];
890
1141
  const descriptor = Object.getOwnPropertyDescriptor(obj, firstKey);
891
1142
  return descriptor ? !descriptor.configurable && !descriptor.writable : false;
892
- } catch (e2) {
1143
+ } catch (e4) {
893
1144
  return false;
894
1145
  }
895
1146
  }
@@ -944,17 +1195,17 @@ function isHarnessAgentInstance(instance) {
944
1195
  let prototype = Object.getPrototypeOf(instance);
945
1196
  while (prototype !== null && !visited.has(prototype)) {
946
1197
  visited.add(prototype);
947
- const constructor = _optionalChain([Object, 'access', _14 => _14.getOwnPropertyDescriptor, 'call', _15 => _15(
1198
+ const constructor = _optionalChain([Object, 'access', _20 => _20.getOwnPropertyDescriptor, 'call', _21 => _21(
948
1199
  prototype,
949
1200
  "constructor"
950
- ), 'optionalAccess', _16 => _16.value]);
951
- const constructorName = typeof constructor === "function" ? _optionalChain([Object, 'access', _17 => _17.getOwnPropertyDescriptor, 'call', _18 => _18(constructor, "name"), 'optionalAccess', _19 => _19.value]) : void 0;
1201
+ ), 'optionalAccess', _22 => _22.value]);
1202
+ const constructorName = typeof constructor === "function" ? _optionalChain([Object, 'access', _23 => _23.getOwnPropertyDescriptor, 'call', _24 => _24(constructor, "name"), 'optionalAccess', _25 => _25.value]) : void 0;
952
1203
  if (constructorName === "HarnessAgent") {
953
1204
  return true;
954
1205
  }
955
1206
  prototype = Object.getPrototypeOf(prototype);
956
1207
  }
957
- } catch (e3) {
1208
+ } catch (e5) {
958
1209
  }
959
1210
  return false;
960
1211
  }
@@ -983,7 +1234,7 @@ var wrapAgentClass = (AgentClass, options = {}) => {
983
1234
  return wrapHarnessAgentGenerate(
984
1235
  original,
985
1236
  harnessAgent,
986
- _chunk6Z5S7VOUjs.harnessAgentChannels.generate,
1237
+ _chunk4AQGZS6Xjs.harnessAgentChannels.generate,
987
1238
  "HarnessAgent.generate",
988
1239
  options
989
1240
  );
@@ -991,7 +1242,7 @@ var wrapAgentClass = (AgentClass, options = {}) => {
991
1242
  return wrapHarnessAgentStream(
992
1243
  original,
993
1244
  harnessAgent,
994
- _chunk6Z5S7VOUjs.harnessAgentChannels.stream,
1245
+ _chunk4AQGZS6Xjs.harnessAgentChannels.stream,
995
1246
  "HarnessAgent.stream",
996
1247
  options
997
1248
  );
@@ -999,7 +1250,7 @@ var wrapAgentClass = (AgentClass, options = {}) => {
999
1250
  return wrapHarnessAgentGenerate(
1000
1251
  original,
1001
1252
  harnessAgent,
1002
- _chunk6Z5S7VOUjs.harnessAgentChannels.continueGenerate,
1253
+ _chunk4AQGZS6Xjs.harnessAgentChannels.continueGenerate,
1003
1254
  "HarnessAgent.continueGenerate",
1004
1255
  options
1005
1256
  );
@@ -1007,7 +1258,7 @@ var wrapAgentClass = (AgentClass, options = {}) => {
1007
1258
  return wrapHarnessAgentStream(
1008
1259
  original,
1009
1260
  harnessAgent,
1010
- _chunk6Z5S7VOUjs.harnessAgentChannels.continueStream,
1261
+ _chunk4AQGZS6Xjs.harnessAgentChannels.continueStream,
1011
1262
  "HarnessAgent.continueStream",
1012
1263
  options
1013
1264
  );
@@ -1030,7 +1281,7 @@ var wrapAgentClass = (AgentClass, options = {}) => {
1030
1281
  };
1031
1282
  var wrapHarnessAgentCreateSession = (createSession, instance) => {
1032
1283
  const wrapper = function(params) {
1033
- return _chunk6Z5S7VOUjs.harnessAgentChannels.createSession.tracePromise(
1284
+ return _chunk4AQGZS6Xjs.harnessAgentChannels.createSession.tracePromise(
1034
1285
  () => params === void 0 ? createSession.call(instance) : createSession.call(instance, params),
1035
1286
  createAISDKChannelContext(_nullishCoalesce(params, () => ( {})), { self: instance })
1036
1287
  );
@@ -1076,15 +1327,15 @@ var wrapAgentGenerate = (generate, instance, options = {}) => {
1076
1327
  };
1077
1328
  function generateChannelForAgent(agentName) {
1078
1329
  if (agentName === "ToolLoopAgent") {
1079
- return _chunk6Z5S7VOUjs.aiSDKChannels.toolLoopAgentGenerate;
1330
+ return _chunk4AQGZS6Xjs.aiSDKChannels.toolLoopAgentGenerate;
1080
1331
  }
1081
- return _chunk6Z5S7VOUjs.aiSDKChannels.agentGenerate;
1332
+ return _chunk4AQGZS6Xjs.aiSDKChannels.agentGenerate;
1082
1333
  }
1083
1334
  var wrapAgentStream = (stream, instance, options = {}) => {
1084
1335
  const defaultName = `${instance.constructor.name}.stream`;
1085
1336
  return (params) => {
1086
1337
  const workflowAgent = instance.constructor.name === "WorkflowAgent";
1087
- if (workflowAgent && _chunkXLLGRXGRjs.currentWorkflowAgentWrapperSpan.call(void 0, )) {
1338
+ if (workflowAgent && _chunkV32LW47Zjs.currentWorkflowAgentWrapperSpan.call(void 0, )) {
1088
1339
  const { span_info: _spanInfo, ...cleanParams } = params;
1089
1340
  return stream.call(instance, { ...instance.settings, ...cleanParams });
1090
1341
  }
@@ -1103,12 +1354,12 @@ var wrapAgentStream = (stream, instance, options = {}) => {
1103
1354
  };
1104
1355
  function streamChannelForAgent(agentName) {
1105
1356
  if (agentName === "ToolLoopAgent") {
1106
- return _chunk6Z5S7VOUjs.aiSDKChannels.toolLoopAgentStream;
1357
+ return _chunk4AQGZS6Xjs.aiSDKChannels.toolLoopAgentStream;
1107
1358
  }
1108
1359
  if (agentName === "WorkflowAgent") {
1109
- return _chunk6Z5S7VOUjs.aiSDKChannels.workflowAgentStream;
1360
+ return _chunk4AQGZS6Xjs.aiSDKChannels.workflowAgentStream;
1110
1361
  }
1111
- return _chunk6Z5S7VOUjs.aiSDKChannels.agentStream;
1362
+ return _chunk4AQGZS6Xjs.aiSDKChannels.agentStream;
1112
1363
  }
1113
1364
  var makeGenerateTextWrapper = (channel, name, generateText, contextOptions = {}, options = {}) => {
1114
1365
  const wrapper = async function(allParams) {
@@ -1132,7 +1383,7 @@ var makeGenerateTextWrapper = (channel, name, generateText, contextOptions = {},
1132
1383
  };
1133
1384
  var wrapGenerateText = (generateText, options = {}, aiSDK) => {
1134
1385
  return makeGenerateTextWrapper(
1135
- _chunk6Z5S7VOUjs.aiSDKChannels.generateText,
1386
+ _chunk4AQGZS6Xjs.aiSDKChannels.generateText,
1136
1387
  "generateText",
1137
1388
  generateText,
1138
1389
  { aiSDK },
@@ -1141,7 +1392,7 @@ var wrapGenerateText = (generateText, options = {}, aiSDK) => {
1141
1392
  };
1142
1393
  var wrapGenerateObject = (generateObject, options = {}, aiSDK) => {
1143
1394
  return makeGenerateTextWrapper(
1144
- _chunk6Z5S7VOUjs.aiSDKChannels.generateObject,
1395
+ _chunk4AQGZS6Xjs.aiSDKChannels.generateObject,
1145
1396
  "generateObject",
1146
1397
  generateObject,
1147
1398
  { aiSDK },
@@ -1155,7 +1406,7 @@ var makeGenerateImageWrapper = (generateImage, contextOptions = {}, options = {}
1155
1406
  const wrapper = async function(allParams) {
1156
1407
  const { span_info, ...params } = allParams;
1157
1408
  const tracedParams = { ...params };
1158
- return _chunk6Z5S7VOUjs.aiSDKChannels.generateImage.tracePromise(
1409
+ return _chunk4AQGZS6Xjs.aiSDKChannels.generateImage.tracePromise(
1159
1410
  () => generateImage(tracedParams),
1160
1411
  createAISDKChannelContext(tracedParams, {
1161
1412
  aiSDK: contextOptions.aiSDK,
@@ -1196,7 +1447,7 @@ var makeEmbedWrapper = (channel, name, embed, contextOptions = {}, options = {})
1196
1447
  };
1197
1448
  var wrapEmbed = (embed, options = {}, aiSDK) => {
1198
1449
  return makeEmbedWrapper(
1199
- _chunk6Z5S7VOUjs.aiSDKChannels.embed,
1450
+ _chunk4AQGZS6Xjs.aiSDKChannels.embed,
1200
1451
  "embed",
1201
1452
  embed,
1202
1453
  { aiSDK },
@@ -1205,7 +1456,7 @@ var wrapEmbed = (embed, options = {}, aiSDK) => {
1205
1456
  };
1206
1457
  var wrapEmbedMany = (embedMany, options = {}, aiSDK) => {
1207
1458
  return makeEmbedWrapper(
1208
- _chunk6Z5S7VOUjs.aiSDKChannels.embedMany,
1459
+ _chunk4AQGZS6Xjs.aiSDKChannels.embedMany,
1209
1460
  "embedMany",
1210
1461
  embedMany,
1211
1462
  { aiSDK },
@@ -1216,7 +1467,7 @@ var makeRerankWrapper = (rerank, contextOptions = {}, options = {}) => {
1216
1467
  const wrapper = async function(allParams) {
1217
1468
  const { span_info, ...params } = allParams;
1218
1469
  const tracedParams = { ...params };
1219
- return _chunk6Z5S7VOUjs.aiSDKChannels.rerank.tracePromise(
1470
+ return _chunk4AQGZS6Xjs.aiSDKChannels.rerank.tracePromise(
1220
1471
  () => rerank(tracedParams),
1221
1472
  createAISDKChannelContext(tracedParams, {
1222
1473
  aiSDK: contextOptions.aiSDK,
@@ -1255,7 +1506,7 @@ var makeStreamWrapper = (channel, name, streamText, contextOptions = {}, options
1255
1506
  };
1256
1507
  var wrapStreamText = (streamText, options = {}, aiSDK) => {
1257
1508
  return makeStreamWrapper(
1258
- _chunk6Z5S7VOUjs.aiSDKChannels.streamText,
1509
+ _chunk4AQGZS6Xjs.aiSDKChannels.streamText,
1259
1510
  "streamText",
1260
1511
  streamText,
1261
1512
  { aiSDK },
@@ -1264,7 +1515,7 @@ var wrapStreamText = (streamText, options = {}, aiSDK) => {
1264
1515
  };
1265
1516
  var wrapStreamObject = (streamObject, options = {}, aiSDK) => {
1266
1517
  return makeStreamWrapper(
1267
- _chunk6Z5S7VOUjs.aiSDKChannels.streamObject,
1518
+ _chunk4AQGZS6Xjs.aiSDKChannels.streamObject,
1268
1519
  "streamObject",
1269
1520
  streamObject,
1270
1521
  { aiSDK },
@@ -1277,11 +1528,11 @@ function mergeSpanInfo(spanInfo, defaults) {
1277
1528
  }
1278
1529
  return {
1279
1530
  ...spanInfo,
1280
- ..._optionalChain([spanInfo, 'optionalAccess', _20 => _20.name]) ? {} : defaults.name ? { name: defaults.name } : {},
1281
- ...defaults.spanType !== void 0 || _optionalChain([spanInfo, 'optionalAccess', _21 => _21.spanAttributes]) ? {
1531
+ ..._optionalChain([spanInfo, 'optionalAccess', _26 => _26.name]) ? {} : defaults.name ? { name: defaults.name } : {},
1532
+ ...defaults.spanType !== void 0 || _optionalChain([spanInfo, 'optionalAccess', _27 => _27.spanAttributes]) ? {
1282
1533
  spanAttributes: {
1283
1534
  ...defaults.spanType !== void 0 ? { type: defaults.spanType } : {},
1284
- ..._nullishCoalesce(_optionalChain([spanInfo, 'optionalAccess', _22 => _22.spanAttributes]), () => ( {}))
1535
+ ..._nullishCoalesce(_optionalChain([spanInfo, 'optionalAccess', _28 => _28.spanAttributes]), () => ( {}))
1285
1536
  }
1286
1537
  } : {}
1287
1538
  };
@@ -1299,7 +1550,7 @@ function createAISDKChannelContext(params, context = {}) {
1299
1550
  // src/wrappers/ai-sdk/deprecated/wrapAISDKModel.ts
1300
1551
  function wrapAISDKModel(model) {
1301
1552
  const m = model;
1302
- if (_optionalChain([m, 'optionalAccess', _23 => _23.specificationVersion]) === "v1" && typeof _optionalChain([m, 'optionalAccess', _24 => _24.provider]) === "string" && typeof _optionalChain([m, 'optionalAccess', _25 => _25.modelId]) === "string") {
1553
+ if (_optionalChain([m, 'optionalAccess', _29 => _29.specificationVersion]) === "v1" && typeof _optionalChain([m, 'optionalAccess', _30 => _30.provider]) === "string" && typeof _optionalChain([m, 'optionalAccess', _31 => _31.modelId]) === "string") {
1303
1554
  return new BraintrustLanguageModelWrapper(m);
1304
1555
  } else {
1305
1556
  console.warn("Unsupported AI SDK model. Not wrapping.");
@@ -1336,19 +1587,19 @@ var BraintrustLanguageModelWrapper = class {
1336
1587
  // For the first cut, do not support custom span_info arguments. We can
1337
1588
  // propagate those via async local storage
1338
1589
  async doGenerate(options) {
1339
- const span = _chunkXLLGRXGRjs.startSpan.call(void 0,
1340
- _chunk6Z5S7VOUjs.withSpanInstrumentationName.call(void 0,
1590
+ const span = _chunkV32LW47Zjs.startSpan.call(void 0,
1591
+ _chunk4AQGZS6Xjs.withSpanInstrumentationName.call(void 0,
1341
1592
  {
1342
1593
  name: "Chat Completion",
1343
1594
  spanAttributes: {
1344
1595
  type: "llm"
1345
1596
  }
1346
1597
  },
1347
- _chunk6Z5S7VOUjs.INSTRUMENTATION_NAMES.AI_SDK
1598
+ _chunk4AQGZS6Xjs.INSTRUMENTATION_NAMES.AI_SDK
1348
1599
  )
1349
1600
  );
1350
1601
  const { prompt, mode, ...rest } = options;
1351
- const startTime = _chunkXLLGRXGRjs.getCurrentUnixTimestamp.call(void 0, );
1602
+ const startTime = _chunkV32LW47Zjs.getCurrentUnixTimestamp.call(void 0, );
1352
1603
  try {
1353
1604
  const ret = await this.model.doGenerate(options);
1354
1605
  span.log({
@@ -1360,12 +1611,12 @@ var BraintrustLanguageModelWrapper = class {
1360
1611
  },
1361
1612
  output: postProcessOutput(ret.text, ret.toolCalls, ret.finishReason),
1362
1613
  metrics: {
1363
- time_to_first_token: _chunkXLLGRXGRjs.getCurrentUnixTimestamp.call(void 0, ) - startTime,
1364
- tokens: !_chunkXLLGRXGRjs.isEmpty.call(void 0, ret.usage) ? ret.usage.promptTokens + ret.usage.completionTokens : void 0,
1365
- prompt_tokens: _optionalChain([ret, 'access', _26 => _26.usage, 'optionalAccess', _27 => _27.promptTokens]),
1366
- completion_tokens: _optionalChain([ret, 'access', _28 => _28.usage, 'optionalAccess', _29 => _29.completionTokens]),
1367
- cached: _chunkXLLGRXGRjs.parseCachedHeader.call(void 0,
1368
- _nullishCoalesce(_optionalChain([ret, 'access', _30 => _30.rawResponse, 'optionalAccess', _31 => _31.headers, 'optionalAccess', _32 => _32[_chunkXLLGRXGRjs.X_CACHED_HEADER]]), () => ( _optionalChain([ret, 'access', _33 => _33.rawResponse, 'optionalAccess', _34 => _34.headers, 'optionalAccess', _35 => _35[_chunkXLLGRXGRjs.LEGACY_CACHED_HEADER]])))
1614
+ time_to_first_token: _chunkV32LW47Zjs.getCurrentUnixTimestamp.call(void 0, ) - startTime,
1615
+ tokens: !_chunkV32LW47Zjs.isEmpty.call(void 0, ret.usage) ? ret.usage.promptTokens + ret.usage.completionTokens : void 0,
1616
+ prompt_tokens: _optionalChain([ret, 'access', _32 => _32.usage, 'optionalAccess', _33 => _33.promptTokens]),
1617
+ completion_tokens: _optionalChain([ret, 'access', _34 => _34.usage, 'optionalAccess', _35 => _35.completionTokens]),
1618
+ cached: _chunkV32LW47Zjs.parseCachedHeader.call(void 0,
1619
+ _nullishCoalesce(_optionalChain([ret, 'access', _36 => _36.rawResponse, 'optionalAccess', _37 => _37.headers, 'optionalAccess', _38 => _38[_chunkV32LW47Zjs.X_CACHED_HEADER]]), () => ( _optionalChain([ret, 'access', _39 => _39.rawResponse, 'optionalAccess', _40 => _40.headers, 'optionalAccess', _41 => _41[_chunkV32LW47Zjs.LEGACY_CACHED_HEADER]])))
1369
1620
  )
1370
1621
  }
1371
1622
  });
@@ -1376,16 +1627,16 @@ var BraintrustLanguageModelWrapper = class {
1376
1627
  }
1377
1628
  async doStream(options) {
1378
1629
  const { prompt, mode, ...rest } = options;
1379
- const startTime = _chunkXLLGRXGRjs.getCurrentUnixTimestamp.call(void 0, );
1380
- const span = _chunkXLLGRXGRjs.startSpan.call(void 0,
1381
- _chunk6Z5S7VOUjs.withSpanInstrumentationName.call(void 0,
1630
+ const startTime = _chunkV32LW47Zjs.getCurrentUnixTimestamp.call(void 0, );
1631
+ const span = _chunkV32LW47Zjs.startSpan.call(void 0,
1632
+ _chunk4AQGZS6Xjs.withSpanInstrumentationName.call(void 0,
1382
1633
  {
1383
1634
  name: "Chat Completion",
1384
1635
  spanAttributes: {
1385
1636
  type: "llm"
1386
1637
  }
1387
1638
  },
1388
- _chunk6Z5S7VOUjs.INSTRUMENTATION_NAMES.AI_SDK
1639
+ _chunk4AQGZS6Xjs.INSTRUMENTATION_NAMES.AI_SDK
1389
1640
  )
1390
1641
  );
1391
1642
  span.log({
@@ -1416,7 +1667,7 @@ var BraintrustLanguageModelWrapper = class {
1416
1667
  new TransformStream({
1417
1668
  transform(chunk, controller) {
1418
1669
  if (time_to_first_token === void 0) {
1419
- time_to_first_token = _chunkXLLGRXGRjs.getCurrentUnixTimestamp.call(void 0, ) - startTime;
1670
+ time_to_first_token = _chunkV32LW47Zjs.getCurrentUnixTimestamp.call(void 0, ) - startTime;
1420
1671
  span.log({ metrics: { time_to_first_token } });
1421
1672
  }
1422
1673
  switch (chunk.type) {
@@ -1461,11 +1712,11 @@ var BraintrustLanguageModelWrapper = class {
1461
1712
  ),
1462
1713
  metrics: {
1463
1714
  time_to_first_token,
1464
- tokens: !_chunkXLLGRXGRjs.isEmpty.call(void 0, usage) ? usage.promptTokens + usage.completionTokens : void 0,
1465
- prompt_tokens: _optionalChain([usage, 'optionalAccess', _36 => _36.promptTokens]),
1466
- completion_tokens: _optionalChain([usage, 'optionalAccess', _37 => _37.completionTokens]),
1467
- cached: _chunkXLLGRXGRjs.parseCachedHeader.call(void 0,
1468
- _nullishCoalesce(_optionalChain([ret, 'access', _38 => _38.rawResponse, 'optionalAccess', _39 => _39.headers, 'optionalAccess', _40 => _40[_chunkXLLGRXGRjs.X_CACHED_HEADER]]), () => ( _optionalChain([ret, 'access', _41 => _41.rawResponse, 'optionalAccess', _42 => _42.headers, 'optionalAccess', _43 => _43[_chunkXLLGRXGRjs.LEGACY_CACHED_HEADER]])))
1715
+ tokens: !_chunkV32LW47Zjs.isEmpty.call(void 0, usage) ? usage.promptTokens + usage.completionTokens : void 0,
1716
+ prompt_tokens: _optionalChain([usage, 'optionalAccess', _42 => _42.promptTokens]),
1717
+ completion_tokens: _optionalChain([usage, 'optionalAccess', _43 => _43.completionTokens]),
1718
+ cached: _chunkV32LW47Zjs.parseCachedHeader.call(void 0,
1719
+ _nullishCoalesce(_optionalChain([ret, 'access', _44 => _44.rawResponse, 'optionalAccess', _45 => _45.headers, 'optionalAccess', _46 => _46[_chunkV32LW47Zjs.X_CACHED_HEADER]]), () => ( _optionalChain([ret, 'access', _47 => _47.rawResponse, 'optionalAccess', _48 => _48.headers, 'optionalAccess', _49 => _49[_chunkV32LW47Zjs.LEGACY_CACHED_HEADER]])))
1469
1720
  )
1470
1721
  }
1471
1722
  });
@@ -1509,7 +1760,7 @@ function postProcessPrompt(prompt) {
1509
1760
  return [
1510
1761
  {
1511
1762
  role: "assistant",
1512
- content: _optionalChain([textPart, 'optionalAccess', _44 => _44.text]),
1763
+ content: _optionalChain([textPart, 'optionalAccess', _50 => _50.text]),
1513
1764
  ...toolCallParts.length > 0 ? {
1514
1765
  tool_calls: toolCallParts.map((part) => ({
1515
1766
  id: part.toolCallId,
@@ -1582,23 +1833,23 @@ function postProcessOutput(text, toolCalls2, finishReason) {
1582
1833
 
1583
1834
  // src/wrappers/ai-sdk/deprecated/BraintrustMiddleware.ts
1584
1835
  function detectProviderFromResult(result) {
1585
- if (!_optionalChain([result, 'optionalAccess', _45 => _45.providerMetadata])) {
1836
+ if (!_optionalChain([result, 'optionalAccess', _51 => _51.providerMetadata])) {
1586
1837
  return void 0;
1587
1838
  }
1588
1839
  const keys = Object.keys(result.providerMetadata);
1589
- return _optionalChain([keys, 'optionalAccess', _46 => _46.at, 'call', _47 => _47(0)]);
1840
+ return _optionalChain([keys, 'optionalAccess', _52 => _52.at, 'call', _53 => _53(0)]);
1590
1841
  }
1591
1842
  function extractModelFromResult(result) {
1592
- if (_optionalChain([result, 'optionalAccess', _48 => _48.response, 'optionalAccess', _49 => _49.modelId])) {
1843
+ if (_optionalChain([result, 'optionalAccess', _54 => _54.response, 'optionalAccess', _55 => _55.modelId])) {
1593
1844
  return result.response.modelId;
1594
1845
  }
1595
- if (_optionalChain([result, 'optionalAccess', _50 => _50.request, 'optionalAccess', _51 => _51.body, 'optionalAccess', _52 => _52.model])) {
1846
+ if (_optionalChain([result, 'optionalAccess', _56 => _56.request, 'optionalAccess', _57 => _57.body, 'optionalAccess', _58 => _58.model])) {
1596
1847
  return result.request.body.model;
1597
1848
  }
1598
1849
  return void 0;
1599
1850
  }
1600
1851
  function extractModelFromWrapGenerateCallback(model) {
1601
- return _optionalChain([model, 'optionalAccess', _53 => _53.modelId]);
1852
+ return _optionalChain([model, 'optionalAccess', _59 => _59.modelId]);
1602
1853
  }
1603
1854
  function camelToSnake(str) {
1604
1855
  return str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
@@ -1643,19 +1894,19 @@ function normalizeUsageMetrics(usage, provider, providerMetadata) {
1643
1894
  metrics.prompt_cached_tokens = cachedInputTokens;
1644
1895
  }
1645
1896
  if (provider === "anthropic") {
1646
- const anthropicMetadata = _optionalChain([providerMetadata, 'optionalAccess', _54 => _54.anthropic]);
1897
+ const anthropicMetadata = _optionalChain([providerMetadata, 'optionalAccess', _60 => _60.anthropic]);
1647
1898
  if (anthropicMetadata) {
1648
1899
  const cacheReadTokens = getNumberProperty(anthropicMetadata.usage, "cache_read_input_tokens") || 0;
1649
1900
  const cacheCreationTokens = getNumberProperty(
1650
1901
  anthropicMetadata.usage,
1651
1902
  "cache_creation_input_tokens"
1652
1903
  ) || 0;
1653
- const cacheTokens = _chunkXLLGRXGRjs.extractAnthropicCacheTokens.call(void 0,
1904
+ const cacheTokens = _chunkV32LW47Zjs.extractAnthropicCacheTokens.call(void 0,
1654
1905
  cacheReadTokens,
1655
1906
  cacheCreationTokens
1656
1907
  );
1657
1908
  Object.assign(metrics, cacheTokens);
1658
- return _chunkXLLGRXGRjs.toNumericMetrics.call(void 0, _chunkXLLGRXGRjs.finalizeAnthropicTokens.call(void 0, metrics));
1909
+ return _chunkV32LW47Zjs.toNumericMetrics.call(void 0, _chunkV32LW47Zjs.finalizeAnthropicTokens.call(void 0, metrics));
1659
1910
  }
1660
1911
  }
1661
1912
  return metrics;
@@ -1669,7 +1920,7 @@ function buildAssistantOutputWithToolCalls(result, toolCalls2) {
1669
1920
  {
1670
1921
  index: 0,
1671
1922
  logprobs: null,
1672
- finish_reason: _nullishCoalesce(normalizeFinishReason(_optionalChain([result, 'optionalAccess', _55 => _55.finishReason])), () => ( (toolCalls2.length ? "tool_calls" : void 0))),
1923
+ finish_reason: _nullishCoalesce(normalizeFinishReason(_optionalChain([result, 'optionalAccess', _61 => _61.finishReason])), () => ( (toolCalls2.length ? "tool_calls" : void 0))),
1673
1924
  message: {
1674
1925
  role: "assistant",
1675
1926
  tool_calls: toolCalls2.length > 0 ? toolCalls2 : void 0
@@ -1682,7 +1933,7 @@ function extractToolCallsFromSteps(steps) {
1682
1933
  if (!Array.isArray(steps)) return toolCalls2;
1683
1934
  let idx = 0;
1684
1935
  for (const step of steps) {
1685
- const blocks = _optionalChain([step, 'optionalAccess', _56 => _56.content]);
1936
+ const blocks = _optionalChain([step, 'optionalAccess', _62 => _62.content]);
1686
1937
  if (!Array.isArray(blocks)) continue;
1687
1938
  for (const block of blocks) {
1688
1939
  if (block && typeof block === "object" && block.type === "tool-call") {
@@ -1705,7 +1956,7 @@ function extractToolCallsFromBlocks(blocks) {
1705
1956
  return extractToolCallsFromSteps([{ content: blocks }]);
1706
1957
  }
1707
1958
  function extractInput(params) {
1708
- return _nullishCoalesce(_nullishCoalesce(_optionalChain([params, 'optionalAccess', _57 => _57.prompt]), () => ( _optionalChain([params, 'optionalAccess', _58 => _58.messages]))), () => ( _optionalChain([params, 'optionalAccess', _59 => _59.system])));
1959
+ return _nullishCoalesce(_nullishCoalesce(_optionalChain([params, 'optionalAccess', _63 => _63.prompt]), () => ( _optionalChain([params, 'optionalAccess', _64 => _64.messages]))), () => ( _optionalChain([params, 'optionalAccess', _65 => _65.system])));
1709
1960
  }
1710
1961
  var V2_EXCLUDE_KEYS = /* @__PURE__ */ new Set([
1711
1962
  "prompt",
@@ -1727,23 +1978,23 @@ function BraintrustMiddleware(config = {}) {
1727
1978
  model: modelFromWrapGenerate
1728
1979
  }) => {
1729
1980
  const rawInput = extractInput(params);
1730
- const processedInput = _chunkXLLGRXGRjs.processInputAttachments.call(void 0, rawInput);
1981
+ const processedInput = _chunkV32LW47Zjs.processInputAttachments.call(void 0, rawInput);
1731
1982
  const spanArgs = {
1732
- name: _optionalChain([config, 'access', _60 => _60.spanInfo, 'optionalAccess', _61 => _61.name]) || "ai-sdk.doGenerate",
1983
+ name: _optionalChain([config, 'access', _66 => _66.spanInfo, 'optionalAccess', _67 => _67.name]) || "ai-sdk.doGenerate",
1733
1984
  spanAttributes: {
1734
1985
  type: "llm" /* LLM */,
1735
- ..._optionalChain([config, 'access', _62 => _62.spanInfo, 'optionalAccess', _63 => _63.spanAttributes]) || {}
1986
+ ..._optionalChain([config, 'access', _68 => _68.spanInfo, 'optionalAccess', _69 => _69.spanAttributes]) || {}
1736
1987
  },
1737
1988
  event: {
1738
1989
  input: processedInput,
1739
1990
  metadata: {
1740
1991
  ...extractModelParameters(params, V2_EXCLUDE_KEYS),
1741
- ..._optionalChain([config, 'access', _64 => _64.spanInfo, 'optionalAccess', _65 => _65.metadata]) || {}
1992
+ ..._optionalChain([config, 'access', _70 => _70.spanInfo, 'optionalAccess', _71 => _71.metadata]) || {}
1742
1993
  }
1743
1994
  }
1744
1995
  };
1745
- const span = _chunkXLLGRXGRjs.startSpan.call(void 0,
1746
- _chunk6Z5S7VOUjs.withSpanInstrumentationName.call(void 0, spanArgs, _chunk6Z5S7VOUjs.INSTRUMENTATION_NAMES.AI_SDK)
1996
+ const span = _chunkV32LW47Zjs.startSpan.call(void 0,
1997
+ _chunk4AQGZS6Xjs.withSpanInstrumentationName.call(void 0, spanArgs, _chunk4AQGZS6Xjs.INSTRUMENTATION_NAMES.AI_SDK)
1747
1998
  );
1748
1999
  try {
1749
2000
  const result = await doGenerate();
@@ -1766,12 +2017,12 @@ function BraintrustMiddleware(config = {}) {
1766
2017
  metadata.model = modelId;
1767
2018
  }
1768
2019
  }
1769
- let toolCalls2 = extractToolCallsFromSteps(_optionalChain([result, 'optionalAccess', _66 => _66.steps]));
2020
+ let toolCalls2 = extractToolCallsFromSteps(_optionalChain([result, 'optionalAccess', _72 => _72.steps]));
1770
2021
  if (!toolCalls2 || toolCalls2.length === 0) {
1771
- toolCalls2 = extractToolCallsFromBlocks(_optionalChain([result, 'optionalAccess', _67 => _67.content]));
2022
+ toolCalls2 = extractToolCallsFromBlocks(_optionalChain([result, 'optionalAccess', _73 => _73.content]));
1772
2023
  }
1773
2024
  span.log({
1774
- output: toolCalls2.length > 0 ? buildAssistantOutputWithToolCalls(result, toolCalls2) : _optionalChain([result, 'optionalAccess', _68 => _68.content]),
2025
+ output: toolCalls2.length > 0 ? buildAssistantOutputWithToolCalls(result, toolCalls2) : _optionalChain([result, 'optionalAccess', _74 => _74.content]),
1775
2026
  metadata,
1776
2027
  metrics: normalizeUsageMetrics(
1777
2028
  result.usage,
@@ -1791,23 +2042,23 @@ function BraintrustMiddleware(config = {}) {
1791
2042
  },
1792
2043
  wrapStream: async ({ doStream, params }) => {
1793
2044
  const rawInput = extractInput(params);
1794
- const processedInput = _chunkXLLGRXGRjs.processInputAttachments.call(void 0, rawInput);
2045
+ const processedInput = _chunkV32LW47Zjs.processInputAttachments.call(void 0, rawInput);
1795
2046
  const spanArgs = {
1796
- name: _optionalChain([config, 'access', _69 => _69.spanInfo, 'optionalAccess', _70 => _70.name]) || "ai-sdk.doStream",
2047
+ name: _optionalChain([config, 'access', _75 => _75.spanInfo, 'optionalAccess', _76 => _76.name]) || "ai-sdk.doStream",
1797
2048
  spanAttributes: {
1798
2049
  type: "llm" /* LLM */,
1799
- ..._optionalChain([config, 'access', _71 => _71.spanInfo, 'optionalAccess', _72 => _72.spanAttributes]) || {}
2050
+ ..._optionalChain([config, 'access', _77 => _77.spanInfo, 'optionalAccess', _78 => _78.spanAttributes]) || {}
1800
2051
  },
1801
2052
  event: {
1802
2053
  input: processedInput,
1803
2054
  metadata: {
1804
2055
  ...extractModelParameters(params, V2_EXCLUDE_KEYS),
1805
- ..._optionalChain([config, 'access', _73 => _73.spanInfo, 'optionalAccess', _74 => _74.metadata]) || {}
2056
+ ..._optionalChain([config, 'access', _79 => _79.spanInfo, 'optionalAccess', _80 => _80.metadata]) || {}
1806
2057
  }
1807
2058
  }
1808
2059
  };
1809
- const span = _chunkXLLGRXGRjs.startSpan.call(void 0,
1810
- _chunk6Z5S7VOUjs.withSpanInstrumentationName.call(void 0, spanArgs, _chunk6Z5S7VOUjs.INSTRUMENTATION_NAMES.AI_SDK)
2060
+ const span = _chunkV32LW47Zjs.startSpan.call(void 0,
2061
+ _chunk4AQGZS6Xjs.withSpanInstrumentationName.call(void 0, spanArgs, _chunk4AQGZS6Xjs.INSTRUMENTATION_NAMES.AI_SDK)
1811
2062
  );
1812
2063
  try {
1813
2064
  const { stream, ...rest } = await doStream();
@@ -1932,7 +2183,7 @@ function createLegacyEveInstrumentation(options) {
1932
2183
  try {
1933
2184
  captureEveModelInput(state, input);
1934
2185
  } catch (error) {
1935
- _chunk6Z5S7VOUjs.debugLogger.warn("Error in Eve LLM input capture:", error);
2186
+ _chunk4AQGZS6Xjs.debugLogger.warn("Error in Eve LLM input capture:", error);
1936
2187
  }
1937
2188
  }
1938
2189
  },
@@ -1942,7 +2193,7 @@ function createLegacyEveInstrumentation(options) {
1942
2193
  };
1943
2194
  }
1944
2195
  function isEveHandleMessageStreamEvent(event) {
1945
- return _chunkXLLGRXGRjs.isObject.call(void 0, event) && typeof event["type"] === "string";
2196
+ return _chunkV32LW47Zjs.isObject.call(void 0, event) && typeof event["type"] === "string";
1946
2197
  }
1947
2198
  var ResumedEveSpan = class {
1948
2199
  constructor(reference) {
@@ -1959,11 +2210,11 @@ var ResumedEveSpan = class {
1959
2210
  }
1960
2211
  log(event) {
1961
2212
  const metrics = {
1962
- ..._optionalChain([this, 'access', _75 => _75.reference, 'access', _76 => _76.startEvent, 'optionalAccess', _77 => _77.metrics]),
2213
+ ..._optionalChain([this, 'access', _81 => _81.reference, 'access', _82 => _82.startEvent, 'optionalAccess', _83 => _83.metrics]),
1963
2214
  ...this.endTime === void 0 ? {} : { end: this.endTime },
1964
2215
  ...event.metrics
1965
2216
  };
1966
- _chunkXLLGRXGRjs.updateSpan.call(void 0, {
2217
+ _chunkV32LW47Zjs.updateSpan.call(void 0, {
1967
2218
  exported: this.reference.exported,
1968
2219
  ...this.reference.startEvent,
1969
2220
  ...event,
@@ -1972,7 +2223,7 @@ var ResumedEveSpan = class {
1972
2223
  }
1973
2224
  end(args) {
1974
2225
  if (this.endTime === void 0) {
1975
- this.endTime = _nullishCoalesce(_optionalChain([args, 'optionalAccess', _78 => _78.endTime]), () => ( _chunkXLLGRXGRjs.getCurrentUnixTimestamp.call(void 0, )));
2226
+ this.endTime = _nullishCoalesce(_optionalChain([args, 'optionalAccess', _84 => _84.endTime]), () => ( _chunkV32LW47Zjs.getCurrentUnixTimestamp.call(void 0, )));
1976
2227
  this.log({ metrics: { end: this.endTime } });
1977
2228
  }
1978
2229
  return this.endTime;
@@ -1984,41 +2235,41 @@ var EveBridge = (_class = class {
1984
2235
  }
1985
2236
 
1986
2237
  __init() {this.eventQueuesBySession = /* @__PURE__ */ new Map()}
1987
- __init2() {this.completedToolKeys = new (0, _chunkXLLGRXGRjs.LRUCache)({
2238
+ __init2() {this.completedToolKeys = new (0, _chunkV32LW47Zjs.LRUCache)({
1988
2239
  max: MAX_EVE_CACHE_ENTRIES
1989
2240
  })}
1990
- __init3() {this.toolsByCallKey = new (0, _chunkXLLGRXGRjs.LRUCache)({
2241
+ __init3() {this.toolsByCallKey = new (0, _chunkV32LW47Zjs.LRUCache)({
1991
2242
  max: MAX_EVE_CACHE_ENTRIES
1992
2243
  })}
1993
- __init4() {this.turnsByKey = new (0, _chunkXLLGRXGRjs.LRUCache)({
2244
+ __init4() {this.turnsByKey = new (0, _chunkV32LW47Zjs.LRUCache)({
1994
2245
  max: MAX_EVE_CACHE_ENTRIES
1995
2246
  })}
1996
2247
  async startEveSpan(args) {
1997
- const rowId = _optionalChain([args, 'optionalAccess', _79 => _79.event, 'optionalAccess', _80 => _80.id]);
2248
+ const rowId = _optionalChain([args, 'optionalAccess', _85 => _85.event, 'optionalAccess', _86 => _86.id]);
1998
2249
  const reference = typeof rowId === "string" && readEveTraceState(this.state).spanReferences.find(
1999
2250
  (candidate) => candidate.rowId === rowId
2000
2251
  );
2001
2252
  if (reference) {
2002
2253
  return new ResumedEveSpan(reference);
2003
2254
  }
2004
- const startTime = _nullishCoalesce(_optionalChain([args, 'optionalAccess', _81 => _81.startTime]), () => ( _chunkXLLGRXGRjs.getCurrentUnixTimestamp.call(void 0, )));
2005
- const parentSpanIds = _optionalChain([args, 'optionalAccess', _82 => _82.parentSpanIds]);
2255
+ const startTime = _nullishCoalesce(_optionalChain([args, 'optionalAccess', _87 => _87.startTime]), () => ( _chunkV32LW47Zjs.getCurrentUnixTimestamp.call(void 0, )));
2256
+ const parentSpanIds = _optionalChain([args, 'optionalAccess', _88 => _88.parentSpanIds]);
2006
2257
  const startEvent = {
2007
2258
  created: (/* @__PURE__ */ new Date()).toISOString(),
2008
2259
  metrics: { start: startTime },
2009
2260
  span_attributes: {
2010
- ..._optionalChain([args, 'optionalAccess', _83 => _83.name]) ? { name: args.name } : {},
2011
- ..._optionalChain([args, 'optionalAccess', _84 => _84.type]) ? { type: args.type } : {},
2012
- ..._optionalChain([args, 'optionalAccess', _85 => _85.spanAttributes])
2261
+ ..._optionalChain([args, 'optionalAccess', _89 => _89.name]) ? { name: args.name } : {},
2262
+ ..._optionalChain([args, 'optionalAccess', _90 => _90.type]) ? { type: args.type } : {},
2263
+ ..._optionalChain([args, 'optionalAccess', _91 => _91.spanAttributes])
2013
2264
  },
2014
2265
  span_parents: parentSpanIds ? "spanId" in parentSpanIds ? [parentSpanIds.spanId] : parentSpanIds.parentSpanIds : []
2015
2266
  };
2016
- const span = _chunkXLLGRXGRjs.withCurrent.call(void 0,
2017
- _chunkXLLGRXGRjs.NOOP_SPAN,
2018
- () => _chunkXLLGRXGRjs._internalStartSpanWithInitialMerge.call(void 0,
2019
- _chunk6Z5S7VOUjs.withSpanInstrumentationName.call(void 0,
2267
+ const span = _chunkV32LW47Zjs.withCurrent.call(void 0,
2268
+ _chunkV32LW47Zjs.NOOP_SPAN,
2269
+ () => _chunkV32LW47Zjs._internalStartSpanWithInitialMerge.call(void 0,
2270
+ _chunk4AQGZS6Xjs.withSpanInstrumentationName.call(void 0,
2020
2271
  { ...args, startTime },
2021
- _chunk6Z5S7VOUjs.INSTRUMENTATION_NAMES.EVE
2272
+ _chunk4AQGZS6Xjs.INSTRUMENTATION_NAMES.EVE
2022
2273
  )
2023
2274
  )
2024
2275
  );
@@ -2046,7 +2297,7 @@ var EveBridge = (_class = class {
2046
2297
  };
2047
2298
  });
2048
2299
  } catch (error) {
2049
- _chunk6Z5S7VOUjs.debugLogger.warn("Error exporting Eve span for resumption:", error);
2300
+ _chunk4AQGZS6Xjs.debugLogger.warn("Error exporting Eve span for resumption:", error);
2050
2301
  }
2051
2302
  return span;
2052
2303
  }
@@ -2066,7 +2317,7 @@ var EveBridge = (_class = class {
2066
2317
  const previous = state.stepStarts.filter(
2067
2318
  (entry) => entry.turnId === event.data.turnId && entry.stepIndex === event.data.stepIndex
2068
2319
  ).at(-1);
2069
- if (_optionalChain([previous, 'optionalAccess', _86 => _86.open])) {
2320
+ if (_optionalChain([previous, 'optionalAccess', _92 => _92.open])) {
2070
2321
  ordinal = previous.ordinal;
2071
2322
  return state;
2072
2323
  }
@@ -2094,12 +2345,12 @@ var EveBridge = (_class = class {
2094
2345
  let index = -1;
2095
2346
  for (let i = state.stepStarts.length - 1; i >= 0; i--) {
2096
2347
  const entry = state.stepStarts[i];
2097
- if (_optionalChain([entry, 'optionalAccess', _87 => _87.turnId]) === turnId && entry.stepIndex === stepIndex) {
2348
+ if (_optionalChain([entry, 'optionalAccess', _93 => _93.turnId]) === turnId && entry.stepIndex === stepIndex) {
2098
2349
  index = i;
2099
2350
  break;
2100
2351
  }
2101
2352
  }
2102
- if (index < 0 || !_optionalChain([state, 'access', _88 => _88.stepStarts, 'access', _89 => _89[index], 'optionalAccess', _90 => _90.open])) {
2353
+ if (index < 0 || !_optionalChain([state, 'access', _94 => _94.stepStarts, 'access', _95 => _95[index], 'optionalAccess', _96 => _96.open])) {
2103
2354
  return state;
2104
2355
  }
2105
2356
  return {
@@ -2133,7 +2384,7 @@ var EveBridge = (_class = class {
2133
2384
  }
2134
2385
  }
2135
2386
  } catch (error) {
2136
- _chunk6Z5S7VOUjs.debugLogger.warn("Error in Eve hook instrumentation:", error);
2387
+ _chunk4AQGZS6Xjs.debugLogger.warn("Error in Eve hook instrumentation:", error);
2137
2388
  }
2138
2389
  };
2139
2390
  const sessionId = event.type === "session.failed" ? event.data.sessionId || sessionIdFromContext(ctx) : sessionIdFromContext(ctx);
@@ -2361,7 +2612,7 @@ var EveBridge = (_class = class {
2361
2612
  return;
2362
2613
  }
2363
2614
  const existingMessage = eveOutputMessage(step.output);
2364
- const existingToolCalls = _chunkXLLGRXGRjs.isObject.call(void 0, existingMessage) ? existingMessage.tool_calls : void 0;
2615
+ const existingToolCalls = _chunkV32LW47Zjs.isObject.call(void 0, existingMessage) ? existingMessage.tool_calls : void 0;
2365
2616
  step.output = mergeEveReasoning(
2366
2617
  [
2367
2618
  {
@@ -2425,11 +2676,11 @@ var EveBridge = (_class = class {
2425
2676
  return;
2426
2677
  }
2427
2678
  const toolCallsById = /* @__PURE__ */ new Map();
2428
- if (Array.isArray(step.output) && _chunkXLLGRXGRjs.isObject.call(void 0, step.output[0])) {
2679
+ if (Array.isArray(step.output) && _chunkV32LW47Zjs.isObject.call(void 0, step.output[0])) {
2429
2680
  const message = step.output[0]["message"];
2430
- if (_chunkXLLGRXGRjs.isObject.call(void 0, message) && Array.isArray(message["tool_calls"])) {
2681
+ if (_chunkV32LW47Zjs.isObject.call(void 0, message) && Array.isArray(message["tool_calls"])) {
2431
2682
  for (const toolCall of message["tool_calls"]) {
2432
- if (_chunkXLLGRXGRjs.isObject.call(void 0, toolCall) && typeof toolCall["id"] === "string") {
2683
+ if (_chunkV32LW47Zjs.isObject.call(void 0, toolCall) && typeof toolCall["id"] === "string") {
2433
2684
  toolCallsById.set(toolCall["id"], toolCall);
2434
2685
  }
2435
2686
  }
@@ -2502,7 +2753,7 @@ var EveBridge = (_class = class {
2502
2753
  this.completedToolKeys.set(key, true);
2503
2754
  }
2504
2755
  async handleSubagentCalled(event, ctx, hookMetadata) {
2505
- if (_optionalChain([event, 'access', _91 => _91.data, 'access', _92 => _92.remote, 'optionalAccess', _93 => _93.url])) {
2756
+ if (_optionalChain([event, 'access', _97 => _97.data, 'access', _98 => _98.remote, 'optionalAccess', _99 => _99.url])) {
2506
2757
  return;
2507
2758
  }
2508
2759
  const turn = await this.ensureTurn(event, ctx, hookMetadata);
@@ -2622,11 +2873,11 @@ var EveBridge = (_class = class {
2622
2873
  return;
2623
2874
  }
2624
2875
  const usage = event.data.usage;
2625
- const inputTokens = typeof _optionalChain([usage, 'optionalAccess', _94 => _94.inputTokens]) === "number" && Number.isFinite(usage.inputTokens) && usage.inputTokens >= 0 ? usage.inputTokens : void 0;
2626
- const outputTokens = typeof _optionalChain([usage, 'optionalAccess', _95 => _95.outputTokens]) === "number" && Number.isFinite(usage.outputTokens) && usage.outputTokens >= 0 ? usage.outputTokens : void 0;
2627
- const cacheReadTokens = typeof _optionalChain([usage, 'optionalAccess', _96 => _96.cacheReadTokens]) === "number" && Number.isFinite(usage.cacheReadTokens) && usage.cacheReadTokens >= 0 ? usage.cacheReadTokens : void 0;
2628
- const cacheWriteTokens = typeof _optionalChain([usage, 'optionalAccess', _97 => _97.cacheWriteTokens]) === "number" && Number.isFinite(usage.cacheWriteTokens) && usage.cacheWriteTokens >= 0 ? usage.cacheWriteTokens : void 0;
2629
- const costUsd = typeof _optionalChain([usage, 'optionalAccess', _98 => _98.costUsd]) === "number" && Number.isFinite(usage.costUsd) && usage.costUsd >= 0 ? usage.costUsd : void 0;
2876
+ const inputTokens = typeof _optionalChain([usage, 'optionalAccess', _100 => _100.inputTokens]) === "number" && Number.isFinite(usage.inputTokens) && usage.inputTokens >= 0 ? usage.inputTokens : void 0;
2877
+ const outputTokens = typeof _optionalChain([usage, 'optionalAccess', _101 => _101.outputTokens]) === "number" && Number.isFinite(usage.outputTokens) && usage.outputTokens >= 0 ? usage.outputTokens : void 0;
2878
+ const cacheReadTokens = typeof _optionalChain([usage, 'optionalAccess', _102 => _102.cacheReadTokens]) === "number" && Number.isFinite(usage.cacheReadTokens) && usage.cacheReadTokens >= 0 ? usage.cacheReadTokens : void 0;
2879
+ const cacheWriteTokens = typeof _optionalChain([usage, 'optionalAccess', _103 => _103.cacheWriteTokens]) === "number" && Number.isFinite(usage.cacheWriteTokens) && usage.cacheWriteTokens >= 0 ? usage.cacheWriteTokens : void 0;
2880
+ const costUsd = typeof _optionalChain([usage, 'optionalAccess', _104 => _104.costUsd]) === "number" && Number.isFinite(usage.costUsd) && usage.costUsd >= 0 ? usage.costUsd : void 0;
2630
2881
  const total = inputTokens !== void 0 && outputTokens !== void 0 ? inputTokens + outputTokens : void 0;
2631
2882
  const metrics = {
2632
2883
  ...inputTokens !== void 0 ? { prompt_tokens: inputTokens } : {},
@@ -2638,7 +2889,7 @@ var EveBridge = (_class = class {
2638
2889
  };
2639
2890
  step.metrics = { ...step.metrics, ...metrics };
2640
2891
  const sessionId = sessionIdFromContext(ctx);
2641
- if (Array.isArray(step.output) && _chunkXLLGRXGRjs.isObject.call(void 0, step.output[0])) {
2892
+ if (Array.isArray(step.output) && _chunkV32LW47Zjs.isObject.call(void 0, step.output[0])) {
2642
2893
  const finishReason = step.output[0].finish_reason;
2643
2894
  if (typeof finishReason !== "string") {
2644
2895
  step.output[0].finish_reason = normalizedFinishReason(
@@ -2685,7 +2936,7 @@ var EveBridge = (_class = class {
2685
2936
  step.span.end(endTime === void 0 ? void 0 : { endTime });
2686
2937
  }
2687
2938
  const turn = this.turnForEvent(event, ctx);
2688
- _optionalChain([turn, 'optionalAccess', _99 => _99.stepsByIndex, 'access', _100 => _100.delete, 'call', _101 => _101(event.data.stepIndex)]);
2939
+ _optionalChain([turn, 'optionalAccess', _105 => _105.stepsByIndex, 'access', _106 => _106.delete, 'call', _107 => _107(event.data.stepIndex)]);
2689
2940
  this.markStepEnded(event.data.turnId, event.data.stepIndex);
2690
2941
  const sessionId = sessionIdFromContext(ctx);
2691
2942
  if (sessionId) {
@@ -2976,10 +3227,10 @@ var EveBridge = (_class = class {
2976
3227
  return state;
2977
3228
  }
2978
3229
  async startTurnSpan(sessionId, event, ctx, metadata) {
2979
- const session = _chunkXLLGRXGRjs.isObject.call(void 0, ctx) ? ctx["session"] : void 0;
2980
- const parent = _chunkXLLGRXGRjs.isObject.call(void 0, session) ? session["parent"] : void 0;
2981
- const parentTurn = _chunkXLLGRXGRjs.isObject.call(void 0, parent) ? parent["turn"] : void 0;
2982
- const parentLineage = _chunkXLLGRXGRjs.isObject.call(void 0, parent) && typeof parent["callId"] === "string" && typeof parent["sessionId"] === "string" && _chunkXLLGRXGRjs.isObject.call(void 0, parentTurn) && typeof parentTurn["id"] === "string" ? {
3230
+ const session = _chunkV32LW47Zjs.isObject.call(void 0, ctx) ? ctx["session"] : void 0;
3231
+ const parent = _chunkV32LW47Zjs.isObject.call(void 0, session) ? session["parent"] : void 0;
3232
+ const parentTurn = _chunkV32LW47Zjs.isObject.call(void 0, parent) ? parent["turn"] : void 0;
3233
+ const parentLineage = _chunkV32LW47Zjs.isObject.call(void 0, parent) && typeof parent["callId"] === "string" && typeof parent["sessionId"] === "string" && _chunkV32LW47Zjs.isObject.call(void 0, parentTurn) && typeof parentTurn["id"] === "string" ? {
2983
3234
  callId: parent["callId"],
2984
3235
  sessionId: parent["sessionId"],
2985
3236
  turnId: parentTurn["id"]
@@ -2988,8 +3239,8 @@ var EveBridge = (_class = class {
2988
3239
  generateEveIds("turn", sessionId, event.data.turnId),
2989
3240
  deterministicEveId(
2990
3241
  "eve:root",
2991
- _nullishCoalesce(_optionalChain([parentLineage, 'optionalAccess', _102 => _102.sessionId]), () => ( sessionId)),
2992
- _nullishCoalesce(_optionalChain([parentLineage, 'optionalAccess', _103 => _103.turnId]), () => ( event.data.turnId))
3242
+ _nullishCoalesce(_optionalChain([parentLineage, 'optionalAccess', _108 => _108.sessionId]), () => ( sessionId)),
3243
+ _nullishCoalesce(_optionalChain([parentLineage, 'optionalAccess', _109 => _109.turnId]), () => ( event.data.turnId))
2993
3244
  ),
2994
3245
  parentLineage ? deterministicEveId(
2995
3246
  "eve:subagent",
@@ -3014,7 +3265,7 @@ var EveBridge = (_class = class {
3014
3265
  return sessionId ? this.turnsByKey.get(turnKey(sessionId, event.data.turnId)) : void 0;
3015
3266
  }
3016
3267
  stepForEvent(event, ctx) {
3017
- return _optionalChain([this, 'access', _104 => _104.turnForEvent, 'call', _105 => _105(event, ctx), 'optionalAccess', _106 => _106.stepsByIndex, 'access', _107 => _107.get, 'call', _108 => _108(
3268
+ return _optionalChain([this, 'access', _110 => _110.turnForEvent, 'call', _111 => _111(event, ctx), 'optionalAccess', _112 => _112.stepsByIndex, 'access', _113 => _113.get, 'call', _114 => _114(
3018
3269
  event.data.stepIndex
3019
3270
  )]);
3020
3271
  }
@@ -3086,10 +3337,10 @@ var EveBridge = (_class = class {
3086
3337
  }
3087
3338
  async flushInstrumentation() {
3088
3339
  try {
3089
- await _chunkXLLGRXGRjs.flush.call(void 0, );
3340
+ await _chunkV32LW47Zjs.flush.call(void 0, );
3090
3341
  return true;
3091
3342
  } catch (error) {
3092
- _chunk6Z5S7VOUjs.debugLogger.warn("Error in Eve flush instrumentation:", error);
3343
+ _chunk4AQGZS6Xjs.debugLogger.warn("Error in Eve flush instrumentation:", error);
3093
3344
  return false;
3094
3345
  }
3095
3346
  }
@@ -3104,12 +3355,12 @@ function emptyEveTraceState() {
3104
3355
  };
3105
3356
  }
3106
3357
  function normalizeEveTraceState(state) {
3107
- if (!_chunkXLLGRXGRjs.isObject.call(void 0, state)) {
3358
+ if (!_chunkV32LW47Zjs.isObject.call(void 0, state)) {
3108
3359
  return emptyEveTraceState();
3109
3360
  }
3110
- const metadata = _chunkXLLGRXGRjs.isObject.call(void 0, state["metadata"]) ? state["metadata"] : {};
3361
+ const metadata = _chunkV32LW47Zjs.isObject.call(void 0, state["metadata"]) ? state["metadata"] : {};
3111
3362
  const spanReferences = Array.isArray(state["spanReferences"]) ? state["spanReferences"].flatMap((entry) => {
3112
- if (!_chunkXLLGRXGRjs.isObject.call(void 0, entry)) {
3363
+ if (!_chunkV32LW47Zjs.isObject.call(void 0, entry)) {
3113
3364
  return [];
3114
3365
  }
3115
3366
  const exported = entry["exported"];
@@ -3118,11 +3369,11 @@ function normalizeEveTraceState(state) {
3118
3369
  const rowId = entry["rowId"];
3119
3370
  const spanId = entry["spanId"];
3120
3371
  const startEvent = entry["startEvent"];
3121
- const startEventCreated = _chunkXLLGRXGRjs.isObject.call(void 0, startEvent) ? startEvent["created"] : void 0;
3122
- const startEventMetrics = _chunkXLLGRXGRjs.isObject.call(void 0, startEvent) ? startEvent["metrics"] : void 0;
3123
- const startEventSpanAttributes = _chunkXLLGRXGRjs.isObject.call(void 0, startEvent) ? startEvent["span_attributes"] : void 0;
3124
- const startEventSpanParents = _chunkXLLGRXGRjs.isObject.call(void 0, startEvent) ? startEvent["span_parents"] : void 0;
3125
- const normalizedStartEvent = typeof startEventCreated === "string" && _chunkXLLGRXGRjs.isObject.call(void 0, startEventMetrics) && typeof startEventMetrics["start"] === "number" && Number.isFinite(startEventMetrics["start"]) && _chunkXLLGRXGRjs.isObject.call(void 0, startEventSpanAttributes) && Array.isArray(startEventSpanParents) && startEventSpanParents.every(
3372
+ const startEventCreated = _chunkV32LW47Zjs.isObject.call(void 0, startEvent) ? startEvent["created"] : void 0;
3373
+ const startEventMetrics = _chunkV32LW47Zjs.isObject.call(void 0, startEvent) ? startEvent["metrics"] : void 0;
3374
+ const startEventSpanAttributes = _chunkV32LW47Zjs.isObject.call(void 0, startEvent) ? startEvent["span_attributes"] : void 0;
3375
+ const startEventSpanParents = _chunkV32LW47Zjs.isObject.call(void 0, startEvent) ? startEvent["span_parents"] : void 0;
3376
+ const normalizedStartEvent = typeof startEventCreated === "string" && _chunkV32LW47Zjs.isObject.call(void 0, startEventMetrics) && typeof startEventMetrics["start"] === "number" && Number.isFinite(startEventMetrics["start"]) && _chunkV32LW47Zjs.isObject.call(void 0, startEventSpanAttributes) && Array.isArray(startEventSpanParents) && startEventSpanParents.every(
3126
3377
  (parent) => typeof parent === "string"
3127
3378
  ) ? {
3128
3379
  created: startEventCreated,
@@ -3142,7 +3393,7 @@ function normalizeEveTraceState(state) {
3142
3393
  ] : [];
3143
3394
  }).slice(-MAX_STORED_SPAN_REFERENCES) : [];
3144
3395
  const llmInputs = Array.isArray(state["llmInputs"]) ? state["llmInputs"].flatMap((entry) => {
3145
- if (!_chunkXLLGRXGRjs.isObject.call(void 0, entry)) {
3396
+ if (!_chunkV32LW47Zjs.isObject.call(void 0, entry)) {
3146
3397
  return [];
3147
3398
  }
3148
3399
  const key = entry["key"];
@@ -3150,7 +3401,7 @@ function normalizeEveTraceState(state) {
3150
3401
  return typeof key === "string" && isCapturedModelInput(input) ? [{ input, key }] : [];
3151
3402
  }).slice(-MAX_STORED_LLM_INPUTS) : [];
3152
3403
  const reasoningBlocks = Array.isArray(state["reasoningBlocks"]) ? state["reasoningBlocks"].flatMap((entry) => {
3153
- if (!_chunkXLLGRXGRjs.isObject.call(void 0, entry)) {
3404
+ if (!_chunkV32LW47Zjs.isObject.call(void 0, entry)) {
3154
3405
  return [];
3155
3406
  }
3156
3407
  const content = entry["content"];
@@ -3165,7 +3416,7 @@ function normalizeEveTraceState(state) {
3165
3416
  ] : [];
3166
3417
  }).slice(-MAX_STORED_REASONING_BLOCKS) : [];
3167
3418
  const stepStarts = Array.isArray(state["stepStarts"]) ? state["stepStarts"].flatMap((entry) => {
3168
- if (!_chunkXLLGRXGRjs.isObject.call(void 0, entry)) {
3419
+ if (!_chunkV32LW47Zjs.isObject.call(void 0, entry)) {
3169
3420
  return [];
3170
3421
  }
3171
3422
  const ordinal = entry["ordinal"];
@@ -3185,12 +3436,12 @@ function normalizeEveTraceState(state) {
3185
3436
  function readEveTraceState(state) {
3186
3437
  try {
3187
3438
  return normalizeEveTraceState(state.get());
3188
- } catch (e4) {
3439
+ } catch (e6) {
3189
3440
  return emptyEveTraceState();
3190
3441
  }
3191
3442
  }
3192
3443
  function storeEveReasoning(state, sessionId, event) {
3193
- const eventAt = _optionalChain([event, 'access', _109 => _109.meta, 'optionalAccess', _110 => _110.at]);
3444
+ const eventAt = _optionalChain([event, 'access', _115 => _115.meta, 'optionalAccess', _116 => _116.at]);
3194
3445
  const key = llmInputKey(sessionId, event.data.turnId, event.data.stepIndex);
3195
3446
  let stored = [];
3196
3447
  state.update((current) => {
@@ -3242,14 +3493,14 @@ function clearStoredEveReasoning(state, sessionId, turnId, stepIndex) {
3242
3493
  });
3243
3494
  }
3244
3495
  function eveOutputMessage(output) {
3245
- return Array.isArray(output) && _chunkXLLGRXGRjs.isObject.call(void 0, output[0]) ? output[0]["message"] : void 0;
3496
+ return Array.isArray(output) && _chunkV32LW47Zjs.isObject.call(void 0, output[0]) ? output[0]["message"] : void 0;
3246
3497
  }
3247
3498
  function mergeEveReasoning(output, reasoning) {
3248
3499
  if (reasoning.length === 0) {
3249
3500
  return output;
3250
3501
  }
3251
- const choice = Array.isArray(output) && _chunkXLLGRXGRjs.isObject.call(void 0, output[0]) ? output[0] : {};
3252
- const message = _chunkXLLGRXGRjs.isObject.call(void 0, choice["message"]) ? choice["message"] : {};
3502
+ const choice = Array.isArray(output) && _chunkV32LW47Zjs.isObject.call(void 0, output[0]) ? output[0] : {};
3503
+ const message = _chunkV32LW47Zjs.isObject.call(void 0, choice["message"]) ? choice["message"] : {};
3253
3504
  return [
3254
3505
  {
3255
3506
  ...choice,
@@ -3293,7 +3544,7 @@ function consumeCapturedEveModelInput(state, sessionId, turnId, stepIndex) {
3293
3544
  if (index < 0) {
3294
3545
  return normalized;
3295
3546
  }
3296
- input = _optionalChain([normalized, 'access', _111 => _111.llmInputs, 'access', _112 => _112[index], 'optionalAccess', _113 => _113.input]);
3547
+ input = _optionalChain([normalized, 'access', _117 => _117.llmInputs, 'access', _118 => _118[index], 'optionalAccess', _119 => _119.input]);
3297
3548
  return {
3298
3549
  ...normalized,
3299
3550
  llmInputs: normalized.llmInputs.filter(
@@ -3303,7 +3554,7 @@ function consumeCapturedEveModelInput(state, sessionId, turnId, stepIndex) {
3303
3554
  });
3304
3555
  return input;
3305
3556
  } catch (error) {
3306
- _chunk6Z5S7VOUjs.debugLogger.warn("Error in Eve LLM input consumption:", error);
3557
+ _chunk4AQGZS6Xjs.debugLogger.warn("Error in Eve LLM input consumption:", error);
3307
3558
  return void 0;
3308
3559
  }
3309
3560
  }
@@ -3324,7 +3575,7 @@ function capturedModelInput(modelInput) {
3324
3575
  return void 0;
3325
3576
  }
3326
3577
  return cloned;
3327
- } catch (e5) {
3578
+ } catch (e7) {
3328
3579
  return void 0;
3329
3580
  }
3330
3581
  }
@@ -3443,14 +3694,14 @@ function capturedEveModelContentPart(part) {
3443
3694
  }
3444
3695
  function isCapturedModelInput(input) {
3445
3696
  return Array.isArray(input) && input.every(
3446
- (message) => _chunkXLLGRXGRjs.isObject.call(void 0, message) && (message["role"] === "system" || message["role"] === "user" || message["role"] === "assistant" || message["role"] === "tool") && (typeof message["content"] === "string" || Array.isArray(message["content"]) && message["content"].every(_chunkXLLGRXGRjs.isObject))
3697
+ (message) => _chunkV32LW47Zjs.isObject.call(void 0, message) && (message["role"] === "system" || message["role"] === "user" || message["role"] === "assistant" || message["role"] === "tool") && (typeof message["content"] === "string" || Array.isArray(message["content"]) && message["content"].every(_chunkV32LW47Zjs.isObject))
3447
3698
  );
3448
3699
  }
3449
3700
  function llmInputKey(sessionId, turnId, stepIndex) {
3450
3701
  return `${sessionId}\0${turnId}\0${stepIndex}`;
3451
3702
  }
3452
3703
  function modelMetadataFromRuntime(runtime) {
3453
- if (!_chunkXLLGRXGRjs.isObject.call(void 0, runtime)) {
3704
+ if (!_chunkV32LW47Zjs.isObject.call(void 0, runtime)) {
3454
3705
  return {};
3455
3706
  }
3456
3707
  const modelId = runtime["modelId"];
@@ -3473,11 +3724,11 @@ function modelMetadataFromModelId(modelId) {
3473
3724
  };
3474
3725
  }
3475
3726
  function sessionIdFromContext(ctx) {
3476
- if (!_chunkXLLGRXGRjs.isObject.call(void 0, ctx)) {
3727
+ if (!_chunkV32LW47Zjs.isObject.call(void 0, ctx)) {
3477
3728
  return void 0;
3478
3729
  }
3479
3730
  const session = ctx["session"];
3480
- if (!_chunkXLLGRXGRjs.isObject.call(void 0, session)) {
3731
+ if (!_chunkV32LW47Zjs.isObject.call(void 0, session)) {
3481
3732
  return void 0;
3482
3733
  }
3483
3734
  const id = session["id"];
@@ -3488,19 +3739,19 @@ function toolMetadataFromTurn(turn) {
3488
3739
  return metadata;
3489
3740
  }
3490
3741
  function isToolCallAction(action) {
3491
- return _chunkXLLGRXGRjs.isObject.call(void 0, action) && action["kind"] === "tool-call" && typeof action["callId"] === "string" && typeof action["toolName"] === "string" && _chunkXLLGRXGRjs.isObject.call(void 0, action["input"]);
3742
+ return _chunkV32LW47Zjs.isObject.call(void 0, action) && action["kind"] === "tool-call" && typeof action["callId"] === "string" && typeof action["toolName"] === "string" && _chunkV32LW47Zjs.isObject.call(void 0, action["input"]);
3492
3743
  }
3493
3744
  function isLocalSubagentCallAction(action) {
3494
- return _chunkXLLGRXGRjs.isObject.call(void 0, action) && action["kind"] === "subagent-call" && typeof action["callId"] === "string" && _chunkXLLGRXGRjs.isObject.call(void 0, action["input"]);
3745
+ return _chunkV32LW47Zjs.isObject.call(void 0, action) && action["kind"] === "subagent-call" && typeof action["callId"] === "string" && _chunkV32LW47Zjs.isObject.call(void 0, action["input"]);
3495
3746
  }
3496
3747
  function isTraceableActionRequest(action) {
3497
3748
  return isToolCallAction(action) || isLocalSubagentCallAction(action);
3498
3749
  }
3499
3750
  function isToolResult(result) {
3500
- return _chunkXLLGRXGRjs.isObject.call(void 0, result) && result["kind"] === "tool-result" && typeof result["callId"] === "string" && typeof result["toolName"] === "string";
3751
+ return _chunkV32LW47Zjs.isObject.call(void 0, result) && result["kind"] === "tool-result" && typeof result["callId"] === "string" && typeof result["toolName"] === "string";
3501
3752
  }
3502
3753
  function isSubagentResult(result) {
3503
- return _chunkXLLGRXGRjs.isObject.call(void 0, result) && result["kind"] === "subagent-result" && typeof result["callId"] === "string" && typeof result["subagentName"] === "string";
3754
+ return _chunkV32LW47Zjs.isObject.call(void 0, result) && result["kind"] === "subagent-result" && typeof result["callId"] === "string" && typeof result["subagentName"] === "string";
3504
3755
  }
3505
3756
  function normalizedFinishReason(finishReason) {
3506
3757
  switch (finishReason) {
@@ -3530,7 +3781,7 @@ function actionResultError(error, output) {
3530
3781
  return result;
3531
3782
  }
3532
3783
  function eventTime(event) {
3533
- if (!_optionalChain([event, 'access', _114 => _114.meta, 'optionalAccess', _115 => _115.at])) {
3784
+ if (!_optionalChain([event, 'access', _120 => _120.meta, 'optionalAccess', _121 => _121.at])) {
3534
3785
  return void 0;
3535
3786
  }
3536
3787
  const timestamp = Date.parse(event.meta.at);
@@ -3564,7 +3815,15 @@ var MAX_EVE_PROVIDER_CACHE_ENTRIES = 1e4;
3564
3815
  function createEveInstrumentationProvider(options = {}) {
3565
3816
  const bridge = new EveProviderBridge(options.metadata);
3566
3817
  return {
3818
+ // Eve versions before tracePolicy use capture to decide whether provider
3819
+ // events include content. Newer versions prefer tracePolicy when both are
3820
+ // present, so keep the deprecated field for backwards compatibility.
3567
3821
  capture: "content",
3822
+ tracePolicy: () => ({
3823
+ emit: true,
3824
+ recordInputs: true,
3825
+ recordOutputs: true
3826
+ }),
3568
3827
  events: {
3569
3828
  "action.completed": (event, context) => bridge.handleActionTerminal(event, context),
3570
3829
  "action.failed": (event, context) => bridge.handleActionTerminal(event, context),
@@ -3579,7 +3838,7 @@ function createEveInstrumentationProvider(options = {}) {
3579
3838
  "turn.failed": (event, context) => bridge.handleTurnTerminal(event, context),
3580
3839
  "turn.started": (event, context) => bridge.handleTurnStarted(event, context)
3581
3840
  },
3582
- flush: _chunkXLLGRXGRjs.flush,
3841
+ flush: _chunkV32LW47Zjs.flush,
3583
3842
  setup: options.setup
3584
3843
  };
3585
3844
  }
@@ -3591,10 +3850,10 @@ var EveProviderBridge = (_class2 = class {
3591
3850
  __init5() {this.activeActions = /* @__PURE__ */ new Map()}
3592
3851
  __init6() {this.activeModels = /* @__PURE__ */ new Map()}
3593
3852
  __init7() {this.modelsByAttempt = /* @__PURE__ */ new Map()}
3594
- __init8() {this.settledOperations = new (0, _chunkXLLGRXGRjs.LRUCache)({
3853
+ __init8() {this.settledOperations = new (0, _chunkV32LW47Zjs.LRUCache)({
3595
3854
  max: MAX_EVE_PROVIDER_CACHE_ENTRIES
3596
3855
  })}
3597
- __init9() {this.turns = new (0, _chunkXLLGRXGRjs.LRUCache)({
3856
+ __init9() {this.turns = new (0, _chunkV32LW47Zjs.LRUCache)({
3598
3857
  max: MAX_EVE_PROVIDER_CACHE_ENTRIES
3599
3858
  })}
3600
3859
  async handleTurnStarted(event, context) {
@@ -3621,7 +3880,7 @@ var EveProviderBridge = (_class2 = class {
3621
3880
  event.parentLineage.turnId
3622
3881
  );
3623
3882
  const parentTurn = this.turns.get(parentTurnKey);
3624
- rootSpanId = await _asyncNullishCoalesce(await _asyncOptionalChain([parentTurn, 'optionalAccess', async _116 => _116.rootSpanId]), async () => ( // Eve propagates the root session through every nested subagent. Use
3883
+ rootSpanId = await _asyncNullishCoalesce(await _asyncOptionalChain([parentTurn, 'optionalAccess', async _122 => _122.rootSpanId]), async () => ( // Eve propagates the root session through every nested subagent. Use
3625
3884
  // it instead of the immediate parent session when no ancestor ran
3626
3885
  // in-process.
3627
3886
  (await generateEveIds(
@@ -3652,7 +3911,7 @@ var EveProviderBridge = (_class2 = class {
3652
3911
  },
3653
3912
  rootSpanId
3654
3913
  );
3655
- _optionalChain([span, 'optionalAccess', _117 => _117.log, 'call', _118 => _118({ metadata })]);
3914
+ _optionalChain([span, 'optionalAccess', _123 => _123.log, 'call', _124 => _124({ metadata })]);
3656
3915
  this.turns.set(key, {
3657
3916
  rootSpanId,
3658
3917
  spanId
@@ -3669,7 +3928,7 @@ var EveProviderBridge = (_class2 = class {
3669
3928
  this.drainActionsForTurn(event.sessionId, event.turnId, error);
3670
3929
  const stored = storedSpan(context);
3671
3930
  if (stored && "exported" in stored) {
3672
- _chunkXLLGRXGRjs.updateSpan.call(void 0, {
3931
+ _chunkV32LW47Zjs.updateSpan.call(void 0, {
3673
3932
  exported: stored.exported,
3674
3933
  ...error !== void 0 ? { error } : {},
3675
3934
  metrics: { end: Date.now() / 1e3 }
@@ -3740,7 +3999,7 @@ var EveProviderBridge = (_class2 = class {
3740
3999
  } else {
3741
4000
  const stored = storedSpan(context);
3742
4001
  if (stored && "exported" in stored) {
3743
- _chunkXLLGRXGRjs.updateSpan.call(void 0, {
4002
+ _chunkV32LW47Zjs.updateSpan.call(void 0, {
3744
4003
  exported: stored.exported,
3745
4004
  ...event.type === "model.call.failed" ? event.error !== void 0 ? { error: event.error } : {} : { output: modelOutput(event) },
3746
4005
  metrics: {
@@ -3799,7 +4058,7 @@ var EveProviderBridge = (_class2 = class {
3799
4058
  return;
3800
4059
  }
3801
4060
  const stored = storedSpan(context);
3802
- if (_optionalChain([stored, 'optionalAccess', _119 => _119.skip])) {
4061
+ if (_optionalChain([stored, 'optionalAccess', _125 => _125.skip])) {
3803
4062
  context.state.set(void 0);
3804
4063
  return;
3805
4064
  }
@@ -3822,7 +4081,7 @@ var EveProviderBridge = (_class2 = class {
3822
4081
  } else {
3823
4082
  const stored2 = storedSpan(context);
3824
4083
  if (stored2 && "exported" in stored2) {
3825
- _chunkXLLGRXGRjs.updateSpan.call(void 0, {
4084
+ _chunkV32LW47Zjs.updateSpan.call(void 0, {
3826
4085
  exported: stored2.exported,
3827
4086
  ...event.type === "action.failed" ? {
3828
4087
  error: _nullishCoalesce(event.error, () => ( new Error(_nullishCoalesce(event.errorCode, () => ( `Eve action ${event.outcome}`)))))
@@ -3873,10 +4132,10 @@ var EveProviderBridge = (_class2 = class {
3873
4132
  return { rootSpanId, spanId };
3874
4133
  }
3875
4134
  async startSpan(context, args, rootSpanId) {
3876
- const span = _chunkXLLGRXGRjs.withCurrent.call(void 0,
3877
- _chunkXLLGRXGRjs.NOOP_SPAN,
3878
- () => _chunkXLLGRXGRjs._internalStartSpanWithInitialMerge.call(void 0,
3879
- _chunk6Z5S7VOUjs.withSpanInstrumentationName.call(void 0, _nullishCoalesce(args, () => ( {})), _chunk6Z5S7VOUjs.INSTRUMENTATION_NAMES.EVE)
4135
+ const span = _chunkV32LW47Zjs.withCurrent.call(void 0,
4136
+ _chunkV32LW47Zjs.NOOP_SPAN,
4137
+ () => _chunkV32LW47Zjs._internalStartSpanWithInitialMerge.call(void 0,
4138
+ _chunk4AQGZS6Xjs.withSpanInstrumentationName.call(void 0, _nullishCoalesce(args, () => ( {})), _chunk4AQGZS6Xjs.INSTRUMENTATION_NAMES.EVE)
3880
4139
  )
3881
4140
  );
3882
4141
  try {
@@ -3885,7 +4144,7 @@ var EveProviderBridge = (_class2 = class {
3885
4144
  ...rootSpanId ? { rootSpanId } : {}
3886
4145
  });
3887
4146
  } catch (error) {
3888
- _chunk6Z5S7VOUjs.debugLogger.warn("Error exporting Eve provider span:", error);
4147
+ _chunk4AQGZS6Xjs.debugLogger.warn("Error exporting Eve provider span:", error);
3889
4148
  }
3890
4149
  return span;
3891
4150
  }
@@ -3901,8 +4160,8 @@ var EveProviderBridge = (_class2 = class {
3901
4160
  forgetModel(attemptId, idempotencyKey) {
3902
4161
  this.activeModels.delete(idempotencyKey);
3903
4162
  const keys = this.modelsByAttempt.get(attemptId);
3904
- _optionalChain([keys, 'optionalAccess', _120 => _120.delete, 'call', _121 => _121(idempotencyKey)]);
3905
- if (_optionalChain([keys, 'optionalAccess', _122 => _122.size]) === 0) this.modelsByAttempt.delete(attemptId);
4163
+ _optionalChain([keys, 'optionalAccess', _126 => _126.delete, 'call', _127 => _127(idempotencyKey)]);
4164
+ if (_optionalChain([keys, 'optionalAccess', _128 => _128.size]) === 0) this.modelsByAttempt.delete(attemptId);
3906
4165
  }
3907
4166
  spanMetadata(sessionId) {
3908
4167
  return {
@@ -3914,13 +4173,13 @@ var EveProviderBridge = (_class2 = class {
3914
4173
  try {
3915
4174
  await fn();
3916
4175
  } catch (error) {
3917
- _chunk6Z5S7VOUjs.debugLogger.warn(`Error in Eve provider ${operation}:`, error);
4176
+ _chunk4AQGZS6Xjs.debugLogger.warn(`Error in Eve provider ${operation}:`, error);
3918
4177
  }
3919
4178
  }
3920
4179
  }, _class2);
3921
4180
  function storedSpan(context) {
3922
4181
  const value = context.state.get();
3923
- if (!_chunkXLLGRXGRjs.isObject.call(void 0, value)) return void 0;
4182
+ if (!_chunkV32LW47Zjs.isObject.call(void 0, value)) return void 0;
3924
4183
  if (value["skip"] === true) return { skip: true };
3925
4184
  return typeof value["exported"] === "string" ? {
3926
4185
  exported: value["exported"],
@@ -3965,10 +4224,10 @@ function usageMetrics(usage) {
3965
4224
  const promptTokens = nonNegativeNumber(usage.inputTokens);
3966
4225
  const completionTokens = nonNegativeNumber(usage.outputTokens);
3967
4226
  const cachedTokens = nonNegativeNumber(
3968
- _optionalChain([usage, 'access', _123 => _123.inputTokenDetails, 'optionalAccess', _124 => _124.cacheReadTokens])
4227
+ _optionalChain([usage, 'access', _129 => _129.inputTokenDetails, 'optionalAccess', _130 => _130.cacheReadTokens])
3969
4228
  );
3970
4229
  const cacheCreationTokens = nonNegativeNumber(
3971
- _optionalChain([usage, 'access', _125 => _125.inputTokenDetails, 'optionalAccess', _126 => _126.cacheWriteTokens])
4230
+ _optionalChain([usage, 'access', _131 => _131.inputTokenDetails, 'optionalAccess', _132 => _132.cacheWriteTokens])
3972
4231
  );
3973
4232
  return {
3974
4233
  ...promptTokens !== void 0 ? { prompt_tokens: promptTokens } : {},
@@ -3992,7 +4251,7 @@ function normalizeFinishReason2(value) {
3992
4251
  function safeJsonStringify(value) {
3993
4252
  try {
3994
4253
  return _nullishCoalesce(JSON.stringify(value), () => ( "null"));
3995
- } catch (e6) {
4254
+ } catch (e8) {
3996
4255
  return "null";
3997
4256
  }
3998
4257
  }
@@ -4076,7 +4335,7 @@ function betaSessionEventsProxy(events) {
4076
4335
  if (prop === "stream") {
4077
4336
  return new TypedApplyProxy(target.stream, {
4078
4337
  apply(stream, thisArg, argArray) {
4079
- return _chunk6Z5S7VOUjs.anthropicChannels.betaSessionsEventsStream.tracePromise(
4338
+ return _chunk4AQGZS6Xjs.anthropicChannels.betaSessionsEventsStream.tracePromise(
4080
4339
  () => Reflect.apply(stream, thisArg, argArray),
4081
4340
  { arguments: argArray }
4082
4341
  );
@@ -4103,7 +4362,7 @@ function betaSessionThreadEventsProxy(events) {
4103
4362
  if (prop === "stream") {
4104
4363
  return new TypedApplyProxy(target.stream, {
4105
4364
  apply(stream, thisArg, argArray) {
4106
- return _chunk6Z5S7VOUjs.anthropicChannels.betaSessionsThreadsEventsStream.tracePromise(
4365
+ return _chunk4AQGZS6Xjs.anthropicChannels.betaSessionsThreadsEventsStream.tracePromise(
4107
4366
  () => Reflect.apply(stream, thisArg, argArray),
4108
4367
  { arguments: argArray }
4109
4368
  );
@@ -4118,7 +4377,7 @@ function messagesProxy(messages) {
4118
4377
  return new Proxy(messages, {
4119
4378
  get(target, prop, receiver) {
4120
4379
  if (prop === "create") {
4121
- return createProxy(target.create, _chunk6Z5S7VOUjs.anthropicChannels.messagesCreate);
4380
+ return createProxy(target.create, _chunk4AQGZS6Xjs.anthropicChannels.messagesCreate);
4122
4381
  }
4123
4382
  return Reflect.get(target, prop, receiver);
4124
4383
  }
@@ -4128,7 +4387,7 @@ function betaMessagesProxy(messages, anthropic) {
4128
4387
  return new Proxy(messages, {
4129
4388
  get(target, prop, receiver) {
4130
4389
  if (prop === "create") {
4131
- return createProxy(target.create, _chunk6Z5S7VOUjs.anthropicChannels.betaMessagesCreate);
4390
+ return createProxy(target.create, _chunk4AQGZS6Xjs.anthropicChannels.betaMessagesCreate);
4132
4391
  }
4133
4392
  if (prop === "toolRunner") {
4134
4393
  if (typeof target.toolRunner !== "function") {
@@ -4137,7 +4396,7 @@ function betaMessagesProxy(messages, anthropic) {
4137
4396
  return toolRunnerProxy(
4138
4397
  target.toolRunner,
4139
4398
  anthropic,
4140
- _chunk6Z5S7VOUjs.anthropicChannels.betaMessagesToolRunner
4399
+ _chunk4AQGZS6Xjs.anthropicChannels.betaMessagesToolRunner
4141
4400
  );
4142
4401
  }
4143
4402
  return Reflect.get(target, prop, receiver);
@@ -4194,11 +4453,11 @@ function wrapClaudeAgentQuery(queryFn, defaultThis) {
4194
4453
  ...params,
4195
4454
  options: {
4196
4455
  ..._nullishCoalesce(params.options, () => ( {})),
4197
- [_chunkXLLGRXGRjs.CLAUDE_AGENT_SDK_SKIP_LOCAL_TOOL_HOOKS_OPTION]: true
4456
+ [_chunkV32LW47Zjs.CLAUDE_AGENT_SDK_SKIP_LOCAL_TOOL_HOOKS_OPTION]: true
4198
4457
  }
4199
4458
  };
4200
4459
  const invocationTarget = thisArg === proxy || thisArg === void 0 ? _nullishCoalesce(defaultThis, () => ( thisArg)) : thisArg;
4201
- return _chunk6Z5S7VOUjs.claudeAgentSDKChannels.query.invoke(
4460
+ return _chunk4AQGZS6Xjs.claudeAgentSDKChannels.query.invoke(
4202
4461
  target,
4203
4462
  invocationTarget,
4204
4463
  [wrappedParams],
@@ -4226,7 +4485,7 @@ function wrapClaudeAgentTool(toolFn, localToolMetadataByTool, defaultThis) {
4226
4485
  }
4227
4486
  const localToolMetadata = { toolName };
4228
4487
  const originalHandler = wrappedArgs[handlerIndex];
4229
- wrappedArgs[handlerIndex] = _chunkXLLGRXGRjs.wrapLocalClaudeToolHandler.call(void 0,
4488
+ wrappedArgs[handlerIndex] = _chunkV32LW47Zjs.wrapLocalClaudeToolHandler.call(void 0,
4230
4489
  originalHandler,
4231
4490
  () => localToolMetadata
4232
4491
  );
@@ -4244,8 +4503,8 @@ function wrapCreateSdkMcpServer(createSdkMcpServerFn, localToolMetadataByTool, d
4244
4503
  apply(target, thisArg, argArray) {
4245
4504
  const invocationTarget = thisArg === proxy || thisArg === void 0 ? _nullishCoalesce(defaultThis, () => ( thisArg)) : thisArg;
4246
4505
  const config = argArray[0];
4247
- const serverName = _optionalChain([config, 'optionalAccess', _127 => _127.name]);
4248
- if (typeof serverName === "string" && Array.isArray(_optionalChain([config, 'optionalAccess', _128 => _128.tools]))) {
4506
+ const serverName = _optionalChain([config, 'optionalAccess', _133 => _133.name]);
4507
+ if (typeof serverName === "string" && Array.isArray(_optionalChain([config, 'optionalAccess', _134 => _134.tools]))) {
4249
4508
  for (const tool of config.tools) {
4250
4509
  if (!tool || typeof tool !== "object") {
4251
4510
  continue;
@@ -4333,7 +4592,7 @@ function patchThinkClass(Think) {
4333
4592
  ...descriptor,
4334
4593
  value: function wrappedCloudflareThinkRunInferenceLoop(input) {
4335
4594
  const args = [input];
4336
- return _chunk6Z5S7VOUjs.cloudflareThinkChannels.runInferenceLoop.tracePromise(
4595
+ return _chunk4AQGZS6Xjs.cloudflareThinkChannels.runInferenceLoop.tracePromise(
4337
4596
  () => Reflect.apply(original, this, args),
4338
4597
  {
4339
4598
  arguments: args,
@@ -4385,7 +4644,7 @@ function isModuleNamespace2(obj) {
4385
4644
  if (!obj || typeof obj !== "object") {
4386
4645
  return false;
4387
4646
  }
4388
- if (_optionalChain([obj, 'access', _129 => _129.constructor, 'optionalAccess', _130 => _130.name]) === "Module") {
4647
+ if (_optionalChain([obj, 'access', _135 => _135.constructor, 'optionalAccess', _136 => _136.name]) === "Module") {
4389
4648
  return true;
4390
4649
  }
4391
4650
  const keys = Object.keys(obj);
@@ -4455,7 +4714,7 @@ function wrapCodexThread(thread) {
4455
4714
  if (prop === "run" && typeof value === "function") {
4456
4715
  return function(input, turnOptions) {
4457
4716
  const args = [input, turnOptions];
4458
- return _chunk6Z5S7VOUjs.openAICodexChannels.run.tracePromise(
4717
+ return _chunk4AQGZS6Xjs.openAICodexChannels.run.tracePromise(
4459
4718
  () => Reflect.apply(value, target, args),
4460
4719
  {
4461
4720
  arguments: args,
@@ -4468,7 +4727,7 @@ function wrapCodexThread(thread) {
4468
4727
  if (prop === "runStreamed" && typeof value === "function") {
4469
4728
  return function(input, turnOptions) {
4470
4729
  const args = [input, turnOptions];
4471
- return _chunk6Z5S7VOUjs.openAICodexChannels.runStreamed.tracePromise(
4730
+ return _chunk4AQGZS6Xjs.openAICodexChannels.runStreamed.tracePromise(
4472
4731
  () => Reflect.apply(value, target, args),
4473
4732
  {
4474
4733
  arguments: args,
@@ -4515,7 +4774,7 @@ function isModuleNamespace3(obj) {
4515
4774
  if (!obj || typeof obj !== "object") {
4516
4775
  return false;
4517
4776
  }
4518
- if (_optionalChain([obj, 'access', _131 => _131.constructor, 'optionalAccess', _132 => _132.name]) === "Module") {
4777
+ if (_optionalChain([obj, 'access', _137 => _137.constructor, 'optionalAccess', _138 => _138.name]) === "Module") {
4519
4778
  return true;
4520
4779
  }
4521
4780
  const keys = Object.keys(obj);
@@ -4536,7 +4795,7 @@ function wrapCursorAgentClass(Agent) {
4536
4795
  if (prop === "create" && typeof value === "function") {
4537
4796
  const wrapped = async function(options) {
4538
4797
  const args = [options];
4539
- return _chunk6Z5S7VOUjs.cursorSDKChannels.create.tracePromise(
4798
+ return _chunk4AQGZS6Xjs.cursorSDKChannels.create.tracePromise(
4540
4799
  async () => wrapCursorAgent(await Reflect.apply(value, target, args)),
4541
4800
  { arguments: args }
4542
4801
  );
@@ -4547,7 +4806,7 @@ function wrapCursorAgentClass(Agent) {
4547
4806
  if (prop === "resume" && typeof value === "function") {
4548
4807
  const wrapped = async function(agentId, options) {
4549
4808
  const args = [agentId, options];
4550
- return _chunk6Z5S7VOUjs.cursorSDKChannels.resume.tracePromise(
4809
+ return _chunk4AQGZS6Xjs.cursorSDKChannels.resume.tracePromise(
4551
4810
  async () => wrapCursorAgent(await Reflect.apply(value, target, args)),
4552
4811
  { arguments: args }
4553
4812
  );
@@ -4558,7 +4817,7 @@ function wrapCursorAgentClass(Agent) {
4558
4817
  if (prop === "prompt" && typeof value === "function") {
4559
4818
  const wrapped = async function(message, options) {
4560
4819
  const args = [message, options];
4561
- return _chunk6Z5S7VOUjs.cursorSDKChannels.prompt.tracePromise(
4820
+ return _chunk4AQGZS6Xjs.cursorSDKChannels.prompt.tracePromise(
4562
4821
  () => Reflect.apply(value, target, args),
4563
4822
  { arguments: args }
4564
4823
  );
@@ -4591,7 +4850,7 @@ function wrapCursorAgent(agent) {
4591
4850
  if (prop === "send" && typeof value === "function") {
4592
4851
  return function(message, options) {
4593
4852
  const args = [message, options];
4594
- return _chunk6Z5S7VOUjs.cursorSDKChannels.send.tracePromise(
4853
+ return _chunk4AQGZS6Xjs.cursorSDKChannels.send.tracePromise(
4595
4854
  () => Reflect.apply(value, target, args),
4596
4855
  {
4597
4856
  agent: target,
@@ -4641,7 +4900,7 @@ function patchAgentSessionClass(AgentSession) {
4641
4900
  ...descriptor,
4642
4901
  value: function wrappedPiCodingAgentPrompt(text, options) {
4643
4902
  const args = [text, options];
4644
- return _chunk6Z5S7VOUjs.piCodingAgentChannels.prompt.invoke(originalPrompt, this, args, {
4903
+ return _chunk4AQGZS6Xjs.piCodingAgentChannels.prompt.invoke(originalPrompt, this, args, {
4645
4904
  session: this
4646
4905
  });
4647
4906
  }
@@ -4687,7 +4946,7 @@ function wrapCloudflareAgent(Agent) {
4687
4946
  if (ownValue(options, "detached")) {
4688
4947
  return Reflect.apply(originalRunAgentTool, this, args);
4689
4948
  }
4690
- return _chunk6Z5S7VOUjs.cloudflareAgentsChannels.runAgentTool.tracePromise(
4949
+ return _chunk4AQGZS6Xjs.cloudflareAgentsChannels.runAgentTool.tracePromise(
4691
4950
  () => Reflect.apply(originalRunAgentTool, this, args),
4692
4951
  { arguments: args, self: this }
4693
4952
  );
@@ -4711,7 +4970,7 @@ function isObjectLike(value) {
4711
4970
  return typeof value === "object" && value !== null || typeof value === "function";
4712
4971
  }
4713
4972
  function warnUnsupportedAgent() {
4714
- _chunk6Z5S7VOUjs.debugLogger.warn("Unsupported Cloudflare Agents Agent class. Not wrapping.");
4973
+ _chunk4AQGZS6Xjs.debugLogger.warn("Unsupported Cloudflare Agents Agent class. Not wrapping.");
4715
4974
  }
4716
4975
 
4717
4976
  // src/wrappers/strands-agent-sdk.ts
@@ -4755,7 +5014,7 @@ function isModuleNamespace4(obj) {
4755
5014
  if (!obj || typeof obj !== "object") {
4756
5015
  return false;
4757
5016
  }
4758
- if (_optionalChain([obj, 'access', _133 => _133.constructor, 'optionalAccess', _134 => _134.name]) === "Module") {
5017
+ if (_optionalChain([obj, 'access', _139 => _139.constructor, 'optionalAccess', _140 => _140.name]) === "Module") {
4759
5018
  return true;
4760
5019
  }
4761
5020
  const keys = Object.keys(obj);
@@ -4817,7 +5076,7 @@ function wrapAgentInstance(agent) {
4817
5076
  if (prop === "stream" && typeof value === "function") {
4818
5077
  return function(args, options) {
4819
5078
  const callArgs = [args, options];
4820
- return _chunk6Z5S7VOUjs.strandsAgentSDKChannels.agentStream.invoke(
5079
+ return _chunk4AQGZS6Xjs.strandsAgentSDKChannels.agentStream.invoke(
4821
5080
  value,
4822
5081
  target,
4823
5082
  callArgs,
@@ -4851,7 +5110,7 @@ function wrapMultiAgentInstance(orchestrator, kind) {
4851
5110
  if (prop === "stream" && typeof value === "function") {
4852
5111
  return function(input, options) {
4853
5112
  const callArgs = [input, options];
4854
- const channel = kind === "graph" ? _chunk6Z5S7VOUjs.strandsAgentSDKChannels.graphStream : _chunk6Z5S7VOUjs.strandsAgentSDKChannels.swarmStream;
5113
+ const channel = kind === "graph" ? _chunk4AQGZS6Xjs.strandsAgentSDKChannels.graphStream : _chunk4AQGZS6Xjs.strandsAgentSDKChannels.swarmStream;
4855
5114
  return channel.invoke(
4856
5115
  value,
4857
5116
  target,
@@ -4891,11 +5150,11 @@ function wrapCloudflareAIChat(module) {
4891
5150
  try {
4892
5151
  AIChatAgent = Reflect.get(candidate, "AIChatAgent");
4893
5152
  } catch (error) {
4894
- _chunk6Z5S7VOUjs.debugLogger.debug("Failed to inspect @cloudflare/ai-chat module:", error);
5153
+ _chunk4AQGZS6Xjs.debugLogger.debug("Failed to inspect @cloudflare/ai-chat module:", error);
4895
5154
  return module;
4896
5155
  }
4897
5156
  if (typeof AIChatAgent !== "function") {
4898
- _chunk6Z5S7VOUjs.debugLogger.warn(
5157
+ _chunk4AQGZS6Xjs.debugLogger.warn(
4899
5158
  "Unsupported @cloudflare/ai-chat module. AIChatAgent was not found; not wrapping."
4900
5159
  );
4901
5160
  return module;
@@ -4929,7 +5188,7 @@ function wrapAIChatAgentClass(AgentClass) {
4929
5188
  args,
4930
5189
  newTarget
4931
5190
  );
4932
- return _chunkXLLGRXGRjs.instrumentCloudflareAIChatAgent.call(void 0, instance);
5191
+ return _chunkV32LW47Zjs.instrumentCloudflareAIChatAgent.call(void 0, instance);
4933
5192
  }
4934
5193
  });
4935
5194
  wrappedClasses.set(AgentClass, wrapped);
@@ -4950,7 +5209,7 @@ function isModuleNamespace5(value) {
4950
5209
  }
4951
5210
  const descriptor = Object.getOwnPropertyDescriptor(value, keys[0]);
4952
5211
  return descriptor ? !descriptor.configurable && !descriptor.writable : false;
4953
- } catch (e7) {
5212
+ } catch (e9) {
4954
5213
  return false;
4955
5214
  }
4956
5215
  }
@@ -5001,7 +5260,7 @@ function wrapGoogleGenAIInstance(instance) {
5001
5260
  }
5002
5261
  if (prop === "interactions") {
5003
5262
  const interactions = Reflect.get(target, prop, receiver);
5004
- if (!_chunkXLLGRXGRjs.isObject.call(void 0, interactions) || typeof interactions.create !== "function") {
5263
+ if (!_chunkV32LW47Zjs.isObject.call(void 0, interactions) || typeof interactions.create !== "function") {
5005
5264
  return interactions;
5006
5265
  }
5007
5266
  if (interactions !== originalInteractions) {
@@ -5015,7 +5274,7 @@ function wrapGoogleGenAIInstance(instance) {
5015
5274
  });
5016
5275
  }
5017
5276
  function patchGoogleGenAIChats(instance, wrappedModels) {
5018
- if (!_chunkXLLGRXGRjs.isObject.call(void 0, instance.chats) || !("modelsModule" in instance.chats)) {
5277
+ if (!_chunkV32LW47Zjs.isObject.call(void 0, instance.chats) || !("modelsModule" in instance.chats)) {
5019
5278
  return;
5020
5279
  }
5021
5280
  Reflect.set(instance.chats, "modelsModule", wrappedModels);
@@ -5048,7 +5307,7 @@ function wrapInteractions(interactions) {
5048
5307
  }
5049
5308
  function wrapGenerateContent(original) {
5050
5309
  return function(params) {
5051
- return _chunk6Z5S7VOUjs.googleGenAIChannels.generateContent.tracePromise(
5310
+ return _chunk4AQGZS6Xjs.googleGenAIChannels.generateContent.tracePromise(
5052
5311
  () => original(params),
5053
5312
  { arguments: [params] }
5054
5313
  );
@@ -5056,7 +5315,7 @@ function wrapGenerateContent(original) {
5056
5315
  }
5057
5316
  function wrapGenerateContentStream(original) {
5058
5317
  return function(params) {
5059
- return _chunk6Z5S7VOUjs.googleGenAIChannels.generateContentStream.tracePromise(
5318
+ return _chunk4AQGZS6Xjs.googleGenAIChannels.generateContentStream.tracePromise(
5060
5319
  () => original(params),
5061
5320
  { arguments: [params] }
5062
5321
  );
@@ -5064,7 +5323,7 @@ function wrapGenerateContentStream(original) {
5064
5323
  }
5065
5324
  function wrapEmbedContent(original) {
5066
5325
  return function(params) {
5067
- return _chunk6Z5S7VOUjs.googleGenAIChannels.embedContent.tracePromise(
5326
+ return _chunk4AQGZS6Xjs.googleGenAIChannels.embedContent.tracePromise(
5068
5327
  () => original(params),
5069
5328
  { arguments: [params] }
5070
5329
  );
@@ -5076,7 +5335,7 @@ function wrapInteractionCreate(original) {
5076
5335
  return options === void 0 ? original(params) : original(params, options);
5077
5336
  }
5078
5337
  const traceContext = options === void 0 ? { arguments: [params] } : { arguments: [params, options] };
5079
- return _chunk6Z5S7VOUjs.googleGenAIChannels.interactionsCreate.tracePromise(
5338
+ return _chunk4AQGZS6Xjs.googleGenAIChannels.interactionsCreate.tracePromise(
5080
5339
  () => options === void 0 ? original(params) : original(params, options),
5081
5340
  traceContext
5082
5341
  );
@@ -5137,7 +5396,7 @@ function wrapRunnerInstance(runner) {
5137
5396
  function wrapRunnerRunAsync(runner) {
5138
5397
  const original = runner.runAsync.bind(runner);
5139
5398
  return function(params) {
5140
- return _chunk6Z5S7VOUjs.googleADKChannels.runnerRunAsync.traceSync(() => original(params), {
5399
+ return _chunk4AQGZS6Xjs.googleADKChannels.runnerRunAsync.traceSync(() => original(params), {
5141
5400
  arguments: [params],
5142
5401
  self: runner
5143
5402
  });
@@ -5164,7 +5423,7 @@ function wrapAgentInstance2(agent) {
5164
5423
  function wrapAgentRunAsync(agent) {
5165
5424
  const original = agent.runAsync.bind(agent);
5166
5425
  return function(parentContext) {
5167
- return _chunk6Z5S7VOUjs.googleADKChannels.agentRunAsync.traceSync(
5426
+ return _chunk4AQGZS6Xjs.googleADKChannels.agentRunAsync.traceSync(
5168
5427
  () => original(parentContext),
5169
5428
  { arguments: [parentContext], self: agent }
5170
5429
  );
@@ -5191,7 +5450,7 @@ function wrapToolInstance(tool) {
5191
5450
  function wrapToolRunAsync(tool) {
5192
5451
  const original = tool.runAsync.bind(tool);
5193
5452
  return function(req) {
5194
- return _chunk6Z5S7VOUjs.googleADKChannels.toolRunAsync.tracePromise(() => original(req), {
5453
+ return _chunk4AQGZS6Xjs.googleADKChannels.toolRunAsync.tracePromise(() => original(req), {
5195
5454
  arguments: [req],
5196
5455
  self: tool
5197
5456
  });
@@ -5303,7 +5562,7 @@ function patchGenkitRegistryLookup(registry) {
5303
5562
  Object.defineProperty(registry, PATCHED_GENKIT_REGISTRY, {
5304
5563
  value: true
5305
5564
  });
5306
- } catch (e8) {
5565
+ } catch (e10) {
5307
5566
  }
5308
5567
  }
5309
5568
  function patchGenkitRegistryConstructor(registry) {
@@ -5334,31 +5593,31 @@ function patchGenkitRegistryConstructor(registry) {
5334
5593
  Object.defineProperty(constructor, PATCHED_GENKIT_REGISTRY_CONSTRUCTOR, {
5335
5594
  value: true
5336
5595
  });
5337
- } catch (e9) {
5596
+ } catch (e11) {
5338
5597
  }
5339
5598
  }
5340
5599
  function wrapGenerate(generate) {
5341
- return (input) => _chunk6Z5S7VOUjs.genkitChannels.generate.tracePromise(() => generate(input), {
5600
+ return (input) => _chunk4AQGZS6Xjs.genkitChannels.generate.tracePromise(() => generate(input), {
5342
5601
  arguments: [input]
5343
5602
  });
5344
5603
  }
5345
5604
  function wrapGenerateStream(generateStream) {
5346
- return (input) => _chunk6Z5S7VOUjs.genkitChannels.generateStream.traceSync(() => generateStream(input), {
5605
+ return (input) => _chunk4AQGZS6Xjs.genkitChannels.generateStream.traceSync(() => generateStream(input), {
5347
5606
  arguments: [input]
5348
5607
  });
5349
5608
  }
5350
5609
  function wrapEmbed2(embed) {
5351
- return (params) => _chunk6Z5S7VOUjs.genkitChannels.embed.tracePromise(() => embed(params), {
5610
+ return (params) => _chunk4AQGZS6Xjs.genkitChannels.embed.tracePromise(() => embed(params), {
5352
5611
  arguments: [params]
5353
5612
  });
5354
5613
  }
5355
5614
  function wrapEmbedMany2(embedMany) {
5356
- return (params) => _chunk6Z5S7VOUjs.genkitChannels.embedMany.tracePromise(() => embedMany(params), {
5615
+ return (params) => _chunk4AQGZS6Xjs.genkitChannels.embedMany.tracePromise(() => embedMany(params), {
5357
5616
  arguments: [params]
5358
5617
  });
5359
5618
  }
5360
5619
  function wrapRun(run) {
5361
- return (name, inputOrFn, maybeFn) => _chunk6Z5S7VOUjs.genkitChannels.actionRun.tracePromise(() => run(name, inputOrFn, maybeFn), {
5620
+ return (name, inputOrFn, maybeFn) => _chunk4AQGZS6Xjs.genkitChannels.actionRun.tracePromise(() => run(name, inputOrFn, maybeFn), {
5362
5621
  arguments: [name, inputOrFn, maybeFn]
5363
5622
  });
5364
5623
  }
@@ -5397,13 +5656,13 @@ function isGenkitAction(value) {
5397
5656
  return typeof value === "function" && "__action" in value;
5398
5657
  }
5399
5658
  function traceActionRun(action, run) {
5400
- return (input, options) => _chunk6Z5S7VOUjs.genkitChannels.actionRun.tracePromise(() => run(input, options), {
5659
+ return (input, options) => _chunk4AQGZS6Xjs.genkitChannels.actionRun.tracePromise(() => run(input, options), {
5401
5660
  arguments: [input, options],
5402
5661
  self: action
5403
5662
  });
5404
5663
  }
5405
5664
  function traceActionStream(action, stream) {
5406
- return (input, options) => _chunk6Z5S7VOUjs.genkitChannels.actionStream.traceSync(() => stream(input, options), {
5665
+ return (input, options) => _chunk4AQGZS6Xjs.genkitChannels.actionStream.traceSync(() => stream(input, options), {
5407
5666
  arguments: [input, options],
5408
5667
  self: action
5409
5668
  });
@@ -5449,10 +5708,10 @@ function isHuggingFaceConstructorKey(value) {
5449
5708
  return HUGGINGFACE_CONSTRUCTOR_KEY_SET.has(value);
5450
5709
  }
5451
5710
  function hasFunction2(value, methodName) {
5452
- return _chunkXLLGRXGRjs.isObject.call(void 0, value) && methodName in value && typeof value[methodName] === "function";
5711
+ return _chunkV32LW47Zjs.isObject.call(void 0, value) && methodName in value && typeof value[methodName] === "function";
5453
5712
  }
5454
5713
  function isSupportedHuggingFaceModule(value) {
5455
- if (!_chunkXLLGRXGRjs.isObject.call(void 0, value)) {
5714
+ if (!_chunkV32LW47Zjs.isObject.call(void 0, value)) {
5456
5715
  return false;
5457
5716
  }
5458
5717
  return HUGGINGFACE_CONSTRUCTOR_KEYS.some(
@@ -5560,14 +5819,14 @@ function wrapChatCompletion2(original, endpointUrl) {
5560
5819
  const context = {
5561
5820
  arguments: [traceParams]
5562
5821
  };
5563
- return _chunk6Z5S7VOUjs.huggingFaceChannels.chatCompletion.tracePromise(
5822
+ return _chunk4AQGZS6Xjs.huggingFaceChannels.chatCompletion.tracePromise(
5564
5823
  () => original(params, options),
5565
5824
  context
5566
5825
  );
5567
5826
  };
5568
5827
  }
5569
5828
  function wrapChatCompletionStream(original, endpointUrl) {
5570
- return (params, options) => _chunk6Z5S7VOUjs.huggingFaceChannels.chatCompletionStream.traceSync(
5829
+ return (params, options) => _chunk4AQGZS6Xjs.huggingFaceChannels.chatCompletionStream.traceSync(
5571
5830
  () => original(params, options),
5572
5831
  {
5573
5832
  arguments: [withEndpointUrl(params, endpointUrl)]
@@ -5580,14 +5839,14 @@ function wrapTextGeneration(original, endpointUrl) {
5580
5839
  const context = {
5581
5840
  arguments: [traceParams]
5582
5841
  };
5583
- return _chunk6Z5S7VOUjs.huggingFaceChannels.textGeneration.tracePromise(
5842
+ return _chunk4AQGZS6Xjs.huggingFaceChannels.textGeneration.tracePromise(
5584
5843
  () => original(params, options),
5585
5844
  context
5586
5845
  );
5587
5846
  };
5588
5847
  }
5589
5848
  function wrapTextGenerationStream(original, endpointUrl) {
5590
- return (params, options) => _chunk6Z5S7VOUjs.huggingFaceChannels.textGenerationStream.traceSync(
5849
+ return (params, options) => _chunk4AQGZS6Xjs.huggingFaceChannels.textGenerationStream.traceSync(
5591
5850
  () => original(params, options),
5592
5851
  {
5593
5852
  arguments: [withEndpointUrl(params, endpointUrl)]
@@ -5600,7 +5859,7 @@ function wrapFeatureExtraction(original, endpointUrl) {
5600
5859
  const context = {
5601
5860
  arguments: [traceParams]
5602
5861
  };
5603
- return _chunk6Z5S7VOUjs.huggingFaceChannels.featureExtraction.tracePromise(
5862
+ return _chunk4AQGZS6Xjs.huggingFaceChannels.featureExtraction.tracePromise(
5604
5863
  () => original(params, options),
5605
5864
  context
5606
5865
  );
@@ -5617,8 +5876,8 @@ var PIPELINE_CONSTRUCTOR_KEYS = /* @__PURE__ */ new Set([
5617
5876
  ]);
5618
5877
  var wrappedValues = /* @__PURE__ */ new WeakMap();
5619
5878
  function wrapHuggingFaceTransformers(transformers) {
5620
- const pipelineTask = _optionalChain([transformers, 'optionalAccess', _135 => _135.task]);
5621
- if (typeof transformers === "function" && _chunk6Z5S7VOUjs.isSupportedHuggingFaceTransformersTask.call(void 0, pipelineTask)) {
5879
+ const pipelineTask = _optionalChain([transformers, 'optionalAccess', _141 => _141.task]);
5880
+ if (typeof transformers === "function" && _chunk4AQGZS6Xjs.isSupportedHuggingFaceTransformersTask.call(void 0, pipelineTask)) {
5622
5881
  return wrapPipeline(transformers);
5623
5882
  }
5624
5883
  if (!isSupportedModule(transformers)) {
@@ -5670,8 +5929,8 @@ function wrapPipelineFactory(factory) {
5670
5929
  const context = {
5671
5930
  arguments: args
5672
5931
  };
5673
- return _chunk6Z5S7VOUjs.huggingFaceTransformersChannels.pipeline.tracePromise(() => Reflect.apply(factory, this, args), context).then((pipeline) => {
5674
- if (_chunk6Z5S7VOUjs.isSupportedHuggingFaceTransformersTask.call(void 0, _nullishCoalesce(pipeline.task, () => ( task)))) {
5932
+ return _chunk4AQGZS6Xjs.huggingFaceTransformersChannels.pipeline.tracePromise(() => Reflect.apply(factory, this, args), context).then((pipeline) => {
5933
+ if (_chunk4AQGZS6Xjs.isSupportedHuggingFaceTransformersTask.call(void 0, _nullishCoalesce(pipeline.task, () => ( task)))) {
5675
5934
  return wrapPipeline(pipeline);
5676
5935
  }
5677
5936
  return pipeline;
@@ -5689,7 +5948,7 @@ function wrapPipelineConstructor(constructor) {
5689
5948
  const proxy = new Proxy(constructor, {
5690
5949
  construct(target, args, newTarget) {
5691
5950
  const pipeline = Reflect.construct(target, args, newTarget);
5692
- if (_chunk6Z5S7VOUjs.isSupportedHuggingFaceTransformersTask.call(void 0, pipeline.task)) {
5951
+ if (_chunk4AQGZS6Xjs.isSupportedHuggingFaceTransformersTask.call(void 0, pipeline.task)) {
5693
5952
  return wrapPipeline(pipeline);
5694
5953
  }
5695
5954
  return pipeline;
@@ -5710,7 +5969,7 @@ function wrapPipeline(pipeline) {
5710
5969
  arguments: args,
5711
5970
  self: target
5712
5971
  };
5713
- return _chunk6Z5S7VOUjs.huggingFaceTransformersChannels.pipelineCall.tracePromise(
5972
+ return _chunk4AQGZS6Xjs.huggingFaceTransformersChannels.pipelineCall.tracePromise(
5714
5973
  () => Reflect.apply(target, thisArg, args),
5715
5974
  context
5716
5975
  );
@@ -5761,7 +6020,7 @@ function wrapCallModel(callModelFn, defaultThis) {
5761
6020
  const request = cloneCallModelRequest(argArray[0]);
5762
6021
  const options = argArray[1];
5763
6022
  const invocationTarget = thisArg === void 0 ? _nullishCoalesce(defaultThis, () => ( thisArg)) : thisArg;
5764
- return _chunk6Z5S7VOUjs.openRouterAgentChannels.callModel.traceSync(
6023
+ return _chunk4AQGZS6Xjs.openRouterAgentChannels.callModel.traceSync(
5765
6024
  () => Reflect.apply(target, invocationTarget, [request, options]),
5766
6025
  {
5767
6026
  arguments: [request]
@@ -5857,24 +6116,24 @@ function rerankProxy(rerank) {
5857
6116
  });
5858
6117
  }
5859
6118
  function wrapChatSend(send) {
5860
- return (request, options) => _chunk6Z5S7VOUjs.openRouterChannels.chatSend.tracePromise(() => send(request, options), {
6119
+ return (request, options) => _chunk4AQGZS6Xjs.openRouterChannels.chatSend.tracePromise(() => send(request, options), {
5861
6120
  arguments: [request]
5862
6121
  });
5863
6122
  }
5864
6123
  function wrapEmbeddingsGenerate(generate) {
5865
- return (request, options) => _chunk6Z5S7VOUjs.openRouterChannels.embeddingsGenerate.tracePromise(
6124
+ return (request, options) => _chunk4AQGZS6Xjs.openRouterChannels.embeddingsGenerate.tracePromise(
5866
6125
  () => generate(request, options),
5867
6126
  { arguments: [request] }
5868
6127
  );
5869
6128
  }
5870
6129
  function wrapResponsesSend(send) {
5871
- return (request, options) => _chunk6Z5S7VOUjs.openRouterChannels.betaResponsesSend.tracePromise(
6130
+ return (request, options) => _chunk4AQGZS6Xjs.openRouterChannels.betaResponsesSend.tracePromise(
5872
6131
  () => send(request, options),
5873
6132
  { arguments: [request] }
5874
6133
  );
5875
6134
  }
5876
6135
  function wrapRerank2(rerank) {
5877
- return (request, options) => _chunk6Z5S7VOUjs.openRouterChannels.rerankRerank.tracePromise(
6136
+ return (request, options) => _chunk4AQGZS6Xjs.openRouterChannels.rerankRerank.tracePromise(
5878
6137
  () => rerank(request, options),
5879
6138
  { arguments: [request] }
5880
6139
  );
@@ -5882,7 +6141,7 @@ function wrapRerank2(rerank) {
5882
6141
  function wrapCallModel2(callModel) {
5883
6142
  return (request, options) => {
5884
6143
  const tracedRequest = { ...request };
5885
- return _chunk6Z5S7VOUjs.openRouterChannels.callModel.traceSync(
6144
+ return _chunk4AQGZS6Xjs.openRouterChannels.callModel.traceSync(
5886
6145
  () => callModel(tracedRequest, options),
5887
6146
  {
5888
6147
  arguments: [tracedRequest]
@@ -6015,7 +6274,7 @@ function classifiersProxy(classifiers) {
6015
6274
  });
6016
6275
  }
6017
6276
  function wrapChatComplete(complete) {
6018
- return (request, options) => _chunk6Z5S7VOUjs.mistralChannels.chatComplete.tracePromise(
6277
+ return (request, options) => _chunk4AQGZS6Xjs.mistralChannels.chatComplete.tracePromise(
6019
6278
  () => complete(request, options),
6020
6279
  {
6021
6280
  arguments: [request]
@@ -6023,52 +6282,52 @@ function wrapChatComplete(complete) {
6023
6282
  );
6024
6283
  }
6025
6284
  function wrapChatStream(stream) {
6026
- return (request, options) => _chunk6Z5S7VOUjs.mistralChannels.chatStream.tracePromise(() => stream(request, options), {
6285
+ return (request, options) => _chunk4AQGZS6Xjs.mistralChannels.chatStream.tracePromise(() => stream(request, options), {
6027
6286
  arguments: [request]
6028
6287
  });
6029
6288
  }
6030
6289
  function wrapEmbeddingsCreate(create) {
6031
- return (request, options) => _chunk6Z5S7VOUjs.mistralChannels.embeddingsCreate.tracePromise(
6290
+ return (request, options) => _chunk4AQGZS6Xjs.mistralChannels.embeddingsCreate.tracePromise(
6032
6291
  () => create(request, options),
6033
6292
  { arguments: [request] }
6034
6293
  );
6035
6294
  }
6036
6295
  function wrapClassifiersModerate(moderate) {
6037
- return (request, options) => _chunk6Z5S7VOUjs.mistralChannels.classifiersModerate.tracePromise(
6296
+ return (request, options) => _chunk4AQGZS6Xjs.mistralChannels.classifiersModerate.tracePromise(
6038
6297
  () => moderate(request, options),
6039
6298
  { arguments: [request] }
6040
6299
  );
6041
6300
  }
6042
6301
  function wrapClassifiersModerateChat(moderateChat) {
6043
- return (request, options) => _chunk6Z5S7VOUjs.mistralChannels.classifiersModerateChat.tracePromise(
6302
+ return (request, options) => _chunk4AQGZS6Xjs.mistralChannels.classifiersModerateChat.tracePromise(
6044
6303
  () => moderateChat(request, options),
6045
6304
  { arguments: [request] }
6046
6305
  );
6047
6306
  }
6048
6307
  function wrapClassifiersClassify(classify) {
6049
- return (request, options) => _chunk6Z5S7VOUjs.mistralChannels.classifiersClassify.tracePromise(
6308
+ return (request, options) => _chunk4AQGZS6Xjs.mistralChannels.classifiersClassify.tracePromise(
6050
6309
  () => classify(request, options),
6051
6310
  { arguments: [request] }
6052
6311
  );
6053
6312
  }
6054
6313
  function wrapClassifiersClassifyChat(classifyChat) {
6055
- return (request, options) => _chunk6Z5S7VOUjs.mistralChannels.classifiersClassifyChat.tracePromise(
6314
+ return (request, options) => _chunk4AQGZS6Xjs.mistralChannels.classifiersClassifyChat.tracePromise(
6056
6315
  () => classifyChat(request, options),
6057
6316
  { arguments: [request] }
6058
6317
  );
6059
6318
  }
6060
6319
  function wrapFimComplete(complete) {
6061
- return (request, options) => _chunk6Z5S7VOUjs.mistralChannels.fimComplete.tracePromise(() => complete(request, options), {
6320
+ return (request, options) => _chunk4AQGZS6Xjs.mistralChannels.fimComplete.tracePromise(() => complete(request, options), {
6062
6321
  arguments: [request]
6063
6322
  });
6064
6323
  }
6065
6324
  function wrapFimStream(stream) {
6066
- return (request, options) => _chunk6Z5S7VOUjs.mistralChannels.fimStream.tracePromise(() => stream(request, options), {
6325
+ return (request, options) => _chunk4AQGZS6Xjs.mistralChannels.fimStream.tracePromise(() => stream(request, options), {
6067
6326
  arguments: [request]
6068
6327
  });
6069
6328
  }
6070
6329
  function wrapAgentsComplete(complete) {
6071
- return (request, options) => _chunk6Z5S7VOUjs.mistralChannels.agentsComplete.tracePromise(
6330
+ return (request, options) => _chunk4AQGZS6Xjs.mistralChannels.agentsComplete.tracePromise(
6072
6331
  () => complete(request, options),
6073
6332
  {
6074
6333
  arguments: [request]
@@ -6076,7 +6335,7 @@ function wrapAgentsComplete(complete) {
6076
6335
  );
6077
6336
  }
6078
6337
  function wrapAgentsStream(stream) {
6079
- return (request, options) => _chunk6Z5S7VOUjs.mistralChannels.agentsStream.tracePromise(() => stream(request, options), {
6338
+ return (request, options) => _chunk4AQGZS6Xjs.mistralChannels.agentsStream.tracePromise(() => stream(request, options), {
6080
6339
  arguments: [request]
6081
6340
  });
6082
6341
  }
@@ -6086,12 +6345,12 @@ function wrapOllama(ollama) {
6086
6345
  if (isSupportedOllamaClient(ollama)) {
6087
6346
  return ollamaProxy(ollama);
6088
6347
  }
6089
- _chunk6Z5S7VOUjs.debugLogger.warn("Unsupported Ollama library. Not wrapping.");
6348
+ _chunk4AQGZS6Xjs.debugLogger.warn("Unsupported Ollama library. Not wrapping.");
6090
6349
  return ollama;
6091
6350
  }
6092
6351
  var ollamaProxyCache = /* @__PURE__ */ new WeakMap();
6093
6352
  function isSupportedOllamaClient(value) {
6094
- return _chunkXLLGRXGRjs.isObject.call(void 0, value) && ["chat", "generate", "embed"].some(
6353
+ return _chunkV32LW47Zjs.isObject.call(void 0, value) && ["chat", "generate", "embed"].some(
6095
6354
  (name) => typeof value[name] === "function"
6096
6355
  );
6097
6356
  }
@@ -6143,17 +6402,17 @@ function ollamaProxy(ollama) {
6143
6402
  return proxy;
6144
6403
  }
6145
6404
  function wrapChat(chat) {
6146
- return (request) => _chunk6Z5S7VOUjs.ollamaChannels.chat.tracePromise(() => chat(request), {
6405
+ return (request) => _chunk4AQGZS6Xjs.ollamaChannels.chat.tracePromise(() => chat(request), {
6147
6406
  arguments: [request]
6148
6407
  });
6149
6408
  }
6150
6409
  function wrapGenerate2(generate) {
6151
- return (request) => _chunk6Z5S7VOUjs.ollamaChannels.generate.tracePromise(() => generate(request), {
6410
+ return (request) => _chunk4AQGZS6Xjs.ollamaChannels.generate.tracePromise(() => generate(request), {
6152
6411
  arguments: [request]
6153
6412
  });
6154
6413
  }
6155
6414
  function wrapEmbed3(embed) {
6156
- return (request) => _chunk6Z5S7VOUjs.ollamaChannels.embed.tracePromise(() => embed(request), {
6415
+ return (request) => _chunk4AQGZS6Xjs.ollamaChannels.embed.tracePromise(() => embed(request), {
6157
6416
  arguments: [request]
6158
6417
  });
6159
6418
  }
@@ -6206,22 +6465,22 @@ function cohereProxy(cohere) {
6206
6465
  return proxy;
6207
6466
  }
6208
6467
  function wrapChat2(chat) {
6209
- return (request, options) => _chunk6Z5S7VOUjs.cohereChannels.chat.tracePromise(() => chat(request, options), {
6468
+ return (request, options) => _chunk4AQGZS6Xjs.cohereChannels.chat.tracePromise(() => chat(request, options), {
6210
6469
  arguments: [request]
6211
6470
  });
6212
6471
  }
6213
6472
  function wrapChatStream2(chatStream) {
6214
- return (request, options) => _chunk6Z5S7VOUjs.cohereChannels.chatStream.tracePromise(() => chatStream(request, options), {
6473
+ return (request, options) => _chunk4AQGZS6Xjs.cohereChannels.chatStream.tracePromise(() => chatStream(request, options), {
6215
6474
  arguments: [request]
6216
6475
  });
6217
6476
  }
6218
6477
  function wrapEmbed4(embed) {
6219
- return (request, options) => _chunk6Z5S7VOUjs.cohereChannels.embed.tracePromise(() => embed(request, options), {
6478
+ return (request, options) => _chunk4AQGZS6Xjs.cohereChannels.embed.tracePromise(() => embed(request, options), {
6220
6479
  arguments: [request]
6221
6480
  });
6222
6481
  }
6223
6482
  function wrapRerank3(rerank) {
6224
- return (request, options) => _chunk6Z5S7VOUjs.cohereChannels.rerank.tracePromise(() => rerank(request, options), {
6483
+ return (request, options) => _chunk4AQGZS6Xjs.cohereChannels.rerank.tracePromise(() => rerank(request, options), {
6225
6484
  arguments: [request]
6226
6485
  });
6227
6486
  }
@@ -6259,7 +6518,7 @@ function voyageAIProxy(client) {
6259
6518
  if (typeof target.embed !== "function") {
6260
6519
  return target.embed;
6261
6520
  }
6262
- return (request, options) => _chunk6Z5S7VOUjs.voyageAIChannels.embed.invoke(
6521
+ return (request, options) => _chunk4AQGZS6Xjs.voyageAIChannels.embed.invoke(
6263
6522
  target.embed,
6264
6523
  target,
6265
6524
  [request, options],
@@ -6269,7 +6528,7 @@ function voyageAIProxy(client) {
6269
6528
  if (typeof target.multimodalEmbed !== "function") {
6270
6529
  return target.multimodalEmbed;
6271
6530
  }
6272
- return (request, options) => _chunk6Z5S7VOUjs.voyageAIChannels.multimodalEmbed.invoke(
6531
+ return (request, options) => _chunk4AQGZS6Xjs.voyageAIChannels.multimodalEmbed.invoke(
6273
6532
  target.multimodalEmbed,
6274
6533
  target,
6275
6534
  [request, options],
@@ -6279,7 +6538,7 @@ function voyageAIProxy(client) {
6279
6538
  if (typeof target.rerank !== "function") {
6280
6539
  return target.rerank;
6281
6540
  }
6282
- return (request, options) => _chunk6Z5S7VOUjs.voyageAIChannels.rerank.invoke(
6541
+ return (request, options) => _chunk4AQGZS6Xjs.voyageAIChannels.rerank.invoke(
6283
6542
  target.rerank,
6284
6543
  target,
6285
6544
  [request, options],
@@ -6289,7 +6548,7 @@ function voyageAIProxy(client) {
6289
6548
  if (typeof target.contextualizedEmbed !== "function") {
6290
6549
  return target.contextualizedEmbed;
6291
6550
  }
6292
- return (request, options) => _chunk6Z5S7VOUjs.voyageAIChannels.contextualizedEmbed.invoke(
6551
+ return (request, options) => _chunk4AQGZS6Xjs.voyageAIChannels.contextualizedEmbed.invoke(
6293
6552
  target.contextualizedEmbed,
6294
6553
  target,
6295
6554
  [request, options],
@@ -6329,7 +6588,7 @@ function isSupportedGroqClient(value) {
6329
6588
  }
6330
6589
  function groqProxy(groq) {
6331
6590
  const privateMethodWorkaroundCache = /* @__PURE__ */ new WeakMap();
6332
- const completionProxy = _optionalChain([groq, 'access', _136 => _136.chat, 'optionalAccess', _137 => _137.completions]) ? new Proxy(groq.chat.completions, {
6591
+ const completionProxy = _optionalChain([groq, 'access', _142 => _142.chat, 'optionalAccess', _143 => _143.completions]) ? new Proxy(groq.chat.completions, {
6333
6592
  get(target, prop, receiver) {
6334
6593
  if (prop === "create") {
6335
6594
  return wrapChatCompletionsCreate(target.create.bind(target));
@@ -6381,13 +6640,13 @@ function groqProxy(groq) {
6381
6640
  return topLevelProxy;
6382
6641
  }
6383
6642
  function wrapChatCompletionsCreate(create) {
6384
- return (request, options) => _chunk6Z5S7VOUjs.groqChannels.chatCompletionsCreate.tracePromise(
6643
+ return (request, options) => _chunk4AQGZS6Xjs.groqChannels.chatCompletionsCreate.tracePromise(
6385
6644
  () => create(request, options),
6386
6645
  { arguments: [request] }
6387
6646
  );
6388
6647
  }
6389
6648
  function wrapEmbeddingsCreate2(create) {
6390
- return (request, options) => _chunk6Z5S7VOUjs.groqChannels.embeddingsCreate.tracePromise(() => create(request, options), {
6649
+ return (request, options) => _chunk4AQGZS6Xjs.groqChannels.embeddingsCreate.tracePromise(() => create(request, options), {
6391
6650
  arguments: [request]
6392
6651
  });
6393
6652
  }
@@ -6461,16 +6720,16 @@ function bedrockRuntimeProxy(client) {
6461
6720
  }
6462
6721
  function wrapSend(send) {
6463
6722
  return (command, optionsOrCb, cb) => {
6464
- if (_chunkXLLGRXGRjs.getBedrockRuntimeOperation.call(void 0, command) === void 0 || typeof optionsOrCb === "function" || typeof cb === "function") {
6723
+ if (_chunkV32LW47Zjs.getBedrockRuntimeOperation.call(void 0, command) === void 0 || typeof optionsOrCb === "function" || typeof cb === "function") {
6465
6724
  return send(command, optionsOrCb, cb);
6466
6725
  }
6467
- return _chunk6Z5S7VOUjs.bedrockRuntimeChannels.clientSend.tracePromise(
6468
- () => _chunkXLLGRXGRjs.runWithAutoInstrumentationSuppressed.call(void 0,
6726
+ return _chunk4AQGZS6Xjs.bedrockRuntimeChannels.clientSend.tracePromise(
6727
+ () => _chunkV32LW47Zjs.runWithAutoInstrumentationSuppressed.call(void 0,
6469
6728
  () => send(command, optionsOrCb)
6470
6729
  ),
6471
6730
  {
6472
6731
  arguments: [command, optionsOrCb],
6473
- span_info: _chunkXLLGRXGRjs.buildBedrockRuntimeSpanInfo.call(void 0, command)
6732
+ span_info: _chunkV32LW47Zjs.buildBedrockRuntimeSpanInfo.call(void 0, command)
6474
6733
  }
6475
6734
  );
6476
6735
  };
@@ -6519,13 +6778,13 @@ function copilotClientProxy(client) {
6519
6778
  return proxy;
6520
6779
  }
6521
6780
  function wrappedCreateSession(client) {
6522
- return (config) => _chunk6Z5S7VOUjs.gitHubCopilotChannels.createSession.tracePromise(
6781
+ return (config) => _chunk4AQGZS6Xjs.gitHubCopilotChannels.createSession.tracePromise(
6523
6782
  () => client.createSession(config),
6524
6783
  { arguments: [config] }
6525
6784
  );
6526
6785
  }
6527
6786
  function wrappedResumeSession(client) {
6528
- return (sessionId, config) => _chunk6Z5S7VOUjs.gitHubCopilotChannels.resumeSession.tracePromise(
6787
+ return (sessionId, config) => _chunk4AQGZS6Xjs.gitHubCopilotChannels.resumeSession.tracePromise(
6529
6788
  () => client.resumeSession(sessionId, config),
6530
6789
  { arguments: [sessionId, config] }
6531
6790
  );
@@ -6630,7 +6889,7 @@ function isModuleNamespace6(value) {
6630
6889
  if (!value || typeof value !== "object") {
6631
6890
  return false;
6632
6891
  }
6633
- if (_optionalChain([value, 'access', _138 => _138.constructor, 'optionalAccess', _139 => _139.name]) === "Module") {
6892
+ if (_optionalChain([value, 'access', _144 => _144.constructor, 'optionalAccess', _145 => _145.name]) === "Module") {
6634
6893
  return true;
6635
6894
  }
6636
6895
  const firstKey = Object.keys(value)[0];
@@ -6654,7 +6913,7 @@ function wrapTraceable(traceable2) {
6654
6913
  apply(target, thisArg, argArray) {
6655
6914
  const [fn, rawConfig] = argArray;
6656
6915
  const config = rawConfig && typeof rawConfig === "object" ? rawConfig : void 0;
6657
- const originalOnEnd = _optionalChain([config, 'optionalAccess', _140 => _140.on_end]);
6916
+ const originalOnEnd = _optionalChain([config, 'optionalAccess', _146 => _146.on_end]);
6658
6917
  const wrappedConfig = {
6659
6918
  ...config,
6660
6919
  on_end(runTree) {
@@ -6703,13 +6962,13 @@ function wrapRunTreeInstance(runTree) {
6703
6962
  wrapped = (...args) => wrapRunTreeInstance(Reflect.apply(value, target, args));
6704
6963
  } else if (prop === "postRun") {
6705
6964
  const method = value;
6706
- wrapped = (...args) => _chunk6Z5S7VOUjs.langSmithChannels.createRun.tracePromise(
6965
+ wrapped = (...args) => _chunk4AQGZS6Xjs.langSmithChannels.createRun.tracePromise(
6707
6966
  () => Reflect.apply(method, target, args),
6708
6967
  { arguments: [target] }
6709
6968
  );
6710
6969
  } else if (prop === "patchRun") {
6711
6970
  const method = value;
6712
- wrapped = (...args) => _chunk6Z5S7VOUjs.langSmithChannels.updateRun.tracePromise(
6971
+ wrapped = (...args) => _chunk4AQGZS6Xjs.langSmithChannels.updateRun.tracePromise(
6713
6972
  () => Reflect.apply(method, target, args),
6714
6973
  {
6715
6974
  arguments: [
@@ -6758,19 +7017,19 @@ function wrapClientInstance(client) {
6758
7017
  let wrapped;
6759
7018
  if (prop === "createRun") {
6760
7019
  const method = value;
6761
- wrapped = (...args) => _chunk6Z5S7VOUjs.langSmithChannels.createRun.tracePromise(
7020
+ wrapped = (...args) => _chunk4AQGZS6Xjs.langSmithChannels.createRun.tracePromise(
6762
7021
  () => Reflect.apply(method, target, args),
6763
7022
  { arguments: args }
6764
7023
  );
6765
7024
  } else if (prop === "updateRun") {
6766
7025
  const method = value;
6767
- wrapped = (...args) => _chunk6Z5S7VOUjs.langSmithChannels.updateRun.tracePromise(
7026
+ wrapped = (...args) => _chunk4AQGZS6Xjs.langSmithChannels.updateRun.tracePromise(
6768
7027
  () => Reflect.apply(method, target, args),
6769
7028
  { arguments: args }
6770
7029
  );
6771
7030
  } else if (prop === "batchIngestRuns") {
6772
7031
  const method = value;
6773
- wrapped = (...args) => _chunk6Z5S7VOUjs.langSmithChannels.batchIngestRuns.tracePromise(
7032
+ wrapped = (...args) => _chunk4AQGZS6Xjs.langSmithChannels.batchIngestRuns.tracePromise(
6774
7033
  () => Reflect.apply(method, target, args),
6775
7034
  { arguments: args }
6776
7035
  );
@@ -6786,13 +7045,13 @@ function publishRunUpdate(runTree) {
6786
7045
  return;
6787
7046
  }
6788
7047
  try {
6789
- void _chunk6Z5S7VOUjs.langSmithChannels.updateRun.tracePromise(() => Promise.resolve(void 0), {
7048
+ void _chunk4AQGZS6Xjs.langSmithChannels.updateRun.tracePromise(() => Promise.resolve(void 0), {
6790
7049
  arguments: [runTree.id, runTree]
6791
7050
  }).catch((error) => {
6792
- _chunk6Z5S7VOUjs.debugLogger.error("LangSmith traceable instrumentation failed:", error);
7051
+ _chunk4AQGZS6Xjs.debugLogger.error("LangSmith traceable instrumentation failed:", error);
6793
7052
  });
6794
7053
  } catch (error) {
6795
- _chunk6Z5S7VOUjs.debugLogger.error("LangSmith traceable instrumentation failed:", error);
7054
+ _chunk4AQGZS6Xjs.debugLogger.error("LangSmith traceable instrumentation failed:", error);
6796
7055
  }
6797
7056
  }
6798
7057
 
@@ -6804,7 +7063,7 @@ var VitestContextManager = class {
6804
7063
  */
6805
7064
 
6806
7065
  constructor() {
6807
- this.contextStorage = _chunk6Z5S7VOUjs.isomorph_default.newAsyncLocalStorage();
7066
+ this.contextStorage = _chunk4AQGZS6Xjs.isomorph_default.newAsyncLocalStorage();
6808
7067
  }
6809
7068
  getCurrentContext() {
6810
7069
  return this.contextStorage.getStore();
@@ -6842,7 +7101,7 @@ var FlushCoordinator = (_class3 = class {constructor() { _class3.prototype.__ini
6842
7101
  if (this.activeFlushes.has(experimentId)) {
6843
7102
  return this.activeFlushes.get(experimentId);
6844
7103
  }
6845
- const flushPromise = _chunkXLLGRXGRjs.summarizeAndFlush.call(void 0, context.experiment, {
7104
+ const flushPromise = _chunkV32LW47Zjs.summarizeAndFlush.call(void 0, context.experiment, {
6846
7105
  displaySummary: config.displaySummary
6847
7106
  });
6848
7107
  this.activeFlushes.set(experimentId, flushPromise);
@@ -6911,8 +7170,8 @@ function normalizeScores(result) {
6911
7170
  (s) => s !== null && s !== void 0 && typeof s === "object" && isScore(s)
6912
7171
  );
6913
7172
  }
6914
- if (typeof result === "object" && result !== null && isScore(result)) {
6915
- return [result];
7173
+ if (typeof result === "object" && result !== null && "score" in result) {
7174
+ return [{ ...result, name: _nullishCoalesce(result.name, () => ( "score")) }];
6916
7175
  }
6917
7176
  return [];
6918
7177
  }
@@ -6940,7 +7199,7 @@ async function runTracedEval(args) {
6940
7199
  }
6941
7200
  if (testError) {
6942
7201
  span.log({ scores: { pass: 0 } });
6943
- _chunkXLLGRXGRjs.logError.call(void 0, span, testError);
7202
+ _chunkV32LW47Zjs.logError.call(void 0, span, testError);
6944
7203
  throw testError;
6945
7204
  }
6946
7205
  span.log({
@@ -6973,7 +7232,7 @@ function wrapTest(originalTest, config) {
6973
7232
  const wrapped = function(name, configOrFn, maybeFn) {
6974
7233
  const isEnhanced = typeof configOrFn !== "function";
6975
7234
  const testConfig = isEnhanced ? configOrFn : void 0;
6976
- if (isEnhanced && _optionalChain([testConfig, 'optionalAccess', _141 => _141.data]) && Array.isArray(testConfig.data)) {
7235
+ if (isEnhanced && _optionalChain([testConfig, 'optionalAccess', _147 => _147.data]) && Array.isArray(testConfig.data)) {
6977
7236
  const dataRecords = testConfig.data;
6978
7237
  const testFn2 = maybeFn;
6979
7238
  if (!testFn2) {
@@ -7011,7 +7270,7 @@ function wrapTest(originalTest, config) {
7011
7270
  const registrationContext = getExperimentContext();
7012
7271
  const testImplementation = async (vitestContext) => {
7013
7272
  const experimentContext = _nullishCoalesce(getExperimentContext(), () => ( registrationContext));
7014
- const experiment = _optionalChain([experimentContext, 'optionalAccess', _142 => _142.experiment]);
7273
+ const experiment = _optionalChain([experimentContext, 'optionalAccess', _148 => _148.experiment]);
7015
7274
  if (config.onProgress) {
7016
7275
  config.onProgress({ type: "test_start", testName: name });
7017
7276
  }
@@ -7043,11 +7302,11 @@ function wrapTest(originalTest, config) {
7043
7302
  const result = await runTracedEval({
7044
7303
  experiment,
7045
7304
  spanName: name,
7046
- input: _optionalChain([testConfig, 'optionalAccess', _143 => _143.input]),
7047
- expected: _optionalChain([testConfig, 'optionalAccess', _144 => _144.expected]),
7048
- metadata: _optionalChain([testConfig, 'optionalAccess', _145 => _145.metadata]),
7049
- tags: _optionalChain([testConfig, 'optionalAccess', _146 => _146.tags]),
7050
- scorers: _optionalChain([testConfig, 'optionalAccess', _147 => _147.scorers]),
7305
+ input: _optionalChain([testConfig, 'optionalAccess', _149 => _149.input]),
7306
+ expected: _optionalChain([testConfig, 'optionalAccess', _150 => _150.expected]),
7307
+ metadata: _optionalChain([testConfig, 'optionalAccess', _151 => _151.metadata]),
7308
+ tags: _optionalChain([testConfig, 'optionalAccess', _152 => _152.tags]),
7309
+ scorers: _optionalChain([testConfig, 'optionalAccess', _153 => _153.scorers]),
7051
7310
  fn: async () => {
7052
7311
  if (testConfig && maybeFn) {
7053
7312
  const params = {
@@ -7114,10 +7373,10 @@ function wrapDescribe(originalDescribe, config, afterAll) {
7114
7373
  const getOrCreateContext = () => {
7115
7374
  if (!context) {
7116
7375
  const experimentName = `${suiteName}-${(/* @__PURE__ */ new Date()).toISOString()}`;
7117
- const experiment = config.projectId ? _chunkXLLGRXGRjs.initExperiment.call(void 0, {
7376
+ const experiment = config.projectId ? _chunkV32LW47Zjs.initExperiment.call(void 0, {
7118
7377
  projectId: config.projectId,
7119
7378
  experiment: experimentName
7120
- }) : _chunkXLLGRXGRjs.initExperiment.call(void 0, config.projectName || suiteName, {
7379
+ }) : _chunkV32LW47Zjs.initExperiment.call(void 0, config.projectName || suiteName, {
7121
7380
  experiment: experimentName
7122
7381
  });
7123
7382
  context = contextManager.createChildContext(void 0, experiment);
@@ -7161,8 +7420,8 @@ function wrapDescribe(originalDescribe, config, afterAll) {
7161
7420
  config.onProgress({
7162
7421
  type: "suite_complete",
7163
7422
  suiteName,
7164
- passed: _nullishCoalesce(_optionalChain([context, 'optionalAccess', _148 => _148.passed]), () => ( 0)),
7165
- failed: _nullishCoalesce(_optionalChain([context, 'optionalAccess', _149 => _149.failed]), () => ( 0))
7423
+ passed: _nullishCoalesce(_optionalChain([context, 'optionalAccess', _154 => _154.passed]), () => ( 0)),
7424
+ failed: _nullishCoalesce(_optionalChain([context, 'optionalAccess', _155 => _155.failed]), () => ( 0))
7166
7425
  });
7167
7426
  }
7168
7427
  });
@@ -7224,7 +7483,7 @@ function wrapExpect(originalExpect) {
7224
7483
  return originalExpect(value);
7225
7484
  }
7226
7485
  const assertion = originalExpect(value, message);
7227
- const span = _chunkXLLGRXGRjs.currentSpan.call(void 0, );
7486
+ const span = _chunkV32LW47Zjs.currentSpan.call(void 0, );
7228
7487
  if (!span) {
7229
7488
  return assertion;
7230
7489
  }
@@ -7236,16 +7495,16 @@ function wrapExpect(originalExpect) {
7236
7495
 
7237
7496
  // src/wrappers/shared/logging.ts
7238
7497
  function logOutputs(outputs) {
7239
- _chunkXLLGRXGRjs.currentSpan.call(void 0, ).log({ output: outputs });
7498
+ _chunkV32LW47Zjs.currentSpan.call(void 0, ).log({ output: outputs });
7240
7499
  }
7241
7500
  function logFeedback(feedback) {
7242
- _chunkXLLGRXGRjs.currentSpan.call(void 0, ).log({
7501
+ _chunkV32LW47Zjs.currentSpan.call(void 0, ).log({
7243
7502
  scores: { [feedback.name]: feedback.score },
7244
7503
  metadata: feedback.metadata
7245
7504
  });
7246
7505
  }
7247
7506
  function getCurrentSpan() {
7248
- return _chunkXLLGRXGRjs.currentSpan.call(void 0, );
7507
+ return _chunkV32LW47Zjs.currentSpan.call(void 0, );
7249
7508
  }
7250
7509
 
7251
7510
  // src/wrappers/vitest/index.ts
@@ -7293,8 +7552,8 @@ function wrapVitest(vitestMethods, config = {}) {
7293
7552
  );
7294
7553
  return;
7295
7554
  }
7296
- await _chunkXLLGRXGRjs.summarizeAndFlush.call(void 0, ctx.experiment, {
7297
- displaySummary: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _150 => _150.displaySummary]), () => ( config.displaySummary))
7555
+ await _chunkV32LW47Zjs.summarizeAndFlush.call(void 0, ctx.experiment, {
7556
+ displaySummary: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _156 => _156.displaySummary]), () => ( config.displaySummary))
7298
7557
  });
7299
7558
  }
7300
7559
  };
@@ -7308,7 +7567,7 @@ function initNodeTestSuite(config) {
7308
7567
  return experiment;
7309
7568
  }
7310
7569
  const experimentName = config.experimentName || `${config.projectName}-${(/* @__PURE__ */ new Date()).toISOString()}`;
7311
- experiment = _chunkXLLGRXGRjs.initExperiment.call(void 0, config.projectName, {
7570
+ experiment = _chunkV32LW47Zjs.initExperiment.call(void 0, config.projectName, {
7312
7571
  experiment: experimentName
7313
7572
  });
7314
7573
  return experiment;
@@ -7357,7 +7616,7 @@ function initNodeTestSuite(config) {
7357
7616
  if (!experiment) {
7358
7617
  return;
7359
7618
  }
7360
- await _chunkXLLGRXGRjs.summarizeAndFlush.call(void 0, experiment, {
7619
+ await _chunkV32LW47Zjs.summarizeAndFlush.call(void 0, experiment, {
7361
7620
  displaySummary: config.displaySummary
7362
7621
  });
7363
7622
  experiment = void 0;
@@ -7374,7 +7633,7 @@ function initNodeTestSuite(config) {
7374
7633
 
7375
7634
  // src/graph-framework.ts
7376
7635
  var graph_framework_exports = {};
7377
- _chunk6Z5S7VOUjs.__export.call(void 0, graph_framework_exports, {
7636
+ _chunk4AQGZS6Xjs.__export.call(void 0, graph_framework_exports, {
7378
7637
  AggregatorNode: () => AggregatorNode,
7379
7638
  GateNode: () => GateNode,
7380
7639
  GraphBuilder: () => GraphBuilder,
@@ -7448,7 +7707,7 @@ var GraphBuilder = (_class4 = class {
7448
7707
  };
7449
7708
  }
7450
7709
  resolveNode(node) {
7451
- if (node instanceof _chunkXLLGRXGRjs.Prompt) {
7710
+ if (node instanceof _chunkV32LW47Zjs.Prompt) {
7452
7711
  const cached = this.nodeLikeNodes.get(node);
7453
7712
  if (cached) {
7454
7713
  return [cached, []];
@@ -7498,7 +7757,7 @@ var GraphBuilder = (_class4 = class {
7498
7757
  // }
7499
7758
  // Helper to generate node IDs
7500
7759
  generateId(name) {
7501
- const uuid = _chunkXLLGRXGRjs.newId.call(void 0, );
7760
+ const uuid = _chunkV32LW47Zjs.newId.call(void 0, );
7502
7761
  if (name) {
7503
7762
  return `${name}-${uuid.slice(0, 8)}`;
7504
7763
  } else {
@@ -7732,7 +7991,7 @@ function isAsync(fn) {
7732
7991
  function isAsyncGenerator(fn) {
7733
7992
  return fn[Symbol.toStringTag] === "AsyncGenerator";
7734
7993
  }
7735
- function isAsyncIterable(obj) {
7994
+ function isAsyncIterable2(obj) {
7736
7995
  return typeof obj[Symbol.asyncIterator] === "function";
7737
7996
  }
7738
7997
  function wrapAsync(asyncFn) {
@@ -7904,7 +8163,7 @@ var eachOfLimit$2 = (limit) => {
7904
8163
  if (isAsyncGenerator(obj)) {
7905
8164
  return asyncEachOfLimit(obj, limit, iteratee, callback);
7906
8165
  }
7907
- if (isAsyncIterable(obj)) {
8166
+ if (isAsyncIterable2(obj)) {
7908
8167
  return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback);
7909
8168
  }
7910
8169
  var nextElem = createIterator(obj);
@@ -8698,7 +8957,7 @@ function waterfall(tasks, callback) {
8698
8957
  var waterfall$1 = awaitify(waterfall);
8699
8958
 
8700
8959
  // src/trace.ts
8701
- var SpanFetcher = class _SpanFetcher extends _chunkXLLGRXGRjs.ObjectFetcher {
8960
+ var SpanFetcher = class _SpanFetcher extends _chunkV32LW47Zjs.ObjectFetcher {
8702
8961
  constructor(objectType, _objectId, rootSpanId, _state, spanTypeFilter, includeScorers = false, brainstoreRealtime = true) {
8703
8962
  const filterExpr = _SpanFetcher.buildFilter(
8704
8963
  rootSpanId,
@@ -8835,7 +9094,7 @@ var CachedSpanFetcher = (_class6 = class {
8835
9094
  async fetchSpans(spanType) {
8836
9095
  const spans = await this.fetchFn(spanType, false);
8837
9096
  for (const span of spans) {
8838
- const type = _nullishCoalesce(_optionalChain([span, 'access', _151 => _151.span_attributes, 'optionalAccess', _152 => _152.type]), () => ( ""));
9097
+ const type = _nullishCoalesce(_optionalChain([span, 'access', _157 => _157.span_attributes, 'optionalAccess', _158 => _158.type]), () => ( ""));
8839
9098
  const existing = _nullishCoalesce(this.spanCache.get(type), () => ( []));
8840
9099
  existing.push(span);
8841
9100
  this.spanCache.set(type, existing);
@@ -8918,11 +9177,11 @@ var LocalTrace = (_class7 = class {
8918
9177
  const cachedSpans = this.state.spanCache.getByRootSpanId(this.rootSpanId);
8919
9178
  if (cachedSpans && cachedSpans.length > 0) {
8920
9179
  let spans = includeScorers ? cachedSpans : cachedSpans.filter(
8921
- (span) => _optionalChain([span, 'access', _153 => _153.span_attributes, 'optionalAccess', _154 => _154.purpose]) !== "scorer"
9180
+ (span) => _optionalChain([span, 'access', _159 => _159.span_attributes, 'optionalAccess', _160 => _160.purpose]) !== "scorer"
8922
9181
  );
8923
9182
  if (spanType && spanType.length > 0) {
8924
9183
  spans = spans.filter(
8925
- (span) => spanType.includes(_nullishCoalesce(_optionalChain([span, 'access', _155 => _155.span_attributes, 'optionalAccess', _156 => _156.type]), () => ( "")))
9184
+ (span) => spanType.includes(_nullishCoalesce(_optionalChain([span, 'access', _161 => _161.span_attributes, 'optionalAccess', _162 => _162.type]), () => ( "")))
8926
9185
  );
8927
9186
  }
8928
9187
  return spans.map((span) => ({
@@ -8947,7 +9206,7 @@ var LocalTrace = (_class7 = class {
8947
9206
  * Calls the API with the project_default preprocessor (which falls back to "thread").
8948
9207
  */
8949
9208
  async getThread(options) {
8950
- const cacheKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _157 => _157.preprocessor]), () => ( "project_default"));
9209
+ const cacheKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _163 => _163.preprocessor]), () => ( "project_default"));
8951
9210
  if (!this.threadCache.has(cacheKey)) {
8952
9211
  const promise = this.fetchThread(options);
8953
9212
  this.threadCache.set(cacheKey, promise);
@@ -8958,7 +9217,7 @@ var LocalTrace = (_class7 = class {
8958
9217
  await this.ensureSpansReady();
8959
9218
  await this.state.login({});
8960
9219
  const result = await invoke({
8961
- globalFunction: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _158 => _158.preprocessor]), () => ( "project_default")),
9220
+ globalFunction: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _164 => _164.preprocessor]), () => ( "project_default")),
8962
9221
  functionType: "preprocessor",
8963
9222
  input: {
8964
9223
  trace_ref: {
@@ -9015,20 +9274,20 @@ var promptContentsSchema = _v3.z.union([
9015
9274
  prompt: _v3.z.string()
9016
9275
  }),
9017
9276
  _v3.z.object({
9018
- messages: _v3.z.array(_chunkXLLGRXGRjs.ChatCompletionMessageParam)
9277
+ messages: _v3.z.array(_chunkV32LW47Zjs.ChatCompletionMessageParam)
9019
9278
  })
9020
9279
  ]);
9021
9280
  var promptDefinitionSchema = promptContentsSchema.and(
9022
9281
  _v3.z.object({
9023
9282
  model: _v3.z.string(),
9024
- params: _chunkXLLGRXGRjs.ModelParams.optional(),
9283
+ params: _chunkV32LW47Zjs.ModelParams.optional(),
9025
9284
  templateFormat: _v3.z.enum(["mustache", "nunjucks", "none"]).optional(),
9026
9285
  environments: _v3.z.array(_v3.z.string()).optional()
9027
9286
  })
9028
9287
  );
9029
9288
  var promptDefinitionWithToolsSchema = promptDefinitionSchema.and(
9030
9289
  _v3.z.object({
9031
- tools: _v3.z.array(_chunkXLLGRXGRjs.ToolFunctionDefinition).optional()
9290
+ tools: _v3.z.array(_chunkV32LW47Zjs.ToolFunctionDefinition).optional()
9032
9291
  })
9033
9292
  );
9034
9293
  function promptDefinitionToPromptData(promptDefinition, rawTools) {
@@ -9076,7 +9335,7 @@ async function validateParameters(parameters, parameterSchema) {
9076
9335
  if (resolvedSchema === void 0 || resolvedSchema === null) {
9077
9336
  return parameters;
9078
9337
  }
9079
- if (_chunkXLLGRXGRjs.RemoteEvalParameters.isParameters(resolvedSchema)) {
9338
+ if (_chunkV32LW47Zjs.RemoteEvalParameters.isParameters(resolvedSchema)) {
9080
9339
  const mergedParameters = parameters && Object.keys(parameters).length > 0 ? {
9081
9340
  ...resolvedSchema.data,
9082
9341
  ...parameters
@@ -9098,14 +9357,14 @@ function validateParametersWithZod(parameters, parameterSchema) {
9098
9357
  const value = parameters[name];
9099
9358
  try {
9100
9359
  if ("type" in schema && schema.type === "prompt") {
9101
- const promptData = value ? _chunkXLLGRXGRjs.PromptData.parse(value) : schema.default ? promptDefinitionToPromptData(
9360
+ const promptData = value ? _chunkV32LW47Zjs.PromptData.parse(value) : schema.default ? promptDefinitionToPromptData(
9102
9361
  schema.default,
9103
9362
  schema.default.tools
9104
9363
  ) : void 0;
9105
9364
  if (!promptData) {
9106
9365
  throw new Error(`Parameter '${name}' is required`);
9107
9366
  }
9108
- return [name, _chunkXLLGRXGRjs.Prompt.fromPromptData(name, promptData)];
9367
+ return [name, _chunkV32LW47Zjs.Prompt.fromPromptData(name, promptData)];
9109
9368
  } else if ("type" in schema && schema.type === "model") {
9110
9369
  const model = _nullishCoalesce(value, () => ( schema.default));
9111
9370
  if (model === void 0) {
@@ -9134,10 +9393,10 @@ function validateParametersWithJsonSchema(parameters, schema) {
9134
9393
  const ajv = new (0, _ajv2.default)({ coerceTypes: true, useDefaults: true, strict: false });
9135
9394
  const validate = ajv.compile(schema);
9136
9395
  if (!validate(parameters)) {
9137
- const errorMessages = _optionalChain([validate, 'access', _159 => _159.errors, 'optionalAccess', _160 => _160.map, 'call', _161 => _161((err) => {
9396
+ const errorMessages = _optionalChain([validate, 'access', _165 => _165.errors, 'optionalAccess', _166 => _166.map, 'call', _167 => _167((err) => {
9138
9397
  const path = err.instancePath || "root";
9139
9398
  return `${path}: ${err.message}`;
9140
- }), 'access', _162 => _162.join, 'call', _163 => _163(", ")]);
9399
+ }), 'access', _168 => _168.join, 'call', _169 => _169(", ")]);
9141
9400
  throw Error(`Invalid parameters: ${errorMessages}`);
9142
9401
  }
9143
9402
  return rehydrateRemoteParameters(parameters, schema);
@@ -9156,7 +9415,7 @@ function rehydrateRemoteParameters(parameters, schema) {
9156
9415
  if (Reflect.get(propertySchema, "x-bt-type") === "prompt") {
9157
9416
  return [
9158
9417
  name,
9159
- _chunkXLLGRXGRjs.Prompt.fromPromptData(name, _chunkXLLGRXGRjs.PromptData.parse(value))
9418
+ _chunkV32LW47Zjs.Prompt.fromPromptData(name, _chunkV32LW47Zjs.PromptData.parse(value))
9160
9419
  ];
9161
9420
  }
9162
9421
  return [name, value];
@@ -9194,7 +9453,7 @@ var EvalResultWithSummary = class {
9194
9453
  async function getPersistedBaseExperimentId(experiment) {
9195
9454
  try {
9196
9455
  return await experiment._getBaseExperimentId();
9197
- } catch (e10) {
9456
+ } catch (e12) {
9198
9457
  return void 0;
9199
9458
  }
9200
9459
  }
@@ -9206,7 +9465,7 @@ function makeEvalName(projectName, experimentName) {
9206
9465
  return out;
9207
9466
  }
9208
9467
  function initExperiment2(state, options = {}) {
9209
- return _chunkXLLGRXGRjs.init.call(void 0, {
9468
+ return _chunkV32LW47Zjs.init.call(void 0, {
9210
9469
  state,
9211
9470
  ...options,
9212
9471
  setCurrent: false
@@ -9217,7 +9476,7 @@ async function getExperimentParametersRef(parameters) {
9217
9476
  return void 0;
9218
9477
  }
9219
9478
  const resolvedParameters = parameters instanceof Promise ? await parameters : parameters;
9220
- if (!_chunkXLLGRXGRjs.RemoteEvalParameters.isParameters(resolvedParameters)) {
9479
+ if (!_chunkV32LW47Zjs.RemoteEvalParameters.isParameters(resolvedParameters)) {
9221
9480
  return void 0;
9222
9481
  }
9223
9482
  if (resolvedParameters.id === void 0) {
@@ -9244,7 +9503,7 @@ async function _internalInitEvaluatorExperiment(projectName, evaluator, data, op
9244
9503
  baseExperimentId: evaluator.baseExperimentId,
9245
9504
  gitMetadataSettings: evaluator.gitMetadataSettings,
9246
9505
  repoInfo: evaluator.repoInfo,
9247
- dataset: _chunkXLLGRXGRjs.Dataset.isDataset(data) ? data : void 0,
9506
+ dataset: _chunkV32LW47Zjs.Dataset.isDataset(data) ? data : void 0,
9248
9507
  parameters
9249
9508
  });
9250
9509
  }
@@ -9259,7 +9518,7 @@ function callEvaluatorData(data) {
9259
9518
  baseExperiment
9260
9519
  };
9261
9520
  }
9262
- function isAsyncIterable2(value) {
9521
+ function isAsyncIterable3(value) {
9263
9522
  return typeof value === "object" && value !== null && Symbol.asyncIterator in value && typeof value[Symbol.asyncIterator] === "function";
9264
9523
  }
9265
9524
  function isIterable(value) {
@@ -9280,7 +9539,7 @@ async function _internalResolveEvaluatorData(evaluator, experiment) {
9280
9539
  );
9281
9540
  }
9282
9541
  let name = dataResult.name;
9283
- if (_chunkXLLGRXGRjs.isEmpty.call(void 0, name)) {
9542
+ if (_chunkV32LW47Zjs.isEmpty.call(void 0, name)) {
9284
9543
  const baseExperiment = await experiment.fetchBaseExperiment();
9285
9544
  if (!baseExperiment) {
9286
9545
  throw new Error("BaseExperiment() failed to fetch base experiment");
@@ -9294,7 +9553,7 @@ async function _internalResolveEvaluatorData(evaluator, experiment) {
9294
9553
  }).asDataset();
9295
9554
  }
9296
9555
  const resolvedDataResult = dataResult instanceof Promise ? await dataResult : dataResult;
9297
- if (isAsyncIterable2(resolvedDataResult)) {
9556
+ if (isAsyncIterable3(resolvedDataResult)) {
9298
9557
  return resolvedDataResult;
9299
9558
  }
9300
9559
  if (Array.isArray(resolvedDataResult) || isIterable(resolvedDataResult)) {
@@ -9315,10 +9574,10 @@ globalThis._evals = {
9315
9574
  reporters: {}
9316
9575
  };
9317
9576
  function _initializeSpanContext() {
9318
- globalThis._spanContext = { currentSpan: _chunkXLLGRXGRjs.currentSpan, withCurrent: _chunkXLLGRXGRjs.withCurrent, startSpan: _chunkXLLGRXGRjs.startSpan, NOOP_SPAN: _chunkXLLGRXGRjs.NOOP_SPAN };
9577
+ globalThis._spanContext = { currentSpan: _chunkV32LW47Zjs.currentSpan, withCurrent: _chunkV32LW47Zjs.withCurrent, startSpan: _chunkV32LW47Zjs.startSpan, NOOP_SPAN: _chunkV32LW47Zjs.NOOP_SPAN };
9319
9578
  }
9320
9579
  async function Eval(name, evaluator, reporterOrOpts) {
9321
- const options = _chunkXLLGRXGRjs.isEmpty.call(void 0, reporterOrOpts) ? {} : typeof reporterOrOpts === "string" ? { reporter: reporterOrOpts } : "name" in reporterOrOpts ? { reporter: reporterOrOpts } : reporterOrOpts;
9580
+ const options = _chunkV32LW47Zjs.isEmpty.call(void 0, reporterOrOpts) ? {} : typeof reporterOrOpts === "string" ? { reporter: reporterOrOpts } : "name" in reporterOrOpts ? { reporter: reporterOrOpts } : reporterOrOpts;
9322
9581
  let evalName = makeEvalName(name, evaluator.experimentName);
9323
9582
  if (globalThis._evals.evaluators[evalName]) {
9324
9583
  evalName = `${evalName}_${Object.keys(_evals).length}`;
@@ -9377,7 +9636,7 @@ async function Eval(name, evaluator, reporterOrOpts) {
9377
9636
  const enableCache = _nullishCoalesce(options.enableCache, () => ( true));
9378
9637
  let ret;
9379
9638
  if (options.parent) {
9380
- ret = await _chunkXLLGRXGRjs.withParent.call(void 0,
9639
+ ret = await _chunkV32LW47Zjs.withParent.call(void 0,
9381
9640
  options.parent,
9382
9641
  () => runEvaluator(
9383
9642
  null,
@@ -9413,7 +9672,7 @@ async function Eval(name, evaluator, reporterOrOpts) {
9413
9672
  if (experiment) {
9414
9673
  await experiment.flush().catch(console.error);
9415
9674
  } else if (options.parent) {
9416
- await _chunkXLLGRXGRjs.flush.call(void 0, { state: evaluator.state }).catch(console.error);
9675
+ await _chunkV32LW47Zjs.flush.call(void 0, { state: evaluator.state }).catch(console.error);
9417
9676
  }
9418
9677
  }
9419
9678
  } finally {
@@ -9495,19 +9754,29 @@ function buildSpanScores(results) {
9495
9754
  function _internalPrepareEvaluatorScore(scoreValue, name) {
9496
9755
  if (scoreValue === null) return { results: null };
9497
9756
  if (Array.isArray(scoreValue)) {
9757
+ const names = /* @__PURE__ */ new Set();
9498
9758
  for (const score of scoreValue) {
9499
- if (!(typeof score === "object" && !_chunkXLLGRXGRjs.isEmpty.call(void 0, score))) {
9759
+ if (!(typeof score === "object" && !_chunkV32LW47Zjs.isEmpty.call(void 0, score))) {
9500
9760
  throw new Error(
9501
9761
  `When returning an array of scores, each score must be a non-empty object. Got: ${JSON.stringify(score)}`
9502
9762
  );
9503
9763
  }
9764
+ if (typeof score.name !== "string") {
9765
+ throw new Error(
9766
+ `When returning an array of scores, each score must have a name. Got: ${JSON.stringify(score)}`
9767
+ );
9768
+ }
9769
+ if (names.has(score.name)) {
9770
+ throw new Error(`Duplicate score name '${score.name}' in score array`);
9771
+ }
9772
+ names.add(score.name);
9504
9773
  }
9505
9774
  }
9506
9775
  let results;
9507
9776
  if (Array.isArray(scoreValue)) {
9508
9777
  results = scoreValue;
9509
- } else if (typeof scoreValue === "object" && !_chunkXLLGRXGRjs.isEmpty.call(void 0, scoreValue)) {
9510
- results = [scoreValue];
9778
+ } else if (typeof scoreValue === "object" && !_chunkV32LW47Zjs.isEmpty.call(void 0, scoreValue)) {
9779
+ results = [{ ...scoreValue, name: _nullishCoalesce(scoreValue.name, () => ( name)) }];
9511
9780
  } else {
9512
9781
  results = [{ name, score: scoreValue }];
9513
9782
  }
@@ -9550,7 +9819,7 @@ function collectScoringResults(runResults, names, onResult) {
9550
9819
  return failing;
9551
9820
  }
9552
9821
  function validateClassificationResult(value, scorerName2) {
9553
- if (!(typeof value === "object" && value !== null && !_chunkXLLGRXGRjs.isEmpty.call(void 0, value))) {
9822
+ if (!(typeof value === "object" && value !== null && !_chunkV32LW47Zjs.isEmpty.call(void 0, value))) {
9554
9823
  throw new Error(
9555
9824
  `When returning structured classifier results, each classification must be a non-empty object. Got: ${JSON.stringify(value)}`
9556
9825
  );
@@ -9600,7 +9869,7 @@ function logScoringFailures(kind, failures, metadata, rootSpan, state) {
9600
9869
  );
9601
9870
  metadata[`${kind}_errors`] = errorMap;
9602
9871
  rootSpan.log({ metadata: { [`${kind}_errors`]: errorMap } });
9603
- _chunk6Z5S7VOUjs.debugLogger.forState(state).warn(
9872
+ _chunk4AQGZS6Xjs.debugLogger.forState(state).warn(
9604
9873
  `Found exceptions for the following ${kind}s: ${Object.keys(errorMap).join(", ")}`,
9605
9874
  failures.map((f) => f.error)
9606
9875
  );
@@ -9634,7 +9903,7 @@ var defaultErrorScoreHandler = ({
9634
9903
  };
9635
9904
  async function runEvaluatorInternal(experiment, evaluator, progressReporter, filters, stream, parameters, collectResults, enableCache) {
9636
9905
  if (enableCache) {
9637
- _optionalChain([(_nullishCoalesce(evaluator.state, () => ( _chunkXLLGRXGRjs._internalGetGlobalState.call(void 0, )))), 'optionalAccess', _164 => _164.spanCache, 'optionalAccess', _165 => _165.start, 'call', _166 => _166()]);
9906
+ _optionalChain([(_nullishCoalesce(evaluator.state, () => ( _chunkV32LW47Zjs._internalGetGlobalState.call(void 0, )))), 'optionalAccess', _170 => _170.spanCache, 'optionalAccess', _171 => _171.start, 'call', _172 => _172()]);
9638
9907
  }
9639
9908
  try {
9640
9909
  parameters = await validateParameters(
@@ -9649,7 +9918,7 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
9649
9918
  const experimentIdPromise = experiment ? (async () => {
9650
9919
  try {
9651
9920
  return await experiment.id;
9652
- } catch (e11) {
9921
+ } catch (e13) {
9653
9922
  return void 0;
9654
9923
  }
9655
9924
  })() : void 0;
@@ -9665,7 +9934,7 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
9665
9934
  if (cancelled) {
9666
9935
  return;
9667
9936
  }
9668
- const eventDataset = experiment ? experiment.dataset : _chunkXLLGRXGRjs.Dataset.isDataset(evaluator.data) ? evaluator.data : void 0;
9937
+ const eventDataset = experiment ? experiment.dataset : _chunkV32LW47Zjs.Dataset.isDataset(evaluator.data) ? evaluator.data : void 0;
9669
9938
  const inlineDatasetOrigin = eventDataset && datum.id && datum._xact_id ? {
9670
9939
  object_type: "dataset",
9671
9940
  object_id: await eventDataset.id,
@@ -9673,8 +9942,8 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
9673
9942
  created: datum.created,
9674
9943
  _xact_id: datum._xact_id
9675
9944
  } : void 0;
9676
- const parsedDatumOrigin = _chunkXLLGRXGRjs.ObjectReference.safeParse(datum.origin);
9677
- const origin = _nullishCoalesce(inlineDatasetOrigin, () => ( (_optionalChain([parsedDatumOrigin, 'optionalAccess', _167 => _167.success]) ? parsedDatumOrigin.data : void 0)));
9945
+ const parsedDatumOrigin = _chunkV32LW47Zjs.ObjectReference.safeParse(datum.origin);
9946
+ const origin = _nullishCoalesce(inlineDatasetOrigin, () => ( (_optionalChain([parsedDatumOrigin, 'optionalAccess', _173 => _173.success]) ? parsedDatumOrigin.data : void 0)));
9678
9947
  const baseEvent = {
9679
9948
  name: "eval",
9680
9949
  spanAttributes: {
@@ -9689,26 +9958,26 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
9689
9958
  }
9690
9959
  };
9691
9960
  const callback = async (rootSpan) => {
9692
- const state = _nullishCoalesce(evaluator.state, () => ( _chunkXLLGRXGRjs._internalGetGlobalState.call(void 0, )));
9961
+ const state = _nullishCoalesce(evaluator.state, () => ( _chunkV32LW47Zjs._internalGetGlobalState.call(void 0, )));
9693
9962
  const ensureSpansFlushed = async () => {
9694
9963
  if (experiment) {
9695
- await _chunkXLLGRXGRjs.flush.call(void 0, { state: experiment.loggingState });
9964
+ await _chunkV32LW47Zjs.flush.call(void 0, { state: experiment.loggingState });
9696
9965
  } else if (state) {
9697
- await _chunkXLLGRXGRjs.flush.call(void 0, { state });
9966
+ await _chunkV32LW47Zjs.flush.call(void 0, { state });
9698
9967
  } else {
9699
- await _chunkXLLGRXGRjs.flush.call(void 0, );
9968
+ await _chunkV32LW47Zjs.flush.call(void 0, );
9700
9969
  }
9701
9970
  if (state) {
9702
9971
  await state.flushOtel();
9703
9972
  }
9704
9973
  };
9705
9974
  const parentStr = state.currentParent.getStore();
9706
- const parentComponents = typeof parentStr === "string" ? _chunkXLLGRXGRjs.SpanComponentsV4.fromStr(parentStr) : null;
9975
+ const parentComponents = typeof parentStr === "string" ? _chunkV32LW47Zjs.SpanComponentsV4.fromStr(parentStr) : null;
9707
9976
  const trace = state ? new LocalTrace({
9708
- objectType: parentComponents ? _chunkXLLGRXGRjs.spanObjectTypeV3ToTypedString.call(void 0,
9977
+ objectType: parentComponents ? _chunkV32LW47Zjs.spanObjectTypeV3ToTypedString.call(void 0,
9709
9978
  parentComponents.data.object_type
9710
9979
  ) : "experiment",
9711
- objectId: await _asyncNullishCoalesce(await _asyncOptionalChain([parentComponents, 'optionalAccess', async _168 => _168.data, 'access', async _169 => _169.object_id]), async () => ( (experimentIdPromise ? await _asyncNullishCoalesce(await experimentIdPromise, async () => ( "")) : ""))),
9980
+ objectId: await _asyncNullishCoalesce(await _asyncOptionalChain([parentComponents, 'optionalAccess', async _174 => _174.data, 'access', async _175 => _175.object_id]), async () => ( (experimentIdPromise ? await _asyncNullishCoalesce(await experimentIdPromise, async () => ( "")) : ""))),
9712
9981
  rootSpanId: rootSpan.rootSpanId,
9713
9982
  ensureSpansFlushed,
9714
9983
  state
@@ -9734,10 +10003,10 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
9734
10003
  _nullishCoalesce(parameters, () => ( {})),
9735
10004
  span,
9736
10005
  (event) => {
9737
- _optionalChain([stream, 'optionalCall', _170 => _170({
10006
+ _optionalChain([stream, 'optionalCall', _176 => _176({
9738
10007
  ...event,
9739
10008
  id: rootSpan.id,
9740
- origin: _optionalChain([baseEvent, 'access', _171 => _171.event, 'optionalAccess', _172 => _172.origin]),
10009
+ origin: _optionalChain([baseEvent, 'access', _177 => _177.event, 'optionalAccess', _178 => _178.origin]),
9741
10010
  name: evaluator.evalName,
9742
10011
  object_type: "task"
9743
10012
  })]);
@@ -9770,7 +10039,7 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
9770
10039
  trace
9771
10040
  };
9772
10041
  const { trace: _trace, ...scoringArgsForLogging } = scoringArgs;
9773
- const propagatedEvent = _chunkXLLGRXGRjs.makeScorerPropagatedEvent.call(void 0,
10042
+ const propagatedEvent = _chunkV32LW47Zjs.makeScorerPropagatedEvent.call(void 0,
9774
10043
  await rootSpan.export()
9775
10044
  );
9776
10045
  const [scoreResults, classificationResults] = await Promise.all([
@@ -9865,7 +10134,7 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
9865
10134
  evaluator.state
9866
10135
  );
9867
10136
  } catch (e) {
9868
- _chunkXLLGRXGRjs.logError.call(void 0, rootSpan, e);
10137
+ _chunkV32LW47Zjs.logError.call(void 0, rootSpan, e);
9869
10138
  error = e;
9870
10139
  } finally {
9871
10140
  progressReporter.increment(evaluator.evalName);
@@ -9889,7 +10158,7 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
9889
10158
  tags: tags.length ? tags : void 0,
9890
10159
  metadata,
9891
10160
  error,
9892
- origin: _optionalChain([baseEvent, 'access', _173 => _173.event, 'optionalAccess', _174 => _174.origin])
10161
+ origin: _optionalChain([baseEvent, 'access', _179 => _179.event, 'optionalAccess', _180 => _180.origin])
9893
10162
  };
9894
10163
  collectedResults.push({
9895
10164
  ...baseResult,
@@ -9899,7 +10168,7 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
9899
10168
  }
9900
10169
  };
9901
10170
  if (!experiment) {
9902
- return await _chunkXLLGRXGRjs.traced.call(void 0, callback, {
10171
+ return await _chunkV32LW47Zjs.traced.call(void 0, callback, {
9903
10172
  ...baseEvent,
9904
10173
  state: evaluator.state
9905
10174
  });
@@ -9929,7 +10198,7 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
9929
10198
  break;
9930
10199
  }
9931
10200
  scheduledTrials++;
9932
- _optionalChain([progressReporter, 'access', _175 => _175.setTotal, 'optionalCall', _176 => _176(evaluator.evalName, scheduledTrials)]);
10201
+ _optionalChain([progressReporter, 'access', _181 => _181.setTotal, 'optionalCall', _182 => _182(evaluator.evalName, scheduledTrials)]);
9933
10202
  q.pushAsync({ datum, trialIndex }).catch((e) => {
9934
10203
  if (queueErrors.length < 5) {
9935
10204
  queueErrors.push(e);
@@ -9953,7 +10222,7 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
9953
10222
  const cancel = async () => {
9954
10223
  await new Promise((_, reject2) => {
9955
10224
  if (cancelled) {
9956
- reject2(new (0, _chunkXLLGRXGRjs.InternalAbortError)("Evaluator already cancelled"));
10225
+ reject2(new (0, _chunkV32LW47Zjs.InternalAbortError)("Evaluator already cancelled"));
9957
10226
  return;
9958
10227
  }
9959
10228
  const rejectOnce = (error) => {
@@ -9966,12 +10235,12 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
9966
10235
  };
9967
10236
  if (evaluator.timeout) {
9968
10237
  timeoutId = setTimeout(() => {
9969
- rejectOnce(new (0, _chunkXLLGRXGRjs.InternalAbortError)("Evaluator timed out"));
10238
+ rejectOnce(new (0, _chunkV32LW47Zjs.InternalAbortError)("Evaluator timed out"));
9970
10239
  }, evaluator.timeout);
9971
10240
  }
9972
10241
  if (evaluator.signal) {
9973
10242
  abortHandler = () => {
9974
- rejectOnce(new (0, _chunkXLLGRXGRjs.InternalAbortError)("Evaluator aborted"));
10243
+ rejectOnce(new (0, _chunkV32LW47Zjs.InternalAbortError)("Evaluator aborted"));
9975
10244
  };
9976
10245
  evaluator.signal.addEventListener("abort", abortHandler);
9977
10246
  }
@@ -9994,9 +10263,9 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
9994
10263
  }
9995
10264
  } catch (e) {
9996
10265
  q.kill();
9997
- if (e instanceof _chunkXLLGRXGRjs.InternalAbortError) {
9998
- if (_chunk6Z5S7VOUjs.isomorph_default.getEnv("BRAINTRUST_VERBOSE")) {
9999
- _chunk6Z5S7VOUjs.debugLogger.forState(evaluator.state).warn("Evaluator cancelled:", e.message);
10266
+ if (e instanceof _chunkV32LW47Zjs.InternalAbortError) {
10267
+ if (_chunk4AQGZS6Xjs.isomorph_default.getEnv("BRAINTRUST_VERBOSE")) {
10268
+ _chunk4AQGZS6Xjs.debugLogger.forState(evaluator.state).warn("Evaluator cancelled:", e.message);
10000
10269
  }
10001
10270
  }
10002
10271
  throw e;
@@ -10021,9 +10290,9 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
10021
10290
  );
10022
10291
  } finally {
10023
10292
  if (enableCache) {
10024
- const spanCache = _optionalChain([(_nullishCoalesce(evaluator.state, () => ( _chunkXLLGRXGRjs._internalGetGlobalState.call(void 0, )))), 'optionalAccess', _177 => _177.spanCache]);
10025
- _optionalChain([spanCache, 'optionalAccess', _178 => _178.dispose, 'call', _179 => _179()]);
10026
- _optionalChain([spanCache, 'optionalAccess', _180 => _180.stop, 'call', _181 => _181()]);
10293
+ const spanCache = _optionalChain([(_nullishCoalesce(evaluator.state, () => ( _chunkV32LW47Zjs._internalGetGlobalState.call(void 0, )))), 'optionalAccess', _183 => _183.spanCache]);
10294
+ _optionalChain([spanCache, 'optionalAccess', _184 => _184.dispose, 'call', _185 => _185()]);
10295
+ _optionalChain([spanCache, 'optionalAccess', _186 => _186.stop, 'call', _187 => _187()]);
10027
10296
  }
10028
10297
  }
10029
10298
  }
@@ -10116,25 +10385,25 @@ var defaultReporter = {
10116
10385
  reportFailures(evaluator, failingResults, { verbose, jsonl });
10117
10386
  }
10118
10387
  if (jsonl) {
10119
- _chunk6Z5S7VOUjs.isomorph_default.writeln(JSON.stringify(summary));
10388
+ _chunk4AQGZS6Xjs.isomorph_default.writeln(JSON.stringify(summary));
10120
10389
  } else {
10121
- _chunk6Z5S7VOUjs.isomorph_default.writeln("Experiment summary");
10122
- _chunk6Z5S7VOUjs.isomorph_default.writeln("==================");
10390
+ _chunk4AQGZS6Xjs.isomorph_default.writeln("Experiment summary");
10391
+ _chunk4AQGZS6Xjs.isomorph_default.writeln("==================");
10123
10392
  if (summary.comparisonExperimentName) {
10124
- _chunk6Z5S7VOUjs.isomorph_default.writeln(
10393
+ _chunk4AQGZS6Xjs.isomorph_default.writeln(
10125
10394
  `${summary.comparisonExperimentName} (baseline) <- ${summary.experimentName} (comparison)`
10126
10395
  );
10127
- _chunk6Z5S7VOUjs.isomorph_default.writeln("");
10396
+ _chunk4AQGZS6Xjs.isomorph_default.writeln("");
10128
10397
  }
10129
10398
  const hasScores = Object.keys(summary.scores).length > 0;
10130
10399
  const hasMetrics = Object.keys(_nullishCoalesce(summary.metrics, () => ( {}))).length > 0;
10131
10400
  const hasComparison = !!summary.comparisonExperimentName;
10132
10401
  if (hasScores || hasMetrics) {
10133
10402
  if (hasComparison) {
10134
- _chunk6Z5S7VOUjs.isomorph_default.writeln(
10403
+ _chunk4AQGZS6Xjs.isomorph_default.writeln(
10135
10404
  "Name Value Change Improvements Regressions"
10136
10405
  );
10137
- _chunk6Z5S7VOUjs.isomorph_default.writeln(
10406
+ _chunk4AQGZS6Xjs.isomorph_default.writeln(
10138
10407
  "----------------------------------------------------------------"
10139
10408
  );
10140
10409
  }
@@ -10143,18 +10412,18 @@ var defaultReporter = {
10143
10412
  const scoreValue = `${scorePercent}%`;
10144
10413
  if (hasComparison) {
10145
10414
  let diffString = "-";
10146
- if (!_chunkXLLGRXGRjs.isEmpty.call(void 0, score.diff)) {
10415
+ if (!_chunkV32LW47Zjs.isEmpty.call(void 0, score.diff)) {
10147
10416
  const diffPercent = (score.diff * 100).toFixed(2);
10148
10417
  const diffSign = score.diff > 0 ? "+" : "";
10149
10418
  diffString = `${diffSign}${diffPercent}%`;
10150
10419
  }
10151
10420
  const improvements = score.improvements > 0 ? score.improvements.toString() : "-";
10152
10421
  const regressions = score.regressions > 0 ? score.regressions.toString() : "-";
10153
- _chunk6Z5S7VOUjs.isomorph_default.writeln(
10422
+ _chunk4AQGZS6Xjs.isomorph_default.writeln(
10154
10423
  `${score.name.padEnd(18)} ${scoreValue.padStart(10)} ${diffString.padStart(10)} ${improvements.padStart(12)} ${regressions.padStart(11)}`
10155
10424
  );
10156
10425
  } else {
10157
- _chunk6Z5S7VOUjs.isomorph_default.writeln(`${score.name.padEnd(20)} ${scoreValue.padStart(15)}`);
10426
+ _chunk4AQGZS6Xjs.isomorph_default.writeln(`${score.name.padEnd(20)} ${scoreValue.padStart(15)}`);
10158
10427
  }
10159
10428
  }
10160
10429
  for (const metric of Object.values(_nullishCoalesce(summary.metrics, () => ( {})))) {
@@ -10163,30 +10432,30 @@ var defaultReporter = {
10163
10432
  const metricValue = metric.unit === "$" ? `${metric.unit}${formattedValue}` : `${formattedValue}${metric.unit}`;
10164
10433
  if (hasComparison) {
10165
10434
  let diffString = "-";
10166
- if (!_chunkXLLGRXGRjs.isEmpty.call(void 0, metric.diff)) {
10435
+ if (!_chunkV32LW47Zjs.isEmpty.call(void 0, metric.diff)) {
10167
10436
  const diffPercent = (metric.diff * 100).toFixed(2);
10168
10437
  const diffSign = metric.diff > 0 ? "+" : "";
10169
10438
  diffString = `${diffSign}${diffPercent}%`;
10170
10439
  }
10171
10440
  const improvements = metric.improvements > 0 ? metric.improvements.toString() : "-";
10172
10441
  const regressions = metric.regressions > 0 ? metric.regressions.toString() : "-";
10173
- _chunk6Z5S7VOUjs.isomorph_default.writeln(
10442
+ _chunk4AQGZS6Xjs.isomorph_default.writeln(
10174
10443
  `${metric.name.padEnd(18)} ${metricValue.padStart(10)} ${diffString.padStart(10)} ${improvements.padStart(12)} ${regressions.padStart(11)}`
10175
10444
  );
10176
10445
  } else {
10177
- _chunk6Z5S7VOUjs.isomorph_default.writeln(
10446
+ _chunk4AQGZS6Xjs.isomorph_default.writeln(
10178
10447
  `${metric.name.padEnd(20)} ${metricValue.padStart(15)}`
10179
10448
  );
10180
10449
  }
10181
10450
  }
10182
10451
  }
10183
10452
  if (summary.experimentUrl) {
10184
- _chunk6Z5S7VOUjs.isomorph_default.writeln("");
10185
- _chunk6Z5S7VOUjs.isomorph_default.writeln(`View results for ${summary.experimentName}`);
10186
- _chunk6Z5S7VOUjs.isomorph_default.writeln(`See results at ${summary.experimentUrl}`);
10453
+ _chunk4AQGZS6Xjs.isomorph_default.writeln("");
10454
+ _chunk4AQGZS6Xjs.isomorph_default.writeln(`View results for ${summary.experimentName}`);
10455
+ _chunk4AQGZS6Xjs.isomorph_default.writeln(`See results at ${summary.experimentUrl}`);
10187
10456
  }
10188
10457
  }
10189
- _chunk6Z5S7VOUjs.isomorph_default.writeln("");
10458
+ _chunk4AQGZS6Xjs.isomorph_default.writeln("");
10190
10459
  return failingResults.length === 0;
10191
10460
  },
10192
10461
  async reportRun(evalReports) {
@@ -10203,7 +10472,7 @@ var DEFAULT_BATCH_SIZE = 1e3;
10203
10472
  var DurableEvalMemoryStore = (_class8 = class {constructor() { _class8.prototype.__init21.call(this); }
10204
10473
  __init21() {this.values = /* @__PURE__ */ new Map()}
10205
10474
  async read(key) {
10206
- return _optionalChain([this, 'access', _182 => _182.values, 'access', _183 => _183.get, 'call', _184 => _184(key), 'optionalAccess', _185 => _185.slice, 'call', _186 => _186()]);
10475
+ return _optionalChain([this, 'access', _188 => _188.values, 'access', _189 => _189.get, 'call', _190 => _190(key), 'optionalAccess', _191 => _191.slice, 'call', _192 => _192()]);
10207
10476
  }
10208
10477
  async write(key, value) {
10209
10478
  this.values.set(key, value.slice());
@@ -10233,13 +10502,13 @@ var DurableEvalRedisStore = class {
10233
10502
  if (typeof value !== "string") {
10234
10503
  throw new Error("DurableEvalRedisStore expected GET to return a string");
10235
10504
  }
10236
- return _chunkXLLGRXGRjs.base64ToUint8Array.call(void 0, value);
10505
+ return _chunkV32LW47Zjs.base64ToUint8Array.call(void 0, value);
10237
10506
  }
10238
10507
  async write(key, value) {
10239
10508
  const client = this.client;
10240
10509
  const set = client.set;
10241
10510
  const redisKey = `${this.keyPrefix}${key}`;
10242
- const encoded = _chunkXLLGRXGRjs.uint8ArrayToBase64.call(void 0, value);
10511
+ const encoded = _chunkV32LW47Zjs.uint8ArrayToBase64.call(void 0, value);
10243
10512
  if (typeof client.defineCommand === "function") {
10244
10513
  await set.call(client, redisKey, encoded, "PX", this.ttlMs);
10245
10514
  } else if (typeof client.sendCommand === "function") {
@@ -10254,7 +10523,7 @@ var DurableEvalRedisStore = class {
10254
10523
  }
10255
10524
  async getOrSet(key, value) {
10256
10525
  const redisKey = `${this.keyPrefix}${key}`;
10257
- const encoded = _chunkXLLGRXGRjs.uint8ArrayToBase64.call(void 0, value);
10526
+ const encoded = _chunkV32LW47Zjs.uint8ArrayToBase64.call(void 0, value);
10258
10527
  const client = this.client;
10259
10528
  const set = client.set;
10260
10529
  let setOptions;
@@ -10276,7 +10545,7 @@ var DurableEvalRedisStore = class {
10276
10545
  "DurableEvalRedisStore expected atomic SET to return a string or null"
10277
10546
  );
10278
10547
  }
10279
- return { value: _chunkXLLGRXGRjs.base64ToUint8Array.call(void 0, existing), created: false };
10548
+ return { value: _chunkV32LW47Zjs.base64ToUint8Array.call(void 0, existing), created: false };
10280
10549
  }
10281
10550
  };
10282
10551
  var BatchTask = (_class9 = class {
@@ -10310,7 +10579,7 @@ function defineDurableEval(projectName, evaluator) {
10310
10579
  }
10311
10580
  async function startDurableEval(definition, options) {
10312
10581
  const store = definition.evaluator.store;
10313
- const runId = _chunkXLLGRXGRjs.newId.call(void 0, );
10582
+ const runId = _chunkV32LW47Zjs.newId.call(void 0, );
10314
10583
  const key = runKey(definition.projectName, definition.evalName, runId);
10315
10584
  const { data } = callEvaluatorData(definition.evaluator.data);
10316
10585
  const parameters = await validateParameters(
@@ -10358,7 +10627,7 @@ async function startDurableEval(definition, options) {
10358
10627
  cases: [],
10359
10628
  batches: []
10360
10629
  };
10361
- await _optionalChain([experiment, 'optionalAccess', _187 => _187.flush, 'call', _188 => _188()]);
10630
+ await _optionalChain([experiment, 'optionalAccess', _193 => _193.flush, 'call', _194 => _194()]);
10362
10631
  await writeRunRecord(store, key, state2);
10363
10632
  return currentStatus(definition, state2);
10364
10633
  }
@@ -10523,9 +10792,9 @@ function currentStatus(definition, state) {
10523
10792
  return { status: "waiting", runId: state.runId, pending };
10524
10793
  }
10525
10794
  async function startCaseRoot(definition, state, record, experiment) {
10526
- if (!experiment) return _chunkXLLGRXGRjs.NOOP_SPAN;
10795
+ if (!experiment) return _chunkV32LW47Zjs.NOOP_SPAN;
10527
10796
  const datum = record.datum;
10528
- return _chunkXLLGRXGRjs._internalStartSpanWithInitialMerge.call(void 0, {
10797
+ return _chunkV32LW47Zjs._internalStartSpanWithInitialMerge.call(void 0, {
10529
10798
  ...definition.evaluator.state ? { state: definition.evaluator.state } : {},
10530
10799
  parent: await experiment.export(),
10531
10800
  name: "eval",
@@ -10591,7 +10860,7 @@ async function logTaskResult(definition, state, record, experiment, task) {
10591
10860
  record.rootSpan = await root.export();
10592
10861
  record.taskLogged = true;
10593
10862
  } catch (error) {
10594
- _chunkXLLGRXGRjs.logError.call(void 0, root, error);
10863
+ _chunkV32LW47Zjs.logError.call(void 0, root, error);
10595
10864
  throw error;
10596
10865
  } finally {
10597
10866
  root.end();
@@ -10606,7 +10875,7 @@ async function logCompletedTasks(definition, state, store, key, experiment) {
10606
10875
  changed.push(record);
10607
10876
  }
10608
10877
  if (changed.length > 0) {
10609
- await _optionalChain([experiment, 'optionalAccess', _189 => _189.flush, 'call', _190 => _190()]);
10878
+ await _optionalChain([experiment, 'optionalAccess', _195 => _195.flush, 'call', _196 => _196()]);
10610
10879
  await writeCaseRecords(store, key, changed);
10611
10880
  }
10612
10881
  }
@@ -10624,7 +10893,7 @@ async function runTaskStage(definition, state, store, key, experiment) {
10624
10893
  changed.push(record);
10625
10894
  }
10626
10895
  if (changed.length > 0) {
10627
- await _optionalChain([experiment, 'optionalAccess', _191 => _191.flush, 'call', _192 => _192()]);
10896
+ await _optionalChain([experiment, 'optionalAccess', _197 => _197.flush, 'call', _198 => _198()]);
10628
10897
  await writeCaseRecords(store, key, changed);
10629
10898
  }
10630
10899
  }
@@ -10633,7 +10902,7 @@ async function runScoreStages(definition, state, store, key, experiment) {
10633
10902
  const changed = /* @__PURE__ */ new Map();
10634
10903
  const persistChangedCases = async () => {
10635
10904
  if (changed.size === 0) return;
10636
- await _optionalChain([experiment, 'optionalAccess', _193 => _193.flush, 'call', _194 => _194()]);
10905
+ await _optionalChain([experiment, 'optionalAccess', _199 => _199.flush, 'call', _200 => _200()]);
10637
10906
  await writeCaseRecords(store, key, [...changed.values()]);
10638
10907
  changed.clear();
10639
10908
  };
@@ -10701,11 +10970,11 @@ function scorerArgs(record) {
10701
10970
  };
10702
10971
  }
10703
10972
  function resumeCaseRoot(definition, record, experiment) {
10704
- if (!experiment) return _chunkXLLGRXGRjs.NOOP_SPAN;
10973
+ if (!experiment) return _chunkV32LW47Zjs.NOOP_SPAN;
10705
10974
  if (!record.rootSpan) {
10706
10975
  throw new Error(`Durable eval case ${record.caseId} has no root span`);
10707
10976
  }
10708
- return _chunkXLLGRXGRjs._internalResumeSpan.call(void 0, {
10977
+ return _chunkV32LW47Zjs._internalResumeSpan.call(void 0, {
10709
10978
  exported: record.rootSpan,
10710
10979
  state: definition.evaluator.state
10711
10980
  });
@@ -10737,14 +11006,14 @@ async function evaluateAndLogScore(definition, state, record, name, experiment,
10737
11006
  type: "score" /* SCORE */,
10738
11007
  purpose: "scorer"
10739
11008
  },
10740
- propagatedEvent: _chunkXLLGRXGRjs.makeScorerPropagatedEvent.call(void 0, rootExport || void 0),
11009
+ propagatedEvent: _chunkV32LW47Zjs.makeScorerPropagatedEvent.call(void 0, rootExport || void 0),
10741
11010
  event: { input: scorerArgs(record) }
10742
11011
  }
10743
11012
  );
10744
11013
  if (prepared.scores) root.log({ scores: prepared.scores });
10745
11014
  record.loggedScores[name] = true;
10746
11015
  } catch (error) {
10747
- _chunkXLLGRXGRjs.logError.call(void 0, root, error);
11016
+ _chunkV32LW47Zjs.logError.call(void 0, root, error);
10748
11017
  throw error;
10749
11018
  } finally {
10750
11019
  root.end();
@@ -10776,7 +11045,7 @@ async function evaluateAndLogClassification(definition, state, record, name, cla
10776
11045
  type: "classifier" /* CLASSIFIER */,
10777
11046
  purpose: "scorer"
10778
11047
  },
10779
- propagatedEvent: _chunkXLLGRXGRjs.makeScorerPropagatedEvent.call(void 0, rootExport || void 0),
11048
+ propagatedEvent: _chunkV32LW47Zjs.makeScorerPropagatedEvent.call(void 0, rootExport || void 0),
10780
11049
  event: { input: scorerArgs(record) }
10781
11050
  }
10782
11051
  );
@@ -10785,7 +11054,7 @@ async function evaluateAndLogClassification(definition, state, record, name, cla
10785
11054
  }
10786
11055
  record.loggedClassifications[name] = true;
10787
11056
  } catch (error) {
10788
- _chunkXLLGRXGRjs.logError.call(void 0, root, error);
11057
+ _chunkV32LW47Zjs.logError.call(void 0, root, error);
10789
11058
  throw error;
10790
11059
  } finally {
10791
11060
  root.end();
@@ -10898,9 +11167,9 @@ function processorForStage(definition, kind, scorerName2) {
10898
11167
  }
10899
11168
  return definition.evaluator.task.processor;
10900
11169
  }
10901
- const scorer = _optionalChain([resolveScorers, 'call', _195 => _195(_nullishCoalesce(definition.evaluator.scores, () => ( []))), 'access', _196 => _196.find, 'call', _197 => _197(
11170
+ const scorer = _optionalChain([resolveScorers, 'call', _201 => _201(_nullishCoalesce(definition.evaluator.scores, () => ( []))), 'access', _202 => _202.find, 'call', _203 => _203(
10902
11171
  ({ name }) => name === scorerName2
10903
- ), 'optionalAccess', _198 => _198.scorer]);
11172
+ ), 'optionalAccess', _204 => _204.scorer]);
10904
11173
  if (!isBatchScorer(scorer)) {
10905
11174
  throw new Error(`Definition no longer contains scorer ${scorerName2}`);
10906
11175
  }
@@ -11027,7 +11296,7 @@ async function finishExperiment(definition, state, experiment) {
11027
11296
  if (!comparisonExperimentId) {
11028
11297
  try {
11029
11298
  comparisonExperimentId = await experiment._getBaseExperimentId();
11030
- } catch (e12) {
11299
+ } catch (e14) {
11031
11300
  comparisonExperimentId = void 0;
11032
11301
  }
11033
11302
  }
@@ -11046,7 +11315,7 @@ function runKey(projectName, evalName, runId) {
11046
11315
  return `durable-eval/v1/runs/${contentVersion(encoder.encode(`${projectName}\0${evalName}\0${runId}`))}`;
11047
11316
  }
11048
11317
  function encodedKeyPart(value) {
11049
- return _chunkXLLGRXGRjs.uint8ArrayToBase64.call(void 0, encoder.encode(value)).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
11318
+ return _chunkV32LW47Zjs.uint8ArrayToBase64.call(void 0, encoder.encode(value)).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
11050
11319
  }
11051
11320
  function caseRecordKey(key, caseId, kind, ...names) {
11052
11321
  const suffix = names.map(encodedKeyPart).join("/");
@@ -11170,12 +11439,12 @@ async function readCaseRecord(definition, store, key, id) {
11170
11439
  }
11171
11440
  return {
11172
11441
  ...base,
11173
- metadata: _nullishCoalesce(_optionalChain([task, 'optionalAccess', _199 => _199.metadata]), () => ( base.metadata)),
11442
+ metadata: _nullishCoalesce(_optionalChain([task, 'optionalAccess', _205 => _205.metadata]), () => ( base.metadata)),
11174
11443
  tags: task ? task.tags : base.tags,
11175
11444
  taskComplete: task !== void 0,
11176
11445
  taskLogged: taskLog !== void 0,
11177
- output: _optionalChain([task, 'optionalAccess', _200 => _200.output]),
11178
- rootSpan: _optionalChain([taskLog, 'optionalAccess', _201 => _201.rootSpan]),
11446
+ output: _optionalChain([task, 'optionalAccess', _206 => _206.output]),
11447
+ rootSpan: _optionalChain([taskLog, 'optionalAccess', _207 => _207.rootSpan]),
11179
11448
  scores,
11180
11449
  loggedScores,
11181
11450
  classifications,
@@ -11291,7 +11560,7 @@ function deterministicId(value) {
11291
11560
  return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-5${hex.slice(13, 16)}-a${hex.slice(17, 20)}-${hex.slice(20, 32)}`;
11292
11561
  }
11293
11562
  function contentVersion(value) {
11294
- if (_chunk6Z5S7VOUjs.isomorph_default.hash) return _chunk6Z5S7VOUjs.isomorph_default.hash(decoder.decode(value));
11563
+ if (_chunk4AQGZS6Xjs.isomorph_default.hash) return _chunk4AQGZS6Xjs.isomorph_default.hash(decoder.decode(value));
11295
11564
  let hash = 2166136261;
11296
11565
  for (const byte of value) {
11297
11566
  hash ^= byte;
@@ -11356,7 +11625,7 @@ function agentAssertionScorer(callback, options = {}) {
11356
11625
  });
11357
11626
  const resources = {};
11358
11627
  if (assertions.some((assertion) => assertion.requiresTrace)) {
11359
- resources.spans = await _optionalChain([args, 'access', _202 => _202.trace, 'optionalAccess', _203 => _203.getSpans, 'call', _204 => _204({ spanType: ["tool"] })]);
11628
+ resources.spans = await _optionalChain([args, 'access', _208 => _208.trace, 'optionalAccess', _209 => _209.getSpans, 'call', _210 => _210({ spanType: ["tool"] })]);
11360
11629
  }
11361
11630
  const results = await Promise.all(
11362
11631
  assertions.map(async (assertion) => {
@@ -11514,7 +11783,7 @@ async function validateSchema(schema, value) {
11514
11783
  }
11515
11784
  }
11516
11785
  function toolCalls(spans) {
11517
- return spans.filter((span) => _optionalChain([span, 'access', _205 => _205.span_attributes, 'optionalAccess', _206 => _206.type]) === "tool");
11786
+ return spans.filter((span) => _optionalChain([span, 'access', _211 => _211.span_attributes, 'optionalAccess', _212 => _212.type]) === "tool");
11518
11787
  }
11519
11788
  function matchingToolCalls(spans, toolName, options) {
11520
11789
  return toolCalls(spans).filter((span) => {
@@ -11532,17 +11801,17 @@ function matchingToolCalls(spans, toolName, options) {
11532
11801
  });
11533
11802
  }
11534
11803
  function getToolName(span) {
11535
- const spanName = [_optionalChain([span, 'access', _207 => _207.span_attributes, 'optionalAccess', _208 => _208.name]), span.name].map(normalizeToolName).find((value) => value !== void 0);
11536
- if (_optionalChain([spanName, 'optionalAccess', _209 => _209.includes, 'call', _210 => _210("/")])) {
11804
+ const spanName = [_optionalChain([span, 'access', _213 => _213.span_attributes, 'optionalAccess', _214 => _214.name]), span.name].map(normalizeToolName).find((value) => value !== void 0);
11805
+ if (_optionalChain([spanName, 'optionalAccess', _215 => _215.includes, 'call', _216 => _216("/")])) {
11537
11806
  return spanName;
11538
11807
  }
11539
11808
  const metadataName = [
11540
- _optionalChain([span, 'access', _211 => _211.metadata, 'optionalAccess', _212 => _212.tool_name]),
11541
- _optionalChain([span, 'access', _213 => _213.metadata, 'optionalAccess', _214 => _214["gen_ai.tool.name"]])
11809
+ _optionalChain([span, 'access', _217 => _217.metadata, 'optionalAccess', _218 => _218.tool_name]),
11810
+ _optionalChain([span, 'access', _219 => _219.metadata, 'optionalAccess', _220 => _220["gen_ai.tool.name"]])
11542
11811
  ].map(normalizeToolName).find((value) => value !== void 0);
11543
11812
  const mcpServer = [
11544
- _optionalChain([span, 'access', _215 => _215.metadata, 'optionalAccess', _216 => _216["mcp.server"]]),
11545
- _optionalChain([span, 'access', _217 => _217.metadata, 'optionalAccess', _218 => _218["openai_codex.mcp.server"]])
11813
+ _optionalChain([span, 'access', _221 => _221.metadata, 'optionalAccess', _222 => _222["mcp.server"]]),
11814
+ _optionalChain([span, 'access', _223 => _223.metadata, 'optionalAccess', _224 => _224["openai_codex.mcp.server"]])
11546
11815
  ].find((value) => typeof value === "string" && value !== "");
11547
11816
  if (metadataName && mcpServer) {
11548
11817
  return `${mcpServer}/${metadataName}`;
@@ -11612,7 +11881,7 @@ function formatValue(value) {
11612
11881
  return serialized;
11613
11882
  }
11614
11883
  return formatValueWithUndefined(value, /* @__PURE__ */ new Set());
11615
- } catch (e13) {
11884
+ } catch (e15) {
11616
11885
  return String(value);
11617
11886
  }
11618
11887
  }
@@ -11771,7 +12040,7 @@ var Project2 = (_class11 = class {
11771
12040
  console.warn("publish() is a no-op when running `braintrust push`.");
11772
12041
  return;
11773
12042
  }
11774
- await _chunkXLLGRXGRjs.login.call(void 0, );
12043
+ await _chunkV32LW47Zjs.login.call(void 0, );
11775
12044
  const projectMap = new ProjectNameIdMap();
11776
12045
  const functionDefinitions = [];
11777
12046
  if (this._publishableCodeFunctions.length > 0) {
@@ -11785,7 +12054,7 @@ var Project2 = (_class11 = class {
11785
12054
  functionDefinitions.push(functionDefinition);
11786
12055
  }
11787
12056
  }
11788
- await _chunkXLLGRXGRjs._internalGetGlobalState.call(void 0, ).apiConn().post_json("insert-functions", {
12057
+ await _chunkV32LW47Zjs._internalGetGlobalState.call(void 0, ).apiConn().post_json("insert-functions", {
11789
12058
  functions: functionDefinitions
11790
12059
  });
11791
12060
  }
@@ -11804,12 +12073,12 @@ var ToolBuilder = (_class12 = class {
11804
12073
  const { handler, name, slug, parameters, returns, ...rest } = opts;
11805
12074
  let resolvedName = _nullishCoalesce(name, () => ( handler.name));
11806
12075
  if (resolvedName.trim().length === 0) {
11807
- resolvedName = `Tool ${_chunk6Z5S7VOUjs.isomorph_default.basename(currentFilename)} ${this.taskCounter}`;
12076
+ resolvedName = `Tool ${_chunk4AQGZS6Xjs.isomorph_default.basename(currentFilename)} ${this.taskCounter}`;
11808
12077
  }
11809
12078
  const tool = new CodeFunction(this.project, {
11810
12079
  handler,
11811
12080
  name: resolvedName,
11812
- slug: _nullishCoalesce(slug, () => ( _chunkXLLGRXGRjs.slugify.call(void 0, resolvedName, { lower: true, strict: true }))),
12081
+ slug: _nullishCoalesce(slug, () => ( _chunkV32LW47Zjs.slugify.call(void 0, resolvedName, { lower: true, strict: true }))),
11813
12082
  type: "tool",
11814
12083
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/consistent-type-assertions
11815
12084
  parameters,
@@ -11834,9 +12103,9 @@ var ScorerBuilder = (_class13 = class {
11834
12103
  resolvedName = opts.handler.name;
11835
12104
  }
11836
12105
  if (!resolvedName || resolvedName.trim().length === 0) {
11837
- resolvedName = `Scorer ${_chunk6Z5S7VOUjs.isomorph_default.basename(currentFilename)} ${this.taskCounter}`;
12106
+ resolvedName = `Scorer ${_chunk4AQGZS6Xjs.isomorph_default.basename(currentFilename)} ${this.taskCounter}`;
11838
12107
  }
11839
- const slug = _nullishCoalesce(opts.slug, () => ( _chunkXLLGRXGRjs.slugify.call(void 0, resolvedName, { lower: true, strict: true })));
12108
+ const slug = _nullishCoalesce(opts.slug, () => ( _chunkV32LW47Zjs.slugify.call(void 0, resolvedName, { lower: true, strict: true })));
11840
12109
  if ("handler" in opts) {
11841
12110
  const scorer = new CodeFunction(this.project, {
11842
12111
  ...opts,
@@ -11891,9 +12160,9 @@ var ClassifierBuilder = (_class14 = class {
11891
12160
  this.taskCounter++;
11892
12161
  let resolvedName = _nullishCoalesce(opts.name, () => ( opts.handler.name));
11893
12162
  if (!resolvedName || resolvedName.trim().length === 0) {
11894
- resolvedName = `Classifier ${_chunk6Z5S7VOUjs.isomorph_default.basename(currentFilename)} ${this.taskCounter}`;
12163
+ resolvedName = `Classifier ${_chunk4AQGZS6Xjs.isomorph_default.basename(currentFilename)} ${this.taskCounter}`;
11895
12164
  }
11896
- const slug = _nullishCoalesce(opts.slug, () => ( _chunkXLLGRXGRjs.slugify.call(void 0, resolvedName, { lower: true, strict: true })));
12165
+ const slug = _nullishCoalesce(opts.slug, () => ( _chunkV32LW47Zjs.slugify.call(void 0, resolvedName, { lower: true, strict: true })));
11897
12166
  const classifier = new CodeFunction(this.project, {
11898
12167
  ...opts,
11899
12168
  name: resolvedName,
@@ -12022,18 +12291,18 @@ var PromptBuilder = class {
12022
12291
  rawTools.push(tool);
12023
12292
  }
12024
12293
  }
12025
- const slug = _nullishCoalesce(opts.slug, () => ( _chunkXLLGRXGRjs.slugify.call(void 0, opts.name, { lower: true, strict: true })));
12294
+ const slug = _nullishCoalesce(opts.slug, () => ( _chunkV32LW47Zjs.slugify.call(void 0, opts.name, { lower: true, strict: true })));
12026
12295
  const promptData = promptDefinitionToPromptData(opts, rawTools);
12027
12296
  const promptRow = {
12028
12297
  id: opts.id,
12029
- _xact_id: opts.version ? _chunkXLLGRXGRjs.loadPrettyXact.call(void 0, opts.version) : void 0,
12298
+ _xact_id: opts.version ? _chunkV32LW47Zjs.loadPrettyXact.call(void 0, opts.version) : void 0,
12030
12299
  name: opts.name,
12031
12300
  slug,
12032
12301
  prompt_data: promptData,
12033
12302
  tags: opts.tags,
12034
12303
  ...this.project.id !== void 0 ? { project_id: this.project.id } : {}
12035
12304
  };
12036
- const prompt = new (0, _chunkXLLGRXGRjs.Prompt)(
12305
+ const prompt = new (0, _chunkV32LW47Zjs.Prompt)(
12037
12306
  promptRow,
12038
12307
  {},
12039
12308
  // It doesn't make sense to specify defaults here.
@@ -12088,7 +12357,7 @@ var ParametersBuilder = class {
12088
12357
  }
12089
12358
 
12090
12359
  create(opts) {
12091
- const slug = _nullishCoalesce(opts.slug, () => ( _chunkXLLGRXGRjs.slugify.call(void 0, opts.name, { lower: true, strict: true })));
12360
+ const slug = _nullishCoalesce(opts.slug, () => ( _chunkV32LW47Zjs.slugify.call(void 0, opts.name, { lower: true, strict: true })));
12092
12361
  const codeParameters = new CodeParameters(this.project, {
12093
12362
  name: opts.name,
12094
12363
  slug,
@@ -12127,7 +12396,7 @@ function serializeEvalParameterstoParametersSchema(parameters) {
12127
12396
  required.push(name);
12128
12397
  }
12129
12398
  } else {
12130
- const schemaObj = _chunkXLLGRXGRjs.zodToJsonSchema.call(void 0, value);
12399
+ const schemaObj = _chunkV32LW47Zjs.zodToJsonSchema.call(void 0, value);
12131
12400
  properties[name] = schemaObj;
12132
12401
  if (!("default" in schemaObj)) {
12133
12402
  required.push(name);
@@ -12156,11 +12425,11 @@ var ProjectNameIdMap = (_class15 = class {constructor() { _class15.prototype.__i
12156
12425
  __init31() {this.idToName = {}}
12157
12426
  async getId(projectName) {
12158
12427
  if (!(projectName in this.nameToId)) {
12159
- const response = await _chunkXLLGRXGRjs._internalGetGlobalState.call(void 0, ).appConn().post_json("api/project/register", {
12428
+ const response = await _chunkV32LW47Zjs._internalGetGlobalState.call(void 0, ).appConn().post_json("api/project/register", {
12160
12429
  project_name: projectName
12161
12430
  });
12162
12431
  const result = _v3.z.object({
12163
- project: _chunkXLLGRXGRjs.Project
12432
+ project: _chunkV32LW47Zjs.Project
12164
12433
  }).parse(response);
12165
12434
  const projectId = result.project.id;
12166
12435
  this.nameToId[projectName] = projectId;
@@ -12170,10 +12439,10 @@ var ProjectNameIdMap = (_class15 = class {constructor() { _class15.prototype.__i
12170
12439
  }
12171
12440
  async getName(projectId) {
12172
12441
  if (!(projectId in this.idToName)) {
12173
- const response = await _chunkXLLGRXGRjs._internalGetGlobalState.call(void 0, ).appConn().post_json("api/project/get", {
12442
+ const response = await _chunkV32LW47Zjs._internalGetGlobalState.call(void 0, ).appConn().post_json("api/project/get", {
12174
12443
  id: projectId
12175
12444
  });
12176
- const result = _v3.z.array(_chunkXLLGRXGRjs.Project).nonempty().parse(response);
12445
+ const result = _v3.z.array(_chunkV32LW47Zjs.Project).nonempty().parse(response);
12177
12446
  const projectName = result[0].name;
12178
12447
  this.idToName[projectId] = projectName;
12179
12448
  this.nameToId[projectName] = projectId;
@@ -12193,16 +12462,16 @@ var ProjectNameIdMap = (_class15 = class {constructor() { _class15.prototype.__i
12193
12462
  var evalBodySchema = _v3.z.object({
12194
12463
  name: _v3.z.string(),
12195
12464
  parameters: _v3.z.record(_v3.z.string(), _v3.z.unknown()).nullish(),
12196
- data: _chunkXLLGRXGRjs.RunEval.shape.data,
12465
+ data: _chunkV32LW47Zjs.RunEval.shape.data,
12197
12466
  scores: _v3.z.array(
12198
12467
  _v3.z.object({
12199
- function_id: _chunkXLLGRXGRjs.FunctionId,
12468
+ function_id: _chunkV32LW47Zjs.FunctionId,
12200
12469
  name: _v3.z.string()
12201
12470
  })
12202
12471
  ).nullish(),
12203
12472
  experiment_name: _v3.z.string().nullish(),
12204
12473
  project_id: _v3.z.string().nullish(),
12205
- parent: _chunkXLLGRXGRjs.InvokeParent.optional(),
12474
+ parent: _chunkV32LW47Zjs.InvokeParent.optional(),
12206
12475
  stream: _v3.z.boolean().optional()
12207
12476
  });
12208
12477
  var staticParametersSchema = _v3.z.record(
@@ -12210,7 +12479,7 @@ var staticParametersSchema = _v3.z.record(
12210
12479
  _v3.z.union([
12211
12480
  _v3.z.object({
12212
12481
  type: _v3.z.literal("prompt"),
12213
- default: _chunkXLLGRXGRjs.PromptData.optional(),
12482
+ default: _chunkV32LW47Zjs.PromptData.optional(),
12214
12483
  description: _v3.z.string().optional()
12215
12484
  }),
12216
12485
  _v3.z.object({
@@ -12266,7 +12535,10 @@ var evaluatorDefinitionsSchema = _v3.z.record(
12266
12535
  );
12267
12536
 
12268
12537
  // src/node/index.ts
12269
- _chunkXLLGRXGRjs.configureNode.call(void 0, );
12538
+ _chunkV32LW47Zjs.configureNode.call(void 0, );
12539
+
12540
+
12541
+
12270
12542
 
12271
12543
 
12272
12544
 
@@ -12449,4 +12721,4 @@ _chunkXLLGRXGRjs.configureNode.call(void 0, );
12449
12721
 
12450
12722
 
12451
12723
 
12452
- exports.Attachment = _chunkXLLGRXGRjs.Attachment; exports.AttachmentReference = _chunkXLLGRXGRjs.AttachmentReference; exports.BAGGAGE_HEADER = _chunkXLLGRXGRjs.BAGGAGE_HEADER; exports.BRAINTRUST_CURRENT_SPAN_STORE = _chunkXLLGRXGRjs.BRAINTRUST_CURRENT_SPAN_STORE; exports.BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME = _chunkXLLGRXGRjs.BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME; exports.BRAINTRUST_PARENT_KEY = _chunkXLLGRXGRjs.BRAINTRUST_PARENT_KEY; exports.BaseAttachment = _chunkXLLGRXGRjs.BaseAttachment; exports.BaseExperiment = BaseExperiment; exports.BatchScorer = BatchScorer; exports.BatchTask = BatchTask; exports.BraintrustLangChainCallbackHandler = _chunkXLLGRXGRjs.BraintrustLangChainCallbackHandler; exports.BraintrustMiddleware = BraintrustMiddleware; exports.BraintrustObservabilityExporter = _chunkXLLGRXGRjs.BraintrustObservabilityExporter; exports.BraintrustState = _chunkXLLGRXGRjs.BraintrustState; exports.BraintrustStream = _chunkXLLGRXGRjs.BraintrustStream; exports.CachedSpanFetcher = CachedSpanFetcher; exports.CodeFunction = CodeFunction; exports.CodePrompt = CodePrompt; exports.ContextManager = _chunkXLLGRXGRjs.ContextManager; exports.DEFAULT_FETCH_BATCH_SIZE = _chunkXLLGRXGRjs.DEFAULT_FETCH_BATCH_SIZE; exports.DEFAULT_MAX_REQUEST_SIZE = _chunkXLLGRXGRjs.DEFAULT_MAX_REQUEST_SIZE; exports.Dataset = _chunkXLLGRXGRjs.Dataset; exports.DatasetPipeline = DatasetPipeline; exports.DurableEvalMemoryStore = DurableEvalMemoryStore; exports.DurableEvalRedisStore = DurableEvalRedisStore; exports.ERR_PERMALINK = _chunkXLLGRXGRjs.ERR_PERMALINK; exports.Eval = Eval; exports.EvalResultWithSummary = EvalResultWithSummary; exports.Experiment = _chunkXLLGRXGRjs.Experiment; exports.ExternalAttachment = _chunkXLLGRXGRjs.ExternalAttachment; exports.FailedHTTPResponse = _chunkXLLGRXGRjs.FailedHTTPResponse; exports.IDGenerator = _chunkXLLGRXGRjs.IDGenerator; exports.JSONAttachment = _chunkXLLGRXGRjs.JSONAttachment; exports.LEGACY_CACHED_HEADER = _chunkXLLGRXGRjs.LEGACY_CACHED_HEADER; exports.LOGS3_OVERFLOW_REFERENCE_TYPE = _chunkXLLGRXGRjs.LOGS3_OVERFLOW_REFERENCE_TYPE; exports.LazyValue = _chunkXLLGRXGRjs.LazyValue; exports.LocalTrace = LocalTrace; exports.Logger = _chunkXLLGRXGRjs.Logger; exports.LoginInvalidOrgError = _chunkXLLGRXGRjs.LoginInvalidOrgError; exports.NOOP_SPAN = _chunkXLLGRXGRjs.NOOP_SPAN; exports.NOOP_SPAN_PERMALINK = _chunkXLLGRXGRjs.NOOP_SPAN_PERMALINK; exports.NoopSpan = _chunkXLLGRXGRjs.NoopSpan; exports.OTELIDGenerator = _chunkXLLGRXGRjs.OTELIDGenerator; exports.ObjectFetcher = _chunkXLLGRXGRjs.ObjectFetcher; exports.Project = Project2; exports.ProjectNameIdMap = ProjectNameIdMap; exports.Prompt = _chunkXLLGRXGRjs.Prompt; exports.PromptBuilder = PromptBuilder; exports.ReadonlyAttachment = _chunkXLLGRXGRjs.ReadonlyAttachment; exports.ReadonlyExperiment = _chunkXLLGRXGRjs.ReadonlyExperiment; exports.Reporter = Reporter; exports.ScorerBuilder = ScorerBuilder; exports.SpanFetcher = SpanFetcher; exports.SpanImpl = _chunkXLLGRXGRjs.SpanImpl; exports.TRACEPARENT_HEADER = _chunkXLLGRXGRjs.TRACEPARENT_HEADER; exports.TRACESTATE_HEADER = _chunkXLLGRXGRjs.TRACESTATE_HEADER; exports.TestBackgroundLogger = _chunkXLLGRXGRjs.TestBackgroundLogger; exports.ToolBuilder = ToolBuilder; exports.UUIDGenerator = _chunkXLLGRXGRjs.UUIDGenerator; exports.X_CACHED_HEADER = _chunkXLLGRXGRjs.X_CACHED_HEADER; exports._exportsForTestingOnly = _chunkXLLGRXGRjs._exportsForTestingOnly; exports._internalGetGlobalState = _chunkXLLGRXGRjs._internalGetGlobalState; exports._internalIso = _chunk6Z5S7VOUjs.isomorph_default; exports._internalSetInitialState = _chunkXLLGRXGRjs._internalSetInitialState; exports.addAzureBlobHeaders = _chunkXLLGRXGRjs.addAzureBlobHeaders; exports.agentAssertionScorer = agentAssertionScorer; exports.braintrustAISDKTelemetry = _chunkXLLGRXGRjs.braintrustAISDKTelemetry; exports.braintrustEveHook = braintrustEveHook; exports.braintrustEveInstrumentation = braintrustEveInstrumentation; exports.braintrustFlueInstrumentation = _chunkXLLGRXGRjs.braintrustFlueInstrumentation; exports.braintrustFlueObserver = _chunkXLLGRXGRjs.braintrustFlueObserver; exports.braintrustStreamChunkSchema = _chunkXLLGRXGRjs.braintrustStreamChunkSchema; exports.buildLocalSummary = buildLocalSummary; exports.collectAnthropicSession = _chunkXLLGRXGRjs.collectAnthropicSession; exports.configureInstrumentation = _chunkXLLGRXGRjs.configureInstrumentation; exports.constructLogs3OverflowRequest = _chunkXLLGRXGRjs.constructLogs3OverflowRequest; exports.createFinalValuePassThroughStream = _chunkXLLGRXGRjs.createFinalValuePassThroughStream; exports.currentExperiment = _chunkXLLGRXGRjs.currentExperiment; exports.currentLogger = _chunkXLLGRXGRjs.currentLogger; exports.currentSpan = _chunkXLLGRXGRjs.currentSpan; exports.deepCopyEvent = _chunkXLLGRXGRjs.deepCopyEvent; exports.default = exports_exports; exports.defaultErrorScoreHandler = defaultErrorScoreHandler; exports.defineDurableEval = defineDurableEval; exports.deserializePlainStringAsJSON = _chunkXLLGRXGRjs.deserializePlainStringAsJSON; exports.devNullWritableStream = _chunkXLLGRXGRjs.devNullWritableStream; exports.evaluatorDefinitionSchema = evaluatorDefinitionSchema; exports.evaluatorDefinitionsSchema = evaluatorDefinitionsSchema; exports.extractTraceContextFromHeaders = _chunkXLLGRXGRjs.extractTraceContextFromHeaders; exports.flush = _chunkXLLGRXGRjs.flush; exports.getContextManager = _chunkXLLGRXGRjs.getContextManager; exports.getIdGenerator = _chunkXLLGRXGRjs.getIdGenerator; exports.getPromptVersions = _chunkXLLGRXGRjs.getPromptVersions; exports.getSpanParentObject = _chunkXLLGRXGRjs.getSpanParentObject; exports.getTemplateRenderer = _chunkXLLGRXGRjs.getTemplateRenderer; exports.graph = graph_framework_exports; exports.init = _chunkXLLGRXGRjs.init; exports.initDataset = _chunkXLLGRXGRjs.initDataset; exports.initExperiment = _chunkXLLGRXGRjs.initExperiment; exports.initFunction = initFunction; exports.initLogger = _chunkXLLGRXGRjs.initLogger; exports.initNodeTestSuite = initNodeTestSuite; exports.injectTraceContext = _chunkXLLGRXGRjs.injectTraceContext; exports.invoke = invoke; exports.isTemplateFormat = _chunkXLLGRXGRjs.isTemplateFormat; exports.loadParameters = _chunkXLLGRXGRjs.loadParameters; exports.loadPrompt = _chunkXLLGRXGRjs.loadPrompt; exports.log = _chunkXLLGRXGRjs.log; exports.logError = _chunkXLLGRXGRjs.logError; exports.login = _chunkXLLGRXGRjs.login; exports.loginToState = _chunkXLLGRXGRjs.loginToState; exports.logs3OverflowUploadSchema = _chunkXLLGRXGRjs.logs3OverflowUploadSchema; exports.newId = _chunkXLLGRXGRjs.newId; exports.parseCachedHeader = _chunkXLLGRXGRjs.parseCachedHeader; exports.parseTemplateFormat = _chunkXLLGRXGRjs.parseTemplateFormat; exports.permalink = _chunkXLLGRXGRjs.permalink; exports.pickLogs3OverflowObjectIds = _chunkXLLGRXGRjs.pickLogs3OverflowObjectIds; exports.projects = projects; exports.promptContentsSchema = promptContentsSchema; exports.promptDefinitionSchema = promptDefinitionSchema; exports.promptDefinitionToPromptData = promptDefinitionToPromptData; exports.promptDefinitionWithToolsSchema = promptDefinitionWithToolsSchema; exports.registerOtelFlush = _chunkXLLGRXGRjs.registerOtelFlush; exports.registerSandbox = registerSandbox; exports.registerTemplatePlugin = _chunkXLLGRXGRjs.registerTemplatePlugin; exports.renderMessage = _chunkXLLGRXGRjs.renderMessage; exports.renderPromptParams = _chunkXLLGRXGRjs.renderPromptParams; exports.renderTemplateContent = _chunkXLLGRXGRjs.renderTemplateContent; exports.reportFailures = reportFailures; exports.runEvaluator = runEvaluator; exports.setFetch = _chunkXLLGRXGRjs.setFetch; exports.setMaskingFunction = _chunkXLLGRXGRjs.setMaskingFunction; exports.spanComponentsToObjectId = _chunkXLLGRXGRjs.spanComponentsToObjectId; exports.startSpan = _chunkXLLGRXGRjs.startSpan; exports.summarize = _chunkXLLGRXGRjs.summarize; exports.templateRegistry = _chunkXLLGRXGRjs.templateRegistry; exports.toolFunctionDefinitionSchema = _chunkXLLGRXGRjs.ToolFunctionDefinition; exports.traceable = _chunkXLLGRXGRjs.traceable; exports.traced = _chunkXLLGRXGRjs.traced; exports.updateSpan = _chunkXLLGRXGRjs.updateSpan; exports.uploadLogs3OverflowPayload = _chunkXLLGRXGRjs.uploadLogs3OverflowPayload; exports.utf8ByteLength = _chunkXLLGRXGRjs.utf8ByteLength; exports.withCurrent = _chunkXLLGRXGRjs.withCurrent; exports.withDataset = _chunkXLLGRXGRjs.withDataset; exports.withExperiment = _chunkXLLGRXGRjs.withExperiment; exports.withLogger = _chunkXLLGRXGRjs.withLogger; exports.withParent = _chunkXLLGRXGRjs.withParent; exports.wrapAISDK = wrapAISDK; exports.wrapAISDKModel = wrapAISDKModel; exports.wrapAgentClass = wrapAgentClass; exports.wrapAnthropic = wrapAnthropic; exports.wrapBedrockRuntime = wrapBedrockRuntime; exports.wrapClaudeAgentSDK = wrapClaudeAgentSDK; exports.wrapCloudflareAIChat = wrapCloudflareAIChat; exports.wrapCloudflareAgent = wrapCloudflareAgent; exports.wrapCloudflareThink = wrapCloudflareThink; exports.wrapCohere = wrapCohere; exports.wrapCopilotClient = wrapCopilotClient; exports.wrapCursorSDK = wrapCursorSDK; exports.wrapGenkit = wrapGenkit; exports.wrapGoogleADK = wrapGoogleADK; exports.wrapGoogleGenAI = wrapGoogleGenAI; exports.wrapGroq = wrapGroq; exports.wrapHuggingFace = wrapHuggingFace; exports.wrapHuggingFaceTransformers = wrapHuggingFaceTransformers; exports.wrapLangSmithClient = wrapLangSmithClient; exports.wrapLangSmithRunTrees = wrapLangSmithRunTrees; exports.wrapLangSmithTraceable = wrapLangSmithTraceable; exports.wrapMastraAgent = _chunkXLLGRXGRjs.wrapMastraAgent; exports.wrapMistral = wrapMistral; exports.wrapOllama = wrapOllama; exports.wrapOpenAI = wrapOpenAI; exports.wrapOpenAICodexSDK = wrapOpenAICodexSDK; exports.wrapOpenAIv4 = wrapOpenAIv4; exports.wrapOpenRouter = wrapOpenRouter; exports.wrapOpenRouterAgent = wrapOpenRouterAgent; exports.wrapPiCodingAgentSDK = wrapPiCodingAgentSDK; exports.wrapStrandsAgentSDK = wrapStrandsAgentSDK; exports.wrapTraced = _chunkXLLGRXGRjs.wrapTraced; exports.wrapVitest = wrapVitest; exports.wrapVoyageAI = wrapVoyageAI;
12724
+ exports.Attachment = _chunkV32LW47Zjs.Attachment; exports.AttachmentReference = _chunkV32LW47Zjs.AttachmentReference; exports.BAGGAGE_HEADER = _chunkV32LW47Zjs.BAGGAGE_HEADER; exports.BRAINTRUST_CURRENT_SPAN_STORE = _chunkV32LW47Zjs.BRAINTRUST_CURRENT_SPAN_STORE; exports.BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME = _chunkV32LW47Zjs.BRAINTRUST_LANGCHAIN_CALLBACK_HANDLER_NAME; exports.BRAINTRUST_PARENT_KEY = _chunkV32LW47Zjs.BRAINTRUST_PARENT_KEY; exports.BaseAttachment = _chunkV32LW47Zjs.BaseAttachment; exports.BaseExperiment = BaseExperiment; exports.BatchScorer = BatchScorer; exports.BatchTask = BatchTask; exports.BraintrustLangChainCallbackHandler = _chunkV32LW47Zjs.BraintrustLangChainCallbackHandler; exports.BraintrustMiddleware = BraintrustMiddleware; exports.BraintrustObservabilityExporter = _chunkV32LW47Zjs.BraintrustObservabilityExporter; exports.BraintrustState = _chunkV32LW47Zjs.BraintrustState; exports.BraintrustStream = _chunkV32LW47Zjs.BraintrustStream; exports.CachedSpanFetcher = CachedSpanFetcher; exports.CodeFunction = CodeFunction; exports.CodePrompt = CodePrompt; exports.ContextManager = _chunkV32LW47Zjs.ContextManager; exports.DEFAULT_FETCH_BATCH_SIZE = _chunkV32LW47Zjs.DEFAULT_FETCH_BATCH_SIZE; exports.DEFAULT_MAX_REQUEST_SIZE = _chunkV32LW47Zjs.DEFAULT_MAX_REQUEST_SIZE; exports.Dataset = _chunkV32LW47Zjs.Dataset; exports.DatasetPipeline = DatasetPipeline; exports.DurableEvalMemoryStore = DurableEvalMemoryStore; exports.DurableEvalRedisStore = DurableEvalRedisStore; exports.ERR_PERMALINK = _chunkV32LW47Zjs.ERR_PERMALINK; exports.Eval = Eval; exports.EvalResultWithSummary = EvalResultWithSummary; exports.Experiment = _chunkV32LW47Zjs.Experiment; exports.ExternalAttachment = _chunkV32LW47Zjs.ExternalAttachment; exports.FailedHTTPResponse = _chunkV32LW47Zjs.FailedHTTPResponse; exports.IDGenerator = _chunkV32LW47Zjs.IDGenerator; exports.JSONAttachment = _chunkV32LW47Zjs.JSONAttachment; exports.LEGACY_CACHED_HEADER = _chunkV32LW47Zjs.LEGACY_CACHED_HEADER; exports.LOGS3_OVERFLOW_REFERENCE_TYPE = _chunkV32LW47Zjs.LOGS3_OVERFLOW_REFERENCE_TYPE; exports.LazyValue = _chunkV32LW47Zjs.LazyValue; exports.LocalTrace = LocalTrace; exports.Logger = _chunkV32LW47Zjs.Logger; exports.LoginInvalidOrgError = _chunkV32LW47Zjs.LoginInvalidOrgError; exports.NOOP_SPAN = _chunkV32LW47Zjs.NOOP_SPAN; exports.NOOP_SPAN_PERMALINK = _chunkV32LW47Zjs.NOOP_SPAN_PERMALINK; exports.NoopSpan = _chunkV32LW47Zjs.NoopSpan; exports.OTELIDGenerator = _chunkV32LW47Zjs.OTELIDGenerator; exports.ObjectFetcher = _chunkV32LW47Zjs.ObjectFetcher; exports.Project = Project2; exports.ProjectNameIdMap = ProjectNameIdMap; exports.Prompt = _chunkV32LW47Zjs.Prompt; exports.PromptBuilder = PromptBuilder; exports.ReadonlyAttachment = _chunkV32LW47Zjs.ReadonlyAttachment; exports.ReadonlyExperiment = _chunkV32LW47Zjs.ReadonlyExperiment; exports.Reporter = Reporter; exports.ScorerBuilder = ScorerBuilder; exports.SpanFetcher = SpanFetcher; exports.SpanImpl = _chunkV32LW47Zjs.SpanImpl; exports.TRACEPARENT_HEADER = _chunkV32LW47Zjs.TRACEPARENT_HEADER; exports.TRACESTATE_HEADER = _chunkV32LW47Zjs.TRACESTATE_HEADER; exports.TestBackgroundLogger = _chunkV32LW47Zjs.TestBackgroundLogger; exports.ToolBuilder = ToolBuilder; exports.UUIDGenerator = _chunkV32LW47Zjs.UUIDGenerator; exports.X_CACHED_HEADER = _chunkV32LW47Zjs.X_CACHED_HEADER; exports._exportsForTestingOnly = _chunkV32LW47Zjs._exportsForTestingOnly; exports._internalGetGlobalState = _chunkV32LW47Zjs._internalGetGlobalState; exports._internalIso = _chunk4AQGZS6Xjs.isomorph_default; exports._internalSetInitialState = _chunkV32LW47Zjs._internalSetInitialState; exports.addAzureBlobHeaders = _chunkV32LW47Zjs.addAzureBlobHeaders; exports.agentAssertionScorer = agentAssertionScorer; exports.braintrustAISDKTelemetry = _chunkV32LW47Zjs.braintrustAISDKTelemetry; exports.braintrustEveHook = braintrustEveHook; exports.braintrustEveInstrumentation = braintrustEveInstrumentation; exports.braintrustFlueInstrumentation = _chunkV32LW47Zjs.braintrustFlueInstrumentation; exports.braintrustFlueObserver = _chunkV32LW47Zjs.braintrustFlueObserver; exports.braintrustStreamChunkSchema = _chunkV32LW47Zjs.braintrustStreamChunkSchema; exports.buildLocalSummary = buildLocalSummary; exports.collectAnthropicSession = _chunkV32LW47Zjs.collectAnthropicSession; exports.completeOpenAIBatchTrace = completeOpenAIBatchTrace; exports.configureInstrumentation = _chunkV32LW47Zjs.configureInstrumentation; exports.constructLogs3OverflowRequest = _chunkV32LW47Zjs.constructLogs3OverflowRequest; exports.createFinalValuePassThroughStream = _chunkV32LW47Zjs.createFinalValuePassThroughStream; exports.currentExperiment = _chunkV32LW47Zjs.currentExperiment; exports.currentLogger = _chunkV32LW47Zjs.currentLogger; exports.currentSpan = _chunkV32LW47Zjs.currentSpan; exports.deepCopyEvent = _chunkV32LW47Zjs.deepCopyEvent; exports.default = exports_exports; exports.defaultErrorScoreHandler = defaultErrorScoreHandler; exports.defineDurableEval = defineDurableEval; exports.deserializePlainStringAsJSON = _chunkV32LW47Zjs.deserializePlainStringAsJSON; exports.devNullWritableStream = _chunkV32LW47Zjs.devNullWritableStream; exports.evaluatorDefinitionSchema = evaluatorDefinitionSchema; exports.evaluatorDefinitionsSchema = evaluatorDefinitionsSchema; exports.extractTraceContextFromHeaders = _chunkV32LW47Zjs.extractTraceContextFromHeaders; exports.flush = _chunkV32LW47Zjs.flush; exports.getContextManager = _chunkV32LW47Zjs.getContextManager; exports.getIdGenerator = _chunkV32LW47Zjs.getIdGenerator; exports.getPromptVersions = _chunkV32LW47Zjs.getPromptVersions; exports.getSpanParentObject = _chunkV32LW47Zjs.getSpanParentObject; exports.getTemplateRenderer = _chunkV32LW47Zjs.getTemplateRenderer; exports.graph = graph_framework_exports; exports.init = _chunkV32LW47Zjs.init; exports.initDataset = _chunkV32LW47Zjs.initDataset; exports.initExperiment = _chunkV32LW47Zjs.initExperiment; exports.initFunction = initFunction; exports.initLogger = _chunkV32LW47Zjs.initLogger; exports.initNodeTestSuite = initNodeTestSuite; exports.injectTraceContext = _chunkV32LW47Zjs.injectTraceContext; exports.invoke = invoke; exports.isTemplateFormat = _chunkV32LW47Zjs.isTemplateFormat; exports.loadParameters = _chunkV32LW47Zjs.loadParameters; exports.loadPrompt = _chunkV32LW47Zjs.loadPrompt; exports.log = _chunkV32LW47Zjs.log; exports.logError = _chunkV32LW47Zjs.logError; exports.login = _chunkV32LW47Zjs.login; exports.loginToState = _chunkV32LW47Zjs.loginToState; exports.logs3OverflowUploadSchema = _chunkV32LW47Zjs.logs3OverflowUploadSchema; exports.newId = _chunkV32LW47Zjs.newId; exports.openaiBatchesRetrieveTraced = openaiBatchesRetrieveTraced; exports.openaiFilesCreateTraced = openaiFilesCreateTraced; exports.parseCachedHeader = _chunkV32LW47Zjs.parseCachedHeader; exports.parseTemplateFormat = _chunkV32LW47Zjs.parseTemplateFormat; exports.permalink = _chunkV32LW47Zjs.permalink; exports.pickLogs3OverflowObjectIds = _chunkV32LW47Zjs.pickLogs3OverflowObjectIds; exports.projects = projects; exports.promptContentsSchema = promptContentsSchema; exports.promptDefinitionSchema = promptDefinitionSchema; exports.promptDefinitionToPromptData = promptDefinitionToPromptData; exports.promptDefinitionWithToolsSchema = promptDefinitionWithToolsSchema; exports.registerOtelFlush = _chunkV32LW47Zjs.registerOtelFlush; exports.registerSandbox = registerSandbox; exports.registerTemplatePlugin = _chunkV32LW47Zjs.registerTemplatePlugin; exports.renderMessage = _chunkV32LW47Zjs.renderMessage; exports.renderPromptParams = _chunkV32LW47Zjs.renderPromptParams; exports.renderTemplateContent = _chunkV32LW47Zjs.renderTemplateContent; exports.reportFailures = reportFailures; exports.runEvaluator = runEvaluator; exports.setFetch = _chunkV32LW47Zjs.setFetch; exports.setMaskingFunction = _chunkV32LW47Zjs.setMaskingFunction; exports.spanComponentsToObjectId = _chunkV32LW47Zjs.spanComponentsToObjectId; exports.startSpan = _chunkV32LW47Zjs.startSpan; exports.summarize = _chunkV32LW47Zjs.summarize; exports.templateRegistry = _chunkV32LW47Zjs.templateRegistry; exports.toolFunctionDefinitionSchema = _chunkV32LW47Zjs.ToolFunctionDefinition; exports.traceable = _chunkV32LW47Zjs.traceable; exports.traced = _chunkV32LW47Zjs.traced; exports.updateSpan = _chunkV32LW47Zjs.updateSpan; exports.uploadLogs3OverflowPayload = _chunkV32LW47Zjs.uploadLogs3OverflowPayload; exports.utf8ByteLength = _chunkV32LW47Zjs.utf8ByteLength; exports.withCurrent = _chunkV32LW47Zjs.withCurrent; exports.withDataset = _chunkV32LW47Zjs.withDataset; exports.withExperiment = _chunkV32LW47Zjs.withExperiment; exports.withLogger = _chunkV32LW47Zjs.withLogger; exports.withParent = _chunkV32LW47Zjs.withParent; exports.wrapAISDK = wrapAISDK; exports.wrapAISDKModel = wrapAISDKModel; exports.wrapAgentClass = wrapAgentClass; exports.wrapAnthropic = wrapAnthropic; exports.wrapBedrockRuntime = wrapBedrockRuntime; exports.wrapClaudeAgentSDK = wrapClaudeAgentSDK; exports.wrapCloudflareAIChat = wrapCloudflareAIChat; exports.wrapCloudflareAgent = wrapCloudflareAgent; exports.wrapCloudflareThink = wrapCloudflareThink; exports.wrapCohere = wrapCohere; exports.wrapCopilotClient = wrapCopilotClient; exports.wrapCursorSDK = wrapCursorSDK; exports.wrapGenkit = wrapGenkit; exports.wrapGoogleADK = wrapGoogleADK; exports.wrapGoogleGenAI = wrapGoogleGenAI; exports.wrapGroq = wrapGroq; exports.wrapHuggingFace = wrapHuggingFace; exports.wrapHuggingFaceTransformers = wrapHuggingFaceTransformers; exports.wrapLangSmithClient = wrapLangSmithClient; exports.wrapLangSmithRunTrees = wrapLangSmithRunTrees; exports.wrapLangSmithTraceable = wrapLangSmithTraceable; exports.wrapMastraAgent = _chunkV32LW47Zjs.wrapMastraAgent; exports.wrapMistral = wrapMistral; exports.wrapOllama = wrapOllama; exports.wrapOpenAI = wrapOpenAI; exports.wrapOpenAICodexSDK = wrapOpenAICodexSDK; exports.wrapOpenAIv4 = wrapOpenAIv4; exports.wrapOpenRouter = wrapOpenRouter; exports.wrapOpenRouterAgent = wrapOpenRouterAgent; exports.wrapPiCodingAgentSDK = wrapPiCodingAgentSDK; exports.wrapStrandsAgentSDK = wrapStrandsAgentSDK; exports.wrapTraced = _chunkV32LW47Zjs.wrapTraced; exports.wrapVitest = wrapVitest; exports.wrapVoyageAI = wrapVoyageAI;