bitfab 0.54.12 → 0.54.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/autoTrace.cjs +0 -19
- package/dist/autoTrace.cjs.map +1 -1
- package/dist/autoTrace.d.cts +1 -3
- package/dist/autoTrace.d.ts +1 -3
- package/dist/autoTrace.js +1 -5
- package/dist/{chunk-RDSNJFWY.js → chunk-3FL22BEM.js} +37 -7
- package/dist/chunk-3FL22BEM.js.map +1 -0
- package/dist/{chunk-VTFBDA3O.js → chunk-N7ZNDZLR.js} +21 -15
- package/dist/chunk-N7ZNDZLR.js.map +1 -0
- package/dist/{chunk-WKXLCFLT.js → chunk-NIGVK5V7.js} +22 -16
- package/dist/chunk-NIGVK5V7.js.map +1 -0
- package/dist/{chunk-EGWJYCNT.js → chunk-RCHSYWKI.js} +2 -19
- package/dist/chunk-RCHSYWKI.js.map +1 -0
- package/dist/{chunk-YY5BB2YS.js → chunk-SV5FYJQ4.js} +33 -60
- package/dist/chunk-SV5FYJQ4.js.map +1 -0
- package/dist/{chunk-ZR4HGK6G.js → chunk-X6JOFMNV.js} +9 -3
- package/dist/chunk-X6JOFMNV.js.map +1 -0
- package/dist/{http-NWSSB5FA.js → http-HM2SNB6L.js} +2 -2
- package/dist/{http-RJH6VYAM.js → http-ZXMIZQV5.js} +2 -2
- package/dist/index.cjs +54 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -14
- package/dist/index.d.ts +16 -14
- package/dist/index.js +4 -4
- package/dist/node.cjs +54 -83
- 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 +4 -4
- package/dist/{replay-WB5NQNQS.js → replay-XCXNPWMC.js} +3 -3
- package/dist/replayCli.js +2 -2
- package/dist/seedCli.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-EGWJYCNT.js.map +0 -1
- package/dist/chunk-RDSNJFWY.js.map +0 -1
- package/dist/chunk-VTFBDA3O.js.map +0 -1
- package/dist/chunk-WKXLCFLT.js.map +0 -1
- package/dist/chunk-YY5BB2YS.js.map +0 -1
- package/dist/chunk-ZR4HGK6G.js.map +0 -1
- /package/dist/{http-NWSSB5FA.js.map → http-HM2SNB6L.js.map} +0 -0
- /package/dist/{http-RJH6VYAM.js.map → http-ZXMIZQV5.js.map} +0 -0
- /package/dist/{replay-WB5NQNQS.js.map → replay-XCXNPWMC.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -442,7 +442,7 @@ declare class HttpClient {
|
|
|
442
442
|
private closing;
|
|
443
443
|
externalSpanTransform: ((payload: Record<string, unknown>, submit: SimulationPlanSubmit) => void) | undefined;
|
|
444
444
|
externalTraceTransform: ((payload: Record<string, unknown>, submit: SimulationPlanSubmit) => void) | undefined;
|
|
445
|
-
releaseHeldExternalSpans: ((timeoutMs: number) => Promise<void>) | undefined;
|
|
445
|
+
releaseHeldExternalSpans: ((timeoutMs: number) => Promise<boolean> | Promise<void>) | undefined;
|
|
446
446
|
stopSimulationPlan: (() => void) | undefined;
|
|
447
447
|
constructor(config: HttpClientConfig);
|
|
448
448
|
/**
|
|
@@ -557,7 +557,6 @@ declare class HttpClient {
|
|
|
557
557
|
* Blocks until complete - needed for function execution.
|
|
558
558
|
*/
|
|
559
559
|
lookupFunction<T>(name: string): Promise<T>;
|
|
560
|
-
getAutoTracePolicy<T>(traceFunctionKey: string, protocol: string): Promise<T>;
|
|
561
560
|
getSimulationPlan(): Promise<SimulationPlanResponse>;
|
|
562
561
|
getTraceSpan(traceId: string, lookup: SpanLookup): Promise<CapturedSpan | null>;
|
|
563
562
|
/**
|
|
@@ -1379,6 +1378,10 @@ declare class LabelsClient {
|
|
|
1379
1378
|
constructor(httpClient: HttpClient);
|
|
1380
1379
|
save(update: LabelUpdate, testRunId?: string): Promise<LabelOutcome>;
|
|
1381
1380
|
saveAll(updates: LabelUpdate[], testRunId?: string): Promise<LabelOutcome[]>;
|
|
1381
|
+
/** Withhold a verdict for a trace or replay attempt whose check did not run. */
|
|
1382
|
+
skip(target: LabelTarget, testRunId?: string): Promise<LabelOutcome>;
|
|
1383
|
+
/** Clear a previous verdict for a trace, replay attempt, or assertion. */
|
|
1384
|
+
archive(target: LabelTarget, testRunId?: string): Promise<LabelOutcome>;
|
|
1382
1385
|
saveHuman(update: HumanLabelUpdate): Promise<HumanLabelOutcome>;
|
|
1383
1386
|
saveHumanAll(updates: HumanLabelUpdate[]): Promise<HumanLabelOutcome[]>;
|
|
1384
1387
|
get(traceId: string): Promise<TraceLabels | null>;
|
|
@@ -1719,7 +1722,7 @@ interface ReplayOptions {
|
|
|
1719
1722
|
traceIds?: string[];
|
|
1720
1723
|
/** Optional display name for the resulting experiment/test run. */
|
|
1721
1724
|
name?: string;
|
|
1722
|
-
/**
|
|
1725
|
+
/** Positive integer limiting parallel items. Set to 1 for sequential. Default 10. */
|
|
1723
1726
|
maxConcurrency?: number;
|
|
1724
1727
|
/**
|
|
1725
1728
|
* Description of the code change being tested in this replay. Stored on
|
|
@@ -1940,6 +1943,7 @@ interface ReplayProgressItem {
|
|
|
1940
1943
|
originalDurationMs?: number | null;
|
|
1941
1944
|
originalTokens?: TokenUsage | null;
|
|
1942
1945
|
originalModel?: string | null;
|
|
1946
|
+
ingestionType?: TraceIngestionType;
|
|
1943
1947
|
/** Always null here: the replayed run's usage is only known at completion. */
|
|
1944
1948
|
tokens?: TokenUsage | null;
|
|
1945
1949
|
/** @deprecated renamed to `originalModel`. */
|
|
@@ -2904,7 +2908,6 @@ declare class Bitfab {
|
|
|
2904
2908
|
readonly graders: GradersClient;
|
|
2905
2909
|
private readonly bamlClient;
|
|
2906
2910
|
private readonly dbSnapshot;
|
|
2907
|
-
private readonly autoTracePolicyRefreshes;
|
|
2908
2911
|
private readonly simulationPlan;
|
|
2909
2912
|
/**
|
|
2910
2913
|
* Mock overrides registered via {@link Bitfab.registerMockOverride}, applied
|
|
@@ -2923,12 +2926,12 @@ declare class Bitfab {
|
|
|
2923
2926
|
*
|
|
2924
2927
|
* Build instrumentation turns repository functions called beneath this
|
|
2925
2928
|
* method into nested spans that capture inputs, outputs, and errors by
|
|
2926
|
-
* default.
|
|
2927
|
-
*
|
|
2929
|
+
* default. Source exclusions and sim-plan capture-off decisions are explicit
|
|
2930
|
+
* opt-outs from that default.
|
|
2928
2931
|
* Without a compatible build transform, this still records the decorated
|
|
2929
2932
|
* method as a normal rich root span but cannot discover child calls.
|
|
2930
2933
|
*
|
|
2931
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
2934
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
2932
2935
|
* @param options - Root presentation, subtree bounds, and exclusions.
|
|
2933
2936
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
2934
2937
|
*/
|
|
@@ -2939,11 +2942,11 @@ declare class Bitfab {
|
|
|
2939
2942
|
* This is the function-oriented equivalent of {@link Bitfab.trace}. Build
|
|
2940
2943
|
* instrumentation turns repository functions called beneath the wrapped
|
|
2941
2944
|
* function into nested spans that capture inputs, outputs, and errors by
|
|
2942
|
-
* default.
|
|
2943
|
-
*
|
|
2944
|
-
* normal rich root span and runs the function unchanged.
|
|
2945
|
+
* default. Source exclusions and sim-plan capture-off decisions are explicit
|
|
2946
|
+
* opt-outs from that default. Without a compatible transform, this still
|
|
2947
|
+
* records one normal rich root span and runs the function unchanged.
|
|
2945
2948
|
*
|
|
2946
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
2949
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
2947
2950
|
* @param optionsOrFn - Options or the workflow entrypoint to wrap.
|
|
2948
2951
|
* @param maybeFn - Workflow entrypoint when options are provided.
|
|
2949
2952
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
@@ -2982,7 +2985,6 @@ declare class Bitfab {
|
|
|
2982
2985
|
private createAutoTraceNode;
|
|
2983
2986
|
private createAutoTraceRoot;
|
|
2984
2987
|
private applySimulationPlan;
|
|
2985
|
-
private refreshAutoTraceCapturePolicy;
|
|
2986
2988
|
/**
|
|
2987
2989
|
* Flush and permanently close this client's tracing resources: its pending
|
|
2988
2990
|
* requests and the single span-transport worker shared by its decorators and
|
|
@@ -3604,7 +3606,7 @@ interface CommitRef {
|
|
|
3604
3606
|
/**
|
|
3605
3607
|
* SDK version from package.json (injected at build time)
|
|
3606
3608
|
*/
|
|
3607
|
-
declare const __version__ = "0.54.
|
|
3609
|
+
declare const __version__ = "0.54.14";
|
|
3608
3610
|
|
|
3609
3611
|
/**
|
|
3610
3612
|
* Constants for the Bitfab SDK.
|
|
@@ -3743,4 +3745,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
|
|
|
3743
3745
|
run?: boolean;
|
|
3744
3746
|
}): Promise<SeedResult>;
|
|
3745
3747
|
|
|
3746
|
-
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, BitfabRivetIntegration, 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, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, 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 };
|
|
3748
|
+
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, BitfabRivetIntegration, 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 LabelTarget, 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, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, 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
|
@@ -442,7 +442,7 @@ declare class HttpClient {
|
|
|
442
442
|
private closing;
|
|
443
443
|
externalSpanTransform: ((payload: Record<string, unknown>, submit: SimulationPlanSubmit) => void) | undefined;
|
|
444
444
|
externalTraceTransform: ((payload: Record<string, unknown>, submit: SimulationPlanSubmit) => void) | undefined;
|
|
445
|
-
releaseHeldExternalSpans: ((timeoutMs: number) => Promise<void>) | undefined;
|
|
445
|
+
releaseHeldExternalSpans: ((timeoutMs: number) => Promise<boolean> | Promise<void>) | undefined;
|
|
446
446
|
stopSimulationPlan: (() => void) | undefined;
|
|
447
447
|
constructor(config: HttpClientConfig);
|
|
448
448
|
/**
|
|
@@ -557,7 +557,6 @@ declare class HttpClient {
|
|
|
557
557
|
* Blocks until complete - needed for function execution.
|
|
558
558
|
*/
|
|
559
559
|
lookupFunction<T>(name: string): Promise<T>;
|
|
560
|
-
getAutoTracePolicy<T>(traceFunctionKey: string, protocol: string): Promise<T>;
|
|
561
560
|
getSimulationPlan(): Promise<SimulationPlanResponse>;
|
|
562
561
|
getTraceSpan(traceId: string, lookup: SpanLookup): Promise<CapturedSpan | null>;
|
|
563
562
|
/**
|
|
@@ -1379,6 +1378,10 @@ declare class LabelsClient {
|
|
|
1379
1378
|
constructor(httpClient: HttpClient);
|
|
1380
1379
|
save(update: LabelUpdate, testRunId?: string): Promise<LabelOutcome>;
|
|
1381
1380
|
saveAll(updates: LabelUpdate[], testRunId?: string): Promise<LabelOutcome[]>;
|
|
1381
|
+
/** Withhold a verdict for a trace or replay attempt whose check did not run. */
|
|
1382
|
+
skip(target: LabelTarget, testRunId?: string): Promise<LabelOutcome>;
|
|
1383
|
+
/** Clear a previous verdict for a trace, replay attempt, or assertion. */
|
|
1384
|
+
archive(target: LabelTarget, testRunId?: string): Promise<LabelOutcome>;
|
|
1382
1385
|
saveHuman(update: HumanLabelUpdate): Promise<HumanLabelOutcome>;
|
|
1383
1386
|
saveHumanAll(updates: HumanLabelUpdate[]): Promise<HumanLabelOutcome[]>;
|
|
1384
1387
|
get(traceId: string): Promise<TraceLabels | null>;
|
|
@@ -1719,7 +1722,7 @@ interface ReplayOptions {
|
|
|
1719
1722
|
traceIds?: string[];
|
|
1720
1723
|
/** Optional display name for the resulting experiment/test run. */
|
|
1721
1724
|
name?: string;
|
|
1722
|
-
/**
|
|
1725
|
+
/** Positive integer limiting parallel items. Set to 1 for sequential. Default 10. */
|
|
1723
1726
|
maxConcurrency?: number;
|
|
1724
1727
|
/**
|
|
1725
1728
|
* Description of the code change being tested in this replay. Stored on
|
|
@@ -1940,6 +1943,7 @@ interface ReplayProgressItem {
|
|
|
1940
1943
|
originalDurationMs?: number | null;
|
|
1941
1944
|
originalTokens?: TokenUsage | null;
|
|
1942
1945
|
originalModel?: string | null;
|
|
1946
|
+
ingestionType?: TraceIngestionType;
|
|
1943
1947
|
/** Always null here: the replayed run's usage is only known at completion. */
|
|
1944
1948
|
tokens?: TokenUsage | null;
|
|
1945
1949
|
/** @deprecated renamed to `originalModel`. */
|
|
@@ -2904,7 +2908,6 @@ declare class Bitfab {
|
|
|
2904
2908
|
readonly graders: GradersClient;
|
|
2905
2909
|
private readonly bamlClient;
|
|
2906
2910
|
private readonly dbSnapshot;
|
|
2907
|
-
private readonly autoTracePolicyRefreshes;
|
|
2908
2911
|
private readonly simulationPlan;
|
|
2909
2912
|
/**
|
|
2910
2913
|
* Mock overrides registered via {@link Bitfab.registerMockOverride}, applied
|
|
@@ -2923,12 +2926,12 @@ declare class Bitfab {
|
|
|
2923
2926
|
*
|
|
2924
2927
|
* Build instrumentation turns repository functions called beneath this
|
|
2925
2928
|
* method into nested spans that capture inputs, outputs, and errors by
|
|
2926
|
-
* default.
|
|
2927
|
-
*
|
|
2929
|
+
* default. Source exclusions and sim-plan capture-off decisions are explicit
|
|
2930
|
+
* opt-outs from that default.
|
|
2928
2931
|
* Without a compatible build transform, this still records the decorated
|
|
2929
2932
|
* method as a normal rich root span but cannot discover child calls.
|
|
2930
2933
|
*
|
|
2931
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
2934
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
2932
2935
|
* @param options - Root presentation, subtree bounds, and exclusions.
|
|
2933
2936
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
2934
2937
|
*/
|
|
@@ -2939,11 +2942,11 @@ declare class Bitfab {
|
|
|
2939
2942
|
* This is the function-oriented equivalent of {@link Bitfab.trace}. Build
|
|
2940
2943
|
* instrumentation turns repository functions called beneath the wrapped
|
|
2941
2944
|
* function into nested spans that capture inputs, outputs, and errors by
|
|
2942
|
-
* default.
|
|
2943
|
-
*
|
|
2944
|
-
* normal rich root span and runs the function unchanged.
|
|
2945
|
+
* default. Source exclusions and sim-plan capture-off decisions are explicit
|
|
2946
|
+
* opt-outs from that default. Without a compatible transform, this still
|
|
2947
|
+
* records one normal rich root span and runs the function unchanged.
|
|
2945
2948
|
*
|
|
2946
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
2949
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
2947
2950
|
* @param optionsOrFn - Options or the workflow entrypoint to wrap.
|
|
2948
2951
|
* @param maybeFn - Workflow entrypoint when options are provided.
|
|
2949
2952
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
@@ -2982,7 +2985,6 @@ declare class Bitfab {
|
|
|
2982
2985
|
private createAutoTraceNode;
|
|
2983
2986
|
private createAutoTraceRoot;
|
|
2984
2987
|
private applySimulationPlan;
|
|
2985
|
-
private refreshAutoTraceCapturePolicy;
|
|
2986
2988
|
/**
|
|
2987
2989
|
* Flush and permanently close this client's tracing resources: its pending
|
|
2988
2990
|
* requests and the single span-transport worker shared by its decorators and
|
|
@@ -3604,7 +3606,7 @@ interface CommitRef {
|
|
|
3604
3606
|
/**
|
|
3605
3607
|
* SDK version from package.json (injected at build time)
|
|
3606
3608
|
*/
|
|
3607
|
-
declare const __version__ = "0.54.
|
|
3609
|
+
declare const __version__ = "0.54.14";
|
|
3608
3610
|
|
|
3609
3611
|
/**
|
|
3610
3612
|
* Constants for the Bitfab SDK.
|
|
@@ -3743,4 +3745,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
|
|
|
3743
3745
|
run?: boolean;
|
|
3744
3746
|
}): Promise<SeedResult>;
|
|
3745
3747
|
|
|
3746
|
-
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, BitfabRivetIntegration, 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, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, 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 };
|
|
3748
|
+
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, BitfabRivetIntegration, 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 LabelTarget, 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, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, 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
|
@@ -30,8 +30,8 @@ import {
|
|
|
30
30
|
getCurrentTrace,
|
|
31
31
|
reseedFromRegistry,
|
|
32
32
|
seedFromRegistry
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-SV5FYJQ4.js";
|
|
34
|
+
import "./chunk-RCHSYWKI.js";
|
|
35
35
|
import {
|
|
36
36
|
BITFAB_PROGRESS_PREFIX,
|
|
37
37
|
DbBranchReplayError,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
ReplayError,
|
|
40
40
|
reportReplayProgress,
|
|
41
41
|
serializeReplayResult
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-X6JOFMNV.js";
|
|
43
43
|
import {
|
|
44
44
|
BitfabError,
|
|
45
45
|
DEFAULT_SERVICE_URL,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
MixedTracingError,
|
|
48
48
|
__version__,
|
|
49
49
|
flushTraces
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-NIGVK5V7.js";
|
|
51
51
|
import "./chunk-VCRFFCLY.js";
|
|
52
52
|
export {
|
|
53
53
|
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.14";
|
|
101
101
|
__packageName__ = "bitfab";
|
|
102
102
|
}
|
|
103
103
|
});
|
|
@@ -1272,6 +1272,7 @@ var init_simulationPlan = __esm({
|
|
|
1272
1272
|
}
|
|
1273
1273
|
this.warnNeverLoaded();
|
|
1274
1274
|
this.warnDropped();
|
|
1275
|
+
return this.held.length === 0;
|
|
1275
1276
|
}
|
|
1276
1277
|
waitForFirstLoad(timeoutMs) {
|
|
1277
1278
|
const firstLoad = this.firstLoad();
|
|
@@ -2094,9 +2095,14 @@ __export(http_exports, {
|
|
|
2094
2095
|
});
|
|
2095
2096
|
async function releaseHeldExternalSpans(timeoutMs) {
|
|
2096
2097
|
const deadline = Date.now() + Math.max(timeoutMs, 0);
|
|
2098
|
+
let released = true;
|
|
2097
2099
|
for (const client of [...liveHttpClients]) {
|
|
2098
|
-
await client.releaseHeldExternalSpans?.(
|
|
2100
|
+
const result = await client.releaseHeldExternalSpans?.(
|
|
2101
|
+
Math.max(0, deadline - Date.now())
|
|
2102
|
+
);
|
|
2103
|
+
released = result !== false && released;
|
|
2099
2104
|
}
|
|
2105
|
+
return released;
|
|
2100
2106
|
}
|
|
2101
2107
|
function stopSimulationPlans() {
|
|
2102
2108
|
for (const client of [...liveHttpClients]) {
|
|
@@ -2113,14 +2119,15 @@ function awaitOnExit(promise) {
|
|
|
2113
2119
|
}
|
|
2114
2120
|
async function flushTraces(timeoutMs = 5e3) {
|
|
2115
2121
|
const deadline = Date.now() + Math.max(timeoutMs, 0);
|
|
2116
|
-
await releaseHeldExternalSpans(planWaitSliceMs(timeoutMs));
|
|
2122
|
+
const released = await releaseHeldExternalSpans(planWaitSliceMs(timeoutMs));
|
|
2117
2123
|
const requestsFlushed = await awaitPendingRequests(
|
|
2118
2124
|
Math.max(0, deadline - Date.now())
|
|
2119
2125
|
);
|
|
2126
|
+
const releasedAfterDeferred = await releaseHeldExternalSpans(0);
|
|
2120
2127
|
const transportsFlushed = await flushTraceTransports(
|
|
2121
2128
|
Math.max(0, deadline - Date.now())
|
|
2122
2129
|
);
|
|
2123
|
-
return requestsFlushed && transportsFlushed;
|
|
2130
|
+
return released && releasedAfterDeferred && requestsFlushed && transportsFlushed;
|
|
2124
2131
|
}
|
|
2125
2132
|
async function awaitPendingRequests(timeoutMs = DEFAULT_LIFECYCLE_TIMEOUT_MS2) {
|
|
2126
2133
|
await replayContextReady.catch(() => {
|
|
@@ -2530,13 +2537,17 @@ var init_http = __esm({
|
|
|
2530
2537
|
*/
|
|
2531
2538
|
async settleDeferredWork(timeoutMs = DEFAULT_LIFECYCLE_TIMEOUT_MS2) {
|
|
2532
2539
|
const deadline = Date.now() + Math.max(timeoutMs, 0);
|
|
2533
|
-
await this.releaseHeldExternalSpans?.(
|
|
2540
|
+
const released = await this.releaseHeldExternalSpans?.(
|
|
2541
|
+
planWaitSliceMs(timeoutMs)
|
|
2542
|
+
);
|
|
2534
2543
|
await replayContextReady.catch(() => {
|
|
2535
2544
|
});
|
|
2536
|
-
|
|
2545
|
+
const settled2 = await waitForPromises(
|
|
2537
2546
|
Array.from(this.deferredWork),
|
|
2538
2547
|
Math.max(0, deadline - Date.now())
|
|
2539
2548
|
);
|
|
2549
|
+
const releasedAfterDeferred = await this.releaseHeldExternalSpans?.(0);
|
|
2550
|
+
return released !== false && releasedAfterDeferred !== false && settled2;
|
|
2540
2551
|
}
|
|
2541
2552
|
/**
|
|
2542
2553
|
* Wait for spans queued by this client to be delivered, within one deadline.
|
|
@@ -2561,7 +2572,9 @@ var init_http = __esm({
|
|
|
2561
2572
|
}
|
|
2562
2573
|
const deadline = Date.now() + Math.max(timeoutMs, 0);
|
|
2563
2574
|
this.closing = (async () => {
|
|
2564
|
-
await this.releaseHeldExternalSpans?.(
|
|
2575
|
+
const released = await this.releaseHeldExternalSpans?.(
|
|
2576
|
+
planWaitSliceMs(timeoutMs)
|
|
2577
|
+
);
|
|
2565
2578
|
this.stopSimulationPlan?.();
|
|
2566
2579
|
this.externalSpanTransform = void 0;
|
|
2567
2580
|
this.externalTraceTransform = void 0;
|
|
@@ -2575,7 +2588,7 @@ var init_http = __esm({
|
|
|
2575
2588
|
const transport = this.traceTransport;
|
|
2576
2589
|
this.traceTransport = void 0;
|
|
2577
2590
|
const shutdownOk = await transport?.shutdown(Math.max(0, deadline - Date.now())) ?? true;
|
|
2578
|
-
return settled2 && shutdownOk;
|
|
2591
|
+
return released !== false && settled2 && shutdownOk;
|
|
2579
2592
|
})();
|
|
2580
2593
|
return this.closing;
|
|
2581
2594
|
}
|
|
@@ -2673,12 +2686,6 @@ var init_http = __esm({
|
|
|
2673
2686
|
async lookupFunction(name) {
|
|
2674
2687
|
return this.request("/api/sdk/functions/lookup", { name });
|
|
2675
2688
|
}
|
|
2676
|
-
async getAutoTracePolicy(traceFunctionKey, protocol) {
|
|
2677
|
-
return this.request("/api/sdk/auto-trace/policy", {
|
|
2678
|
-
traceFunctionKey,
|
|
2679
|
-
protocol
|
|
2680
|
-
});
|
|
2681
|
-
}
|
|
2682
2689
|
async getSimulationPlan() {
|
|
2683
2690
|
return this.get(
|
|
2684
2691
|
"/api/sdk/sim-plan",
|
|
@@ -4015,6 +4022,12 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
4015
4022
|
}
|
|
4016
4023
|
}
|
|
4017
4024
|
const attempts = resolveAttempts(options?.attempts);
|
|
4025
|
+
const maxConcurrency = options?.maxConcurrency ?? 10;
|
|
4026
|
+
if (!Number.isInteger(maxConcurrency) || maxConcurrency < 1) {
|
|
4027
|
+
throw new BitfabError(
|
|
4028
|
+
`maxConcurrency must be a positive integer (got ${maxConcurrency}).`
|
|
4029
|
+
);
|
|
4030
|
+
}
|
|
4018
4031
|
await replayContextReady;
|
|
4019
4032
|
let codeChangeDescription = options?.codeChangeDescription;
|
|
4020
4033
|
let codeChangeFiles = options?.codeChangeFiles;
|
|
@@ -4061,7 +4074,6 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
4061
4074
|
}
|
|
4062
4075
|
}
|
|
4063
4076
|
const mockStrategy = options?.mock ?? "marked";
|
|
4064
|
-
const maxConcurrency = options?.maxConcurrency ?? 10;
|
|
4065
4077
|
const fullTestRunUrl = `${serviceUrl}${testRunUrl}`;
|
|
4066
4078
|
const resolvedOverrides = [
|
|
4067
4079
|
...normalizeMockOverrides(options?.mockOverride),
|
|
@@ -4158,6 +4170,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
4158
4170
|
originalDurationMs: item.originalDurationMs,
|
|
4159
4171
|
originalTokens: item.originalTokens,
|
|
4160
4172
|
originalModel: item.originalModel,
|
|
4173
|
+
ingestionType: item.ingestionType,
|
|
4161
4174
|
tokens: item.tokens,
|
|
4162
4175
|
model: item.model,
|
|
4163
4176
|
dbSnapshotRef: item.dbSnapshotRef,
|
|
@@ -5209,21 +5222,6 @@ function currentAutoTraceScope() {
|
|
|
5209
5222
|
initializeAutoTraceStorage();
|
|
5210
5223
|
return autoTraceState.storage?.getStore() ?? autoTraceState.browserScope;
|
|
5211
5224
|
}
|
|
5212
|
-
function __setBitfabAutoTraceCapturePolicy(client, traceFunctionKey, functionIds) {
|
|
5213
|
-
const policies = autoTraceState.capturePolicies.get(client) ?? /* @__PURE__ */ new Map();
|
|
5214
|
-
if (functionIds === void 0) {
|
|
5215
|
-
policies.delete(traceFunctionKey);
|
|
5216
|
-
if (policies.size === 0) {
|
|
5217
|
-
autoTraceState.capturePolicies.delete(client);
|
|
5218
|
-
}
|
|
5219
|
-
return;
|
|
5220
|
-
}
|
|
5221
|
-
policies.set(traceFunctionKey, new Set(functionIds));
|
|
5222
|
-
autoTraceState.capturePolicies.set(client, policies);
|
|
5223
|
-
}
|
|
5224
|
-
function getAutoTraceCapturePolicy(client, traceFunctionKey) {
|
|
5225
|
-
return autoTraceState.capturePolicies.get(client)?.get(traceFunctionKey);
|
|
5226
|
-
}
|
|
5227
5225
|
|
|
5228
5226
|
// src/optionalPeer.ts
|
|
5229
5227
|
function importOptionalPeer(specifierParts) {
|
|
@@ -6013,6 +6011,14 @@ var LabelsClient = class {
|
|
|
6013
6011
|
);
|
|
6014
6012
|
return response.labels;
|
|
6015
6013
|
}
|
|
6014
|
+
/** Withhold a verdict for a trace or replay attempt whose check did not run. */
|
|
6015
|
+
async skip(target, testRunId) {
|
|
6016
|
+
return this.save({ ...target, skip: true }, testRunId);
|
|
6017
|
+
}
|
|
6018
|
+
/** Clear a previous verdict for a trace, replay attempt, or assertion. */
|
|
6019
|
+
async archive(target, testRunId) {
|
|
6020
|
+
return this.save({ ...target, archive: true }, testRunId);
|
|
6021
|
+
}
|
|
6016
6022
|
async saveHuman(update) {
|
|
6017
6023
|
const [outcome] = await this.saveHumanAll([update]);
|
|
6018
6024
|
return outcome;
|
|
@@ -6931,6 +6937,15 @@ var BitfabLangGraphIntegration = class {
|
|
|
6931
6937
|
// src/client.ts
|
|
6932
6938
|
init_mockOverride();
|
|
6933
6939
|
|
|
6940
|
+
// src/streamFinalizationError.ts
|
|
6941
|
+
var StreamFinalizationError = class extends Error {
|
|
6942
|
+
constructor(message, output) {
|
|
6943
|
+
super(message);
|
|
6944
|
+
this.output = output;
|
|
6945
|
+
this.name = "StreamFinalizationError";
|
|
6946
|
+
}
|
|
6947
|
+
};
|
|
6948
|
+
|
|
6934
6949
|
// src/openaiAgentSdk.ts
|
|
6935
6950
|
var BitfabOpenAIAgentHandler = class {
|
|
6936
6951
|
constructor(config) {
|
|
@@ -6970,7 +6985,11 @@ var BitfabOpenAIAgentHandler = class {
|
|
|
6970
6985
|
if (isStreaming && res?.completed) {
|
|
6971
6986
|
try {
|
|
6972
6987
|
await res.completed;
|
|
6973
|
-
} catch {
|
|
6988
|
+
} catch (error) {
|
|
6989
|
+
throw new StreamFinalizationError(
|
|
6990
|
+
error instanceof Error ? error.message : String(error),
|
|
6991
|
+
res.finalOutput
|
|
6992
|
+
);
|
|
6974
6993
|
}
|
|
6975
6994
|
}
|
|
6976
6995
|
return res?.finalOutput;
|
|
@@ -7072,7 +7091,6 @@ function openAiAgentsParentSpanId(bitfabTraceId, enclosingSpanIds) {
|
|
|
7072
7091
|
}
|
|
7073
7092
|
|
|
7074
7093
|
// src/client.ts
|
|
7075
|
-
init_policyRefresh();
|
|
7076
7094
|
init_randomUuid();
|
|
7077
7095
|
init_replay();
|
|
7078
7096
|
|
|
@@ -7729,17 +7747,6 @@ function runWithSeedContext(ctx, fn) {
|
|
|
7729
7747
|
init_serialize();
|
|
7730
7748
|
init_simulationPlan();
|
|
7731
7749
|
init_spanOrigin();
|
|
7732
|
-
|
|
7733
|
-
// src/streamFinalizationError.ts
|
|
7734
|
-
var StreamFinalizationError = class extends Error {
|
|
7735
|
-
constructor(message, output) {
|
|
7736
|
-
super(message);
|
|
7737
|
-
this.output = output;
|
|
7738
|
-
this.name = "StreamFinalizationError";
|
|
7739
|
-
}
|
|
7740
|
-
};
|
|
7741
|
-
|
|
7742
|
-
// src/client.ts
|
|
7743
7750
|
init_traceMetadata();
|
|
7744
7751
|
|
|
7745
7752
|
// src/traces.ts
|
|
@@ -8656,8 +8663,6 @@ function readBooleanEnv(name) {
|
|
|
8656
8663
|
var DEFAULT_AUTO_TRACE_MAX_DEPTH = 30;
|
|
8657
8664
|
var DEFAULT_AUTO_TRACE_MAX_SPANS = 500;
|
|
8658
8665
|
var AUTO_TRACE_PROTOCOL = "ts-auto-v1";
|
|
8659
|
-
var AUTO_TRACE_POLICY_REFRESH_MS = 6e4;
|
|
8660
|
-
var AUTO_TRACE_POLICY_RETRY_MS = 1e4;
|
|
8661
8666
|
function spanOwnerName(receiver) {
|
|
8662
8667
|
if (typeof receiver === "function") {
|
|
8663
8668
|
return receiver.name !== "" ? receiver.name : void 0;
|
|
@@ -8690,7 +8695,6 @@ var Bitfab = class {
|
|
|
8690
8695
|
constructor(config) {
|
|
8691
8696
|
/** Gate the empty-key warning to fire at most once. */
|
|
8692
8697
|
this.apiKeyWarned = false;
|
|
8693
|
-
this.autoTracePolicyRefreshes = /* @__PURE__ */ new Map();
|
|
8694
8698
|
/**
|
|
8695
8699
|
* Mock overrides registered via {@link Bitfab.registerMockOverride}, applied
|
|
8696
8700
|
* to every `replay` on this client (after any per-call `mockOverride`). In
|
|
@@ -8739,12 +8743,12 @@ var Bitfab = class {
|
|
|
8739
8743
|
*
|
|
8740
8744
|
* Build instrumentation turns repository functions called beneath this
|
|
8741
8745
|
* method into nested spans that capture inputs, outputs, and errors by
|
|
8742
|
-
* default.
|
|
8743
|
-
*
|
|
8746
|
+
* default. Source exclusions and sim-plan capture-off decisions are explicit
|
|
8747
|
+
* opt-outs from that default.
|
|
8744
8748
|
* Without a compatible build transform, this still records the decorated
|
|
8745
8749
|
* method as a normal rich root span but cannot discover child calls.
|
|
8746
8750
|
*
|
|
8747
|
-
* @param traceFunctionKey - Groups traces and their capture
|
|
8751
|
+
* @param traceFunctionKey - Groups traces and their capture controls.
|
|
8748
8752
|
* @param options - Root presentation, subtree bounds, and exclusions.
|
|
8749
8753
|
* @experimental Automatic child-call instrumentation is experimental.
|
|
8750
8754
|
*/
|
|
@@ -8902,11 +8906,6 @@ var Bitfab = class {
|
|
|
8902
8906
|
traceFunctionKey,
|
|
8903
8907
|
spanOptions,
|
|
8904
8908
|
function(...args) {
|
|
8905
|
-
const capturePolicy = getAutoTraceCapturePolicy(
|
|
8906
|
-
self,
|
|
8907
|
-
traceFunctionKey
|
|
8908
|
-
);
|
|
8909
|
-
self.refreshAutoTraceCapturePolicy(traceFunctionKey);
|
|
8910
8909
|
self.simulationPlan.refresh();
|
|
8911
8910
|
let spansUsed = 0;
|
|
8912
8911
|
let truncated = false;
|
|
@@ -8986,7 +8985,7 @@ var Bitfab = class {
|
|
|
8986
8985
|
surface: "opt-out",
|
|
8987
8986
|
instrumentation: "trace",
|
|
8988
8987
|
functionId: definition.id,
|
|
8989
|
-
captureContent:
|
|
8988
|
+
captureContent: true,
|
|
8990
8989
|
autoTraceDefinition: definition,
|
|
8991
8990
|
...nodeConfiguration?.testRunId !== void 0 && {
|
|
8992
8991
|
testRunId: nodeConfiguration.testRunId
|
|
@@ -9085,34 +9084,6 @@ var Bitfab = class {
|
|
|
9085
9084
|
applySimulationPlan(payload, submit) {
|
|
9086
9085
|
this.simulationPlan.send(payload, rootTraceFunctionKeyOf(payload), submit);
|
|
9087
9086
|
}
|
|
9088
|
-
refreshAutoTraceCapturePolicy(traceFunctionKey) {
|
|
9089
|
-
const state2 = this.autoTracePolicyRefreshes.get(traceFunctionKey) ?? new PolicyRefresh();
|
|
9090
|
-
this.autoTracePolicyRefreshes.set(traceFunctionKey, state2);
|
|
9091
|
-
state2.run(
|
|
9092
|
-
() => this.httpClient.getAutoTracePolicy(
|
|
9093
|
-
traceFunctionKey,
|
|
9094
|
-
AUTO_TRACE_PROTOCOL
|
|
9095
|
-
),
|
|
9096
|
-
(policy) => {
|
|
9097
|
-
if (policy.protocol !== AUTO_TRACE_PROTOCOL) {
|
|
9098
|
-
state2.hold(AUTO_TRACE_POLICY_RETRY_MS);
|
|
9099
|
-
return;
|
|
9100
|
-
}
|
|
9101
|
-
const functionIds = Array.isArray(policy.functionIds) ? policy.functionIds.filter(
|
|
9102
|
-
(id) => typeof id === "string" && id.startsWith(`${AUTO_TRACE_PROTOCOL}:`)
|
|
9103
|
-
).slice(0, DEFAULT_AUTO_TRACE_MAX_SPANS) : [];
|
|
9104
|
-
__setBitfabAutoTraceCapturePolicy(
|
|
9105
|
-
this,
|
|
9106
|
-
traceFunctionKey,
|
|
9107
|
-
policy.revision === null ? void 0 : functionIds
|
|
9108
|
-
);
|
|
9109
|
-
state2.hold(AUTO_TRACE_POLICY_REFRESH_MS);
|
|
9110
|
-
},
|
|
9111
|
-
() => {
|
|
9112
|
-
state2.hold(AUTO_TRACE_POLICY_RETRY_MS);
|
|
9113
|
-
}
|
|
9114
|
-
);
|
|
9115
|
-
}
|
|
9116
9087
|
/**
|
|
9117
9088
|
* Flush and permanently close this client's tracing resources: its pending
|
|
9118
9089
|
* requests and the single span-transport worker shared by its decorators and
|