bitfab 0.16.0 → 0.16.2
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/{chunk-53G5GR7B.js → chunk-4WJPQT2X.js} +24 -6
- package/dist/{chunk-53G5GR7B.js.map → chunk-4WJPQT2X.js.map} +1 -1
- package/dist/index.cjs +30 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -8
- package/dist/index.d.ts +24 -8
- package/dist/index.js +2 -1
- package/dist/node.cjs +30 -7
- 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 +2 -1
- package/dist/{replay-WIBKB3BK.js → replay-BIPIDXX6.js} +7 -4
- package/dist/replay-BIPIDXX6.js.map +1 -0
- package/package.json +1 -1
- package/dist/replay-WIBKB3BK.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -343,9 +343,9 @@ declare class ReplayEnvironment {
|
|
|
343
343
|
type MockStrategy = "none" | "all" | "marked";
|
|
344
344
|
interface ReplayOptions {
|
|
345
345
|
/**
|
|
346
|
-
* Maximum number of traces to replay (1
|
|
347
|
-
*
|
|
348
|
-
* many traces replay
|
|
346
|
+
* Maximum number of traces to replay (1-100, default 5). Ignored when
|
|
347
|
+
* `traceIds` is passed (with a warning): an explicit ID list already
|
|
348
|
+
* determines how many traces replay.
|
|
349
349
|
*/
|
|
350
350
|
limit?: number;
|
|
351
351
|
/** Optional list of specific trace IDs to replay (max 100). */
|
|
@@ -812,6 +812,22 @@ declare class Bitfab {
|
|
|
812
812
|
* @returns A BitfabLangGraphCallbackHandler configured for this client
|
|
813
813
|
*/
|
|
814
814
|
getLangGraphCallbackHandler(traceFunctionKey: string): BitfabLangGraphCallbackHandler;
|
|
815
|
+
/**
|
|
816
|
+
* Get a LangChain callback handler for tracing.
|
|
817
|
+
*
|
|
818
|
+
* Alias of {@link getLangGraphCallbackHandler}: LangChain chains and
|
|
819
|
+
* LangGraph graphs share the same callback system, so one handler serves
|
|
820
|
+
* both.
|
|
821
|
+
*
|
|
822
|
+
* ```typescript
|
|
823
|
+
* const handler = client.getLangChainCallbackHandler("my-chain");
|
|
824
|
+
* const result = await chain.invoke(input, { callbacks: [handler] });
|
|
825
|
+
* ```
|
|
826
|
+
*
|
|
827
|
+
* @param traceFunctionKey - Groups traces under this key in Bitfab
|
|
828
|
+
* @returns A BitfabLangGraphCallbackHandler configured for this client
|
|
829
|
+
*/
|
|
830
|
+
getLangChainCallbackHandler(traceFunctionKey: string): BitfabLangGraphCallbackHandler;
|
|
815
831
|
/**
|
|
816
832
|
* Get a Claude Agent SDK handler for tracing.
|
|
817
833
|
*
|
|
@@ -959,9 +975,9 @@ declare class Bitfab {
|
|
|
959
975
|
*
|
|
960
976
|
* @param traceFunctionKey - The trace function key to replay
|
|
961
977
|
* @param fn - The function to replay (must be the return value of `withSpan`)
|
|
962
|
-
* @param options - Optional replay options.
|
|
963
|
-
*
|
|
964
|
-
*
|
|
978
|
+
* @param options - Optional replay options. When `traceIds` is passed,
|
|
979
|
+
* `limit` is ignored (with a warning): an explicit ID list already
|
|
980
|
+
* determines how many traces replay.
|
|
965
981
|
* @returns ReplayResult with items, testRunId, and testRunUrl
|
|
966
982
|
*/
|
|
967
983
|
replay<TReturn>(traceFunctionKey: string, fn: (...args: any[]) => TReturn | Promise<TReturn>, options?: ReplayOptions): Promise<ReplayResult<TReturn>>;
|
|
@@ -1027,7 +1043,7 @@ declare class BitfabFunction {
|
|
|
1027
1043
|
/**
|
|
1028
1044
|
* SDK version from package.json (injected at build time)
|
|
1029
1045
|
*/
|
|
1030
|
-
declare const __version__ = "0.16.
|
|
1046
|
+
declare const __version__ = "0.16.2";
|
|
1031
1047
|
|
|
1032
1048
|
/**
|
|
1033
1049
|
* Constants for the Bitfab SDK.
|
|
@@ -1037,4 +1053,4 @@ declare const __version__ = "0.16.0";
|
|
|
1037
1053
|
*/
|
|
1038
1054
|
declare const DEFAULT_SERVICE_URL = "https://bitfab.ai";
|
|
1039
1055
|
|
|
1040
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AllowedEnvVars, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler, BitfabOpenAITracingProcessor, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type MockStrategy, type ProviderDefinition, ReplayEnvironment, type ReplayEnvironmentSnapshot, type ReplayItem, type ReplayOptions, type ReplayResult, SUPPORTED_PROVIDERS, type SpanOptions, type SpanType, type TokenUsage, type TraceResponse, type TracingProcessor, type WrapBAMLOptions, type WrappedBamlFn, __version__, flushTraces, getCurrentSpan, getCurrentTrace };
|
|
1056
|
+
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AllowedEnvVars, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabOpenAITracingProcessor, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type MockStrategy, type ProviderDefinition, ReplayEnvironment, type ReplayEnvironmentSnapshot, type ReplayItem, type ReplayOptions, type ReplayResult, SUPPORTED_PROVIDERS, type SpanOptions, type SpanType, type TokenUsage, type TraceResponse, type TracingProcessor, type WrapBAMLOptions, type WrappedBamlFn, __version__, flushTraces, getCurrentSpan, getCurrentTrace };
|
package/dist/index.d.ts
CHANGED
|
@@ -343,9 +343,9 @@ declare class ReplayEnvironment {
|
|
|
343
343
|
type MockStrategy = "none" | "all" | "marked";
|
|
344
344
|
interface ReplayOptions {
|
|
345
345
|
/**
|
|
346
|
-
* Maximum number of traces to replay (1
|
|
347
|
-
*
|
|
348
|
-
* many traces replay
|
|
346
|
+
* Maximum number of traces to replay (1-100, default 5). Ignored when
|
|
347
|
+
* `traceIds` is passed (with a warning): an explicit ID list already
|
|
348
|
+
* determines how many traces replay.
|
|
349
349
|
*/
|
|
350
350
|
limit?: number;
|
|
351
351
|
/** Optional list of specific trace IDs to replay (max 100). */
|
|
@@ -812,6 +812,22 @@ declare class Bitfab {
|
|
|
812
812
|
* @returns A BitfabLangGraphCallbackHandler configured for this client
|
|
813
813
|
*/
|
|
814
814
|
getLangGraphCallbackHandler(traceFunctionKey: string): BitfabLangGraphCallbackHandler;
|
|
815
|
+
/**
|
|
816
|
+
* Get a LangChain callback handler for tracing.
|
|
817
|
+
*
|
|
818
|
+
* Alias of {@link getLangGraphCallbackHandler}: LangChain chains and
|
|
819
|
+
* LangGraph graphs share the same callback system, so one handler serves
|
|
820
|
+
* both.
|
|
821
|
+
*
|
|
822
|
+
* ```typescript
|
|
823
|
+
* const handler = client.getLangChainCallbackHandler("my-chain");
|
|
824
|
+
* const result = await chain.invoke(input, { callbacks: [handler] });
|
|
825
|
+
* ```
|
|
826
|
+
*
|
|
827
|
+
* @param traceFunctionKey - Groups traces under this key in Bitfab
|
|
828
|
+
* @returns A BitfabLangGraphCallbackHandler configured for this client
|
|
829
|
+
*/
|
|
830
|
+
getLangChainCallbackHandler(traceFunctionKey: string): BitfabLangGraphCallbackHandler;
|
|
815
831
|
/**
|
|
816
832
|
* Get a Claude Agent SDK handler for tracing.
|
|
817
833
|
*
|
|
@@ -959,9 +975,9 @@ declare class Bitfab {
|
|
|
959
975
|
*
|
|
960
976
|
* @param traceFunctionKey - The trace function key to replay
|
|
961
977
|
* @param fn - The function to replay (must be the return value of `withSpan`)
|
|
962
|
-
* @param options - Optional replay options.
|
|
963
|
-
*
|
|
964
|
-
*
|
|
978
|
+
* @param options - Optional replay options. When `traceIds` is passed,
|
|
979
|
+
* `limit` is ignored (with a warning): an explicit ID list already
|
|
980
|
+
* determines how many traces replay.
|
|
965
981
|
* @returns ReplayResult with items, testRunId, and testRunUrl
|
|
966
982
|
*/
|
|
967
983
|
replay<TReturn>(traceFunctionKey: string, fn: (...args: any[]) => TReturn | Promise<TReturn>, options?: ReplayOptions): Promise<ReplayResult<TReturn>>;
|
|
@@ -1027,7 +1043,7 @@ declare class BitfabFunction {
|
|
|
1027
1043
|
/**
|
|
1028
1044
|
* SDK version from package.json (injected at build time)
|
|
1029
1045
|
*/
|
|
1030
|
-
declare const __version__ = "0.16.
|
|
1046
|
+
declare const __version__ = "0.16.2";
|
|
1031
1047
|
|
|
1032
1048
|
/**
|
|
1033
1049
|
* Constants for the Bitfab SDK.
|
|
@@ -1037,4 +1053,4 @@ declare const __version__ = "0.16.0";
|
|
|
1037
1053
|
*/
|
|
1038
1054
|
declare const DEFAULT_SERVICE_URL = "https://bitfab.ai";
|
|
1039
1055
|
|
|
1040
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AllowedEnvVars, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler, BitfabOpenAITracingProcessor, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type MockStrategy, type ProviderDefinition, ReplayEnvironment, type ReplayEnvironmentSnapshot, type ReplayItem, type ReplayOptions, type ReplayResult, SUPPORTED_PROVIDERS, type SpanOptions, type SpanType, type TokenUsage, type TraceResponse, type TracingProcessor, type WrapBAMLOptions, type WrappedBamlFn, __version__, flushTraces, getCurrentSpan, getCurrentTrace };
|
|
1056
|
+
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AllowedEnvVars, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabOpenAITracingProcessor, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type MockStrategy, type ProviderDefinition, ReplayEnvironment, type ReplayEnvironmentSnapshot, type ReplayItem, type ReplayOptions, type ReplayResult, SUPPORTED_PROVIDERS, type SpanOptions, type SpanType, type TokenUsage, type TraceResponse, type TracingProcessor, type WrapBAMLOptions, type WrappedBamlFn, __version__, flushTraces, getCurrentSpan, getCurrentTrace };
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
flushTraces,
|
|
21
21
|
getCurrentSpan,
|
|
22
22
|
getCurrentTrace
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-4WJPQT2X.js";
|
|
24
24
|
import {
|
|
25
25
|
BitfabError
|
|
26
26
|
} from "./chunk-QT7HWOKU.js";
|
|
@@ -29,6 +29,7 @@ export {
|
|
|
29
29
|
BitfabClaudeAgentHandler,
|
|
30
30
|
BitfabError,
|
|
31
31
|
BitfabFunction,
|
|
32
|
+
BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler,
|
|
32
33
|
BitfabLangGraphCallbackHandler,
|
|
33
34
|
BitfabOpenAITracingProcessor,
|
|
34
35
|
DEFAULT_SERVICE_URL,
|
package/dist/node.cjs
CHANGED
|
@@ -333,9 +333,12 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
|
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
if (options?.limit !== void 0 && options?.traceIds !== void 0) {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
try {
|
|
337
|
+
console.warn(
|
|
338
|
+
"Bitfab: limit is ignored when traceIds is passed: the explicit trace ID list already determines how many traces replay."
|
|
339
|
+
);
|
|
340
|
+
} catch {
|
|
341
|
+
}
|
|
339
342
|
}
|
|
340
343
|
await replayContextReady;
|
|
341
344
|
const {
|
|
@@ -432,6 +435,7 @@ __export(node_exports, {
|
|
|
432
435
|
BitfabClaudeAgentHandler: () => BitfabClaudeAgentHandler,
|
|
433
436
|
BitfabError: () => BitfabError,
|
|
434
437
|
BitfabFunction: () => BitfabFunction,
|
|
438
|
+
BitfabLangChainCallbackHandler: () => BitfabLangGraphCallbackHandler,
|
|
435
439
|
BitfabLangGraphCallbackHandler: () => BitfabLangGraphCallbackHandler,
|
|
436
440
|
BitfabOpenAITracingProcessor: () => BitfabOpenAITracingProcessor,
|
|
437
441
|
DEFAULT_SERVICE_URL: () => DEFAULT_SERVICE_URL,
|
|
@@ -452,7 +456,7 @@ registerAsyncLocalStorageClass(
|
|
|
452
456
|
);
|
|
453
457
|
|
|
454
458
|
// src/version.generated.ts
|
|
455
|
-
var __version__ = "0.16.
|
|
459
|
+
var __version__ = "0.16.2";
|
|
456
460
|
|
|
457
461
|
// src/constants.ts
|
|
458
462
|
var DEFAULT_SERVICE_URL = "https://bitfab.ai";
|
|
@@ -2739,6 +2743,24 @@ var Bitfab = class {
|
|
|
2739
2743
|
}
|
|
2740
2744
|
});
|
|
2741
2745
|
}
|
|
2746
|
+
/**
|
|
2747
|
+
* Get a LangChain callback handler for tracing.
|
|
2748
|
+
*
|
|
2749
|
+
* Alias of {@link getLangGraphCallbackHandler}: LangChain chains and
|
|
2750
|
+
* LangGraph graphs share the same callback system, so one handler serves
|
|
2751
|
+
* both.
|
|
2752
|
+
*
|
|
2753
|
+
* ```typescript
|
|
2754
|
+
* const handler = client.getLangChainCallbackHandler("my-chain");
|
|
2755
|
+
* const result = await chain.invoke(input, { callbacks: [handler] });
|
|
2756
|
+
* ```
|
|
2757
|
+
*
|
|
2758
|
+
* @param traceFunctionKey - Groups traces under this key in Bitfab
|
|
2759
|
+
* @returns A BitfabLangGraphCallbackHandler configured for this client
|
|
2760
|
+
*/
|
|
2761
|
+
getLangChainCallbackHandler(traceFunctionKey) {
|
|
2762
|
+
return this.getLangGraphCallbackHandler(traceFunctionKey);
|
|
2763
|
+
}
|
|
2742
2764
|
/**
|
|
2743
2765
|
* Get a Claude Agent SDK handler for tracing.
|
|
2744
2766
|
*
|
|
@@ -3242,9 +3264,9 @@ var Bitfab = class {
|
|
|
3242
3264
|
*
|
|
3243
3265
|
* @param traceFunctionKey - The trace function key to replay
|
|
3244
3266
|
* @param fn - The function to replay (must be the return value of `withSpan`)
|
|
3245
|
-
* @param options - Optional replay options.
|
|
3246
|
-
*
|
|
3247
|
-
*
|
|
3267
|
+
* @param options - Optional replay options. When `traceIds` is passed,
|
|
3268
|
+
* `limit` is ignored (with a warning): an explicit ID list already
|
|
3269
|
+
* determines how many traces replay.
|
|
3248
3270
|
* @returns ReplayResult with items, testRunId, and testRunUrl
|
|
3249
3271
|
*/
|
|
3250
3272
|
async replay(traceFunctionKey, fn, options) {
|
|
@@ -3322,6 +3344,7 @@ assertAsyncStorageRegistered();
|
|
|
3322
3344
|
BitfabClaudeAgentHandler,
|
|
3323
3345
|
BitfabError,
|
|
3324
3346
|
BitfabFunction,
|
|
3347
|
+
BitfabLangChainCallbackHandler,
|
|
3325
3348
|
BitfabLangGraphCallbackHandler,
|
|
3326
3349
|
BitfabOpenAITracingProcessor,
|
|
3327
3350
|
DEFAULT_SERVICE_URL,
|