bitfab 0.54.7 → 0.54.9
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/README.md +2 -1
- package/dist/{chunk-CRBJE655.js → chunk-5EW5MV2Z.js} +3 -3
- package/dist/{chunk-GGMFD2ZE.js → chunk-7HXFT6JR.js} +2 -2
- package/dist/{chunk-GGMFD2ZE.js.map → chunk-7HXFT6JR.js.map} +1 -1
- package/dist/{chunk-VDQAIWLX.js → chunk-TOCJX6OP.js} +2 -2
- package/dist/{chunk-VDQAIWLX.js.map → chunk-TOCJX6OP.js.map} +1 -1
- package/dist/{chunk-MFMTLYDW.js → chunk-UKKR2PF4.js} +44 -11
- package/dist/chunk-UKKR2PF4.js.map +1 -0
- package/dist/{chunk-ONMN7WXS.js → chunk-VT5IUVBY.js} +2 -2
- package/dist/{http-NIVPIUA2.js → http-HYJYQTX2.js} +2 -2
- package/dist/{http-DYGY3K7H.js → http-WQ6YWRTW.js} +2 -2
- package/dist/index.cjs +39 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -5
- package/dist/index.d.ts +50 -5
- package/dist/index.js +3 -3
- package/dist/node.cjs +39 -6
- 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 +3 -3
- package/dist/{replay-22RLT3Z4.js → replay-MISWCCCG.js} +3 -3
- package/dist/replayCli.js +2 -2
- package/dist/seedCli.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-MFMTLYDW.js.map +0 -1
- /package/dist/{chunk-CRBJE655.js.map → chunk-5EW5MV2Z.js.map} +0 -0
- /package/dist/{chunk-ONMN7WXS.js.map → chunk-VT5IUVBY.js.map} +0 -0
- /package/dist/{http-DYGY3K7H.js.map → http-HYJYQTX2.js.map} +0 -0
- /package/dist/{http-NIVPIUA2.js.map → http-WQ6YWRTW.js.map} +0 -0
- /package/dist/{replay-22RLT3Z4.js.map → replay-MISWCCCG.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/** One span the justification rests on, with what that span shows. */
|
|
2
|
+
type JustificationSpan = {
|
|
3
|
+
spanId: string;
|
|
4
|
+
text: string;
|
|
5
|
+
};
|
|
6
|
+
/** Evidence for an assertion or a category: one entry per span relied on. */
|
|
7
|
+
type Justification = JustificationSpan[];
|
|
8
|
+
/** Whether a person has reviewed an assertion or a category. */
|
|
9
|
+
type ApprovalState = "pending" | "approved" | "rejected";
|
|
10
|
+
type Approver = {
|
|
11
|
+
id: string;
|
|
12
|
+
fullName: string | null;
|
|
13
|
+
email: string | null;
|
|
14
|
+
imageUrl: string | null;
|
|
15
|
+
};
|
|
16
|
+
/** Read-only on this client: only a person in Bitfab sets these. */
|
|
17
|
+
type ApprovalFields = {
|
|
18
|
+
approvalState: ApprovalState;
|
|
19
|
+
approvedBy: Approver | null;
|
|
20
|
+
approvedAt: string | null;
|
|
21
|
+
};
|
|
22
|
+
|
|
1
23
|
declare class TraceCompletion {
|
|
2
24
|
private readonly traces;
|
|
3
25
|
private readonly closed;
|
|
@@ -816,13 +838,20 @@ type AssertionCategorySummary = {
|
|
|
816
838
|
};
|
|
817
839
|
type AssertionCategory = AssertionCategorySummary & {
|
|
818
840
|
organizationId: string;
|
|
841
|
+
/** Why this category is worth having, span by span. */
|
|
842
|
+
justification: Justification | null;
|
|
819
843
|
createdAt: string;
|
|
820
844
|
updatedAt: string;
|
|
821
|
-
};
|
|
845
|
+
} & ApprovalFields;
|
|
822
846
|
type SaveAssertionCategoryParams = {
|
|
823
847
|
id?: string;
|
|
824
848
|
title: string;
|
|
825
849
|
description?: string;
|
|
850
|
+
/**
|
|
851
|
+
* Why this category is worth having, one entry per span it rests on. Any span
|
|
852
|
+
* in the organization may be cited. Omit on an edit to preserve it.
|
|
853
|
+
*/
|
|
854
|
+
justification?: Justification | null;
|
|
826
855
|
};
|
|
827
856
|
/** Organization-scoped groupings for assertions. */
|
|
828
857
|
declare class AssertionCategoriesClient {
|
|
@@ -2223,9 +2252,13 @@ type TraceAssertion = {
|
|
|
2223
2252
|
failCriteria: string | null;
|
|
2224
2253
|
targetOnEvaluatedTrace: TraceTarget | null;
|
|
2225
2254
|
source: TraceAssertionSource;
|
|
2255
|
+
/** Why this assertion is right for its trace, span by span. */
|
|
2256
|
+
justification: Justification | null;
|
|
2257
|
+
/** Why its assigned category is the right one, span by span. */
|
|
2258
|
+
categoryJustification: Justification | null;
|
|
2226
2259
|
createdAt: string;
|
|
2227
2260
|
updatedAt: string;
|
|
2228
|
-
};
|
|
2261
|
+
} & ApprovalFields;
|
|
2229
2262
|
type SaveAssertion = {
|
|
2230
2263
|
/** Omit to preserve the category, or pass null to clear it. */
|
|
2231
2264
|
category_assertion_id?: string | null;
|
|
@@ -2234,6 +2267,16 @@ type SaveAssertion = {
|
|
|
2234
2267
|
passCriteria?: string | null;
|
|
2235
2268
|
failCriteria?: string | null;
|
|
2236
2269
|
targetOnEvaluatedTrace?: TraceTarget | null;
|
|
2270
|
+
/**
|
|
2271
|
+
* Why this assertion is right for this trace, one entry per span it rests on.
|
|
2272
|
+
* Cite spans on this trace only. Omit on an edit to preserve it.
|
|
2273
|
+
*/
|
|
2274
|
+
justification?: Justification | null;
|
|
2275
|
+
/**
|
|
2276
|
+
* Why `category_assertion_id` is the right category. Changing the category
|
|
2277
|
+
* clears it. Omit on an edit to preserve it.
|
|
2278
|
+
*/
|
|
2279
|
+
categoryJustification?: Justification | null;
|
|
2237
2280
|
};
|
|
2238
2281
|
type TraceAssertionsResult = {
|
|
2239
2282
|
assertions: TraceAssertion[];
|
|
@@ -2763,7 +2806,8 @@ declare class Bitfab {
|
|
|
2763
2806
|
private readonly serviceUrl;
|
|
2764
2807
|
private readonly timeout;
|
|
2765
2808
|
private readonly envVars;
|
|
2766
|
-
private readonly
|
|
2809
|
+
private readonly captureConfiguredInCode;
|
|
2810
|
+
private captureConfiguredFromEnv;
|
|
2767
2811
|
private readonly strict;
|
|
2768
2812
|
private readonly httpClient;
|
|
2769
2813
|
/** Dataset operations for the authenticated organization. */
|
|
@@ -2884,6 +2928,7 @@ declare class Bitfab {
|
|
|
2884
2928
|
* early resolve that found nothing never poisons a later one.
|
|
2885
2929
|
*/
|
|
2886
2930
|
private resolveApiKey;
|
|
2931
|
+
private isCaptureConfigured;
|
|
2887
2932
|
private isCaptureEnabled;
|
|
2888
2933
|
private shouldRecord;
|
|
2889
2934
|
private prepareFrameworkIntegration;
|
|
@@ -3429,7 +3474,7 @@ interface CommitRef {
|
|
|
3429
3474
|
/**
|
|
3430
3475
|
* SDK version from package.json (injected at build time)
|
|
3431
3476
|
*/
|
|
3432
|
-
declare const __version__ = "0.54.
|
|
3477
|
+
declare const __version__ = "0.54.9";
|
|
3433
3478
|
|
|
3434
3479
|
/**
|
|
3435
3480
|
* Constants for the Bitfab SDK.
|
|
@@ -3568,4 +3613,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
|
|
|
3568
3613
|
run?: boolean;
|
|
3569
3614
|
}): Promise<SeedResult>;
|
|
3570
3615
|
|
|
3571
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionVerdict, 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 CommitRef, 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 GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, 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, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, 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 TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, 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, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
|
|
3616
|
+
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionVerdict, 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 CommitRef, 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 GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, 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, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, 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 TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, 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, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/** One span the justification rests on, with what that span shows. */
|
|
2
|
+
type JustificationSpan = {
|
|
3
|
+
spanId: string;
|
|
4
|
+
text: string;
|
|
5
|
+
};
|
|
6
|
+
/** Evidence for an assertion or a category: one entry per span relied on. */
|
|
7
|
+
type Justification = JustificationSpan[];
|
|
8
|
+
/** Whether a person has reviewed an assertion or a category. */
|
|
9
|
+
type ApprovalState = "pending" | "approved" | "rejected";
|
|
10
|
+
type Approver = {
|
|
11
|
+
id: string;
|
|
12
|
+
fullName: string | null;
|
|
13
|
+
email: string | null;
|
|
14
|
+
imageUrl: string | null;
|
|
15
|
+
};
|
|
16
|
+
/** Read-only on this client: only a person in Bitfab sets these. */
|
|
17
|
+
type ApprovalFields = {
|
|
18
|
+
approvalState: ApprovalState;
|
|
19
|
+
approvedBy: Approver | null;
|
|
20
|
+
approvedAt: string | null;
|
|
21
|
+
};
|
|
22
|
+
|
|
1
23
|
declare class TraceCompletion {
|
|
2
24
|
private readonly traces;
|
|
3
25
|
private readonly closed;
|
|
@@ -816,13 +838,20 @@ type AssertionCategorySummary = {
|
|
|
816
838
|
};
|
|
817
839
|
type AssertionCategory = AssertionCategorySummary & {
|
|
818
840
|
organizationId: string;
|
|
841
|
+
/** Why this category is worth having, span by span. */
|
|
842
|
+
justification: Justification | null;
|
|
819
843
|
createdAt: string;
|
|
820
844
|
updatedAt: string;
|
|
821
|
-
};
|
|
845
|
+
} & ApprovalFields;
|
|
822
846
|
type SaveAssertionCategoryParams = {
|
|
823
847
|
id?: string;
|
|
824
848
|
title: string;
|
|
825
849
|
description?: string;
|
|
850
|
+
/**
|
|
851
|
+
* Why this category is worth having, one entry per span it rests on. Any span
|
|
852
|
+
* in the organization may be cited. Omit on an edit to preserve it.
|
|
853
|
+
*/
|
|
854
|
+
justification?: Justification | null;
|
|
826
855
|
};
|
|
827
856
|
/** Organization-scoped groupings for assertions. */
|
|
828
857
|
declare class AssertionCategoriesClient {
|
|
@@ -2223,9 +2252,13 @@ type TraceAssertion = {
|
|
|
2223
2252
|
failCriteria: string | null;
|
|
2224
2253
|
targetOnEvaluatedTrace: TraceTarget | null;
|
|
2225
2254
|
source: TraceAssertionSource;
|
|
2255
|
+
/** Why this assertion is right for its trace, span by span. */
|
|
2256
|
+
justification: Justification | null;
|
|
2257
|
+
/** Why its assigned category is the right one, span by span. */
|
|
2258
|
+
categoryJustification: Justification | null;
|
|
2226
2259
|
createdAt: string;
|
|
2227
2260
|
updatedAt: string;
|
|
2228
|
-
};
|
|
2261
|
+
} & ApprovalFields;
|
|
2229
2262
|
type SaveAssertion = {
|
|
2230
2263
|
/** Omit to preserve the category, or pass null to clear it. */
|
|
2231
2264
|
category_assertion_id?: string | null;
|
|
@@ -2234,6 +2267,16 @@ type SaveAssertion = {
|
|
|
2234
2267
|
passCriteria?: string | null;
|
|
2235
2268
|
failCriteria?: string | null;
|
|
2236
2269
|
targetOnEvaluatedTrace?: TraceTarget | null;
|
|
2270
|
+
/**
|
|
2271
|
+
* Why this assertion is right for this trace, one entry per span it rests on.
|
|
2272
|
+
* Cite spans on this trace only. Omit on an edit to preserve it.
|
|
2273
|
+
*/
|
|
2274
|
+
justification?: Justification | null;
|
|
2275
|
+
/**
|
|
2276
|
+
* Why `category_assertion_id` is the right category. Changing the category
|
|
2277
|
+
* clears it. Omit on an edit to preserve it.
|
|
2278
|
+
*/
|
|
2279
|
+
categoryJustification?: Justification | null;
|
|
2237
2280
|
};
|
|
2238
2281
|
type TraceAssertionsResult = {
|
|
2239
2282
|
assertions: TraceAssertion[];
|
|
@@ -2763,7 +2806,8 @@ declare class Bitfab {
|
|
|
2763
2806
|
private readonly serviceUrl;
|
|
2764
2807
|
private readonly timeout;
|
|
2765
2808
|
private readonly envVars;
|
|
2766
|
-
private readonly
|
|
2809
|
+
private readonly captureConfiguredInCode;
|
|
2810
|
+
private captureConfiguredFromEnv;
|
|
2767
2811
|
private readonly strict;
|
|
2768
2812
|
private readonly httpClient;
|
|
2769
2813
|
/** Dataset operations for the authenticated organization. */
|
|
@@ -2884,6 +2928,7 @@ declare class Bitfab {
|
|
|
2884
2928
|
* early resolve that found nothing never poisons a later one.
|
|
2885
2929
|
*/
|
|
2886
2930
|
private resolveApiKey;
|
|
2931
|
+
private isCaptureConfigured;
|
|
2887
2932
|
private isCaptureEnabled;
|
|
2888
2933
|
private shouldRecord;
|
|
2889
2934
|
private prepareFrameworkIntegration;
|
|
@@ -3429,7 +3474,7 @@ interface CommitRef {
|
|
|
3429
3474
|
/**
|
|
3430
3475
|
* SDK version from package.json (injected at build time)
|
|
3431
3476
|
*/
|
|
3432
|
-
declare const __version__ = "0.54.
|
|
3477
|
+
declare const __version__ = "0.54.9";
|
|
3433
3478
|
|
|
3434
3479
|
/**
|
|
3435
3480
|
* Constants for the Bitfab SDK.
|
|
@@ -3568,4 +3613,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
|
|
|
3568
3613
|
run?: boolean;
|
|
3569
3614
|
}): Promise<SeedResult>;
|
|
3570
3615
|
|
|
3571
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionVerdict, 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 CommitRef, 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 GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, 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, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, 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 TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, 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, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
|
|
3616
|
+
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionVerdict, 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 CommitRef, 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 GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, 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, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, 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 TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, 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, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
getCurrentTrace,
|
|
30
30
|
reseedFromRegistry,
|
|
31
31
|
seedFromRegistry
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-UKKR2PF4.js";
|
|
33
33
|
import "./chunk-EGWJYCNT.js";
|
|
34
34
|
import {
|
|
35
35
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
ReplayError,
|
|
39
39
|
reportReplayProgress,
|
|
40
40
|
serializeReplayResult
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-VT5IUVBY.js";
|
|
42
42
|
import {
|
|
43
43
|
BitfabError,
|
|
44
44
|
DEFAULT_SERVICE_URL,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
MixedTracingError,
|
|
47
47
|
__version__,
|
|
48
48
|
flushTraces
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-7HXFT6JR.js";
|
|
50
50
|
import "./chunk-VCRFFCLY.js";
|
|
51
51
|
export {
|
|
52
52
|
AssertionCategoriesClient,
|
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.54.
|
|
100
|
+
__version__ = "0.54.9";
|
|
101
101
|
__packageName__ = "bitfab";
|
|
102
102
|
}
|
|
103
103
|
});
|
|
@@ -7916,6 +7916,30 @@ function readEnv2(name) {
|
|
|
7916
7916
|
}
|
|
7917
7917
|
return void 0;
|
|
7918
7918
|
}
|
|
7919
|
+
var CAPTURE_ENABLED_ENV = "BITFAB_CAPTURE_ENABLED";
|
|
7920
|
+
var TRUE_ENV_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes"]);
|
|
7921
|
+
var FALSE_ENV_VALUES = /* @__PURE__ */ new Set(["0", "false", "no"]);
|
|
7922
|
+
function readBooleanEnv(name) {
|
|
7923
|
+
const raw = readEnv2(name);
|
|
7924
|
+
if (raw === void 0) {
|
|
7925
|
+
return void 0;
|
|
7926
|
+
}
|
|
7927
|
+
const value = raw.trim().toLowerCase();
|
|
7928
|
+
if (value === "") {
|
|
7929
|
+
return void 0;
|
|
7930
|
+
}
|
|
7931
|
+
if (TRUE_ENV_VALUES.has(value)) {
|
|
7932
|
+
return true;
|
|
7933
|
+
}
|
|
7934
|
+
if (FALSE_ENV_VALUES.has(value)) {
|
|
7935
|
+
return false;
|
|
7936
|
+
}
|
|
7937
|
+
warnOnce(
|
|
7938
|
+
`unrecognized-boolean-env:${name}`,
|
|
7939
|
+
`${name}="${raw}" is not 0 or 1; ignoring it.`
|
|
7940
|
+
);
|
|
7941
|
+
return void 0;
|
|
7942
|
+
}
|
|
7919
7943
|
var DEFAULT_AUTO_TRACE_MAX_DEPTH = 30;
|
|
7920
7944
|
var DEFAULT_AUTO_TRACE_MAX_SPANS = 500;
|
|
7921
7945
|
var AUTO_TRACE_PROTOCOL = "ts-auto-v1";
|
|
@@ -7970,7 +7994,7 @@ var Bitfab = class {
|
|
|
7970
7994
|
"Bitfab({ enabled }) is deprecated; pass captureEnabled instead."
|
|
7971
7995
|
);
|
|
7972
7996
|
}
|
|
7973
|
-
this.
|
|
7997
|
+
this.captureConfiguredInCode = config.captureEnabled === void 0 && config.enabled === void 0 ? void 0 : (config.captureEnabled ?? true) && (config.enabled ?? true);
|
|
7974
7998
|
this.strict = config.strict ?? false;
|
|
7975
7999
|
this.bamlClient = config.bamlClient ?? null;
|
|
7976
8000
|
if (config.dbSnapshot) {
|
|
@@ -8424,7 +8448,7 @@ var Bitfab = class {
|
|
|
8424
8448
|
"Bitfab: no API key resolved. Set BITFAB_API_KEY or pass apiKey to new Bitfab(). If a script loads env with dotenv, load it before the module that constructs the client is imported (e.g. `node --env-file=.env script.ts`), or pass `apiKey: () => process.env.BITFAB_API_KEY`."
|
|
8425
8449
|
);
|
|
8426
8450
|
}
|
|
8427
|
-
if (this.
|
|
8451
|
+
if (this.isCaptureConfigured() && !this.apiKeyWarned) {
|
|
8428
8452
|
this.apiKeyWarned = true;
|
|
8429
8453
|
console.warn(
|
|
8430
8454
|
"Bitfab: apiKey is empty - tracing is disabled. Provide a valid API key to enable tracing."
|
|
@@ -8432,20 +8456,29 @@ var Bitfab = class {
|
|
|
8432
8456
|
}
|
|
8433
8457
|
return void 0;
|
|
8434
8458
|
}
|
|
8459
|
+
isCaptureConfigured() {
|
|
8460
|
+
if (this.captureConfiguredInCode !== void 0) {
|
|
8461
|
+
return this.captureConfiguredInCode;
|
|
8462
|
+
}
|
|
8463
|
+
if (this.captureConfiguredFromEnv === void 0) {
|
|
8464
|
+
this.captureConfiguredFromEnv = readBooleanEnv(CAPTURE_ENABLED_ENV) ?? true;
|
|
8465
|
+
}
|
|
8466
|
+
return this.captureConfiguredFromEnv;
|
|
8467
|
+
}
|
|
8435
8468
|
isCaptureEnabled() {
|
|
8436
|
-
if (!this.
|
|
8469
|
+
if (!this.isCaptureConfigured()) {
|
|
8437
8470
|
return false;
|
|
8438
8471
|
}
|
|
8439
8472
|
return this.resolveApiKey() !== void 0;
|
|
8440
8473
|
}
|
|
8441
8474
|
shouldRecord() {
|
|
8442
|
-
if (!this.
|
|
8475
|
+
if (!this.isCaptureConfigured() && !getReplayContext() && !inSeedScope()) {
|
|
8443
8476
|
return false;
|
|
8444
8477
|
}
|
|
8445
8478
|
return this.resolveApiKey() !== void 0;
|
|
8446
8479
|
}
|
|
8447
8480
|
prepareFrameworkIntegration() {
|
|
8448
|
-
if (this.
|
|
8481
|
+
if (this.isCaptureConfigured() && this.strict) {
|
|
8449
8482
|
this.resolveApiKey();
|
|
8450
8483
|
}
|
|
8451
8484
|
}
|