bitfab 0.44.1 → 0.46.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/{chunk-6K7ZEU4B.js → chunk-ACTCII7Z.js} +2 -2
- package/dist/{chunk-6K7ZEU4B.js.map → chunk-ACTCII7Z.js.map} +1 -1
- package/dist/{chunk-JEPE7OJ2.js → chunk-RGX4CJ34.js} +2 -2
- package/dist/{chunk-JEPE7OJ2.js.map → chunk-RGX4CJ34.js.map} +1 -1
- package/dist/{chunk-BPVYNFCE.js → chunk-SYRQHV7J.js} +59 -6
- package/dist/chunk-SYRQHV7J.js.map +1 -0
- package/dist/{chunk-PUHN4E2S.js → chunk-V73RJLOF.js} +2 -2
- package/dist/{http-BAP3SWUW.js → http-MKX2IXAQ.js} +2 -2
- package/dist/{http-NSLIVDHV.js → http-NKWONITE.js} +2 -2
- package/dist/index.cjs +56 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +117 -34
- package/dist/index.d.ts +117 -34
- package/dist/index.js +7 -3
- package/dist/node.cjs +56 -1
- 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 +7 -3
- package/dist/node.js.map +1 -1
- package/dist/{replay-ZZXLMJGS.js → replay-Q46MY2HC.js} +3 -3
- package/dist/replayCli.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-BPVYNFCE.js.map +0 -1
- /package/dist/{chunk-PUHN4E2S.js.map → chunk-V73RJLOF.js.map} +0 -0
- /package/dist/{http-BAP3SWUW.js.map → http-MKX2IXAQ.js.map} +0 -0
- /package/dist/{http-NSLIVDHV.js.map → http-NKWONITE.js.map} +0 -0
- /package/dist/{replay-ZZXLMJGS.js.map → replay-Q46MY2HC.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BAML execution utilities for the Bitfab TypeScript SDK.
|
|
3
|
-
* This module provides functions to execute BAML prompts dynamically on the client side.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Provider definition from the server.
|
|
7
|
-
*/
|
|
8
|
-
interface ProviderDefinition {
|
|
9
|
-
provider: string;
|
|
10
|
-
apiKeyEnv: string;
|
|
11
|
-
models: Array<{
|
|
12
|
-
model: string;
|
|
13
|
-
description: string;
|
|
14
|
-
}>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Result of a BAML function execution with raw collector data.
|
|
18
|
-
*/
|
|
19
|
-
interface BamlExecutionResult {
|
|
20
|
-
/** The parsed result of the function */
|
|
21
|
-
result: unknown;
|
|
22
|
-
/** Raw collector data for the server to parse */
|
|
23
|
-
rawCollector: Record<string, unknown> | null;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Type for allowed environment variables.
|
|
27
|
-
* Only OPENAI_API_KEY is currently supported.
|
|
28
|
-
*/
|
|
29
|
-
type AllowedEnvVars = {
|
|
30
|
-
OPENAI_API_KEY?: string;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
1
|
/**
|
|
34
2
|
* Per-trace database snapshot ref capture.
|
|
35
3
|
*
|
|
@@ -803,6 +771,86 @@ interface SpanTreeResponse {
|
|
|
803
771
|
root: SpanTreeNode;
|
|
804
772
|
}
|
|
805
773
|
|
|
774
|
+
type TraceTargetOccurrence = "first" | "last" | number;
|
|
775
|
+
type TraceTarget = {
|
|
776
|
+
kind: "output";
|
|
777
|
+
} | {
|
|
778
|
+
kind: "span";
|
|
779
|
+
name: string;
|
|
780
|
+
occurrence?: TraceTargetOccurrence;
|
|
781
|
+
};
|
|
782
|
+
type TraceAssertionSource = "human" | "agent";
|
|
783
|
+
type TraceAssertion = {
|
|
784
|
+
id: string;
|
|
785
|
+
traceId: string;
|
|
786
|
+
assertion: string;
|
|
787
|
+
passCriteria: string | null;
|
|
788
|
+
failCriteria: string | null;
|
|
789
|
+
targetOnEvaluatedTrace: TraceTarget | null;
|
|
790
|
+
source: TraceAssertionSource;
|
|
791
|
+
createdAt: string;
|
|
792
|
+
updatedAt: string;
|
|
793
|
+
};
|
|
794
|
+
type SaveAssertion = {
|
|
795
|
+
id?: string;
|
|
796
|
+
assertion: string;
|
|
797
|
+
passCriteria?: string | null;
|
|
798
|
+
failCriteria?: string | null;
|
|
799
|
+
targetOnEvaluatedTrace?: TraceTarget | null;
|
|
800
|
+
};
|
|
801
|
+
type TraceAssertionsResult = {
|
|
802
|
+
assertions: TraceAssertion[];
|
|
803
|
+
inheritedFrom: string | null;
|
|
804
|
+
};
|
|
805
|
+
type SaveAssertionsParams = {
|
|
806
|
+
traceId: string;
|
|
807
|
+
assertions: SaveAssertion[];
|
|
808
|
+
source?: TraceAssertionSource;
|
|
809
|
+
};
|
|
810
|
+
type ArchiveAssertionsParams = {
|
|
811
|
+
traceId: string;
|
|
812
|
+
assertionIds: string[];
|
|
813
|
+
};
|
|
814
|
+
declare class TracesClient {
|
|
815
|
+
private readonly httpClient;
|
|
816
|
+
constructor(httpClient: HttpClient);
|
|
817
|
+
getAssertions(traceId: string): Promise<TraceAssertionsResult>;
|
|
818
|
+
saveAssertions(params: SaveAssertionsParams): Promise<TraceAssertion[]>;
|
|
819
|
+
archiveAssertions(params: ArchiveAssertionsParams): Promise<string[]>;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* BAML execution utilities for the Bitfab TypeScript SDK.
|
|
824
|
+
* This module provides functions to execute BAML prompts dynamically on the client side.
|
|
825
|
+
*/
|
|
826
|
+
/**
|
|
827
|
+
* Provider definition from the server.
|
|
828
|
+
*/
|
|
829
|
+
interface ProviderDefinition {
|
|
830
|
+
provider: string;
|
|
831
|
+
apiKeyEnv: string;
|
|
832
|
+
models: Array<{
|
|
833
|
+
model: string;
|
|
834
|
+
description: string;
|
|
835
|
+
}>;
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* Result of a BAML function execution with raw collector data.
|
|
839
|
+
*/
|
|
840
|
+
interface BamlExecutionResult {
|
|
841
|
+
/** The parsed result of the function */
|
|
842
|
+
result: unknown;
|
|
843
|
+
/** Raw collector data for the server to parse */
|
|
844
|
+
rawCollector: Record<string, unknown> | null;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Type for allowed environment variables.
|
|
848
|
+
* Only OPENAI_API_KEY is currently supported.
|
|
849
|
+
*/
|
|
850
|
+
type AllowedEnvVars = {
|
|
851
|
+
OPENAI_API_KEY?: string;
|
|
852
|
+
};
|
|
853
|
+
|
|
806
854
|
/**
|
|
807
855
|
* Claude Agent SDK handler for Bitfab tracing.
|
|
808
856
|
*
|
|
@@ -1209,6 +1257,39 @@ declare class DatasetsClient {
|
|
|
1209
1257
|
getGraderRerun(datasetId: string, runId?: string): Promise<GraderRerun | null>;
|
|
1210
1258
|
}
|
|
1211
1259
|
|
|
1260
|
+
type LabelConfidence = "VeryLow" | "Low" | "Medium" | "High" | "VeryHigh";
|
|
1261
|
+
type LabelAction = "set" | "archived" | "no-active-label" | "skipped";
|
|
1262
|
+
type LabelTarget = {
|
|
1263
|
+
traceId: string;
|
|
1264
|
+
originalTraceId?: never;
|
|
1265
|
+
attempt?: never;
|
|
1266
|
+
} | {
|
|
1267
|
+
originalTraceId: string;
|
|
1268
|
+
attempt?: number;
|
|
1269
|
+
traceId?: never;
|
|
1270
|
+
};
|
|
1271
|
+
type LabelVerdict = {
|
|
1272
|
+
label: boolean;
|
|
1273
|
+
annotation: string;
|
|
1274
|
+
confidence?: LabelConfidence;
|
|
1275
|
+
} | {
|
|
1276
|
+
skip: true;
|
|
1277
|
+
} | {
|
|
1278
|
+
archive: true;
|
|
1279
|
+
};
|
|
1280
|
+
type LabelUpdate = LabelTarget & LabelVerdict;
|
|
1281
|
+
type LabelOutcome = {
|
|
1282
|
+
key: string;
|
|
1283
|
+
traceId: string;
|
|
1284
|
+
action: LabelAction;
|
|
1285
|
+
};
|
|
1286
|
+
declare class LabelsClient {
|
|
1287
|
+
private readonly httpClient;
|
|
1288
|
+
constructor(httpClient: HttpClient);
|
|
1289
|
+
save(update: LabelUpdate, testRunId?: string): Promise<LabelOutcome>;
|
|
1290
|
+
saveAll(updates: LabelUpdate[], testRunId?: string): Promise<LabelOutcome[]>;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1212
1293
|
/**
|
|
1213
1294
|
* LangGraph/LangChain callback handler for Bitfab tracing.
|
|
1214
1295
|
*
|
|
@@ -2469,6 +2550,8 @@ declare class Bitfab {
|
|
|
2469
2550
|
private readonly httpClient;
|
|
2470
2551
|
/** Dataset operations for the authenticated organization. */
|
|
2471
2552
|
readonly datasets: DatasetsClient;
|
|
2553
|
+
readonly traces: TracesClient;
|
|
2554
|
+
readonly labels: LabelsClient;
|
|
2472
2555
|
private readonly bamlClient;
|
|
2473
2556
|
private readonly dbSnapshot;
|
|
2474
2557
|
private readonly autoTracePolicyRefreshes;
|
|
@@ -3114,7 +3197,7 @@ declare class BitfabFunction {
|
|
|
3114
3197
|
/**
|
|
3115
3198
|
* SDK version from package.json (injected at build time)
|
|
3116
3199
|
*/
|
|
3117
|
-
declare const __version__ = "0.
|
|
3200
|
+
declare const __version__ = "0.46.0";
|
|
3118
3201
|
|
|
3119
3202
|
/**
|
|
3120
3203
|
* Constants for the Bitfab SDK.
|
|
@@ -3244,4 +3327,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
|
|
|
3244
3327
|
run?: boolean;
|
|
3245
3328
|
}): Promise<SeedResult>;
|
|
3246
3329
|
|
|
3247
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, HttpClient, type LangGraphIntegrationOptions, type ListDatasetsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, 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, type RerunGradersOptions, type RerunGradersResult, SUPPORTED_PROVIDERS, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceIngestionType, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
|
|
3330
|
+
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, HttpClient, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, 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, type RerunGradersOptions, type RerunGradersResult, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionsParams, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceIngestionType, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BAML execution utilities for the Bitfab TypeScript SDK.
|
|
3
|
-
* This module provides functions to execute BAML prompts dynamically on the client side.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Provider definition from the server.
|
|
7
|
-
*/
|
|
8
|
-
interface ProviderDefinition {
|
|
9
|
-
provider: string;
|
|
10
|
-
apiKeyEnv: string;
|
|
11
|
-
models: Array<{
|
|
12
|
-
model: string;
|
|
13
|
-
description: string;
|
|
14
|
-
}>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Result of a BAML function execution with raw collector data.
|
|
18
|
-
*/
|
|
19
|
-
interface BamlExecutionResult {
|
|
20
|
-
/** The parsed result of the function */
|
|
21
|
-
result: unknown;
|
|
22
|
-
/** Raw collector data for the server to parse */
|
|
23
|
-
rawCollector: Record<string, unknown> | null;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Type for allowed environment variables.
|
|
27
|
-
* Only OPENAI_API_KEY is currently supported.
|
|
28
|
-
*/
|
|
29
|
-
type AllowedEnvVars = {
|
|
30
|
-
OPENAI_API_KEY?: string;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
1
|
/**
|
|
34
2
|
* Per-trace database snapshot ref capture.
|
|
35
3
|
*
|
|
@@ -803,6 +771,86 @@ interface SpanTreeResponse {
|
|
|
803
771
|
root: SpanTreeNode;
|
|
804
772
|
}
|
|
805
773
|
|
|
774
|
+
type TraceTargetOccurrence = "first" | "last" | number;
|
|
775
|
+
type TraceTarget = {
|
|
776
|
+
kind: "output";
|
|
777
|
+
} | {
|
|
778
|
+
kind: "span";
|
|
779
|
+
name: string;
|
|
780
|
+
occurrence?: TraceTargetOccurrence;
|
|
781
|
+
};
|
|
782
|
+
type TraceAssertionSource = "human" | "agent";
|
|
783
|
+
type TraceAssertion = {
|
|
784
|
+
id: string;
|
|
785
|
+
traceId: string;
|
|
786
|
+
assertion: string;
|
|
787
|
+
passCriteria: string | null;
|
|
788
|
+
failCriteria: string | null;
|
|
789
|
+
targetOnEvaluatedTrace: TraceTarget | null;
|
|
790
|
+
source: TraceAssertionSource;
|
|
791
|
+
createdAt: string;
|
|
792
|
+
updatedAt: string;
|
|
793
|
+
};
|
|
794
|
+
type SaveAssertion = {
|
|
795
|
+
id?: string;
|
|
796
|
+
assertion: string;
|
|
797
|
+
passCriteria?: string | null;
|
|
798
|
+
failCriteria?: string | null;
|
|
799
|
+
targetOnEvaluatedTrace?: TraceTarget | null;
|
|
800
|
+
};
|
|
801
|
+
type TraceAssertionsResult = {
|
|
802
|
+
assertions: TraceAssertion[];
|
|
803
|
+
inheritedFrom: string | null;
|
|
804
|
+
};
|
|
805
|
+
type SaveAssertionsParams = {
|
|
806
|
+
traceId: string;
|
|
807
|
+
assertions: SaveAssertion[];
|
|
808
|
+
source?: TraceAssertionSource;
|
|
809
|
+
};
|
|
810
|
+
type ArchiveAssertionsParams = {
|
|
811
|
+
traceId: string;
|
|
812
|
+
assertionIds: string[];
|
|
813
|
+
};
|
|
814
|
+
declare class TracesClient {
|
|
815
|
+
private readonly httpClient;
|
|
816
|
+
constructor(httpClient: HttpClient);
|
|
817
|
+
getAssertions(traceId: string): Promise<TraceAssertionsResult>;
|
|
818
|
+
saveAssertions(params: SaveAssertionsParams): Promise<TraceAssertion[]>;
|
|
819
|
+
archiveAssertions(params: ArchiveAssertionsParams): Promise<string[]>;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* BAML execution utilities for the Bitfab TypeScript SDK.
|
|
824
|
+
* This module provides functions to execute BAML prompts dynamically on the client side.
|
|
825
|
+
*/
|
|
826
|
+
/**
|
|
827
|
+
* Provider definition from the server.
|
|
828
|
+
*/
|
|
829
|
+
interface ProviderDefinition {
|
|
830
|
+
provider: string;
|
|
831
|
+
apiKeyEnv: string;
|
|
832
|
+
models: Array<{
|
|
833
|
+
model: string;
|
|
834
|
+
description: string;
|
|
835
|
+
}>;
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* Result of a BAML function execution with raw collector data.
|
|
839
|
+
*/
|
|
840
|
+
interface BamlExecutionResult {
|
|
841
|
+
/** The parsed result of the function */
|
|
842
|
+
result: unknown;
|
|
843
|
+
/** Raw collector data for the server to parse */
|
|
844
|
+
rawCollector: Record<string, unknown> | null;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Type for allowed environment variables.
|
|
848
|
+
* Only OPENAI_API_KEY is currently supported.
|
|
849
|
+
*/
|
|
850
|
+
type AllowedEnvVars = {
|
|
851
|
+
OPENAI_API_KEY?: string;
|
|
852
|
+
};
|
|
853
|
+
|
|
806
854
|
/**
|
|
807
855
|
* Claude Agent SDK handler for Bitfab tracing.
|
|
808
856
|
*
|
|
@@ -1209,6 +1257,39 @@ declare class DatasetsClient {
|
|
|
1209
1257
|
getGraderRerun(datasetId: string, runId?: string): Promise<GraderRerun | null>;
|
|
1210
1258
|
}
|
|
1211
1259
|
|
|
1260
|
+
type LabelConfidence = "VeryLow" | "Low" | "Medium" | "High" | "VeryHigh";
|
|
1261
|
+
type LabelAction = "set" | "archived" | "no-active-label" | "skipped";
|
|
1262
|
+
type LabelTarget = {
|
|
1263
|
+
traceId: string;
|
|
1264
|
+
originalTraceId?: never;
|
|
1265
|
+
attempt?: never;
|
|
1266
|
+
} | {
|
|
1267
|
+
originalTraceId: string;
|
|
1268
|
+
attempt?: number;
|
|
1269
|
+
traceId?: never;
|
|
1270
|
+
};
|
|
1271
|
+
type LabelVerdict = {
|
|
1272
|
+
label: boolean;
|
|
1273
|
+
annotation: string;
|
|
1274
|
+
confidence?: LabelConfidence;
|
|
1275
|
+
} | {
|
|
1276
|
+
skip: true;
|
|
1277
|
+
} | {
|
|
1278
|
+
archive: true;
|
|
1279
|
+
};
|
|
1280
|
+
type LabelUpdate = LabelTarget & LabelVerdict;
|
|
1281
|
+
type LabelOutcome = {
|
|
1282
|
+
key: string;
|
|
1283
|
+
traceId: string;
|
|
1284
|
+
action: LabelAction;
|
|
1285
|
+
};
|
|
1286
|
+
declare class LabelsClient {
|
|
1287
|
+
private readonly httpClient;
|
|
1288
|
+
constructor(httpClient: HttpClient);
|
|
1289
|
+
save(update: LabelUpdate, testRunId?: string): Promise<LabelOutcome>;
|
|
1290
|
+
saveAll(updates: LabelUpdate[], testRunId?: string): Promise<LabelOutcome[]>;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1212
1293
|
/**
|
|
1213
1294
|
* LangGraph/LangChain callback handler for Bitfab tracing.
|
|
1214
1295
|
*
|
|
@@ -2469,6 +2550,8 @@ declare class Bitfab {
|
|
|
2469
2550
|
private readonly httpClient;
|
|
2470
2551
|
/** Dataset operations for the authenticated organization. */
|
|
2471
2552
|
readonly datasets: DatasetsClient;
|
|
2553
|
+
readonly traces: TracesClient;
|
|
2554
|
+
readonly labels: LabelsClient;
|
|
2472
2555
|
private readonly bamlClient;
|
|
2473
2556
|
private readonly dbSnapshot;
|
|
2474
2557
|
private readonly autoTracePolicyRefreshes;
|
|
@@ -3114,7 +3197,7 @@ declare class BitfabFunction {
|
|
|
3114
3197
|
/**
|
|
3115
3198
|
* SDK version from package.json (injected at build time)
|
|
3116
3199
|
*/
|
|
3117
|
-
declare const __version__ = "0.
|
|
3200
|
+
declare const __version__ = "0.46.0";
|
|
3118
3201
|
|
|
3119
3202
|
/**
|
|
3120
3203
|
* Constants for the Bitfab SDK.
|
|
@@ -3244,4 +3327,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
|
|
|
3244
3327
|
run?: boolean;
|
|
3245
3328
|
}): Promise<SeedResult>;
|
|
3246
3329
|
|
|
3247
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, HttpClient, type LangGraphIntegrationOptions, type ListDatasetsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, 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, type RerunGradersOptions, type RerunGradersResult, SUPPORTED_PROVIDERS, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceIngestionType, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
|
|
3330
|
+
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, HttpClient, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, 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, type RerunGradersOptions, type RerunGradersResult, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionsParams, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceIngestionType, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
|
package/dist/index.js
CHANGED
|
@@ -17,14 +17,16 @@ import {
|
|
|
17
17
|
BitfabOpenAITracingProcessor,
|
|
18
18
|
BitfabVercelAiHandler,
|
|
19
19
|
DatasetsClient,
|
|
20
|
+
LabelsClient,
|
|
20
21
|
SUPPORTED_PROVIDERS,
|
|
22
|
+
TracesClient,
|
|
21
23
|
defineReplayRegistry,
|
|
22
24
|
finalizers,
|
|
23
25
|
getCurrentReplayBranch,
|
|
24
26
|
getCurrentSpan,
|
|
25
27
|
getCurrentTrace,
|
|
26
28
|
seedFromRegistry
|
|
27
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-SYRQHV7J.js";
|
|
28
30
|
import "./chunk-ZUD7OFYB.js";
|
|
29
31
|
import {
|
|
30
32
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -33,7 +35,7 @@ import {
|
|
|
33
35
|
ReplayError,
|
|
34
36
|
reportReplayProgress,
|
|
35
37
|
serializeReplayResult
|
|
36
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-V73RJLOF.js";
|
|
37
39
|
import {
|
|
38
40
|
BitfabError,
|
|
39
41
|
DEFAULT_SERVICE_URL,
|
|
@@ -41,7 +43,7 @@ import {
|
|
|
41
43
|
MixedTracingError,
|
|
42
44
|
__version__,
|
|
43
45
|
flushTraces
|
|
44
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-ACTCII7Z.js";
|
|
45
47
|
import "./chunk-H6LZRFMN.js";
|
|
46
48
|
export {
|
|
47
49
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -59,10 +61,12 @@ export {
|
|
|
59
61
|
DatasetsClient,
|
|
60
62
|
DbBranchReplayError,
|
|
61
63
|
HttpClient,
|
|
64
|
+
LabelsClient,
|
|
62
65
|
MixedTracingError,
|
|
63
66
|
NO_MOCK_OVERRIDE,
|
|
64
67
|
ReplayError,
|
|
65
68
|
SUPPORTED_PROVIDERS,
|
|
69
|
+
TracesClient,
|
|
66
70
|
__version__,
|
|
67
71
|
defineReplayRegistry,
|
|
68
72
|
finalizers,
|
package/dist/node.cjs
CHANGED
|
@@ -97,7 +97,7 @@ var __version__, __packageName__;
|
|
|
97
97
|
var init_version_generated = __esm({
|
|
98
98
|
"src/version.generated.ts"() {
|
|
99
99
|
"use strict";
|
|
100
|
-
__version__ = "0.
|
|
100
|
+
__version__ = "0.46.0";
|
|
101
101
|
__packageName__ = "bitfab";
|
|
102
102
|
}
|
|
103
103
|
});
|
|
@@ -3285,10 +3285,12 @@ __export(node_exports, {
|
|
|
3285
3285
|
DatasetsClient: () => DatasetsClient,
|
|
3286
3286
|
DbBranchReplayError: () => DbBranchReplayError,
|
|
3287
3287
|
HttpClient: () => HttpClient,
|
|
3288
|
+
LabelsClient: () => LabelsClient,
|
|
3288
3289
|
MixedTracingError: () => MixedTracingError,
|
|
3289
3290
|
NO_MOCK_OVERRIDE: () => NO_MOCK_OVERRIDE,
|
|
3290
3291
|
ReplayError: () => ReplayError,
|
|
3291
3292
|
SUPPORTED_PROVIDERS: () => SUPPORTED_PROVIDERS,
|
|
3293
|
+
TracesClient: () => TracesClient,
|
|
3292
3294
|
__version__: () => __version__,
|
|
3293
3295
|
defineReplayRegistry: () => defineReplayRegistry,
|
|
3294
3296
|
finalizers: () => finalizers,
|
|
@@ -3309,6 +3311,33 @@ registerAsyncLocalStorageClass(
|
|
|
3309
3311
|
import_node_async_hooks.AsyncLocalStorage
|
|
3310
3312
|
);
|
|
3311
3313
|
|
|
3314
|
+
// src/assertions.ts
|
|
3315
|
+
function expectationsPath(traceId, suffix = "") {
|
|
3316
|
+
return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
|
|
3317
|
+
}
|
|
3318
|
+
var TracesClient = class {
|
|
3319
|
+
constructor(httpClient) {
|
|
3320
|
+
this.httpClient = httpClient;
|
|
3321
|
+
}
|
|
3322
|
+
async getAssertions(traceId) {
|
|
3323
|
+
return this.httpClient.get(expectationsPath(traceId));
|
|
3324
|
+
}
|
|
3325
|
+
async saveAssertions(params) {
|
|
3326
|
+
const response = await this.httpClient.request(expectationsPath(params.traceId), {
|
|
3327
|
+
assertions: params.assertions,
|
|
3328
|
+
source: params.source ?? "agent"
|
|
3329
|
+
});
|
|
3330
|
+
return response.assertions;
|
|
3331
|
+
}
|
|
3332
|
+
async archiveAssertions(params) {
|
|
3333
|
+
const response = await this.httpClient.request(
|
|
3334
|
+
expectationsPath(params.traceId, "/archive"),
|
|
3335
|
+
{ assertionIds: params.assertionIds }
|
|
3336
|
+
);
|
|
3337
|
+
return response.archived;
|
|
3338
|
+
}
|
|
3339
|
+
};
|
|
3340
|
+
|
|
3312
3341
|
// src/claudeAgentSdk.ts
|
|
3313
3342
|
init_constants();
|
|
3314
3343
|
init_http();
|
|
@@ -4559,6 +4588,28 @@ function buildSnapshotRef(config, sdkWallClockBeforeFn) {
|
|
|
4559
4588
|
init_errors();
|
|
4560
4589
|
init_http();
|
|
4561
4590
|
|
|
4591
|
+
// src/labels.ts
|
|
4592
|
+
var LABELS_PATH = "/api/sdk/traces/labels";
|
|
4593
|
+
var LabelsClient = class {
|
|
4594
|
+
constructor(httpClient) {
|
|
4595
|
+
this.httpClient = httpClient;
|
|
4596
|
+
}
|
|
4597
|
+
async save(update, testRunId) {
|
|
4598
|
+
const [outcome] = await this.saveAll([update], testRunId);
|
|
4599
|
+
return outcome;
|
|
4600
|
+
}
|
|
4601
|
+
async saveAll(updates, testRunId) {
|
|
4602
|
+
const response = await this.httpClient.request(
|
|
4603
|
+
LABELS_PATH,
|
|
4604
|
+
{
|
|
4605
|
+
labels: updates,
|
|
4606
|
+
...testRunId === void 0 ? {} : { testRunId }
|
|
4607
|
+
}
|
|
4608
|
+
);
|
|
4609
|
+
return response.labels;
|
|
4610
|
+
}
|
|
4611
|
+
};
|
|
4612
|
+
|
|
4562
4613
|
// src/langgraph.ts
|
|
4563
4614
|
init_constants();
|
|
4564
4615
|
init_http();
|
|
@@ -6332,6 +6383,8 @@ var Bitfab = class {
|
|
|
6332
6383
|
timeout: this.timeout
|
|
6333
6384
|
});
|
|
6334
6385
|
this.datasets = new DatasetsClient(this.httpClient);
|
|
6386
|
+
this.traces = new TracesClient(this.httpClient);
|
|
6387
|
+
this.labels = new LabelsClient(this.httpClient);
|
|
6335
6388
|
}
|
|
6336
6389
|
/**
|
|
6337
6390
|
* Decorate a class method as an automatically expanded trace root.
|
|
@@ -8237,10 +8290,12 @@ assertAsyncStorageRegistered();
|
|
|
8237
8290
|
DatasetsClient,
|
|
8238
8291
|
DbBranchReplayError,
|
|
8239
8292
|
HttpClient,
|
|
8293
|
+
LabelsClient,
|
|
8240
8294
|
MixedTracingError,
|
|
8241
8295
|
NO_MOCK_OVERRIDE,
|
|
8242
8296
|
ReplayError,
|
|
8243
8297
|
SUPPORTED_PROVIDERS,
|
|
8298
|
+
TracesClient,
|
|
8244
8299
|
__version__,
|
|
8245
8300
|
defineReplayRegistry,
|
|
8246
8301
|
finalizers,
|