@bitfab/sdk 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/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 captureConfigured;
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.7";
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 captureConfigured;
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.7";
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
@@ -20,7 +20,7 @@ import {
20
20
  getCurrentTrace,
21
21
  reseedFromRegistry,
22
22
  seedFromRegistry
23
- } from "./chunk-X6AIRJJX.js";
23
+ } from "./chunk-I5Z3CTO6.js";
24
24
  import "./chunk-EGWJYCNT.js";
25
25
  import {
26
26
  BITFAB_PROGRESS_PREFIX,
@@ -29,7 +29,7 @@ import {
29
29
  ReplayError,
30
30
  reportReplayProgress,
31
31
  serializeReplayResult
32
- } from "./chunk-27WMHYUI.js";
32
+ } from "./chunk-4PMIFWUB.js";
33
33
  import {
34
34
  BitfabError,
35
35
  DEFAULT_SERVICE_URL,
@@ -37,7 +37,7 @@ import {
37
37
  MixedTracingError,
38
38
  __version__,
39
39
  flushTraces
40
- } from "./chunk-JF56DBPP.js";
40
+ } from "./chunk-B7CO654C.js";
41
41
  import "./chunk-VCRFFCLY.js";
42
42
  export {
43
43
  AssertionCategoriesClient,
package/dist/node.cjs CHANGED
@@ -88,7 +88,7 @@ var __version__, __packageName__;
88
88
  var init_version_generated = __esm({
89
89
  "src/version.generated.ts"() {
90
90
  "use strict";
91
- __version__ = "0.54.7";
91
+ __version__ = "0.54.9";
92
92
  __packageName__ = "@bitfab/sdk";
93
93
  }
94
94
  });
@@ -7907,6 +7907,30 @@ function readEnv2(name) {
7907
7907
  }
7908
7908
  return void 0;
7909
7909
  }
7910
+ var CAPTURE_ENABLED_ENV = "BITFAB_CAPTURE_ENABLED";
7911
+ var TRUE_ENV_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes"]);
7912
+ var FALSE_ENV_VALUES = /* @__PURE__ */ new Set(["0", "false", "no"]);
7913
+ function readBooleanEnv(name) {
7914
+ const raw = readEnv2(name);
7915
+ if (raw === void 0) {
7916
+ return void 0;
7917
+ }
7918
+ const value = raw.trim().toLowerCase();
7919
+ if (value === "") {
7920
+ return void 0;
7921
+ }
7922
+ if (TRUE_ENV_VALUES.has(value)) {
7923
+ return true;
7924
+ }
7925
+ if (FALSE_ENV_VALUES.has(value)) {
7926
+ return false;
7927
+ }
7928
+ warnOnce(
7929
+ `unrecognized-boolean-env:${name}`,
7930
+ `${name}="${raw}" is not 0 or 1; ignoring it.`
7931
+ );
7932
+ return void 0;
7933
+ }
7910
7934
  var DEFAULT_AUTO_TRACE_MAX_DEPTH = 30;
7911
7935
  var DEFAULT_AUTO_TRACE_MAX_SPANS = 500;
7912
7936
  var AUTO_TRACE_PROTOCOL = "ts-auto-v1";
@@ -7961,7 +7985,7 @@ var Bitfab = class {
7961
7985
  "Bitfab({ enabled }) is deprecated; pass captureEnabled instead."
7962
7986
  );
7963
7987
  }
7964
- this.captureConfigured = (config.captureEnabled ?? true) && (config.enabled ?? true);
7988
+ this.captureConfiguredInCode = config.captureEnabled === void 0 && config.enabled === void 0 ? void 0 : (config.captureEnabled ?? true) && (config.enabled ?? true);
7965
7989
  this.strict = config.strict ?? false;
7966
7990
  this.bamlClient = config.bamlClient ?? null;
7967
7991
  if (config.dbSnapshot) {
@@ -8415,7 +8439,7 @@ var Bitfab = class {
8415
8439
  "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`."
8416
8440
  );
8417
8441
  }
8418
- if (this.captureConfigured && !this.apiKeyWarned) {
8442
+ if (this.isCaptureConfigured() && !this.apiKeyWarned) {
8419
8443
  this.apiKeyWarned = true;
8420
8444
  console.warn(
8421
8445
  "Bitfab: apiKey is empty - tracing is disabled. Provide a valid API key to enable tracing."
@@ -8423,20 +8447,29 @@ var Bitfab = class {
8423
8447
  }
8424
8448
  return void 0;
8425
8449
  }
8450
+ isCaptureConfigured() {
8451
+ if (this.captureConfiguredInCode !== void 0) {
8452
+ return this.captureConfiguredInCode;
8453
+ }
8454
+ if (this.captureConfiguredFromEnv === void 0) {
8455
+ this.captureConfiguredFromEnv = readBooleanEnv(CAPTURE_ENABLED_ENV) ?? true;
8456
+ }
8457
+ return this.captureConfiguredFromEnv;
8458
+ }
8426
8459
  isCaptureEnabled() {
8427
- if (!this.captureConfigured) {
8460
+ if (!this.isCaptureConfigured()) {
8428
8461
  return false;
8429
8462
  }
8430
8463
  return this.resolveApiKey() !== void 0;
8431
8464
  }
8432
8465
  shouldRecord() {
8433
- if (!this.captureConfigured && !getReplayContext() && !inSeedScope()) {
8466
+ if (!this.isCaptureConfigured() && !getReplayContext() && !inSeedScope()) {
8434
8467
  return false;
8435
8468
  }
8436
8469
  return this.resolveApiKey() !== void 0;
8437
8470
  }
8438
8471
  prepareFrameworkIntegration() {
8439
- if (this.captureConfigured && this.strict) {
8472
+ if (this.isCaptureConfigured() && this.strict) {
8440
8473
  this.resolveApiKey();
8441
8474
  }
8442
8475
  }