@bitfab/sdk 0.38.5 → 0.38.7
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/autoTrace.cjs +8 -1
- package/dist/autoTrace.cjs.map +1 -1
- package/dist/autoTrace.d.cts +2 -2
- package/dist/autoTrace.d.ts +2 -2
- package/dist/autoTrace.js +1 -1
- package/dist/{chunk-VVI573UU.js → chunk-7E6KCBTH.js} +2 -2
- package/dist/{chunk-VVI573UU.js.map → chunk-7E6KCBTH.js.map} +1 -1
- package/dist/{chunk-Z3GIZGS5.js → chunk-RZ3P6ICN.js} +313 -8
- package/dist/chunk-RZ3P6ICN.js.map +1 -0
- package/dist/{chunk-J47KPS77.js → chunk-ZUD7OFYB.js} +9 -2
- package/dist/{chunk-J47KPS77.js.map → chunk-ZUD7OFYB.js.map} +1 -1
- package/dist/index.cjs +324 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -6
- package/dist/index.d.ts +104 -6
- package/dist/index.js +5 -3
- package/dist/node.cjs +324 -9
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +5 -3
- package/dist/node.js.map +1 -1
- package/dist/{replay-Z6DON4SP.js → replay-DIRRDWI2.js} +2 -2
- package/package.json +11 -1
- package/dist/chunk-Z3GIZGS5.js.map +0 -1
- /package/dist/{replay-Z6DON4SP.js.map → replay-DIRRDWI2.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1072,6 +1072,7 @@ declare class BitfabLangGraphCallbackHandler {
|
|
|
1072
1072
|
private readonly ownsHttpClient;
|
|
1073
1073
|
private readonly traceFunctionKey;
|
|
1074
1074
|
private readonly getActiveSpanContext;
|
|
1075
|
+
private readonly captureTools;
|
|
1075
1076
|
private runToSpan;
|
|
1076
1077
|
private invocations;
|
|
1077
1078
|
constructor(config: {
|
|
@@ -1080,6 +1081,8 @@ declare class BitfabLangGraphCallbackHandler {
|
|
|
1080
1081
|
serviceUrl?: string;
|
|
1081
1082
|
timeout?: number;
|
|
1082
1083
|
getActiveSpanContext?: () => ActiveSpanContext$1 | null;
|
|
1084
|
+
/** Whether callback tool events should emit spans. Defaults to true. */
|
|
1085
|
+
captureTools?: boolean;
|
|
1083
1086
|
/**
|
|
1084
1087
|
* The owning `Bitfab` client's HTTP client. Supplied by
|
|
1085
1088
|
* `getLangGraphCallbackHandler()` so this handler shares that client's
|
|
@@ -1115,6 +1118,79 @@ declare class BitfabLangGraphCallbackHandler {
|
|
|
1115
1118
|
handleRetrieverError(error: unknown, runId: string): Promise<void>;
|
|
1116
1119
|
}
|
|
1117
1120
|
|
|
1121
|
+
interface SpanClient {
|
|
1122
|
+
withSpan<TArgs extends unknown[], TReturn>(traceFunctionKey: string, options: {
|
|
1123
|
+
name?: string;
|
|
1124
|
+
type?: "agent" | "function";
|
|
1125
|
+
captureWhen?: "always" | "nested";
|
|
1126
|
+
mockOnReplay?: boolean;
|
|
1127
|
+
finalize?: (result: unknown) => unknown | Promise<unknown>;
|
|
1128
|
+
}, fn: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
1129
|
+
}
|
|
1130
|
+
interface LangGraphTool {
|
|
1131
|
+
readonly name?: string;
|
|
1132
|
+
invoke(input: unknown, ...rest: unknown[]): unknown;
|
|
1133
|
+
}
|
|
1134
|
+
interface ConfiguredLangGraphRunnable<TInput, TConfig, TReturn> {
|
|
1135
|
+
invoke(input: TInput, config?: TConfig): TReturn;
|
|
1136
|
+
}
|
|
1137
|
+
interface LangGraphRunnable<TInput, TConfig, TReturn> {
|
|
1138
|
+
withConfig(config: {
|
|
1139
|
+
callbacks: unknown[];
|
|
1140
|
+
}): ConfiguredLangGraphRunnable<TInput, TConfig, TReturn>;
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Options for first-class LangGraph ToolNode replay interception.
|
|
1144
|
+
*
|
|
1145
|
+
* @experimental This API may change before it is stable.
|
|
1146
|
+
*/
|
|
1147
|
+
interface LangGraphIntegrationOptions {
|
|
1148
|
+
/**
|
|
1149
|
+
* Tools marked for recorded-output mocking under replay's default
|
|
1150
|
+
* `mock: "marked"` strategy. Defaults to every wrapped tool. Pass a list to
|
|
1151
|
+
* mark only those tool names, or `false` to require `mock: "all"` or an
|
|
1152
|
+
* override.
|
|
1153
|
+
*/
|
|
1154
|
+
mockToolsOnReplay?: boolean | readonly string[];
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* First-class LangGraph integration for callback tracing and replayable
|
|
1158
|
+
* `ToolNode` tools.
|
|
1159
|
+
*
|
|
1160
|
+
* @experimental This API may change before it is stable.
|
|
1161
|
+
*/
|
|
1162
|
+
declare class BitfabLangGraphIntegration {
|
|
1163
|
+
/** Callback handler for the compiled graph's invocation config. */
|
|
1164
|
+
readonly callbackHandler: any;
|
|
1165
|
+
private readonly client;
|
|
1166
|
+
private readonly traceFunctionKey;
|
|
1167
|
+
private readonly mockToolsOnReplay;
|
|
1168
|
+
constructor(config: {
|
|
1169
|
+
client: SpanClient;
|
|
1170
|
+
traceFunctionKey: string;
|
|
1171
|
+
callbackHandler: BitfabLangGraphCallbackHandler;
|
|
1172
|
+
options?: LangGraphIntegrationOptions;
|
|
1173
|
+
});
|
|
1174
|
+
/**
|
|
1175
|
+
* Wrap tools before passing the same returned array to both
|
|
1176
|
+
* `model.bindTools()` and `new ToolNode()`. Each invocation becomes an
|
|
1177
|
+
* independently mockable child span.
|
|
1178
|
+
*/
|
|
1179
|
+
wrapTools<T extends readonly LangGraphTool[]>(tools: T): T;
|
|
1180
|
+
/**
|
|
1181
|
+
* Create the normal graph entry point. The returned function adds Bitfab's
|
|
1182
|
+
* callback handler, preserves invocation config, and records only the graph
|
|
1183
|
+
* input as the replayable root input.
|
|
1184
|
+
*
|
|
1185
|
+
* @experimental This API may change before it is stable.
|
|
1186
|
+
*/
|
|
1187
|
+
createInvoker<TInput, TConfig, TReturn>(graph: LangGraphRunnable<TInput, TConfig, TReturn>): (input: TInput, config?: TConfig) => TReturn;
|
|
1188
|
+
private wrapTool;
|
|
1189
|
+
private assertReplayToolResultExists;
|
|
1190
|
+
/** Wrap the function that invokes the compiled graph as the replay root. */
|
|
1191
|
+
wrapInvoke<TArgs extends unknown[], TReturn>(fn: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1118
1194
|
/**
|
|
1119
1195
|
* OpenAI Agents SDK handler for Bitfab tracing.
|
|
1120
1196
|
*
|
|
@@ -2183,8 +2259,9 @@ declare class Bitfab {
|
|
|
2183
2259
|
* Decorate a class method as an automatically expanded trace root.
|
|
2184
2260
|
*
|
|
2185
2261
|
* Build instrumentation turns repository functions called beneath this
|
|
2186
|
-
* method into nested spans
|
|
2187
|
-
*
|
|
2262
|
+
* method into nested spans that capture inputs, outputs, and errors by
|
|
2263
|
+
* default. A confirmed capture policy can narrow rich capture to selected
|
|
2264
|
+
* function IDs.
|
|
2188
2265
|
* Without a compatible build transform, this still records the decorated
|
|
2189
2266
|
* method as a normal rich root span but cannot discover child calls.
|
|
2190
2267
|
*
|
|
@@ -2198,8 +2275,10 @@ declare class Bitfab {
|
|
|
2198
2275
|
*
|
|
2199
2276
|
* This is the function-oriented equivalent of {@link Bitfab.trace}. Build
|
|
2200
2277
|
* instrumentation turns repository functions called beneath the wrapped
|
|
2201
|
-
* function into nested spans
|
|
2202
|
-
*
|
|
2278
|
+
* function into nested spans that capture inputs, outputs, and errors by
|
|
2279
|
+
* default. A confirmed capture policy can narrow rich capture to selected
|
|
2280
|
+
* function IDs. Without a compatible transform, this still records one
|
|
2281
|
+
* normal rich root span and runs the function unchanged.
|
|
2203
2282
|
*
|
|
2204
2283
|
* @param traceFunctionKey - Groups traces and their capture policy.
|
|
2205
2284
|
* @param optionsOrFn - Options or the workflow entrypoint to wrap.
|
|
@@ -2369,6 +2448,19 @@ declare class Bitfab {
|
|
|
2369
2448
|
* @returns A BitfabLangGraphCallbackHandler configured for this client
|
|
2370
2449
|
*/
|
|
2371
2450
|
getLangChainCallbackHandler(traceFunctionKey: string): BitfabLangGraphCallbackHandler;
|
|
2451
|
+
/**
|
|
2452
|
+
* Get the first-class LangGraph integration for tracing and replaying tools
|
|
2453
|
+
* executed by `ToolNode`.
|
|
2454
|
+
*
|
|
2455
|
+
* The integration combines `wrapTools()` for per-tool replay interception
|
|
2456
|
+
* with `createInvoker()` for a callback-configured replayable graph entry
|
|
2457
|
+
* point. Lower-level callback and root wrappers remain available.
|
|
2458
|
+
*
|
|
2459
|
+
* @param traceFunctionKey - Groups traces under this key in Bitfab
|
|
2460
|
+
* @param options - Controls which tools are marked for replay mocking
|
|
2461
|
+
* @experimental This API may change before it is stable.
|
|
2462
|
+
*/
|
|
2463
|
+
getLangGraphIntegration(traceFunctionKey: string, options?: LangGraphIntegrationOptions): BitfabLangGraphIntegration;
|
|
2372
2464
|
/**
|
|
2373
2465
|
* Get a Claude Agent SDK handler for tracing.
|
|
2374
2466
|
*
|
|
@@ -2760,6 +2852,12 @@ declare class BitfabFunction {
|
|
|
2760
2852
|
* @returns A LangChain callback handler for this client and key
|
|
2761
2853
|
*/
|
|
2762
2854
|
getLangChainCallbackHandler(): BitfabLangGraphCallbackHandler;
|
|
2855
|
+
/**
|
|
2856
|
+
* Get the first-class LangGraph tool replay integration bound to this key.
|
|
2857
|
+
*
|
|
2858
|
+
* @experimental This API may change before it is stable.
|
|
2859
|
+
*/
|
|
2860
|
+
getLangGraphIntegration(options?: LangGraphIntegrationOptions): BitfabLangGraphIntegration;
|
|
2763
2861
|
/**
|
|
2764
2862
|
* Wrap a BAML client method to automatically capture prompt and LLM metadata.
|
|
2765
2863
|
* Delegates to the parent client's wrapBAML method.
|
|
@@ -2786,7 +2884,7 @@ declare class BitfabFunction {
|
|
|
2786
2884
|
/**
|
|
2787
2885
|
* SDK version from package.json (injected at build time)
|
|
2788
2886
|
*/
|
|
2789
|
-
declare const __version__ = "0.38.
|
|
2887
|
+
declare const __version__ = "0.38.7";
|
|
2790
2888
|
|
|
2791
2889
|
/**
|
|
2792
2890
|
* Constants for the Bitfab SDK.
|
|
@@ -2889,4 +2987,4 @@ type ReplayRegistry = Record<string, ReplayRegistration>;
|
|
|
2889
2987
|
*/
|
|
2890
2988
|
declare function defineReplayRegistry<TRegistry extends ReplayRegistry>(registry: TRegistry): TRegistry;
|
|
2891
2989
|
|
|
2892
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AllowedEnvVars, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, HttpClient, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, SUPPORTED_PROVIDERS, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceResponse, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, serializeReplayResult };
|
|
2990
|
+
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AllowedEnvVars, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, HttpClient, type LangGraphIntegrationOptions, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, SUPPORTED_PROVIDERS, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceResponse, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, serializeReplayResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -1072,6 +1072,7 @@ declare class BitfabLangGraphCallbackHandler {
|
|
|
1072
1072
|
private readonly ownsHttpClient;
|
|
1073
1073
|
private readonly traceFunctionKey;
|
|
1074
1074
|
private readonly getActiveSpanContext;
|
|
1075
|
+
private readonly captureTools;
|
|
1075
1076
|
private runToSpan;
|
|
1076
1077
|
private invocations;
|
|
1077
1078
|
constructor(config: {
|
|
@@ -1080,6 +1081,8 @@ declare class BitfabLangGraphCallbackHandler {
|
|
|
1080
1081
|
serviceUrl?: string;
|
|
1081
1082
|
timeout?: number;
|
|
1082
1083
|
getActiveSpanContext?: () => ActiveSpanContext$1 | null;
|
|
1084
|
+
/** Whether callback tool events should emit spans. Defaults to true. */
|
|
1085
|
+
captureTools?: boolean;
|
|
1083
1086
|
/**
|
|
1084
1087
|
* The owning `Bitfab` client's HTTP client. Supplied by
|
|
1085
1088
|
* `getLangGraphCallbackHandler()` so this handler shares that client's
|
|
@@ -1115,6 +1118,79 @@ declare class BitfabLangGraphCallbackHandler {
|
|
|
1115
1118
|
handleRetrieverError(error: unknown, runId: string): Promise<void>;
|
|
1116
1119
|
}
|
|
1117
1120
|
|
|
1121
|
+
interface SpanClient {
|
|
1122
|
+
withSpan<TArgs extends unknown[], TReturn>(traceFunctionKey: string, options: {
|
|
1123
|
+
name?: string;
|
|
1124
|
+
type?: "agent" | "function";
|
|
1125
|
+
captureWhen?: "always" | "nested";
|
|
1126
|
+
mockOnReplay?: boolean;
|
|
1127
|
+
finalize?: (result: unknown) => unknown | Promise<unknown>;
|
|
1128
|
+
}, fn: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
1129
|
+
}
|
|
1130
|
+
interface LangGraphTool {
|
|
1131
|
+
readonly name?: string;
|
|
1132
|
+
invoke(input: unknown, ...rest: unknown[]): unknown;
|
|
1133
|
+
}
|
|
1134
|
+
interface ConfiguredLangGraphRunnable<TInput, TConfig, TReturn> {
|
|
1135
|
+
invoke(input: TInput, config?: TConfig): TReturn;
|
|
1136
|
+
}
|
|
1137
|
+
interface LangGraphRunnable<TInput, TConfig, TReturn> {
|
|
1138
|
+
withConfig(config: {
|
|
1139
|
+
callbacks: unknown[];
|
|
1140
|
+
}): ConfiguredLangGraphRunnable<TInput, TConfig, TReturn>;
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Options for first-class LangGraph ToolNode replay interception.
|
|
1144
|
+
*
|
|
1145
|
+
* @experimental This API may change before it is stable.
|
|
1146
|
+
*/
|
|
1147
|
+
interface LangGraphIntegrationOptions {
|
|
1148
|
+
/**
|
|
1149
|
+
* Tools marked for recorded-output mocking under replay's default
|
|
1150
|
+
* `mock: "marked"` strategy. Defaults to every wrapped tool. Pass a list to
|
|
1151
|
+
* mark only those tool names, or `false` to require `mock: "all"` or an
|
|
1152
|
+
* override.
|
|
1153
|
+
*/
|
|
1154
|
+
mockToolsOnReplay?: boolean | readonly string[];
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* First-class LangGraph integration for callback tracing and replayable
|
|
1158
|
+
* `ToolNode` tools.
|
|
1159
|
+
*
|
|
1160
|
+
* @experimental This API may change before it is stable.
|
|
1161
|
+
*/
|
|
1162
|
+
declare class BitfabLangGraphIntegration {
|
|
1163
|
+
/** Callback handler for the compiled graph's invocation config. */
|
|
1164
|
+
readonly callbackHandler: any;
|
|
1165
|
+
private readonly client;
|
|
1166
|
+
private readonly traceFunctionKey;
|
|
1167
|
+
private readonly mockToolsOnReplay;
|
|
1168
|
+
constructor(config: {
|
|
1169
|
+
client: SpanClient;
|
|
1170
|
+
traceFunctionKey: string;
|
|
1171
|
+
callbackHandler: BitfabLangGraphCallbackHandler;
|
|
1172
|
+
options?: LangGraphIntegrationOptions;
|
|
1173
|
+
});
|
|
1174
|
+
/**
|
|
1175
|
+
* Wrap tools before passing the same returned array to both
|
|
1176
|
+
* `model.bindTools()` and `new ToolNode()`. Each invocation becomes an
|
|
1177
|
+
* independently mockable child span.
|
|
1178
|
+
*/
|
|
1179
|
+
wrapTools<T extends readonly LangGraphTool[]>(tools: T): T;
|
|
1180
|
+
/**
|
|
1181
|
+
* Create the normal graph entry point. The returned function adds Bitfab's
|
|
1182
|
+
* callback handler, preserves invocation config, and records only the graph
|
|
1183
|
+
* input as the replayable root input.
|
|
1184
|
+
*
|
|
1185
|
+
* @experimental This API may change before it is stable.
|
|
1186
|
+
*/
|
|
1187
|
+
createInvoker<TInput, TConfig, TReturn>(graph: LangGraphRunnable<TInput, TConfig, TReturn>): (input: TInput, config?: TConfig) => TReturn;
|
|
1188
|
+
private wrapTool;
|
|
1189
|
+
private assertReplayToolResultExists;
|
|
1190
|
+
/** Wrap the function that invokes the compiled graph as the replay root. */
|
|
1191
|
+
wrapInvoke<TArgs extends unknown[], TReturn>(fn: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1118
1194
|
/**
|
|
1119
1195
|
* OpenAI Agents SDK handler for Bitfab tracing.
|
|
1120
1196
|
*
|
|
@@ -2183,8 +2259,9 @@ declare class Bitfab {
|
|
|
2183
2259
|
* Decorate a class method as an automatically expanded trace root.
|
|
2184
2260
|
*
|
|
2185
2261
|
* Build instrumentation turns repository functions called beneath this
|
|
2186
|
-
* method into nested spans
|
|
2187
|
-
*
|
|
2262
|
+
* method into nested spans that capture inputs, outputs, and errors by
|
|
2263
|
+
* default. A confirmed capture policy can narrow rich capture to selected
|
|
2264
|
+
* function IDs.
|
|
2188
2265
|
* Without a compatible build transform, this still records the decorated
|
|
2189
2266
|
* method as a normal rich root span but cannot discover child calls.
|
|
2190
2267
|
*
|
|
@@ -2198,8 +2275,10 @@ declare class Bitfab {
|
|
|
2198
2275
|
*
|
|
2199
2276
|
* This is the function-oriented equivalent of {@link Bitfab.trace}. Build
|
|
2200
2277
|
* instrumentation turns repository functions called beneath the wrapped
|
|
2201
|
-
* function into nested spans
|
|
2202
|
-
*
|
|
2278
|
+
* function into nested spans that capture inputs, outputs, and errors by
|
|
2279
|
+
* default. A confirmed capture policy can narrow rich capture to selected
|
|
2280
|
+
* function IDs. Without a compatible transform, this still records one
|
|
2281
|
+
* normal rich root span and runs the function unchanged.
|
|
2203
2282
|
*
|
|
2204
2283
|
* @param traceFunctionKey - Groups traces and their capture policy.
|
|
2205
2284
|
* @param optionsOrFn - Options or the workflow entrypoint to wrap.
|
|
@@ -2369,6 +2448,19 @@ declare class Bitfab {
|
|
|
2369
2448
|
* @returns A BitfabLangGraphCallbackHandler configured for this client
|
|
2370
2449
|
*/
|
|
2371
2450
|
getLangChainCallbackHandler(traceFunctionKey: string): BitfabLangGraphCallbackHandler;
|
|
2451
|
+
/**
|
|
2452
|
+
* Get the first-class LangGraph integration for tracing and replaying tools
|
|
2453
|
+
* executed by `ToolNode`.
|
|
2454
|
+
*
|
|
2455
|
+
* The integration combines `wrapTools()` for per-tool replay interception
|
|
2456
|
+
* with `createInvoker()` for a callback-configured replayable graph entry
|
|
2457
|
+
* point. Lower-level callback and root wrappers remain available.
|
|
2458
|
+
*
|
|
2459
|
+
* @param traceFunctionKey - Groups traces under this key in Bitfab
|
|
2460
|
+
* @param options - Controls which tools are marked for replay mocking
|
|
2461
|
+
* @experimental This API may change before it is stable.
|
|
2462
|
+
*/
|
|
2463
|
+
getLangGraphIntegration(traceFunctionKey: string, options?: LangGraphIntegrationOptions): BitfabLangGraphIntegration;
|
|
2372
2464
|
/**
|
|
2373
2465
|
* Get a Claude Agent SDK handler for tracing.
|
|
2374
2466
|
*
|
|
@@ -2760,6 +2852,12 @@ declare class BitfabFunction {
|
|
|
2760
2852
|
* @returns A LangChain callback handler for this client and key
|
|
2761
2853
|
*/
|
|
2762
2854
|
getLangChainCallbackHandler(): BitfabLangGraphCallbackHandler;
|
|
2855
|
+
/**
|
|
2856
|
+
* Get the first-class LangGraph tool replay integration bound to this key.
|
|
2857
|
+
*
|
|
2858
|
+
* @experimental This API may change before it is stable.
|
|
2859
|
+
*/
|
|
2860
|
+
getLangGraphIntegration(options?: LangGraphIntegrationOptions): BitfabLangGraphIntegration;
|
|
2763
2861
|
/**
|
|
2764
2862
|
* Wrap a BAML client method to automatically capture prompt and LLM metadata.
|
|
2765
2863
|
* Delegates to the parent client's wrapBAML method.
|
|
@@ -2786,7 +2884,7 @@ declare class BitfabFunction {
|
|
|
2786
2884
|
/**
|
|
2787
2885
|
* SDK version from package.json (injected at build time)
|
|
2788
2886
|
*/
|
|
2789
|
-
declare const __version__ = "0.38.
|
|
2887
|
+
declare const __version__ = "0.38.7";
|
|
2790
2888
|
|
|
2791
2889
|
/**
|
|
2792
2890
|
* Constants for the Bitfab SDK.
|
|
@@ -2889,4 +2987,4 @@ type ReplayRegistry = Record<string, ReplayRegistration>;
|
|
|
2889
2987
|
*/
|
|
2890
2988
|
declare function defineReplayRegistry<TRegistry extends ReplayRegistry>(registry: TRegistry): TRegistry;
|
|
2891
2989
|
|
|
2892
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AllowedEnvVars, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, HttpClient, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, SUPPORTED_PROVIDERS, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceResponse, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, serializeReplayResult };
|
|
2990
|
+
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AllowedEnvVars, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, HttpClient, type LangGraphIntegrationOptions, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, SUPPORTED_PROVIDERS, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceResponse, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, serializeReplayResult };
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
BitfabClaudeAgentHandler,
|
|
4
4
|
BitfabFunction,
|
|
5
5
|
BitfabLangGraphCallbackHandler,
|
|
6
|
+
BitfabLangGraphIntegration,
|
|
6
7
|
BitfabOpenAIAgentHandler,
|
|
7
8
|
BitfabOpenAITracingProcessor,
|
|
8
9
|
BitfabVercelAiHandler,
|
|
@@ -12,8 +13,8 @@ import {
|
|
|
12
13
|
getCurrentReplayBranch,
|
|
13
14
|
getCurrentSpan,
|
|
14
15
|
getCurrentTrace
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-RZ3P6ICN.js";
|
|
17
|
+
import "./chunk-ZUD7OFYB.js";
|
|
17
18
|
import {
|
|
18
19
|
BITFAB_PROGRESS_PREFIX,
|
|
19
20
|
BitfabError,
|
|
@@ -26,7 +27,7 @@ import {
|
|
|
26
27
|
flushTraces,
|
|
27
28
|
reportReplayProgress,
|
|
28
29
|
serializeReplayResult
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-7E6KCBTH.js";
|
|
30
31
|
import "./chunk-H6LZRFMN.js";
|
|
31
32
|
export {
|
|
32
33
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -36,6 +37,7 @@ export {
|
|
|
36
37
|
BitfabFunction,
|
|
37
38
|
BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler,
|
|
38
39
|
BitfabLangGraphCallbackHandler,
|
|
40
|
+
BitfabLangGraphIntegration,
|
|
39
41
|
BitfabOpenAIAgentHandler,
|
|
40
42
|
BitfabOpenAITracingProcessor,
|
|
41
43
|
BitfabVercelAiHandler,
|