@bitfab/sdk 0.52.3 → 0.52.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-45SK3FUL.js → chunk-DP3QEGTV.js} +3 -2
- package/dist/chunk-DP3QEGTV.js.map +1 -0
- package/dist/{chunk-SECFVEQV.js → chunk-LQ32JQNZ.js} +56 -6
- package/dist/chunk-LQ32JQNZ.js.map +1 -0
- package/dist/{chunk-QHA46TT6.js → chunk-MM4A6UWJ.js} +14 -2
- package/dist/{chunk-QHA46TT6.js.map → chunk-MM4A6UWJ.js.map} +1 -1
- package/dist/{chunk-ODF4JSYX.js → chunk-OF5GWNGU.js} +14 -2
- package/dist/{chunk-ODF4JSYX.js.map → chunk-OF5GWNGU.js.map} +1 -1
- package/dist/chunk-P2AZ7RUM.js +747 -0
- package/dist/chunk-P2AZ7RUM.js.map +1 -0
- package/dist/{http-ZW5THLTW.js → http-UA54C2J2.js} +2 -2
- package/dist/{http-3MPIPYKC.js → http-WBNDRQIV.js} +2 -2
- package/dist/index.cjs +65 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -2
- package/dist/index.d.ts +36 -2
- package/dist/index.js +5 -3
- package/dist/node.cjs +65 -1
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +5 -3
- package/dist/node.js.map +1 -1
- package/dist/{replay-W5SAHEU5.js → replay-RUONYMHD.js} +5 -3
- package/dist/replayCli.js +18 -687
- package/dist/replayCli.js.map +1 -1
- package/dist/seedCli.js +30 -0
- package/dist/seedCli.js.map +1 -0
- package/package.json +3 -2
- package/dist/chunk-45SK3FUL.js.map +0 -1
- package/dist/chunk-SECFVEQV.js.map +0 -1
- /package/dist/{http-3MPIPYKC.js.map → http-UA54C2J2.js.map} +0 -0
- /package/dist/{http-ZW5THLTW.js.map → http-WBNDRQIV.js.map} +0 -0
- /package/dist/{replay-W5SAHEU5.js.map → replay-RUONYMHD.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -591,6 +591,8 @@ declare class HttpClient {
|
|
|
591
591
|
* Blocking call.
|
|
592
592
|
*/
|
|
593
593
|
completeReplay(testRunId: string): Promise<CompleteReplayResponse>;
|
|
594
|
+
getReseedSource(traceId: string): Promise<ReseedSourceResponse>;
|
|
595
|
+
reseedTrace(traceId: string, runTraceId: string): Promise<ReseedTraceResponse>;
|
|
594
596
|
/**
|
|
595
597
|
* Ask the server to materialize a per-trace DB branch lease from a
|
|
596
598
|
* captured `dbSnapshotRef`. Blocking - the resolver creates a Neon
|
|
@@ -749,6 +751,21 @@ interface CompleteReplayResponse {
|
|
|
749
751
|
*/
|
|
750
752
|
traceCount?: number;
|
|
751
753
|
}
|
|
754
|
+
interface ReseedSourceResponse {
|
|
755
|
+
traceId: string;
|
|
756
|
+
traceFunctionKey: string;
|
|
757
|
+
ingestionType: string;
|
|
758
|
+
name: string | null;
|
|
759
|
+
sessionId: string | null;
|
|
760
|
+
metadata: Record<string, unknown>;
|
|
761
|
+
input: unknown;
|
|
762
|
+
inputMeta: unknown;
|
|
763
|
+
inputSerialized: unknown;
|
|
764
|
+
}
|
|
765
|
+
interface ReseedTraceResponse {
|
|
766
|
+
traceId: string;
|
|
767
|
+
previousRunTraceId: string;
|
|
768
|
+
}
|
|
752
769
|
interface SpanTreeNode {
|
|
753
770
|
/** Upstream platform span id. Stable structural identity; NOT the row id. */
|
|
754
771
|
sourceSpanId: string;
|
|
@@ -2459,6 +2476,13 @@ interface SeedRunOptions<TArgs extends unknown[]> {
|
|
|
2459
2476
|
sessionId?: string;
|
|
2460
2477
|
name?: string;
|
|
2461
2478
|
}
|
|
2479
|
+
interface ReseedOptions {
|
|
2480
|
+
traceId: string;
|
|
2481
|
+
}
|
|
2482
|
+
interface ReseedResult {
|
|
2483
|
+
traceId: string;
|
|
2484
|
+
previousRunTraceId: string;
|
|
2485
|
+
}
|
|
2462
2486
|
interface BitfabConfig {
|
|
2463
2487
|
/**
|
|
2464
2488
|
* The API key for Bitfab API authentication. Resolved lazily, the first
|
|
@@ -3118,6 +3142,7 @@ declare class Bitfab {
|
|
|
3118
3142
|
seedTrace<TArgs extends unknown[], TReturn>(traceFunctionKey: string, fn: (...args: TArgs) => TReturn, options?: SeedRunOptions<TArgs>): Promise<string>;
|
|
3119
3143
|
private seedTraceFromCase;
|
|
3120
3144
|
private seedTraceByRunning;
|
|
3145
|
+
reseedTrace(traceFunctionKey: string, fn: (...args: any[]) => unknown, options: ReseedOptions): Promise<ReseedResult>;
|
|
3121
3146
|
replay<TReturn>(traceFunctionKey: string, fn: (...args: any[]) => TReturn | Promise<TReturn>, options?: ReplayOptions): Promise<ReplayResult<TReturn>>;
|
|
3122
3147
|
}
|
|
3123
3148
|
/**
|
|
@@ -3293,7 +3318,7 @@ declare class BitfabFunction {
|
|
|
3293
3318
|
/**
|
|
3294
3319
|
* SDK version from package.json (injected at build time)
|
|
3295
3320
|
*/
|
|
3296
|
-
declare const __version__ = "0.52.
|
|
3321
|
+
declare const __version__ = "0.52.4";
|
|
3297
3322
|
|
|
3298
3323
|
/**
|
|
3299
3324
|
* Constants for the Bitfab SDK.
|
|
@@ -3410,6 +3435,15 @@ interface SeedResult {
|
|
|
3410
3435
|
traceFunctionKey: string;
|
|
3411
3436
|
traceIds: string[];
|
|
3412
3437
|
}
|
|
3438
|
+
interface ReseedRegistryResult {
|
|
3439
|
+
pipeline: string;
|
|
3440
|
+
traceFunctionKey: string;
|
|
3441
|
+
reseeded: {
|
|
3442
|
+
traceId: string;
|
|
3443
|
+
previousRunTraceId: string;
|
|
3444
|
+
}[];
|
|
3445
|
+
}
|
|
3446
|
+
declare function reseedFromRegistry(registry: ReplayRegistry, pipeline: string, traceIds: readonly string[]): Promise<ReseedRegistryResult>;
|
|
3413
3447
|
/**
|
|
3414
3448
|
* Seed cases through an already-registered pipeline.
|
|
3415
3449
|
*
|
|
@@ -3423,4 +3457,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
|
|
|
3423
3457
|
run?: boolean;
|
|
3424
3458
|
}): Promise<SeedResult>;
|
|
3425
3459
|
|
|
3426
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, 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 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, SUPPORTED_PROVIDERS, type SaveAssertion, 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 TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
|
|
3460
|
+
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, 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 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 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 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
|
@@ -591,6 +591,8 @@ declare class HttpClient {
|
|
|
591
591
|
* Blocking call.
|
|
592
592
|
*/
|
|
593
593
|
completeReplay(testRunId: string): Promise<CompleteReplayResponse>;
|
|
594
|
+
getReseedSource(traceId: string): Promise<ReseedSourceResponse>;
|
|
595
|
+
reseedTrace(traceId: string, runTraceId: string): Promise<ReseedTraceResponse>;
|
|
594
596
|
/**
|
|
595
597
|
* Ask the server to materialize a per-trace DB branch lease from a
|
|
596
598
|
* captured `dbSnapshotRef`. Blocking - the resolver creates a Neon
|
|
@@ -749,6 +751,21 @@ interface CompleteReplayResponse {
|
|
|
749
751
|
*/
|
|
750
752
|
traceCount?: number;
|
|
751
753
|
}
|
|
754
|
+
interface ReseedSourceResponse {
|
|
755
|
+
traceId: string;
|
|
756
|
+
traceFunctionKey: string;
|
|
757
|
+
ingestionType: string;
|
|
758
|
+
name: string | null;
|
|
759
|
+
sessionId: string | null;
|
|
760
|
+
metadata: Record<string, unknown>;
|
|
761
|
+
input: unknown;
|
|
762
|
+
inputMeta: unknown;
|
|
763
|
+
inputSerialized: unknown;
|
|
764
|
+
}
|
|
765
|
+
interface ReseedTraceResponse {
|
|
766
|
+
traceId: string;
|
|
767
|
+
previousRunTraceId: string;
|
|
768
|
+
}
|
|
752
769
|
interface SpanTreeNode {
|
|
753
770
|
/** Upstream platform span id. Stable structural identity; NOT the row id. */
|
|
754
771
|
sourceSpanId: string;
|
|
@@ -2459,6 +2476,13 @@ interface SeedRunOptions<TArgs extends unknown[]> {
|
|
|
2459
2476
|
sessionId?: string;
|
|
2460
2477
|
name?: string;
|
|
2461
2478
|
}
|
|
2479
|
+
interface ReseedOptions {
|
|
2480
|
+
traceId: string;
|
|
2481
|
+
}
|
|
2482
|
+
interface ReseedResult {
|
|
2483
|
+
traceId: string;
|
|
2484
|
+
previousRunTraceId: string;
|
|
2485
|
+
}
|
|
2462
2486
|
interface BitfabConfig {
|
|
2463
2487
|
/**
|
|
2464
2488
|
* The API key for Bitfab API authentication. Resolved lazily, the first
|
|
@@ -3118,6 +3142,7 @@ declare class Bitfab {
|
|
|
3118
3142
|
seedTrace<TArgs extends unknown[], TReturn>(traceFunctionKey: string, fn: (...args: TArgs) => TReturn, options?: SeedRunOptions<TArgs>): Promise<string>;
|
|
3119
3143
|
private seedTraceFromCase;
|
|
3120
3144
|
private seedTraceByRunning;
|
|
3145
|
+
reseedTrace(traceFunctionKey: string, fn: (...args: any[]) => unknown, options: ReseedOptions): Promise<ReseedResult>;
|
|
3121
3146
|
replay<TReturn>(traceFunctionKey: string, fn: (...args: any[]) => TReturn | Promise<TReturn>, options?: ReplayOptions): Promise<ReplayResult<TReturn>>;
|
|
3122
3147
|
}
|
|
3123
3148
|
/**
|
|
@@ -3293,7 +3318,7 @@ declare class BitfabFunction {
|
|
|
3293
3318
|
/**
|
|
3294
3319
|
* SDK version from package.json (injected at build time)
|
|
3295
3320
|
*/
|
|
3296
|
-
declare const __version__ = "0.52.
|
|
3321
|
+
declare const __version__ = "0.52.4";
|
|
3297
3322
|
|
|
3298
3323
|
/**
|
|
3299
3324
|
* Constants for the Bitfab SDK.
|
|
@@ -3410,6 +3435,15 @@ interface SeedResult {
|
|
|
3410
3435
|
traceFunctionKey: string;
|
|
3411
3436
|
traceIds: string[];
|
|
3412
3437
|
}
|
|
3438
|
+
interface ReseedRegistryResult {
|
|
3439
|
+
pipeline: string;
|
|
3440
|
+
traceFunctionKey: string;
|
|
3441
|
+
reseeded: {
|
|
3442
|
+
traceId: string;
|
|
3443
|
+
previousRunTraceId: string;
|
|
3444
|
+
}[];
|
|
3445
|
+
}
|
|
3446
|
+
declare function reseedFromRegistry(registry: ReplayRegistry, pipeline: string, traceIds: readonly string[]): Promise<ReseedRegistryResult>;
|
|
3413
3447
|
/**
|
|
3414
3448
|
* Seed cases through an already-registered pipeline.
|
|
3415
3449
|
*
|
|
@@ -3423,4 +3457,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
|
|
|
3423
3457
|
run?: boolean;
|
|
3424
3458
|
}): Promise<SeedResult>;
|
|
3425
3459
|
|
|
3426
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, 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 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, SUPPORTED_PROVIDERS, type SaveAssertion, 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 TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
|
|
3460
|
+
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, 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 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 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 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
|
@@ -17,8 +17,9 @@ import {
|
|
|
17
17
|
getCurrentReplayBranch,
|
|
18
18
|
getCurrentSpan,
|
|
19
19
|
getCurrentTrace,
|
|
20
|
+
reseedFromRegistry,
|
|
20
21
|
seedFromRegistry
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-LQ32JQNZ.js";
|
|
22
23
|
import "./chunk-ZUD7OFYB.js";
|
|
23
24
|
import {
|
|
24
25
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -27,7 +28,7 @@ import {
|
|
|
27
28
|
ReplayError,
|
|
28
29
|
reportReplayProgress,
|
|
29
30
|
serializeReplayResult
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-DP3QEGTV.js";
|
|
31
32
|
import {
|
|
32
33
|
BitfabError,
|
|
33
34
|
DEFAULT_SERVICE_URL,
|
|
@@ -35,7 +36,7 @@ import {
|
|
|
35
36
|
MixedTracingError,
|
|
36
37
|
__version__,
|
|
37
38
|
flushTraces
|
|
38
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-OF5GWNGU.js";
|
|
39
40
|
import "./chunk-H6LZRFMN.js";
|
|
40
41
|
export {
|
|
41
42
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -68,6 +69,7 @@ export {
|
|
|
68
69
|
getCurrentSpan,
|
|
69
70
|
getCurrentTrace,
|
|
70
71
|
reportReplayProgress,
|
|
72
|
+
reseedFromRegistry,
|
|
71
73
|
seedFromRegistry,
|
|
72
74
|
serializeReplayResult
|
|
73
75
|
};
|
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.52.
|
|
91
|
+
__version__ = "0.52.4";
|
|
92
92
|
__packageName__ = "@bitfab/sdk";
|
|
93
93
|
}
|
|
94
94
|
});
|
|
@@ -2122,6 +2122,18 @@ var init_http = __esm({
|
|
|
2122
2122
|
{ timeout: REPLAY_COMPLETE_REQUEST_TIMEOUT_MS }
|
|
2123
2123
|
);
|
|
2124
2124
|
}
|
|
2125
|
+
async getReseedSource(traceId) {
|
|
2126
|
+
return this.get(
|
|
2127
|
+
`/api/sdk/traces/${encodeURIComponent(traceId)}/reseedSource`
|
|
2128
|
+
);
|
|
2129
|
+
}
|
|
2130
|
+
async reseedTrace(traceId, runTraceId) {
|
|
2131
|
+
return this.request(
|
|
2132
|
+
`/api/sdk/traces/${encodeURIComponent(traceId)}/reseed`,
|
|
2133
|
+
{ runTraceId },
|
|
2134
|
+
{ timeout: 3e4 }
|
|
2135
|
+
);
|
|
2136
|
+
}
|
|
2125
2137
|
/**
|
|
2126
2138
|
* Ask the server to materialize a per-trace DB branch lease from a
|
|
2127
2139
|
* captured `dbSnapshotRef`. Blocking - the resolver creates a Neon
|
|
@@ -2566,6 +2578,7 @@ __export(replay_exports, {
|
|
|
2566
2578
|
BITFAB_PROGRESS_PREFIX: () => BITFAB_PROGRESS_PREFIX,
|
|
2567
2579
|
DbBranchReplayError: () => DbBranchReplayError,
|
|
2568
2580
|
ReplayError: () => ReplayError,
|
|
2581
|
+
deserializeInputs: () => deserializeInputs,
|
|
2569
2582
|
replay: () => replay,
|
|
2570
2583
|
reportReplayProgress: () => reportReplayProgress,
|
|
2571
2584
|
serializeReplayResult: () => serializeReplayResult,
|
|
@@ -3416,6 +3429,7 @@ __export(node_exports, {
|
|
|
3416
3429
|
getCurrentSpan: () => getCurrentSpan,
|
|
3417
3430
|
getCurrentTrace: () => getCurrentTrace,
|
|
3418
3431
|
reportReplayProgress: () => reportReplayProgress,
|
|
3432
|
+
reseedFromRegistry: () => reseedFromRegistry,
|
|
3419
3433
|
seedFromRegistry: () => seedFromRegistry,
|
|
3420
3434
|
serializeReplayResult: () => serializeReplayResult
|
|
3421
3435
|
});
|
|
@@ -5732,6 +5746,7 @@ var BitfabOpenAIAgentHandler = class {
|
|
|
5732
5746
|
|
|
5733
5747
|
// src/client.ts
|
|
5734
5748
|
init_randomUuid();
|
|
5749
|
+
init_replay();
|
|
5735
5750
|
|
|
5736
5751
|
// src/replayBranch.ts
|
|
5737
5752
|
var _url, _context;
|
|
@@ -8159,6 +8174,36 @@ var Bitfab = class {
|
|
|
8159
8174
|
}
|
|
8160
8175
|
return traceId;
|
|
8161
8176
|
}
|
|
8177
|
+
async reseedTrace(traceFunctionKey, fn, options) {
|
|
8178
|
+
const source = await this.httpClient.getReseedSource(options.traceId);
|
|
8179
|
+
if (source.traceFunctionKey !== traceFunctionKey) {
|
|
8180
|
+
throw new BitfabError(
|
|
8181
|
+
`Trace ${options.traceId} belongs to '${source.traceFunctionKey}', not '${traceFunctionKey}'.`
|
|
8182
|
+
);
|
|
8183
|
+
}
|
|
8184
|
+
const args = deserializeInputs({
|
|
8185
|
+
input: source.input,
|
|
8186
|
+
input_meta: source.inputMeta
|
|
8187
|
+
});
|
|
8188
|
+
const runTraceId = await this.seedTraceByRunning(
|
|
8189
|
+
traceFunctionKey,
|
|
8190
|
+
fn,
|
|
8191
|
+
{
|
|
8192
|
+
args,
|
|
8193
|
+
metadata: source.metadata,
|
|
8194
|
+
...source.sessionId === null ? {} : { sessionId: source.sessionId },
|
|
8195
|
+
...source.name === null ? {} : { name: source.name }
|
|
8196
|
+
}
|
|
8197
|
+
);
|
|
8198
|
+
const adopted = await this.httpClient.reseedTrace(
|
|
8199
|
+
options.traceId,
|
|
8200
|
+
runTraceId
|
|
8201
|
+
);
|
|
8202
|
+
return {
|
|
8203
|
+
traceId: adopted.traceId,
|
|
8204
|
+
previousRunTraceId: adopted.previousRunTraceId
|
|
8205
|
+
};
|
|
8206
|
+
}
|
|
8162
8207
|
async replay(traceFunctionKey, fn, options) {
|
|
8163
8208
|
const wrappedKey = fn._bitfabTraceFunctionKey;
|
|
8164
8209
|
let replayFn = fn;
|
|
@@ -8420,6 +8465,24 @@ init_replay();
|
|
|
8420
8465
|
function defineReplayRegistry(registry) {
|
|
8421
8466
|
return registry;
|
|
8422
8467
|
}
|
|
8468
|
+
async function reseedFromRegistry(registry, pipeline, traceIds) {
|
|
8469
|
+
const registration = registry[pipeline];
|
|
8470
|
+
if (registration === void 0) {
|
|
8471
|
+
throw new BitfabError(
|
|
8472
|
+
`Unknown pipeline '${pipeline}'. Registered: ${Object.keys(registry).join(", ")}`
|
|
8473
|
+
);
|
|
8474
|
+
}
|
|
8475
|
+
const traceFunctionKey = resolveTraceFunctionKey(registration);
|
|
8476
|
+
const reseeded = [];
|
|
8477
|
+
for (const traceId of traceIds) {
|
|
8478
|
+
reseeded.push(
|
|
8479
|
+
await registration.client.reseedTrace(traceFunctionKey, registration.fn, {
|
|
8480
|
+
traceId
|
|
8481
|
+
})
|
|
8482
|
+
);
|
|
8483
|
+
}
|
|
8484
|
+
return { pipeline, traceFunctionKey, reseeded };
|
|
8485
|
+
}
|
|
8423
8486
|
async function seedFromRegistry(registry, pipeline, cases, options = {}) {
|
|
8424
8487
|
const registration = registry[pipeline];
|
|
8425
8488
|
if (registration === void 0) {
|
|
@@ -8500,6 +8563,7 @@ assertAsyncStorageRegistered();
|
|
|
8500
8563
|
getCurrentSpan,
|
|
8501
8564
|
getCurrentTrace,
|
|
8502
8565
|
reportReplayProgress,
|
|
8566
|
+
reseedFromRegistry,
|
|
8503
8567
|
seedFromRegistry,
|
|
8504
8568
|
serializeReplayResult
|
|
8505
8569
|
});
|