bitfab 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.
Files changed (34) hide show
  1. package/dist/{chunk-XRSOWDOP.js → chunk-34B7PVAM.js} +14 -2
  2. package/dist/{chunk-XRSOWDOP.js.map → chunk-34B7PVAM.js.map} +1 -1
  3. package/dist/{chunk-EAET3MSX.js → chunk-AUROMI67.js} +56 -6
  4. package/dist/chunk-AUROMI67.js.map +1 -0
  5. package/dist/chunk-HKTODDFP.js +747 -0
  6. package/dist/chunk-HKTODDFP.js.map +1 -0
  7. package/dist/{chunk-JPFJ5YSK.js → chunk-IG3CPSRQ.js} +14 -2
  8. package/dist/{chunk-JPFJ5YSK.js.map → chunk-IG3CPSRQ.js.map} +1 -1
  9. package/dist/{chunk-NZGYJWHY.js → chunk-U2D7ACC4.js} +3 -2
  10. package/dist/chunk-U2D7ACC4.js.map +1 -0
  11. package/dist/{http-W66ZE5TL.js → http-F3AXLOJT.js} +2 -2
  12. package/dist/{http-HSNLZMNZ.js → http-RFNQ7LSU.js} +2 -2
  13. package/dist/index.cjs +65 -1
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +36 -2
  16. package/dist/index.d.ts +36 -2
  17. package/dist/index.js +5 -3
  18. package/dist/node.cjs +65 -1
  19. package/dist/node.cjs.map +1 -1
  20. package/dist/node.d.cts +1 -1
  21. package/dist/node.d.ts +1 -1
  22. package/dist/node.js +5 -3
  23. package/dist/node.js.map +1 -1
  24. package/dist/{replay-QMA2K5M4.js → replay-ZOTYMBMD.js} +5 -3
  25. package/dist/replayCli.js +18 -687
  26. package/dist/replayCli.js.map +1 -1
  27. package/dist/seedCli.js +30 -0
  28. package/dist/seedCli.js.map +1 -0
  29. package/package.json +3 -2
  30. package/dist/chunk-EAET3MSX.js.map +0 -1
  31. package/dist/chunk-NZGYJWHY.js.map +0 -1
  32. /package/dist/{http-HSNLZMNZ.js.map → http-F3AXLOJT.js.map} +0 -0
  33. /package/dist/{http-W66ZE5TL.js.map → http-RFNQ7LSU.js.map} +0 -0
  34. /package/dist/{replay-QMA2K5M4.js.map → replay-ZOTYMBMD.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.3";
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.3";
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
@@ -26,8 +26,9 @@ import {
26
26
  getCurrentReplayBranch,
27
27
  getCurrentSpan,
28
28
  getCurrentTrace,
29
+ reseedFromRegistry,
29
30
  seedFromRegistry
30
- } from "./chunk-EAET3MSX.js";
31
+ } from "./chunk-AUROMI67.js";
31
32
  import "./chunk-ZUD7OFYB.js";
32
33
  import {
33
34
  BITFAB_PROGRESS_PREFIX,
@@ -36,7 +37,7 @@ import {
36
37
  ReplayError,
37
38
  reportReplayProgress,
38
39
  serializeReplayResult
39
- } from "./chunk-NZGYJWHY.js";
40
+ } from "./chunk-U2D7ACC4.js";
40
41
  import {
41
42
  BitfabError,
42
43
  DEFAULT_SERVICE_URL,
@@ -44,7 +45,7 @@ import {
44
45
  MixedTracingError,
45
46
  __version__,
46
47
  flushTraces
47
- } from "./chunk-XRSOWDOP.js";
48
+ } from "./chunk-34B7PVAM.js";
48
49
  import "./chunk-H6LZRFMN.js";
49
50
  export {
50
51
  BITFAB_PROGRESS_PREFIX,
@@ -77,6 +78,7 @@ export {
77
78
  getCurrentSpan,
78
79
  getCurrentTrace,
79
80
  reportReplayProgress,
81
+ reseedFromRegistry,
80
82
  seedFromRegistry,
81
83
  serializeReplayResult
82
84
  };
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.52.3";
100
+ __version__ = "0.52.4";
101
101
  __packageName__ = "bitfab";
102
102
  }
103
103
  });
@@ -2131,6 +2131,18 @@ var init_http = __esm({
2131
2131
  { timeout: REPLAY_COMPLETE_REQUEST_TIMEOUT_MS }
2132
2132
  );
2133
2133
  }
2134
+ async getReseedSource(traceId) {
2135
+ return this.get(
2136
+ `/api/sdk/traces/${encodeURIComponent(traceId)}/reseedSource`
2137
+ );
2138
+ }
2139
+ async reseedTrace(traceId, runTraceId) {
2140
+ return this.request(
2141
+ `/api/sdk/traces/${encodeURIComponent(traceId)}/reseed`,
2142
+ { runTraceId },
2143
+ { timeout: 3e4 }
2144
+ );
2145
+ }
2134
2146
  /**
2135
2147
  * Ask the server to materialize a per-trace DB branch lease from a
2136
2148
  * captured `dbSnapshotRef`. Blocking - the resolver creates a Neon
@@ -2575,6 +2587,7 @@ __export(replay_exports, {
2575
2587
  BITFAB_PROGRESS_PREFIX: () => BITFAB_PROGRESS_PREFIX,
2576
2588
  DbBranchReplayError: () => DbBranchReplayError,
2577
2589
  ReplayError: () => ReplayError,
2590
+ deserializeInputs: () => deserializeInputs,
2578
2591
  replay: () => replay,
2579
2592
  reportReplayProgress: () => reportReplayProgress,
2580
2593
  serializeReplayResult: () => serializeReplayResult,
@@ -3425,6 +3438,7 @@ __export(node_exports, {
3425
3438
  getCurrentSpan: () => getCurrentSpan,
3426
3439
  getCurrentTrace: () => getCurrentTrace,
3427
3440
  reportReplayProgress: () => reportReplayProgress,
3441
+ reseedFromRegistry: () => reseedFromRegistry,
3428
3442
  seedFromRegistry: () => seedFromRegistry,
3429
3443
  serializeReplayResult: () => serializeReplayResult
3430
3444
  });
@@ -5741,6 +5755,7 @@ var BitfabOpenAIAgentHandler = class {
5741
5755
 
5742
5756
  // src/client.ts
5743
5757
  init_randomUuid();
5758
+ init_replay();
5744
5759
 
5745
5760
  // src/replayBranch.ts
5746
5761
  var _url, _context;
@@ -8168,6 +8183,36 @@ var Bitfab = class {
8168
8183
  }
8169
8184
  return traceId;
8170
8185
  }
8186
+ async reseedTrace(traceFunctionKey, fn, options) {
8187
+ const source = await this.httpClient.getReseedSource(options.traceId);
8188
+ if (source.traceFunctionKey !== traceFunctionKey) {
8189
+ throw new BitfabError(
8190
+ `Trace ${options.traceId} belongs to '${source.traceFunctionKey}', not '${traceFunctionKey}'.`
8191
+ );
8192
+ }
8193
+ const args = deserializeInputs({
8194
+ input: source.input,
8195
+ input_meta: source.inputMeta
8196
+ });
8197
+ const runTraceId = await this.seedTraceByRunning(
8198
+ traceFunctionKey,
8199
+ fn,
8200
+ {
8201
+ args,
8202
+ metadata: source.metadata,
8203
+ ...source.sessionId === null ? {} : { sessionId: source.sessionId },
8204
+ ...source.name === null ? {} : { name: source.name }
8205
+ }
8206
+ );
8207
+ const adopted = await this.httpClient.reseedTrace(
8208
+ options.traceId,
8209
+ runTraceId
8210
+ );
8211
+ return {
8212
+ traceId: adopted.traceId,
8213
+ previousRunTraceId: adopted.previousRunTraceId
8214
+ };
8215
+ }
8171
8216
  async replay(traceFunctionKey, fn, options) {
8172
8217
  const wrappedKey = fn._bitfabTraceFunctionKey;
8173
8218
  let replayFn = fn;
@@ -8429,6 +8474,24 @@ init_replay();
8429
8474
  function defineReplayRegistry(registry) {
8430
8475
  return registry;
8431
8476
  }
8477
+ async function reseedFromRegistry(registry, pipeline, traceIds) {
8478
+ const registration = registry[pipeline];
8479
+ if (registration === void 0) {
8480
+ throw new BitfabError(
8481
+ `Unknown pipeline '${pipeline}'. Registered: ${Object.keys(registry).join(", ")}`
8482
+ );
8483
+ }
8484
+ const traceFunctionKey = resolveTraceFunctionKey(registration);
8485
+ const reseeded = [];
8486
+ for (const traceId of traceIds) {
8487
+ reseeded.push(
8488
+ await registration.client.reseedTrace(traceFunctionKey, registration.fn, {
8489
+ traceId
8490
+ })
8491
+ );
8492
+ }
8493
+ return { pipeline, traceFunctionKey, reseeded };
8494
+ }
8432
8495
  async function seedFromRegistry(registry, pipeline, cases, options = {}) {
8433
8496
  const registration = registry[pipeline];
8434
8497
  if (registration === void 0) {
@@ -8509,6 +8572,7 @@ assertAsyncStorageRegistered();
8509
8572
  getCurrentSpan,
8510
8573
  getCurrentTrace,
8511
8574
  reportReplayProgress,
8575
+ reseedFromRegistry,
8512
8576
  seedFromRegistry,
8513
8577
  serializeReplayResult
8514
8578
  });