braintrust 0.3.7 → 0.4.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.
package/dist/index.d.mts CHANGED
@@ -1,6 +1,48 @@
1
1
  import { z } from 'zod/v3';
2
2
  import { z as z$1 } from 'zod';
3
3
 
4
+ /**
5
+ * Abstract base class for ID generators
6
+ */
7
+ declare abstract class IDGenerator {
8
+ /**
9
+ * Generate a span ID
10
+ */
11
+ abstract getSpanId(): string;
12
+ /**
13
+ * Generate a trace ID
14
+ */
15
+ abstract getTraceId(): string;
16
+ /**
17
+ * Return true if the generator should use span_id as root_span_id for backwards compatibility
18
+ */
19
+ abstract shareRootSpanId(): boolean;
20
+ }
21
+ /**
22
+ * ID generator that uses UUID4 for both span and trace IDs
23
+ */
24
+ declare class UUIDGenerator extends IDGenerator {
25
+ getSpanId(): string;
26
+ getTraceId(): string;
27
+ shareRootSpanId(): boolean;
28
+ }
29
+ /**
30
+ * ID generator that generates OpenTelemetry-compatible IDs
31
+ * Uses hex strings for compatibility with OpenTelemetry systems
32
+ */
33
+ declare class OTELIDGenerator extends IDGenerator {
34
+ getSpanId(): string;
35
+ getTraceId(): string;
36
+ shareRootSpanId(): boolean;
37
+ }
38
+ /**
39
+ * Factory function that creates a new ID generator instance each time.
40
+ *
41
+ * This eliminates global state and makes tests parallelizable.
42
+ * Each caller gets their own generator instance.
43
+ */
44
+ declare function getIdGenerator(): IDGenerator;
45
+
4
46
  declare const TRANSACTION_ID_FIELD = "_xact_id";
5
47
  declare const IS_MERGE_FIELD = "_is_merge";
6
48
  declare const MERGE_PATHS_FIELD = "_merge_paths";
@@ -14456,6 +14498,7 @@ declare class NoopSpan implements Span$1 {
14456
14498
  setAttributes(_args: Omit<StartSpanArgs, "event">): void;
14457
14499
  startSpanWithParents(_spanId: string, _spanParents: string[], _args?: StartSpanArgs): Span$1;
14458
14500
  state(): BraintrustState;
14501
+ toString(): string;
14459
14502
  }
14460
14503
  declare const NOOP_SPAN: NoopSpan;
14461
14504
  declare const NOOP_SPAN_PERMALINK = "https://braintrust.dev/noop-span";
@@ -14529,8 +14572,11 @@ declare class BraintrustState {
14529
14572
  private _apiConn;
14530
14573
  private _proxyConn;
14531
14574
  promptCache: PromptCache;
14575
+ private _idGenerator;
14532
14576
  constructor(loginParams: LoginOptions);
14533
14577
  resetLoginInfo(): void;
14578
+ resetIdGenState(): void;
14579
+ get idGenerator(): IDGenerator;
14534
14580
  copyLoginInfo(other: BraintrustState): void;
14535
14581
  serialize(): SerializedBraintrustState;
14536
14582
  static deserialize(serialized: unknown, opts?: LoginOptions): BraintrustState;
@@ -14548,6 +14594,8 @@ declare class BraintrustState {
14548
14594
  loginReplaceApiConn(apiConn: HTTPConnection): void;
14549
14595
  disable(): void;
14550
14596
  enforceQueueSizeLimit(enforce: boolean): void;
14597
+ toJSON(): Record<string, any>;
14598
+ toString(): string;
14551
14599
  }
14552
14600
  declare function useTestBackgroundLogger(): TestBackgroundLogger;
14553
14601
  declare function clearTestBackgroundLogger(): void;
@@ -14584,6 +14632,7 @@ declare class HTTPConnection {
14584
14632
  post(path: string, params?: Record<string, unknown> | string, config?: RequestInit): Promise<Response>;
14585
14633
  get_json(object_type: string, args?: Record<string, string | string[] | undefined> | undefined, retries?: number): Promise<any>;
14586
14634
  post_json(object_type: string, args?: Record<string, unknown> | string | undefined): Promise<any>;
14635
+ toString(): string;
14587
14636
  }
14588
14637
  interface ObjectMetadata {
14589
14638
  id: string;
@@ -15567,6 +15616,7 @@ declare class SpanImpl implements Span$1 {
15567
15616
  flush(): Promise<void>;
15568
15617
  close(args?: EndSpanArgs): number;
15569
15618
  state(): BraintrustState;
15619
+ toString(): string;
15570
15620
  }
15571
15621
  /**
15572
15622
  * A dataset is a collection of records, such as model inputs and expected outputs, which represent
@@ -15838,6 +15888,7 @@ declare function simulateLogoutForTests(): BraintrustState;
15838
15888
  * @returns Promise containing the version data
15839
15889
  */
15840
15890
  declare function getPromptVersions(projectId: string, promptId: string): Promise<any>;
15891
+ declare function resetIdGenStateForTests(): void;
15841
15892
  declare const _exportsForTestingOnly: {
15842
15893
  extractAttachments: typeof extractAttachments;
15843
15894
  deepCopyEvent: typeof deepCopyEvent;
@@ -15849,6 +15900,7 @@ declare const _exportsForTestingOnly: {
15849
15900
  initTestExperiment: typeof initTestExperiment;
15850
15901
  isGeneratorFunction: typeof isGeneratorFunction;
15851
15902
  isAsyncGeneratorFunction: typeof isAsyncGeneratorFunction;
15903
+ resetIdGenStateForTests: typeof resetIdGenStateForTests;
15852
15904
  };
15853
15905
 
15854
15906
  declare const braintrustStreamChunkSchema: z.ZodUnion<[z.ZodObject<{
@@ -21236,6 +21288,44 @@ declare function wrapAISDK<T extends AISDKMethods>(ai: T): {
21236
21288
  streamObject: T["streamObject"];
21237
21289
  };
21238
21290
 
21291
+ interface MastraAgentMethods {
21292
+ name?: string;
21293
+ tools?: Record<string, unknown> | unknown[];
21294
+ model?: any;
21295
+ __setTools(tools: Record<string, unknown> | unknown[]): void;
21296
+ generateVNext?: (params: any) => any;
21297
+ streamVNext?: (params: any) => any;
21298
+ }
21299
+ /**
21300
+ * Wraps a Mastra agent with Braintrust tracing. This function wraps the agent's
21301
+ * underlying language model with BraintrustMiddleware and traces all agent method calls.
21302
+ *
21303
+ * **Important**: This wrapper only supports AI SDK v5 methods such as `generateVNext` and `streamVNext`.
21304
+ *
21305
+ * @param agent - The Mastra agent to wrap
21306
+ * @param options - Optional configuration for the wrapper
21307
+ * @returns The wrapped agent with Braintrust tracing
21308
+ *
21309
+ * @example
21310
+ * ```typescript
21311
+ * import { wrapMastraAgent } from "braintrust";
21312
+ * import { Agent } from "@mastra/core/agent";
21313
+ * import { openai } from "@ai-sdk/openai";
21314
+ *
21315
+ * const agent = new Agent({
21316
+ * name: "Assistant",
21317
+ * model: openai("gpt-4"),
21318
+ * instructions: "You are a helpful assistant."
21319
+ * });
21320
+ *
21321
+ * const wrappedAgent = wrapMastraAgent(agent);
21322
+ * ```
21323
+ */
21324
+ declare function wrapMastraAgent<T extends MastraAgentMethods>(agent: T, options?: {
21325
+ name?: string;
21326
+ span_name?: string;
21327
+ }): T;
21328
+
21239
21329
  /**
21240
21330
  * Wrap an `Anthropic` object (created with `new Anthropic(...)`) to add tracing. If Braintrust is
21241
21331
  * not configured, nothing will be traced. If this is not an `Anthropic` object, this function is
@@ -21248,6 +21338,35 @@ declare function wrapAISDK<T extends AISDKMethods>(ai: T): {
21248
21338
  */
21249
21339
  declare function wrapAnthropic<T extends object>(anthropic: T): T;
21250
21340
 
21341
+ /**
21342
+ * Wraps the Claude Agent SDK with Braintrust tracing. This returns wrapped versions
21343
+ * of query and tool that automatically trace all agent interactions.
21344
+ *
21345
+ * @param sdk - The Claude Agent SDK module
21346
+ * @returns Object with wrapped query, tool, and createSdkMcpServer functions
21347
+ *
21348
+ * @example
21349
+ * ```typescript
21350
+ * import * as claudeSDK from "@anthropic-ai/claude-agent-sdk";
21351
+ * import { wrapClaudeAgentSDK } from "braintrust";
21352
+ *
21353
+ * // Wrap once - returns { query, tool, createSdkMcpServer } with tracing built-in
21354
+ * const { query, tool, createSdkMcpServer } = wrapClaudeAgentSDK(claudeSDK);
21355
+ *
21356
+ * // Use normally - tracing is automatic
21357
+ * for await (const message of query({
21358
+ * prompt: "Hello, Claude!",
21359
+ * options: { model: "claude-3-5-sonnet-20241022" }
21360
+ * })) {
21361
+ * console.log(message);
21362
+ * }
21363
+ *
21364
+ * // Tools created with wrapped tool() are automatically traced
21365
+ * const calculator = tool("calculator", "Does math", schema, handler);
21366
+ * ```
21367
+ */
21368
+ declare function wrapClaudeAgentSDK<T extends object>(sdk: T): T;
21369
+
21251
21370
  interface Context {
21252
21371
  [key: string]: any;
21253
21372
  }
@@ -21539,6 +21658,8 @@ declare const braintrust_FailedHTTPResponse: typeof FailedHTTPResponse;
21539
21658
  type braintrust_FullInitOptions<IsOpen extends boolean> = FullInitOptions<IsOpen>;
21540
21659
  type braintrust_FullLoginOptions = FullLoginOptions;
21541
21660
  type braintrust_FunctionEvent = FunctionEvent;
21661
+ type braintrust_IDGenerator = IDGenerator;
21662
+ declare const braintrust_IDGenerator: typeof IDGenerator;
21542
21663
  declare const braintrust_INTERNAL_BTQL_LIMIT: typeof INTERNAL_BTQL_LIMIT;
21543
21664
  type braintrust_InitOptions<IsOpen extends boolean> = InitOptions<IsOpen>;
21544
21665
  type braintrust_InvokeFunctionArgs<Input, Output, Stream extends boolean = false> = InvokeFunctionArgs<Input, Output, Stream>;
@@ -21555,6 +21676,8 @@ declare const braintrust_NOOP_SPAN: typeof NOOP_SPAN;
21555
21676
  declare const braintrust_NOOP_SPAN_PERMALINK: typeof NOOP_SPAN_PERMALINK;
21556
21677
  type braintrust_NoopSpan = NoopSpan;
21557
21678
  declare const braintrust_NoopSpan: typeof NoopSpan;
21679
+ type braintrust_OTELIDGenerator = OTELIDGenerator;
21680
+ declare const braintrust_OTELIDGenerator: typeof OTELIDGenerator;
21558
21681
  type braintrust_ObjectMetadata = ObjectMetadata;
21559
21682
  type braintrust_Project = Project;
21560
21683
  declare const braintrust_Project: typeof Project;
@@ -21590,6 +21713,8 @@ type braintrust_TestBackgroundLogger = TestBackgroundLogger;
21590
21713
  declare const braintrust_TestBackgroundLogger: typeof TestBackgroundLogger;
21591
21714
  type braintrust_ToolBuilder = ToolBuilder;
21592
21715
  declare const braintrust_ToolBuilder: typeof ToolBuilder;
21716
+ type braintrust_UUIDGenerator = UUIDGenerator;
21717
+ declare const braintrust_UUIDGenerator: typeof UUIDGenerator;
21593
21718
  type braintrust_WithTransactionId<R> = WithTransactionId<R>;
21594
21719
  declare const braintrust_X_CACHED_HEADER: typeof X_CACHED_HEADER;
21595
21720
  declare const braintrust__exportsForTestingOnly: typeof _exportsForTestingOnly;
@@ -21601,10 +21726,12 @@ declare const braintrust_createFinalValuePassThroughStream: typeof createFinalVa
21601
21726
  declare const braintrust_currentExperiment: typeof currentExperiment;
21602
21727
  declare const braintrust_currentLogger: typeof currentLogger;
21603
21728
  declare const braintrust_currentSpan: typeof currentSpan;
21729
+ declare const braintrust_deepCopyEvent: typeof deepCopyEvent;
21604
21730
  declare const braintrust_defaultErrorScoreHandler: typeof defaultErrorScoreHandler;
21605
21731
  declare const braintrust_deserializePlainStringAsJSON: typeof deserializePlainStringAsJSON;
21606
21732
  declare const braintrust_devNullWritableStream: typeof devNullWritableStream;
21607
21733
  declare const braintrust_flush: typeof flush;
21734
+ declare const braintrust_getIdGenerator: typeof getIdGenerator;
21608
21735
  declare const braintrust_getPromptVersions: typeof getPromptVersions;
21609
21736
  declare const braintrust_getSpanParentObject: typeof getSpanParentObject;
21610
21737
  declare const braintrust_init: typeof init;
@@ -21646,11 +21773,13 @@ declare const braintrust_withParent: typeof withParent;
21646
21773
  declare const braintrust_wrapAISDK: typeof wrapAISDK;
21647
21774
  declare const braintrust_wrapAISDKModel: typeof wrapAISDKModel;
21648
21775
  declare const braintrust_wrapAnthropic: typeof wrapAnthropic;
21776
+ declare const braintrust_wrapClaudeAgentSDK: typeof wrapClaudeAgentSDK;
21777
+ declare const braintrust_wrapMastraAgent: typeof wrapMastraAgent;
21649
21778
  declare const braintrust_wrapOpenAI: typeof wrapOpenAI;
21650
21779
  declare const braintrust_wrapOpenAIv4: typeof wrapOpenAIv4;
21651
21780
  declare const braintrust_wrapTraced: typeof wrapTraced;
21652
21781
  declare namespace braintrust {
21653
- export { braintrust_AISpanProcessor as AISpanProcessor, type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, braintrust_BaseAttachment as BaseAttachment, braintrust_BaseExperiment as BaseExperiment, type braintrust_BaseMetadata as BaseMetadata, braintrust_BraintrustExporter as BraintrustExporter, braintrust_BraintrustMiddleware as BraintrustMiddleware, braintrust_BraintrustSpanProcessor as BraintrustSpanProcessor, braintrust_BraintrustState as BraintrustState, braintrust_BraintrustStream as BraintrustStream, type braintrust_BraintrustStreamChunk as BraintrustStreamChunk, type braintrust_ChatPrompt as ChatPrompt, braintrust_CodeFunction as CodeFunction, type braintrust_CodeOpts as CodeOpts, braintrust_CodePrompt as CodePrompt, type braintrust_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, type braintrust_CreateProjectOpts as CreateProjectOpts, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, braintrust_ERR_PERMALINK as ERR_PERMALINK, type braintrust_EndSpanArgs as EndSpanArgs, braintrust_Eval as Eval, type braintrust_EvalCase as EvalCase, type braintrust_EvalHooks as EvalHooks, type braintrust_EvalResult as EvalResult, braintrust_EvalResultWithSummary as EvalResultWithSummary, type braintrust_EvalScorer as EvalScorer, type braintrust_EvalScorerArgs as EvalScorerArgs, type braintrust_EvalTask as EvalTask, type braintrust_Evaluator as Evaluator, type braintrust_EvaluatorDef as EvaluatorDef, type braintrust_EvaluatorFile as EvaluatorFile, braintrust_Experiment as Experiment, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_ExternalAttachment as ExternalAttachment, type braintrust_ExternalAttachmentParams as ExternalAttachmentParams, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, type braintrust_FunctionEvent as FunctionEvent, braintrust_INTERNAL_BTQL_LIMIT as INTERNAL_BTQL_LIMIT, type braintrust_InitOptions as InitOptions, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, braintrust_LazyValue as LazyValue, type braintrust_LogOptions as LogOptions, braintrust_Logger as Logger, type braintrust_LoginOptions as LoginOptions, type braintrust_MetricSummary as MetricSummary, braintrust_NOOP_SPAN as NOOP_SPAN, braintrust_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, braintrust_NoopSpan as NoopSpan, type braintrust_ObjectMetadata as ObjectMetadata, braintrust_Project as Project, braintrust_ProjectNameIdMap as ProjectNameIdMap, type braintrust_PromiseUnless as PromiseUnless, braintrust_Prompt as Prompt, braintrust_PromptBuilder as PromptBuilder, type braintrust_PromptContents as PromptContents, type braintrust_PromptDefinition as PromptDefinition, type braintrust_PromptDefinitionWithTools as PromptDefinitionWithTools, type braintrust_PromptOpts as PromptOpts, type braintrust_PromptRowWithId as PromptRowWithId, braintrust_ReadonlyAttachment as ReadonlyAttachment, braintrust_ReadonlyExperiment as ReadonlyExperiment, braintrust_Reporter as Reporter, type braintrust_ReporterBody as ReporterBody, type braintrust_ScoreSummary as ScoreSummary, braintrust_ScorerBuilder as ScorerBuilder, type braintrust_ScorerOpts as ScorerOpts, type braintrust_SerializedBraintrustState as SerializedBraintrustState, type braintrust_SetCurrentArg as SetCurrentArg, type Span$1 as Span, type braintrust_SpanContext as SpanContext, braintrust_SpanImpl as SpanImpl, type braintrust_StartSpanArgs as StartSpanArgs, braintrust_TestBackgroundLogger as TestBackgroundLogger, braintrust_ToolBuilder as ToolBuilder, type braintrust_WithTransactionId as WithTransactionId, braintrust_X_CACHED_HEADER as X_CACHED_HEADER, braintrust__exportsForTestingOnly as _exportsForTestingOnly, braintrust__internalGetGlobalState as _internalGetGlobalState, braintrust__internalSetInitialState as _internalSetInitialState, braintrust_braintrustStreamChunkSchema as braintrustStreamChunkSchema, braintrust_buildLocalSummary as buildLocalSummary, braintrust_createFinalValuePassThroughStream as createFinalValuePassThroughStream, braintrust_currentExperiment as currentExperiment, braintrust_currentLogger as currentLogger, braintrust_currentSpan as currentSpan, braintrust_defaultErrorScoreHandler as defaultErrorScoreHandler, braintrust_deserializePlainStringAsJSON as deserializePlainStringAsJSON, braintrust_devNullWritableStream as devNullWritableStream, braintrust_flush as flush, braintrust_getPromptVersions as getPromptVersions, braintrust_getSpanParentObject as getSpanParentObject, graphFramework as graph, braintrust_init as init, braintrust_initDataset as initDataset, braintrust_initExperiment as initExperiment, braintrust_initFunction as initFunction, braintrust_initLogger as initLogger, braintrust_invoke as invoke, braintrust_loadPrompt as loadPrompt, braintrust_log as log, braintrust_logError as logError, braintrust_login as login, braintrust_loginToState as loginToState, braintrust_newId as newId, braintrust_parseCachedHeader as parseCachedHeader, braintrust_permalink as permalink, braintrust_projects as projects, braintrust_promptContentsSchema as promptContentsSchema, braintrust_promptDefinitionSchema as promptDefinitionSchema, braintrust_promptDefinitionToPromptData as promptDefinitionToPromptData, braintrust_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, braintrust_renderMessage as renderMessage, braintrust_renderPromptParams as renderPromptParams, braintrust_reportFailures as reportFailures, braintrust_runEvaluator as runEvaluator, braintrust_setFetch as setFetch, braintrust_setMaskingFunction as setMaskingFunction, braintrust_spanComponentsToObjectId as spanComponentsToObjectId, braintrust_startSpan as startSpan, braintrust_summarize as summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, braintrust_traceable as traceable, braintrust_traced as traced, braintrust_updateSpan as updateSpan, braintrust_withCurrent as withCurrent, braintrust_withDataset as withDataset, braintrust_withExperiment as withExperiment, braintrust_withLogger as withLogger, braintrust_withParent as withParent, braintrust_wrapAISDK as wrapAISDK, braintrust_wrapAISDKModel as wrapAISDKModel, braintrust_wrapAnthropic as wrapAnthropic, braintrust_wrapOpenAI as wrapOpenAI, braintrust_wrapOpenAIv4 as wrapOpenAIv4, braintrust_wrapTraced as wrapTraced };
21782
+ export { braintrust_AISpanProcessor as AISpanProcessor, type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, braintrust_BaseAttachment as BaseAttachment, braintrust_BaseExperiment as BaseExperiment, type braintrust_BaseMetadata as BaseMetadata, braintrust_BraintrustExporter as BraintrustExporter, braintrust_BraintrustMiddleware as BraintrustMiddleware, braintrust_BraintrustSpanProcessor as BraintrustSpanProcessor, braintrust_BraintrustState as BraintrustState, braintrust_BraintrustStream as BraintrustStream, type braintrust_BraintrustStreamChunk as BraintrustStreamChunk, type braintrust_ChatPrompt as ChatPrompt, braintrust_CodeFunction as CodeFunction, type braintrust_CodeOpts as CodeOpts, braintrust_CodePrompt as CodePrompt, type braintrust_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, type braintrust_CreateProjectOpts as CreateProjectOpts, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, braintrust_ERR_PERMALINK as ERR_PERMALINK, type braintrust_EndSpanArgs as EndSpanArgs, braintrust_Eval as Eval, type braintrust_EvalCase as EvalCase, type braintrust_EvalHooks as EvalHooks, type braintrust_EvalResult as EvalResult, braintrust_EvalResultWithSummary as EvalResultWithSummary, type braintrust_EvalScorer as EvalScorer, type braintrust_EvalScorerArgs as EvalScorerArgs, type braintrust_EvalTask as EvalTask, type braintrust_Evaluator as Evaluator, type braintrust_EvaluatorDef as EvaluatorDef, type braintrust_EvaluatorFile as EvaluatorFile, braintrust_Experiment as Experiment, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_ExternalAttachment as ExternalAttachment, type braintrust_ExternalAttachmentParams as ExternalAttachmentParams, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, type braintrust_FunctionEvent as FunctionEvent, braintrust_IDGenerator as IDGenerator, braintrust_INTERNAL_BTQL_LIMIT as INTERNAL_BTQL_LIMIT, type braintrust_InitOptions as InitOptions, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, braintrust_LazyValue as LazyValue, type braintrust_LogOptions as LogOptions, braintrust_Logger as Logger, type braintrust_LoginOptions as LoginOptions, type braintrust_MetricSummary as MetricSummary, braintrust_NOOP_SPAN as NOOP_SPAN, braintrust_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, braintrust_NoopSpan as NoopSpan, braintrust_OTELIDGenerator as OTELIDGenerator, type braintrust_ObjectMetadata as ObjectMetadata, braintrust_Project as Project, braintrust_ProjectNameIdMap as ProjectNameIdMap, type braintrust_PromiseUnless as PromiseUnless, braintrust_Prompt as Prompt, braintrust_PromptBuilder as PromptBuilder, type braintrust_PromptContents as PromptContents, type braintrust_PromptDefinition as PromptDefinition, type braintrust_PromptDefinitionWithTools as PromptDefinitionWithTools, type braintrust_PromptOpts as PromptOpts, type braintrust_PromptRowWithId as PromptRowWithId, braintrust_ReadonlyAttachment as ReadonlyAttachment, braintrust_ReadonlyExperiment as ReadonlyExperiment, braintrust_Reporter as Reporter, type braintrust_ReporterBody as ReporterBody, type braintrust_ScoreSummary as ScoreSummary, braintrust_ScorerBuilder as ScorerBuilder, type braintrust_ScorerOpts as ScorerOpts, type braintrust_SerializedBraintrustState as SerializedBraintrustState, type braintrust_SetCurrentArg as SetCurrentArg, type Span$1 as Span, type braintrust_SpanContext as SpanContext, braintrust_SpanImpl as SpanImpl, type braintrust_StartSpanArgs as StartSpanArgs, braintrust_TestBackgroundLogger as TestBackgroundLogger, braintrust_ToolBuilder as ToolBuilder, braintrust_UUIDGenerator as UUIDGenerator, type braintrust_WithTransactionId as WithTransactionId, braintrust_X_CACHED_HEADER as X_CACHED_HEADER, braintrust__exportsForTestingOnly as _exportsForTestingOnly, braintrust__internalGetGlobalState as _internalGetGlobalState, braintrust__internalSetInitialState as _internalSetInitialState, braintrust_braintrustStreamChunkSchema as braintrustStreamChunkSchema, braintrust_buildLocalSummary as buildLocalSummary, braintrust_createFinalValuePassThroughStream as createFinalValuePassThroughStream, braintrust_currentExperiment as currentExperiment, braintrust_currentLogger as currentLogger, braintrust_currentSpan as currentSpan, braintrust_deepCopyEvent as deepCopyEvent, braintrust_defaultErrorScoreHandler as defaultErrorScoreHandler, braintrust_deserializePlainStringAsJSON as deserializePlainStringAsJSON, braintrust_devNullWritableStream as devNullWritableStream, braintrust_flush as flush, braintrust_getIdGenerator as getIdGenerator, braintrust_getPromptVersions as getPromptVersions, braintrust_getSpanParentObject as getSpanParentObject, graphFramework as graph, braintrust_init as init, braintrust_initDataset as initDataset, braintrust_initExperiment as initExperiment, braintrust_initFunction as initFunction, braintrust_initLogger as initLogger, braintrust_invoke as invoke, braintrust_loadPrompt as loadPrompt, braintrust_log as log, braintrust_logError as logError, braintrust_login as login, braintrust_loginToState as loginToState, braintrust_newId as newId, braintrust_parseCachedHeader as parseCachedHeader, braintrust_permalink as permalink, braintrust_projects as projects, braintrust_promptContentsSchema as promptContentsSchema, braintrust_promptDefinitionSchema as promptDefinitionSchema, braintrust_promptDefinitionToPromptData as promptDefinitionToPromptData, braintrust_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, braintrust_renderMessage as renderMessage, braintrust_renderPromptParams as renderPromptParams, braintrust_reportFailures as reportFailures, braintrust_runEvaluator as runEvaluator, braintrust_setFetch as setFetch, braintrust_setMaskingFunction as setMaskingFunction, braintrust_spanComponentsToObjectId as spanComponentsToObjectId, braintrust_startSpan as startSpan, braintrust_summarize as summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, braintrust_traceable as traceable, braintrust_traced as traced, braintrust_updateSpan as updateSpan, braintrust_withCurrent as withCurrent, braintrust_withDataset as withDataset, braintrust_withExperiment as withExperiment, braintrust_withLogger as withLogger, braintrust_withParent as withParent, braintrust_wrapAISDK as wrapAISDK, braintrust_wrapAISDKModel as wrapAISDKModel, braintrust_wrapAnthropic as wrapAnthropic, braintrust_wrapClaudeAgentSDK as wrapClaudeAgentSDK, braintrust_wrapMastraAgent as wrapMastraAgent, braintrust_wrapOpenAI as wrapOpenAI, braintrust_wrapOpenAIv4 as wrapOpenAIv4, braintrust_wrapTraced as wrapTraced };
21654
21783
  }
21655
21784
 
21656
21785
  type EvaluatorManifest = Record<string, EvaluatorDef<unknown, unknown, unknown, BaseMetadata>>;
@@ -28707,4 +28836,4 @@ type EvaluatorDefinitions = z.infer<typeof evaluatorDefinitionsSchema>;
28707
28836
  * @module braintrust
28708
28837
  */
28709
28838
 
28710
- export { AISpanProcessor, type AnyDataset, Attachment, type AttachmentParams, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BraintrustExporter, BraintrustMiddleware, BraintrustSpanProcessor, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, type CreateProjectOpts, type DataSummary, Dataset, type DatasetRecord, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalHooks, type EvalParameterSerializedSchema, type EvalParameters, type EvalResult, EvalResultWithSummary, type EvalScorer, type EvalScorerArgs, type EvalTask, type Evaluator, type EvaluatorDef, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorFile, type EvaluatorManifest, Experiment, type ExperimentLogFullArgs, type ExperimentLogPartialArgs, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, type FunctionEvent, INTERNAL_BTQL_LIMIT, type IdField, type InitOptions, type InputField, type InvokeFunctionArgs, type InvokeReturn, LEGACY_CACHED_HEADER, LazyValue, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, type ObjectMetadata, type OtherExperimentLogFields, type ParentExperimentIds, type ParentProjectLogIds, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, Reporter, type ReporterBody, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span$1 as Span, type SpanContext, SpanImpl, type StartSpanArgs, TestBackgroundLogger, ToolBuilder, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, buildLocalSummary, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, braintrust as default, defaultErrorScoreHandler, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getPromptVersions, getSpanParentObject, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, renderMessage, renderPromptParams, reportFailures, runEvaluator, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDK, wrapAISDKModel, wrapAnthropic, wrapOpenAI, wrapOpenAIv4, wrapTraced };
28839
+ export { AISpanProcessor, type AnyDataset, Attachment, type AttachmentParams, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BraintrustExporter, BraintrustMiddleware, BraintrustSpanProcessor, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, type CreateProjectOpts, type DataSummary, Dataset, type DatasetRecord, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalHooks, type EvalParameterSerializedSchema, type EvalParameters, type EvalResult, EvalResultWithSummary, type EvalScorer, type EvalScorerArgs, type EvalTask, type Evaluator, type EvaluatorDef, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorFile, type EvaluatorManifest, Experiment, type ExperimentLogFullArgs, type ExperimentLogPartialArgs, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, type FunctionEvent, IDGenerator, INTERNAL_BTQL_LIMIT, type IdField, type InitOptions, type InputField, type InvokeFunctionArgs, type InvokeReturn, LEGACY_CACHED_HEADER, LazyValue, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, OTELIDGenerator, type ObjectMetadata, type OtherExperimentLogFields, type ParentExperimentIds, type ParentProjectLogIds, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, Reporter, type ReporterBody, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span$1 as Span, type SpanContext, SpanImpl, type StartSpanArgs, TestBackgroundLogger, ToolBuilder, UUIDGenerator, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, buildLocalSummary, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, deepCopyEvent, braintrust as default, defaultErrorScoreHandler, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getIdGenerator, getPromptVersions, getSpanParentObject, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, renderMessage, renderPromptParams, reportFailures, runEvaluator, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDK, wrapAISDKModel, wrapAnthropic, wrapClaudeAgentSDK, wrapMastraAgent, wrapOpenAI, wrapOpenAIv4, wrapTraced };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,48 @@
1
1
  import { z } from 'zod/v3';
2
2
  import { z as z$1 } from 'zod';
3
3
 
4
+ /**
5
+ * Abstract base class for ID generators
6
+ */
7
+ declare abstract class IDGenerator {
8
+ /**
9
+ * Generate a span ID
10
+ */
11
+ abstract getSpanId(): string;
12
+ /**
13
+ * Generate a trace ID
14
+ */
15
+ abstract getTraceId(): string;
16
+ /**
17
+ * Return true if the generator should use span_id as root_span_id for backwards compatibility
18
+ */
19
+ abstract shareRootSpanId(): boolean;
20
+ }
21
+ /**
22
+ * ID generator that uses UUID4 for both span and trace IDs
23
+ */
24
+ declare class UUIDGenerator extends IDGenerator {
25
+ getSpanId(): string;
26
+ getTraceId(): string;
27
+ shareRootSpanId(): boolean;
28
+ }
29
+ /**
30
+ * ID generator that generates OpenTelemetry-compatible IDs
31
+ * Uses hex strings for compatibility with OpenTelemetry systems
32
+ */
33
+ declare class OTELIDGenerator extends IDGenerator {
34
+ getSpanId(): string;
35
+ getTraceId(): string;
36
+ shareRootSpanId(): boolean;
37
+ }
38
+ /**
39
+ * Factory function that creates a new ID generator instance each time.
40
+ *
41
+ * This eliminates global state and makes tests parallelizable.
42
+ * Each caller gets their own generator instance.
43
+ */
44
+ declare function getIdGenerator(): IDGenerator;
45
+
4
46
  declare const TRANSACTION_ID_FIELD = "_xact_id";
5
47
  declare const IS_MERGE_FIELD = "_is_merge";
6
48
  declare const MERGE_PATHS_FIELD = "_merge_paths";
@@ -14456,6 +14498,7 @@ declare class NoopSpan implements Span$1 {
14456
14498
  setAttributes(_args: Omit<StartSpanArgs, "event">): void;
14457
14499
  startSpanWithParents(_spanId: string, _spanParents: string[], _args?: StartSpanArgs): Span$1;
14458
14500
  state(): BraintrustState;
14501
+ toString(): string;
14459
14502
  }
14460
14503
  declare const NOOP_SPAN: NoopSpan;
14461
14504
  declare const NOOP_SPAN_PERMALINK = "https://braintrust.dev/noop-span";
@@ -14529,8 +14572,11 @@ declare class BraintrustState {
14529
14572
  private _apiConn;
14530
14573
  private _proxyConn;
14531
14574
  promptCache: PromptCache;
14575
+ private _idGenerator;
14532
14576
  constructor(loginParams: LoginOptions);
14533
14577
  resetLoginInfo(): void;
14578
+ resetIdGenState(): void;
14579
+ get idGenerator(): IDGenerator;
14534
14580
  copyLoginInfo(other: BraintrustState): void;
14535
14581
  serialize(): SerializedBraintrustState;
14536
14582
  static deserialize(serialized: unknown, opts?: LoginOptions): BraintrustState;
@@ -14548,6 +14594,8 @@ declare class BraintrustState {
14548
14594
  loginReplaceApiConn(apiConn: HTTPConnection): void;
14549
14595
  disable(): void;
14550
14596
  enforceQueueSizeLimit(enforce: boolean): void;
14597
+ toJSON(): Record<string, any>;
14598
+ toString(): string;
14551
14599
  }
14552
14600
  declare function useTestBackgroundLogger(): TestBackgroundLogger;
14553
14601
  declare function clearTestBackgroundLogger(): void;
@@ -14584,6 +14632,7 @@ declare class HTTPConnection {
14584
14632
  post(path: string, params?: Record<string, unknown> | string, config?: RequestInit): Promise<Response>;
14585
14633
  get_json(object_type: string, args?: Record<string, string | string[] | undefined> | undefined, retries?: number): Promise<any>;
14586
14634
  post_json(object_type: string, args?: Record<string, unknown> | string | undefined): Promise<any>;
14635
+ toString(): string;
14587
14636
  }
14588
14637
  interface ObjectMetadata {
14589
14638
  id: string;
@@ -15567,6 +15616,7 @@ declare class SpanImpl implements Span$1 {
15567
15616
  flush(): Promise<void>;
15568
15617
  close(args?: EndSpanArgs): number;
15569
15618
  state(): BraintrustState;
15619
+ toString(): string;
15570
15620
  }
15571
15621
  /**
15572
15622
  * A dataset is a collection of records, such as model inputs and expected outputs, which represent
@@ -15838,6 +15888,7 @@ declare function simulateLogoutForTests(): BraintrustState;
15838
15888
  * @returns Promise containing the version data
15839
15889
  */
15840
15890
  declare function getPromptVersions(projectId: string, promptId: string): Promise<any>;
15891
+ declare function resetIdGenStateForTests(): void;
15841
15892
  declare const _exportsForTestingOnly: {
15842
15893
  extractAttachments: typeof extractAttachments;
15843
15894
  deepCopyEvent: typeof deepCopyEvent;
@@ -15849,6 +15900,7 @@ declare const _exportsForTestingOnly: {
15849
15900
  initTestExperiment: typeof initTestExperiment;
15850
15901
  isGeneratorFunction: typeof isGeneratorFunction;
15851
15902
  isAsyncGeneratorFunction: typeof isAsyncGeneratorFunction;
15903
+ resetIdGenStateForTests: typeof resetIdGenStateForTests;
15852
15904
  };
15853
15905
 
15854
15906
  declare const braintrustStreamChunkSchema: z.ZodUnion<[z.ZodObject<{
@@ -21236,6 +21288,44 @@ declare function wrapAISDK<T extends AISDKMethods>(ai: T): {
21236
21288
  streamObject: T["streamObject"];
21237
21289
  };
21238
21290
 
21291
+ interface MastraAgentMethods {
21292
+ name?: string;
21293
+ tools?: Record<string, unknown> | unknown[];
21294
+ model?: any;
21295
+ __setTools(tools: Record<string, unknown> | unknown[]): void;
21296
+ generateVNext?: (params: any) => any;
21297
+ streamVNext?: (params: any) => any;
21298
+ }
21299
+ /**
21300
+ * Wraps a Mastra agent with Braintrust tracing. This function wraps the agent's
21301
+ * underlying language model with BraintrustMiddleware and traces all agent method calls.
21302
+ *
21303
+ * **Important**: This wrapper only supports AI SDK v5 methods such as `generateVNext` and `streamVNext`.
21304
+ *
21305
+ * @param agent - The Mastra agent to wrap
21306
+ * @param options - Optional configuration for the wrapper
21307
+ * @returns The wrapped agent with Braintrust tracing
21308
+ *
21309
+ * @example
21310
+ * ```typescript
21311
+ * import { wrapMastraAgent } from "braintrust";
21312
+ * import { Agent } from "@mastra/core/agent";
21313
+ * import { openai } from "@ai-sdk/openai";
21314
+ *
21315
+ * const agent = new Agent({
21316
+ * name: "Assistant",
21317
+ * model: openai("gpt-4"),
21318
+ * instructions: "You are a helpful assistant."
21319
+ * });
21320
+ *
21321
+ * const wrappedAgent = wrapMastraAgent(agent);
21322
+ * ```
21323
+ */
21324
+ declare function wrapMastraAgent<T extends MastraAgentMethods>(agent: T, options?: {
21325
+ name?: string;
21326
+ span_name?: string;
21327
+ }): T;
21328
+
21239
21329
  /**
21240
21330
  * Wrap an `Anthropic` object (created with `new Anthropic(...)`) to add tracing. If Braintrust is
21241
21331
  * not configured, nothing will be traced. If this is not an `Anthropic` object, this function is
@@ -21248,6 +21338,35 @@ declare function wrapAISDK<T extends AISDKMethods>(ai: T): {
21248
21338
  */
21249
21339
  declare function wrapAnthropic<T extends object>(anthropic: T): T;
21250
21340
 
21341
+ /**
21342
+ * Wraps the Claude Agent SDK with Braintrust tracing. This returns wrapped versions
21343
+ * of query and tool that automatically trace all agent interactions.
21344
+ *
21345
+ * @param sdk - The Claude Agent SDK module
21346
+ * @returns Object with wrapped query, tool, and createSdkMcpServer functions
21347
+ *
21348
+ * @example
21349
+ * ```typescript
21350
+ * import * as claudeSDK from "@anthropic-ai/claude-agent-sdk";
21351
+ * import { wrapClaudeAgentSDK } from "braintrust";
21352
+ *
21353
+ * // Wrap once - returns { query, tool, createSdkMcpServer } with tracing built-in
21354
+ * const { query, tool, createSdkMcpServer } = wrapClaudeAgentSDK(claudeSDK);
21355
+ *
21356
+ * // Use normally - tracing is automatic
21357
+ * for await (const message of query({
21358
+ * prompt: "Hello, Claude!",
21359
+ * options: { model: "claude-3-5-sonnet-20241022" }
21360
+ * })) {
21361
+ * console.log(message);
21362
+ * }
21363
+ *
21364
+ * // Tools created with wrapped tool() are automatically traced
21365
+ * const calculator = tool("calculator", "Does math", schema, handler);
21366
+ * ```
21367
+ */
21368
+ declare function wrapClaudeAgentSDK<T extends object>(sdk: T): T;
21369
+
21251
21370
  interface Context {
21252
21371
  [key: string]: any;
21253
21372
  }
@@ -21539,6 +21658,8 @@ declare const braintrust_FailedHTTPResponse: typeof FailedHTTPResponse;
21539
21658
  type braintrust_FullInitOptions<IsOpen extends boolean> = FullInitOptions<IsOpen>;
21540
21659
  type braintrust_FullLoginOptions = FullLoginOptions;
21541
21660
  type braintrust_FunctionEvent = FunctionEvent;
21661
+ type braintrust_IDGenerator = IDGenerator;
21662
+ declare const braintrust_IDGenerator: typeof IDGenerator;
21542
21663
  declare const braintrust_INTERNAL_BTQL_LIMIT: typeof INTERNAL_BTQL_LIMIT;
21543
21664
  type braintrust_InitOptions<IsOpen extends boolean> = InitOptions<IsOpen>;
21544
21665
  type braintrust_InvokeFunctionArgs<Input, Output, Stream extends boolean = false> = InvokeFunctionArgs<Input, Output, Stream>;
@@ -21555,6 +21676,8 @@ declare const braintrust_NOOP_SPAN: typeof NOOP_SPAN;
21555
21676
  declare const braintrust_NOOP_SPAN_PERMALINK: typeof NOOP_SPAN_PERMALINK;
21556
21677
  type braintrust_NoopSpan = NoopSpan;
21557
21678
  declare const braintrust_NoopSpan: typeof NoopSpan;
21679
+ type braintrust_OTELIDGenerator = OTELIDGenerator;
21680
+ declare const braintrust_OTELIDGenerator: typeof OTELIDGenerator;
21558
21681
  type braintrust_ObjectMetadata = ObjectMetadata;
21559
21682
  type braintrust_Project = Project;
21560
21683
  declare const braintrust_Project: typeof Project;
@@ -21590,6 +21713,8 @@ type braintrust_TestBackgroundLogger = TestBackgroundLogger;
21590
21713
  declare const braintrust_TestBackgroundLogger: typeof TestBackgroundLogger;
21591
21714
  type braintrust_ToolBuilder = ToolBuilder;
21592
21715
  declare const braintrust_ToolBuilder: typeof ToolBuilder;
21716
+ type braintrust_UUIDGenerator = UUIDGenerator;
21717
+ declare const braintrust_UUIDGenerator: typeof UUIDGenerator;
21593
21718
  type braintrust_WithTransactionId<R> = WithTransactionId<R>;
21594
21719
  declare const braintrust_X_CACHED_HEADER: typeof X_CACHED_HEADER;
21595
21720
  declare const braintrust__exportsForTestingOnly: typeof _exportsForTestingOnly;
@@ -21601,10 +21726,12 @@ declare const braintrust_createFinalValuePassThroughStream: typeof createFinalVa
21601
21726
  declare const braintrust_currentExperiment: typeof currentExperiment;
21602
21727
  declare const braintrust_currentLogger: typeof currentLogger;
21603
21728
  declare const braintrust_currentSpan: typeof currentSpan;
21729
+ declare const braintrust_deepCopyEvent: typeof deepCopyEvent;
21604
21730
  declare const braintrust_defaultErrorScoreHandler: typeof defaultErrorScoreHandler;
21605
21731
  declare const braintrust_deserializePlainStringAsJSON: typeof deserializePlainStringAsJSON;
21606
21732
  declare const braintrust_devNullWritableStream: typeof devNullWritableStream;
21607
21733
  declare const braintrust_flush: typeof flush;
21734
+ declare const braintrust_getIdGenerator: typeof getIdGenerator;
21608
21735
  declare const braintrust_getPromptVersions: typeof getPromptVersions;
21609
21736
  declare const braintrust_getSpanParentObject: typeof getSpanParentObject;
21610
21737
  declare const braintrust_init: typeof init;
@@ -21646,11 +21773,13 @@ declare const braintrust_withParent: typeof withParent;
21646
21773
  declare const braintrust_wrapAISDK: typeof wrapAISDK;
21647
21774
  declare const braintrust_wrapAISDKModel: typeof wrapAISDKModel;
21648
21775
  declare const braintrust_wrapAnthropic: typeof wrapAnthropic;
21776
+ declare const braintrust_wrapClaudeAgentSDK: typeof wrapClaudeAgentSDK;
21777
+ declare const braintrust_wrapMastraAgent: typeof wrapMastraAgent;
21649
21778
  declare const braintrust_wrapOpenAI: typeof wrapOpenAI;
21650
21779
  declare const braintrust_wrapOpenAIv4: typeof wrapOpenAIv4;
21651
21780
  declare const braintrust_wrapTraced: typeof wrapTraced;
21652
21781
  declare namespace braintrust {
21653
- export { braintrust_AISpanProcessor as AISpanProcessor, type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, braintrust_BaseAttachment as BaseAttachment, braintrust_BaseExperiment as BaseExperiment, type braintrust_BaseMetadata as BaseMetadata, braintrust_BraintrustExporter as BraintrustExporter, braintrust_BraintrustMiddleware as BraintrustMiddleware, braintrust_BraintrustSpanProcessor as BraintrustSpanProcessor, braintrust_BraintrustState as BraintrustState, braintrust_BraintrustStream as BraintrustStream, type braintrust_BraintrustStreamChunk as BraintrustStreamChunk, type braintrust_ChatPrompt as ChatPrompt, braintrust_CodeFunction as CodeFunction, type braintrust_CodeOpts as CodeOpts, braintrust_CodePrompt as CodePrompt, type braintrust_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, type braintrust_CreateProjectOpts as CreateProjectOpts, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, braintrust_ERR_PERMALINK as ERR_PERMALINK, type braintrust_EndSpanArgs as EndSpanArgs, braintrust_Eval as Eval, type braintrust_EvalCase as EvalCase, type braintrust_EvalHooks as EvalHooks, type braintrust_EvalResult as EvalResult, braintrust_EvalResultWithSummary as EvalResultWithSummary, type braintrust_EvalScorer as EvalScorer, type braintrust_EvalScorerArgs as EvalScorerArgs, type braintrust_EvalTask as EvalTask, type braintrust_Evaluator as Evaluator, type braintrust_EvaluatorDef as EvaluatorDef, type braintrust_EvaluatorFile as EvaluatorFile, braintrust_Experiment as Experiment, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_ExternalAttachment as ExternalAttachment, type braintrust_ExternalAttachmentParams as ExternalAttachmentParams, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, type braintrust_FunctionEvent as FunctionEvent, braintrust_INTERNAL_BTQL_LIMIT as INTERNAL_BTQL_LIMIT, type braintrust_InitOptions as InitOptions, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, braintrust_LazyValue as LazyValue, type braintrust_LogOptions as LogOptions, braintrust_Logger as Logger, type braintrust_LoginOptions as LoginOptions, type braintrust_MetricSummary as MetricSummary, braintrust_NOOP_SPAN as NOOP_SPAN, braintrust_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, braintrust_NoopSpan as NoopSpan, type braintrust_ObjectMetadata as ObjectMetadata, braintrust_Project as Project, braintrust_ProjectNameIdMap as ProjectNameIdMap, type braintrust_PromiseUnless as PromiseUnless, braintrust_Prompt as Prompt, braintrust_PromptBuilder as PromptBuilder, type braintrust_PromptContents as PromptContents, type braintrust_PromptDefinition as PromptDefinition, type braintrust_PromptDefinitionWithTools as PromptDefinitionWithTools, type braintrust_PromptOpts as PromptOpts, type braintrust_PromptRowWithId as PromptRowWithId, braintrust_ReadonlyAttachment as ReadonlyAttachment, braintrust_ReadonlyExperiment as ReadonlyExperiment, braintrust_Reporter as Reporter, type braintrust_ReporterBody as ReporterBody, type braintrust_ScoreSummary as ScoreSummary, braintrust_ScorerBuilder as ScorerBuilder, type braintrust_ScorerOpts as ScorerOpts, type braintrust_SerializedBraintrustState as SerializedBraintrustState, type braintrust_SetCurrentArg as SetCurrentArg, type Span$1 as Span, type braintrust_SpanContext as SpanContext, braintrust_SpanImpl as SpanImpl, type braintrust_StartSpanArgs as StartSpanArgs, braintrust_TestBackgroundLogger as TestBackgroundLogger, braintrust_ToolBuilder as ToolBuilder, type braintrust_WithTransactionId as WithTransactionId, braintrust_X_CACHED_HEADER as X_CACHED_HEADER, braintrust__exportsForTestingOnly as _exportsForTestingOnly, braintrust__internalGetGlobalState as _internalGetGlobalState, braintrust__internalSetInitialState as _internalSetInitialState, braintrust_braintrustStreamChunkSchema as braintrustStreamChunkSchema, braintrust_buildLocalSummary as buildLocalSummary, braintrust_createFinalValuePassThroughStream as createFinalValuePassThroughStream, braintrust_currentExperiment as currentExperiment, braintrust_currentLogger as currentLogger, braintrust_currentSpan as currentSpan, braintrust_defaultErrorScoreHandler as defaultErrorScoreHandler, braintrust_deserializePlainStringAsJSON as deserializePlainStringAsJSON, braintrust_devNullWritableStream as devNullWritableStream, braintrust_flush as flush, braintrust_getPromptVersions as getPromptVersions, braintrust_getSpanParentObject as getSpanParentObject, graphFramework as graph, braintrust_init as init, braintrust_initDataset as initDataset, braintrust_initExperiment as initExperiment, braintrust_initFunction as initFunction, braintrust_initLogger as initLogger, braintrust_invoke as invoke, braintrust_loadPrompt as loadPrompt, braintrust_log as log, braintrust_logError as logError, braintrust_login as login, braintrust_loginToState as loginToState, braintrust_newId as newId, braintrust_parseCachedHeader as parseCachedHeader, braintrust_permalink as permalink, braintrust_projects as projects, braintrust_promptContentsSchema as promptContentsSchema, braintrust_promptDefinitionSchema as promptDefinitionSchema, braintrust_promptDefinitionToPromptData as promptDefinitionToPromptData, braintrust_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, braintrust_renderMessage as renderMessage, braintrust_renderPromptParams as renderPromptParams, braintrust_reportFailures as reportFailures, braintrust_runEvaluator as runEvaluator, braintrust_setFetch as setFetch, braintrust_setMaskingFunction as setMaskingFunction, braintrust_spanComponentsToObjectId as spanComponentsToObjectId, braintrust_startSpan as startSpan, braintrust_summarize as summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, braintrust_traceable as traceable, braintrust_traced as traced, braintrust_updateSpan as updateSpan, braintrust_withCurrent as withCurrent, braintrust_withDataset as withDataset, braintrust_withExperiment as withExperiment, braintrust_withLogger as withLogger, braintrust_withParent as withParent, braintrust_wrapAISDK as wrapAISDK, braintrust_wrapAISDKModel as wrapAISDKModel, braintrust_wrapAnthropic as wrapAnthropic, braintrust_wrapOpenAI as wrapOpenAI, braintrust_wrapOpenAIv4 as wrapOpenAIv4, braintrust_wrapTraced as wrapTraced };
21782
+ export { braintrust_AISpanProcessor as AISpanProcessor, type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, braintrust_BaseAttachment as BaseAttachment, braintrust_BaseExperiment as BaseExperiment, type braintrust_BaseMetadata as BaseMetadata, braintrust_BraintrustExporter as BraintrustExporter, braintrust_BraintrustMiddleware as BraintrustMiddleware, braintrust_BraintrustSpanProcessor as BraintrustSpanProcessor, braintrust_BraintrustState as BraintrustState, braintrust_BraintrustStream as BraintrustStream, type braintrust_BraintrustStreamChunk as BraintrustStreamChunk, type braintrust_ChatPrompt as ChatPrompt, braintrust_CodeFunction as CodeFunction, type braintrust_CodeOpts as CodeOpts, braintrust_CodePrompt as CodePrompt, type braintrust_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, type braintrust_CreateProjectOpts as CreateProjectOpts, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, braintrust_ERR_PERMALINK as ERR_PERMALINK, type braintrust_EndSpanArgs as EndSpanArgs, braintrust_Eval as Eval, type braintrust_EvalCase as EvalCase, type braintrust_EvalHooks as EvalHooks, type braintrust_EvalResult as EvalResult, braintrust_EvalResultWithSummary as EvalResultWithSummary, type braintrust_EvalScorer as EvalScorer, type braintrust_EvalScorerArgs as EvalScorerArgs, type braintrust_EvalTask as EvalTask, type braintrust_Evaluator as Evaluator, type braintrust_EvaluatorDef as EvaluatorDef, type braintrust_EvaluatorFile as EvaluatorFile, braintrust_Experiment as Experiment, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_ExternalAttachment as ExternalAttachment, type braintrust_ExternalAttachmentParams as ExternalAttachmentParams, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, type braintrust_FunctionEvent as FunctionEvent, braintrust_IDGenerator as IDGenerator, braintrust_INTERNAL_BTQL_LIMIT as INTERNAL_BTQL_LIMIT, type braintrust_InitOptions as InitOptions, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, braintrust_LazyValue as LazyValue, type braintrust_LogOptions as LogOptions, braintrust_Logger as Logger, type braintrust_LoginOptions as LoginOptions, type braintrust_MetricSummary as MetricSummary, braintrust_NOOP_SPAN as NOOP_SPAN, braintrust_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, braintrust_NoopSpan as NoopSpan, braintrust_OTELIDGenerator as OTELIDGenerator, type braintrust_ObjectMetadata as ObjectMetadata, braintrust_Project as Project, braintrust_ProjectNameIdMap as ProjectNameIdMap, type braintrust_PromiseUnless as PromiseUnless, braintrust_Prompt as Prompt, braintrust_PromptBuilder as PromptBuilder, type braintrust_PromptContents as PromptContents, type braintrust_PromptDefinition as PromptDefinition, type braintrust_PromptDefinitionWithTools as PromptDefinitionWithTools, type braintrust_PromptOpts as PromptOpts, type braintrust_PromptRowWithId as PromptRowWithId, braintrust_ReadonlyAttachment as ReadonlyAttachment, braintrust_ReadonlyExperiment as ReadonlyExperiment, braintrust_Reporter as Reporter, type braintrust_ReporterBody as ReporterBody, type braintrust_ScoreSummary as ScoreSummary, braintrust_ScorerBuilder as ScorerBuilder, type braintrust_ScorerOpts as ScorerOpts, type braintrust_SerializedBraintrustState as SerializedBraintrustState, type braintrust_SetCurrentArg as SetCurrentArg, type Span$1 as Span, type braintrust_SpanContext as SpanContext, braintrust_SpanImpl as SpanImpl, type braintrust_StartSpanArgs as StartSpanArgs, braintrust_TestBackgroundLogger as TestBackgroundLogger, braintrust_ToolBuilder as ToolBuilder, braintrust_UUIDGenerator as UUIDGenerator, type braintrust_WithTransactionId as WithTransactionId, braintrust_X_CACHED_HEADER as X_CACHED_HEADER, braintrust__exportsForTestingOnly as _exportsForTestingOnly, braintrust__internalGetGlobalState as _internalGetGlobalState, braintrust__internalSetInitialState as _internalSetInitialState, braintrust_braintrustStreamChunkSchema as braintrustStreamChunkSchema, braintrust_buildLocalSummary as buildLocalSummary, braintrust_createFinalValuePassThroughStream as createFinalValuePassThroughStream, braintrust_currentExperiment as currentExperiment, braintrust_currentLogger as currentLogger, braintrust_currentSpan as currentSpan, braintrust_deepCopyEvent as deepCopyEvent, braintrust_defaultErrorScoreHandler as defaultErrorScoreHandler, braintrust_deserializePlainStringAsJSON as deserializePlainStringAsJSON, braintrust_devNullWritableStream as devNullWritableStream, braintrust_flush as flush, braintrust_getIdGenerator as getIdGenerator, braintrust_getPromptVersions as getPromptVersions, braintrust_getSpanParentObject as getSpanParentObject, graphFramework as graph, braintrust_init as init, braintrust_initDataset as initDataset, braintrust_initExperiment as initExperiment, braintrust_initFunction as initFunction, braintrust_initLogger as initLogger, braintrust_invoke as invoke, braintrust_loadPrompt as loadPrompt, braintrust_log as log, braintrust_logError as logError, braintrust_login as login, braintrust_loginToState as loginToState, braintrust_newId as newId, braintrust_parseCachedHeader as parseCachedHeader, braintrust_permalink as permalink, braintrust_projects as projects, braintrust_promptContentsSchema as promptContentsSchema, braintrust_promptDefinitionSchema as promptDefinitionSchema, braintrust_promptDefinitionToPromptData as promptDefinitionToPromptData, braintrust_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, braintrust_renderMessage as renderMessage, braintrust_renderPromptParams as renderPromptParams, braintrust_reportFailures as reportFailures, braintrust_runEvaluator as runEvaluator, braintrust_setFetch as setFetch, braintrust_setMaskingFunction as setMaskingFunction, braintrust_spanComponentsToObjectId as spanComponentsToObjectId, braintrust_startSpan as startSpan, braintrust_summarize as summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, braintrust_traceable as traceable, braintrust_traced as traced, braintrust_updateSpan as updateSpan, braintrust_withCurrent as withCurrent, braintrust_withDataset as withDataset, braintrust_withExperiment as withExperiment, braintrust_withLogger as withLogger, braintrust_withParent as withParent, braintrust_wrapAISDK as wrapAISDK, braintrust_wrapAISDKModel as wrapAISDKModel, braintrust_wrapAnthropic as wrapAnthropic, braintrust_wrapClaudeAgentSDK as wrapClaudeAgentSDK, braintrust_wrapMastraAgent as wrapMastraAgent, braintrust_wrapOpenAI as wrapOpenAI, braintrust_wrapOpenAIv4 as wrapOpenAIv4, braintrust_wrapTraced as wrapTraced };
21654
21783
  }
21655
21784
 
21656
21785
  type EvaluatorManifest = Record<string, EvaluatorDef<unknown, unknown, unknown, BaseMetadata>>;
@@ -28707,4 +28836,4 @@ type EvaluatorDefinitions = z.infer<typeof evaluatorDefinitionsSchema>;
28707
28836
  * @module braintrust
28708
28837
  */
28709
28838
 
28710
- export { AISpanProcessor, type AnyDataset, Attachment, type AttachmentParams, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BraintrustExporter, BraintrustMiddleware, BraintrustSpanProcessor, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, type CreateProjectOpts, type DataSummary, Dataset, type DatasetRecord, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalHooks, type EvalParameterSerializedSchema, type EvalParameters, type EvalResult, EvalResultWithSummary, type EvalScorer, type EvalScorerArgs, type EvalTask, type Evaluator, type EvaluatorDef, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorFile, type EvaluatorManifest, Experiment, type ExperimentLogFullArgs, type ExperimentLogPartialArgs, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, type FunctionEvent, INTERNAL_BTQL_LIMIT, type IdField, type InitOptions, type InputField, type InvokeFunctionArgs, type InvokeReturn, LEGACY_CACHED_HEADER, LazyValue, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, type ObjectMetadata, type OtherExperimentLogFields, type ParentExperimentIds, type ParentProjectLogIds, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, Reporter, type ReporterBody, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span$1 as Span, type SpanContext, SpanImpl, type StartSpanArgs, TestBackgroundLogger, ToolBuilder, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, buildLocalSummary, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, braintrust as default, defaultErrorScoreHandler, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getPromptVersions, getSpanParentObject, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, renderMessage, renderPromptParams, reportFailures, runEvaluator, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDK, wrapAISDKModel, wrapAnthropic, wrapOpenAI, wrapOpenAIv4, wrapTraced };
28839
+ export { AISpanProcessor, type AnyDataset, Attachment, type AttachmentParams, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BraintrustExporter, BraintrustMiddleware, BraintrustSpanProcessor, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, type CreateProjectOpts, type DataSummary, Dataset, type DatasetRecord, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalHooks, type EvalParameterSerializedSchema, type EvalParameters, type EvalResult, EvalResultWithSummary, type EvalScorer, type EvalScorerArgs, type EvalTask, type Evaluator, type EvaluatorDef, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorFile, type EvaluatorManifest, Experiment, type ExperimentLogFullArgs, type ExperimentLogPartialArgs, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, type FunctionEvent, IDGenerator, INTERNAL_BTQL_LIMIT, type IdField, type InitOptions, type InputField, type InvokeFunctionArgs, type InvokeReturn, LEGACY_CACHED_HEADER, LazyValue, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, OTELIDGenerator, type ObjectMetadata, type OtherExperimentLogFields, type ParentExperimentIds, type ParentProjectLogIds, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, Reporter, type ReporterBody, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span$1 as Span, type SpanContext, SpanImpl, type StartSpanArgs, TestBackgroundLogger, ToolBuilder, UUIDGenerator, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, buildLocalSummary, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, deepCopyEvent, braintrust as default, defaultErrorScoreHandler, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getIdGenerator, getPromptVersions, getSpanParentObject, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, renderMessage, renderPromptParams, reportFailures, runEvaluator, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDK, wrapAISDKModel, wrapAnthropic, wrapClaudeAgentSDK, wrapMastraAgent, wrapOpenAI, wrapOpenAIv4, wrapTraced };