bitfab 0.59.0 → 0.60.0
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.map +1 -1
- package/dist/autoTrace.d.cts +2 -0
- package/dist/autoTrace.d.ts +2 -0
- package/dist/autoTrace.js +1 -1
- package/dist/{chunk-ETZUSSF6.js → chunk-5DNB7EN7.js} +1 -1
- package/dist/chunk-5DNB7EN7.js.map +1 -0
- package/dist/{chunk-FHEEAPG2.js → chunk-7GIZS4E2.js} +54 -38
- package/dist/chunk-7GIZS4E2.js.map +1 -0
- package/dist/{chunk-R5MUOBRK.js → chunk-ASJPN3L2.js} +29 -14
- package/dist/chunk-ASJPN3L2.js.map +1 -0
- package/dist/{chunk-KFZ5OIN5.js → chunk-HKQGI5WP.js} +29 -14
- package/dist/chunk-HKQGI5WP.js.map +1 -0
- package/dist/{chunk-RYSCYPHQ.js → chunk-RXKKTRSN.js} +37 -38
- package/dist/chunk-RXKKTRSN.js.map +1 -0
- package/dist/{chunk-Y6FVWJKU.js → chunk-YS75T7YL.js} +18 -10
- package/dist/chunk-YS75T7YL.js.map +1 -0
- package/dist/{http-7WLON2BH.js → http-EQLFIFHN.js} +4 -2
- package/dist/{http-D7P4JL6C.js → http-QKQUDVEX.js} +4 -2
- package/dist/index.cjs +109 -79
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +71 -36
- package/dist/index.d.ts +71 -36
- package/dist/index.js +4 -4
- package/dist/node.cjs +109 -79
- 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-5TZNJ2DL.js → replay-TAYX5PBU.js} +3 -3
- package/dist/replayCli.js +2 -2
- package/dist/seedCli.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-ETZUSSF6.js.map +0 -1
- package/dist/chunk-FHEEAPG2.js.map +0 -1
- package/dist/chunk-KFZ5OIN5.js.map +0 -1
- package/dist/chunk-R5MUOBRK.js.map +0 -1
- package/dist/chunk-RYSCYPHQ.js.map +0 -1
- package/dist/chunk-Y6FVWJKU.js.map +0 -1
- /package/dist/{http-7WLON2BH.js.map → http-EQLFIFHN.js.map} +0 -0
- /package/dist/{http-D7P4JL6C.js.map → http-QKQUDVEX.js.map} +0 -0
- /package/dist/{replay-5TZNJ2DL.js.map → replay-TAYX5PBU.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -196,8 +196,8 @@ type MockOverrideInput = MockOverride | MockOverrideResolver;
|
|
|
196
196
|
/**
|
|
197
197
|
* Replay context propagation via AsyncLocalStorage.
|
|
198
198
|
*
|
|
199
|
-
* When set, the withSpan wrapper injects
|
|
200
|
-
* so that new spans created during replay are linked to the
|
|
199
|
+
* When set, the withSpan wrapper injects experimentId into the span payload
|
|
200
|
+
* so that new spans created during replay are linked to the experiment.
|
|
201
201
|
* Optionally carries a mock tree so child spans can return historical
|
|
202
202
|
* outputs instead of executing.
|
|
203
203
|
*/
|
|
@@ -299,7 +299,7 @@ interface MockTree {
|
|
|
299
299
|
spans: Map<string, MockSpan>;
|
|
300
300
|
}
|
|
301
301
|
interface ReplayContext {
|
|
302
|
-
|
|
302
|
+
experimentId: string;
|
|
303
303
|
traceId?: string;
|
|
304
304
|
inputSourceSpanId?: string;
|
|
305
305
|
/**
|
|
@@ -600,7 +600,7 @@ declare class HttpClient {
|
|
|
600
600
|
}): Promise<void>;
|
|
601
601
|
/**
|
|
602
602
|
* Start a replay session by fetching historical traces.
|
|
603
|
-
* Blocking call - creates
|
|
603
|
+
* Blocking call - creates an experiment and returns lightweight item references.
|
|
604
604
|
*/
|
|
605
605
|
startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean, judgeAssertions?: boolean): Promise<StartReplayResponse>;
|
|
606
606
|
/**
|
|
@@ -631,12 +631,12 @@ declare class HttpClient {
|
|
|
631
631
|
* has a final status AND at least that many persisted spans, which is what
|
|
632
632
|
* makes this a real barrier rather than a "the row exists" check.
|
|
633
633
|
*/
|
|
634
|
-
getReplayStatus(
|
|
634
|
+
getReplayStatus(experimentId: string, expectedSpanCounts: Record<string, number>): Promise<ReplayStatusResponse>;
|
|
635
635
|
/**
|
|
636
|
-
* Mark a replay
|
|
636
|
+
* Mark a replay experiment as completed.
|
|
637
637
|
* Blocking call.
|
|
638
638
|
*/
|
|
639
|
-
completeReplay(
|
|
639
|
+
completeReplay(experimentId: string): Promise<CompleteReplayResponse>;
|
|
640
640
|
getReseedSource(traceId: string): Promise<ReseedSourceResponse>;
|
|
641
641
|
reseedTrace(traceId: string, runTraceId: string): Promise<ReseedTraceResponse>;
|
|
642
642
|
/**
|
|
@@ -645,7 +645,7 @@ declare class HttpClient {
|
|
|
645
645
|
* snapshot + preview branch and polls operations to readiness, which
|
|
646
646
|
* can take seconds.
|
|
647
647
|
*/
|
|
648
|
-
resolveDbBranchLease(
|
|
648
|
+
resolveDbBranchLease(experimentId: string, traceId: string, dbBranchSettings?: DbBranchSettings, attempt?: number): Promise<{
|
|
649
649
|
dbSnapshotRef: DbSnapshotRef | null;
|
|
650
650
|
lease: DbBranchLease | null;
|
|
651
651
|
leaseError: {
|
|
@@ -702,8 +702,8 @@ interface CodeChangeFile {
|
|
|
702
702
|
after: string;
|
|
703
703
|
}
|
|
704
704
|
interface StartReplayResponse {
|
|
705
|
-
|
|
706
|
-
|
|
705
|
+
experimentId: string;
|
|
706
|
+
experimentUrl: string;
|
|
707
707
|
attempts?: number;
|
|
708
708
|
items: Array<{
|
|
709
709
|
/** Bitfab trace ID of the original (historical) trace being replayed. */
|
|
@@ -791,7 +791,7 @@ interface CompleteReplayResponse {
|
|
|
791
791
|
traceOutlines?: Record<string, TraceOutline>;
|
|
792
792
|
originalTraceOutlines?: Record<string, TraceOutline>;
|
|
793
793
|
/**
|
|
794
|
-
* Number of traces the server has persisted for this
|
|
794
|
+
* Number of traces the server has persisted for this experiment at
|
|
795
795
|
* completion time. Lets the SDK distinguish "uploads failed" from
|
|
796
796
|
* "server never saw them" when the trace-ID mapping is incomplete.
|
|
797
797
|
*/
|
|
@@ -1379,6 +1379,7 @@ type SaveAssertion = {
|
|
|
1379
1379
|
category_assertion_id?: string | null;
|
|
1380
1380
|
id?: string;
|
|
1381
1381
|
assertion: string;
|
|
1382
|
+
humanNote?: string | null;
|
|
1382
1383
|
passCriteria?: string | null;
|
|
1383
1384
|
failCriteria?: string | null;
|
|
1384
1385
|
targetOnEvaluatedTrace?: TraceTarget | null;
|
|
@@ -1523,12 +1524,12 @@ type TraceLabels = {
|
|
|
1523
1524
|
declare class LabelsClient {
|
|
1524
1525
|
private readonly httpClient;
|
|
1525
1526
|
constructor(httpClient: HttpClient);
|
|
1526
|
-
save(update: LabelUpdate,
|
|
1527
|
-
saveAll(updates: LabelUpdate[],
|
|
1527
|
+
save(update: LabelUpdate, experimentId?: string): Promise<LabelOutcome>;
|
|
1528
|
+
saveAll(updates: LabelUpdate[], experimentId?: string): Promise<LabelOutcome[]>;
|
|
1528
1529
|
/** Withhold a verdict for a trace or replay attempt whose check did not run. */
|
|
1529
|
-
skip(target: LabelTarget,
|
|
1530
|
+
skip(target: LabelTarget, experimentId?: string): Promise<LabelOutcome>;
|
|
1530
1531
|
/** Clear a previous verdict for a trace, replay attempt, or assertion. */
|
|
1531
|
-
archive(target: LabelTarget,
|
|
1532
|
+
archive(target: LabelTarget, experimentId?: string): Promise<LabelOutcome>;
|
|
1532
1533
|
saveHuman(update: HumanLabelUpdate): Promise<HumanLabelOutcome>;
|
|
1533
1534
|
saveHumanAll(updates: HumanLabelUpdate[]): Promise<HumanLabelOutcome[]>;
|
|
1534
1535
|
get(traceId: string): Promise<TraceLabels | null>;
|
|
@@ -1829,12 +1830,12 @@ declare class OrganizationMembersClient {
|
|
|
1829
1830
|
}
|
|
1830
1831
|
|
|
1831
1832
|
/**
|
|
1832
|
-
* Replay historical traces through a function and create
|
|
1833
|
+
* Replay historical traces through a function and create an experiment.
|
|
1833
1834
|
*
|
|
1834
1835
|
* The replay flow has three phases:
|
|
1835
|
-
* 1. Start: fetches historical traces from the server and creates
|
|
1836
|
+
* 1. Start: fetches historical traces from the server and creates an experiment
|
|
1836
1837
|
* 2. Execute: re-runs each trace's inputs through the provided function locally
|
|
1837
|
-
* 3. Complete: marks the
|
|
1838
|
+
* 3. Complete: marks the experiment as completed on the server
|
|
1838
1839
|
*/
|
|
1839
1840
|
|
|
1840
1841
|
type MockStrategy = "none" | "all" | "marked";
|
|
@@ -1886,7 +1887,7 @@ interface ReplayOptions {
|
|
|
1886
1887
|
* it selects by ID with no dataset attribution.
|
|
1887
1888
|
*/
|
|
1888
1889
|
traceIds?: string[];
|
|
1889
|
-
/** Optional display name for the resulting experiment
|
|
1890
|
+
/** Optional display name for the resulting experiment. */
|
|
1890
1891
|
name?: string;
|
|
1891
1892
|
/** Positive integer limiting parallel items. Set to 1 for sequential. Default 10. */
|
|
1892
1893
|
maxConcurrency?: number;
|
|
@@ -1944,14 +1945,14 @@ interface ReplayOptions {
|
|
|
1944
1945
|
* Dataset this replay runs against. Mutually exclusive with `datasetIds`.
|
|
1945
1946
|
* Alone it replays the dataset's full membership, and with `traceIds` it
|
|
1946
1947
|
* replays only those members. When set, the resulting experiment is
|
|
1947
|
-
* durably attributed to the dataset (stored on the
|
|
1948
|
+
* durably attributed to the dataset (stored on the experiment), so it appears
|
|
1948
1949
|
* under the dataset's experiments even if the trace lineage can't be
|
|
1949
1950
|
* reconstructed. Validated server-side against the org.
|
|
1950
1951
|
*/
|
|
1951
1952
|
datasetId?: string;
|
|
1952
1953
|
datasetIds?: string[];
|
|
1953
1954
|
/**
|
|
1954
|
-
* Graders to attach directly to this experiment
|
|
1955
|
+
* Graders to attach directly to this experiment, independent of any
|
|
1955
1956
|
* graders already on the dataset. The resulting experiment is graded by the
|
|
1956
1957
|
* union of these and the dataset's runnable graders at completion, so use this
|
|
1957
1958
|
* to grade a single run with a check you don't want to add to the dataset
|
|
@@ -2035,11 +2036,27 @@ interface ReplayOptions {
|
|
|
2035
2036
|
* are still in flight. A throwing callback never crashes the run.
|
|
2036
2037
|
*/
|
|
2037
2038
|
onItemStart?: (progress: ReplayItemStartProgress) => void;
|
|
2039
|
+
/**
|
|
2040
|
+
* Called once, right after the server creates the experiment and before any
|
|
2041
|
+
* item runs, with the experiment ID and its dashboard URL. Use it to show
|
|
2042
|
+
* where results will appear while the replay is still running. A throwing
|
|
2043
|
+
* callback never crashes the run.
|
|
2044
|
+
*/
|
|
2045
|
+
onExperimentStart?: (experiment: ReplayExperiment) => void;
|
|
2046
|
+
}
|
|
2047
|
+
/** The experiment a replay records into, passed to {@link ReplayOptions.onExperimentStart}. */
|
|
2048
|
+
interface ReplayExperiment {
|
|
2049
|
+
/** Experiment ID created for this replay. */
|
|
2050
|
+
experimentId: string;
|
|
2051
|
+
/** Full URL to view the experiment in the dashboard. */
|
|
2052
|
+
experimentUrl: string;
|
|
2038
2053
|
}
|
|
2039
2054
|
/** Emitted through {@link ReplayOptions.onItemStart} when a worker starts an item. */
|
|
2040
2055
|
interface ReplayItemStartProgress {
|
|
2041
2056
|
type: "started";
|
|
2042
|
-
/**
|
|
2057
|
+
/** Experiment ID created for this replay. */
|
|
2058
|
+
experimentId: string;
|
|
2059
|
+
/** @deprecated Use {@link experimentId}. Same value. */
|
|
2043
2060
|
testRunId: string;
|
|
2044
2061
|
/** Items whose processing has started so far. */
|
|
2045
2062
|
started: number;
|
|
@@ -2066,7 +2083,9 @@ interface ReplayItemStartProgress {
|
|
|
2066
2083
|
interface ReplayItemFinishProgress {
|
|
2067
2084
|
/** Event kind, omitted for backward-compatible per-item events. */
|
|
2068
2085
|
type?: "item";
|
|
2069
|
-
/**
|
|
2086
|
+
/** Experiment ID created for this replay. */
|
|
2087
|
+
experimentId: string;
|
|
2088
|
+
/** @deprecated Use {@link experimentId}. Same value. */
|
|
2070
2089
|
testRunId: string;
|
|
2071
2090
|
/** Items that have finished so far, whether they succeeded or errored. */
|
|
2072
2091
|
completed: number;
|
|
@@ -2136,6 +2155,8 @@ interface ReplayProgressItem {
|
|
|
2136
2155
|
interface ReplayProgress {
|
|
2137
2156
|
type?: "item" | "complete";
|
|
2138
2157
|
result?: ReplayResult<unknown>;
|
|
2158
|
+
experimentId?: string;
|
|
2159
|
+
/** @deprecated Use {@link experimentId}. Same value. */
|
|
2139
2160
|
testRunId?: string;
|
|
2140
2161
|
completed: number;
|
|
2141
2162
|
total: number;
|
|
@@ -2202,7 +2223,7 @@ interface ReplayItem<T> {
|
|
|
2202
2223
|
* trace row; the client-side id used to correlate spans during the run is
|
|
2203
2224
|
* never surfaced here. Null until completion, on older servers that omit the
|
|
2204
2225
|
* mapping, or if the item produced no trace. Not the verdict-persistence key:
|
|
2205
|
-
* that is the original-trace lineage (`originalTraceId` + `
|
|
2226
|
+
* that is the original-trace lineage (`originalTraceId` + `experimentId`).
|
|
2206
2227
|
*/
|
|
2207
2228
|
traceId: string | null;
|
|
2208
2229
|
/** Bitfab trace ID of the original (historical) trace being replayed. */
|
|
@@ -2285,9 +2306,13 @@ interface ReplayItem<T> {
|
|
|
2285
2306
|
interface ReplayResult<T> {
|
|
2286
2307
|
/** Individual replay items with inputs, results, and comparison data. */
|
|
2287
2308
|
items: ReplayItem<T>[];
|
|
2288
|
-
/** The
|
|
2309
|
+
/** The experiment ID created on the server. */
|
|
2310
|
+
experimentId: string;
|
|
2311
|
+
/** Full URL to view the experiment in the dashboard. */
|
|
2312
|
+
experimentUrl: string;
|
|
2313
|
+
/** @deprecated Use {@link experimentId}. Same value. */
|
|
2289
2314
|
testRunId: string;
|
|
2290
|
-
/**
|
|
2315
|
+
/** @deprecated Use {@link experimentUrl}. Same value. */
|
|
2291
2316
|
testRunUrl: string;
|
|
2292
2317
|
attempts: number;
|
|
2293
2318
|
}
|
|
@@ -2297,10 +2322,14 @@ interface ReplayResult<T> {
|
|
|
2297
2322
|
*/
|
|
2298
2323
|
declare class ReplayError<T = unknown> extends BitfabError {
|
|
2299
2324
|
readonly items: ReplayItem<T>[];
|
|
2325
|
+
readonly experimentId: string;
|
|
2326
|
+
readonly experimentUrl: string;
|
|
2327
|
+
readonly cause: unknown;
|
|
2328
|
+
/** @deprecated Use {@link experimentId}. Same value. */
|
|
2300
2329
|
readonly testRunId: string;
|
|
2330
|
+
/** @deprecated Use {@link experimentUrl}. Same value. */
|
|
2301
2331
|
readonly testRunUrl: string;
|
|
2302
|
-
|
|
2303
|
-
constructor(message: string, items: ReplayItem<T>[], testRunId: string, testRunUrl: string, cause: unknown);
|
|
2332
|
+
constructor(message: string, items: ReplayItem<T>[], experimentId: string, experimentUrl: string, cause: unknown);
|
|
2304
2333
|
}
|
|
2305
2334
|
/**
|
|
2306
2335
|
* A database branch requested for one replay item could not be resolved.
|
|
@@ -2668,7 +2697,8 @@ interface CurrentSpan {
|
|
|
2668
2697
|
* Unlike `getCurrentTrace()`, this handle is not tied to AsyncLocalStorage -
|
|
2669
2698
|
* each method sends to the server immediately. Useful for adding context
|
|
2670
2699
|
* to a trace from a different process, request, or thread (e.g. a forked
|
|
2671
|
-
* agent that wants to annotate the original conversation's trace).
|
|
2700
|
+
* agent that wants to annotate the original conversation's trace). Its methods
|
|
2701
|
+
* write whether or not capture is on.
|
|
2672
2702
|
*/
|
|
2673
2703
|
interface DetachedTrace {
|
|
2674
2704
|
/** The canonical Bitfab trace ID this handle resolves. */
|
|
@@ -2875,7 +2905,12 @@ interface SpanOptions {
|
|
|
2875
2905
|
* real child.
|
|
2876
2906
|
*/
|
|
2877
2907
|
mockOnReplay?: boolean;
|
|
2878
|
-
/** Optional
|
|
2908
|
+
/** Optional experiment ID included on the span and on the trace it starts. */
|
|
2909
|
+
experimentId?: string;
|
|
2910
|
+
/**
|
|
2911
|
+
* @deprecated Use {@link experimentId}. Same meaning. Passing both with
|
|
2912
|
+
* different values throws.
|
|
2913
|
+
*/
|
|
2879
2914
|
testRunId?: string;
|
|
2880
2915
|
/**
|
|
2881
2916
|
* Record a serializable view of a non-serializable result (e.g. a live
|
|
@@ -3404,14 +3439,14 @@ declare class Bitfab {
|
|
|
3404
3439
|
*/
|
|
3405
3440
|
private sendWrapperSpan;
|
|
3406
3441
|
/**
|
|
3407
|
-
* Replay historical traces through a function and create
|
|
3442
|
+
* Replay historical traces through a function and create an experiment.
|
|
3408
3443
|
*
|
|
3409
3444
|
* Fetches the last N traces for the given trace function key, re-runs each
|
|
3410
3445
|
* through the provided function, and returns comparison data.
|
|
3411
3446
|
*
|
|
3412
3447
|
* Accepts either a `withSpan`-wrapped function (under the same key) or any
|
|
3413
3448
|
* plain callable: plain callables are wrapped internally so each replayed
|
|
3414
|
-
* invocation records a trace tied to the
|
|
3449
|
+
* invocation records a trace tied to the experiment. The plain-callable form
|
|
3415
3450
|
* is how handler-instrumented workflows (LangGraph/LangChain, Claude Agent
|
|
3416
3451
|
* SDK) replay - those record traces under a key with no `withSpan`-wrapped
|
|
3417
3452
|
* root in the app.
|
|
@@ -3421,7 +3456,7 @@ declare class Bitfab {
|
|
|
3421
3456
|
* @param options - Optional replay options. When `traceIds` is passed,
|
|
3422
3457
|
* `limit` is ignored (with a warning): an explicit ID list already
|
|
3423
3458
|
* determines how many traces replay.
|
|
3424
|
-
* @returns ReplayResult with items,
|
|
3459
|
+
* @returns ReplayResult with items, experimentId, and experimentUrl
|
|
3425
3460
|
*/
|
|
3426
3461
|
/**
|
|
3427
3462
|
* Register a mock override applied to every subsequent `replay` on this
|
|
@@ -3681,7 +3716,7 @@ interface CommitRef {
|
|
|
3681
3716
|
/**
|
|
3682
3717
|
* SDK version from package.json (injected at build time)
|
|
3683
3718
|
*/
|
|
3684
|
-
declare const __version__ = "0.
|
|
3719
|
+
declare const __version__ = "0.60.0";
|
|
3685
3720
|
|
|
3686
3721
|
/**
|
|
3687
3722
|
* Constants for the Bitfab SDK.
|
|
@@ -3750,7 +3785,7 @@ declare const finalizers: {
|
|
|
3750
3785
|
};
|
|
3751
3786
|
|
|
3752
3787
|
type ReplayFunction = (...args: any[]) => unknown | Promise<unknown>;
|
|
3753
|
-
type ReplayRegistryOptions = Omit<ReplayOptions, "onItemStart" | "onItemFinish" | "onProgress">;
|
|
3788
|
+
type ReplayRegistryOptions = Omit<ReplayOptions, "onItemStart" | "onItemFinish" | "onProgress" | "onExperimentStart">;
|
|
3754
3789
|
interface ReplayRegistryContext {
|
|
3755
3790
|
/** Values supplied through `--params` and repeated `--param name=value`. */
|
|
3756
3791
|
params: Readonly<Record<string, unknown>>;
|
|
@@ -3820,4 +3855,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
|
|
|
3820
3855
|
run?: boolean;
|
|
3821
3856
|
}): Promise<SeedResult>;
|
|
3822
3857
|
|
|
3823
|
-
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 AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionLabelEvidence, type AssertionVerdict, type Assignee, 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 GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, 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 OrganizationMember, OrganizationMembersClient, 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 };
|
|
3858
|
+
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 AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionLabelEvidence, type AssertionVerdict, type Assignee, 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 GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, 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 OrganizationMember, OrganizationMembersClient, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayExperiment, 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
|
@@ -196,8 +196,8 @@ type MockOverrideInput = MockOverride | MockOverrideResolver;
|
|
|
196
196
|
/**
|
|
197
197
|
* Replay context propagation via AsyncLocalStorage.
|
|
198
198
|
*
|
|
199
|
-
* When set, the withSpan wrapper injects
|
|
200
|
-
* so that new spans created during replay are linked to the
|
|
199
|
+
* When set, the withSpan wrapper injects experimentId into the span payload
|
|
200
|
+
* so that new spans created during replay are linked to the experiment.
|
|
201
201
|
* Optionally carries a mock tree so child spans can return historical
|
|
202
202
|
* outputs instead of executing.
|
|
203
203
|
*/
|
|
@@ -299,7 +299,7 @@ interface MockTree {
|
|
|
299
299
|
spans: Map<string, MockSpan>;
|
|
300
300
|
}
|
|
301
301
|
interface ReplayContext {
|
|
302
|
-
|
|
302
|
+
experimentId: string;
|
|
303
303
|
traceId?: string;
|
|
304
304
|
inputSourceSpanId?: string;
|
|
305
305
|
/**
|
|
@@ -600,7 +600,7 @@ declare class HttpClient {
|
|
|
600
600
|
}): Promise<void>;
|
|
601
601
|
/**
|
|
602
602
|
* Start a replay session by fetching historical traces.
|
|
603
|
-
* Blocking call - creates
|
|
603
|
+
* Blocking call - creates an experiment and returns lightweight item references.
|
|
604
604
|
*/
|
|
605
605
|
startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean, judgeAssertions?: boolean): Promise<StartReplayResponse>;
|
|
606
606
|
/**
|
|
@@ -631,12 +631,12 @@ declare class HttpClient {
|
|
|
631
631
|
* has a final status AND at least that many persisted spans, which is what
|
|
632
632
|
* makes this a real barrier rather than a "the row exists" check.
|
|
633
633
|
*/
|
|
634
|
-
getReplayStatus(
|
|
634
|
+
getReplayStatus(experimentId: string, expectedSpanCounts: Record<string, number>): Promise<ReplayStatusResponse>;
|
|
635
635
|
/**
|
|
636
|
-
* Mark a replay
|
|
636
|
+
* Mark a replay experiment as completed.
|
|
637
637
|
* Blocking call.
|
|
638
638
|
*/
|
|
639
|
-
completeReplay(
|
|
639
|
+
completeReplay(experimentId: string): Promise<CompleteReplayResponse>;
|
|
640
640
|
getReseedSource(traceId: string): Promise<ReseedSourceResponse>;
|
|
641
641
|
reseedTrace(traceId: string, runTraceId: string): Promise<ReseedTraceResponse>;
|
|
642
642
|
/**
|
|
@@ -645,7 +645,7 @@ declare class HttpClient {
|
|
|
645
645
|
* snapshot + preview branch and polls operations to readiness, which
|
|
646
646
|
* can take seconds.
|
|
647
647
|
*/
|
|
648
|
-
resolveDbBranchLease(
|
|
648
|
+
resolveDbBranchLease(experimentId: string, traceId: string, dbBranchSettings?: DbBranchSettings, attempt?: number): Promise<{
|
|
649
649
|
dbSnapshotRef: DbSnapshotRef | null;
|
|
650
650
|
lease: DbBranchLease | null;
|
|
651
651
|
leaseError: {
|
|
@@ -702,8 +702,8 @@ interface CodeChangeFile {
|
|
|
702
702
|
after: string;
|
|
703
703
|
}
|
|
704
704
|
interface StartReplayResponse {
|
|
705
|
-
|
|
706
|
-
|
|
705
|
+
experimentId: string;
|
|
706
|
+
experimentUrl: string;
|
|
707
707
|
attempts?: number;
|
|
708
708
|
items: Array<{
|
|
709
709
|
/** Bitfab trace ID of the original (historical) trace being replayed. */
|
|
@@ -791,7 +791,7 @@ interface CompleteReplayResponse {
|
|
|
791
791
|
traceOutlines?: Record<string, TraceOutline>;
|
|
792
792
|
originalTraceOutlines?: Record<string, TraceOutline>;
|
|
793
793
|
/**
|
|
794
|
-
* Number of traces the server has persisted for this
|
|
794
|
+
* Number of traces the server has persisted for this experiment at
|
|
795
795
|
* completion time. Lets the SDK distinguish "uploads failed" from
|
|
796
796
|
* "server never saw them" when the trace-ID mapping is incomplete.
|
|
797
797
|
*/
|
|
@@ -1379,6 +1379,7 @@ type SaveAssertion = {
|
|
|
1379
1379
|
category_assertion_id?: string | null;
|
|
1380
1380
|
id?: string;
|
|
1381
1381
|
assertion: string;
|
|
1382
|
+
humanNote?: string | null;
|
|
1382
1383
|
passCriteria?: string | null;
|
|
1383
1384
|
failCriteria?: string | null;
|
|
1384
1385
|
targetOnEvaluatedTrace?: TraceTarget | null;
|
|
@@ -1523,12 +1524,12 @@ type TraceLabels = {
|
|
|
1523
1524
|
declare class LabelsClient {
|
|
1524
1525
|
private readonly httpClient;
|
|
1525
1526
|
constructor(httpClient: HttpClient);
|
|
1526
|
-
save(update: LabelUpdate,
|
|
1527
|
-
saveAll(updates: LabelUpdate[],
|
|
1527
|
+
save(update: LabelUpdate, experimentId?: string): Promise<LabelOutcome>;
|
|
1528
|
+
saveAll(updates: LabelUpdate[], experimentId?: string): Promise<LabelOutcome[]>;
|
|
1528
1529
|
/** Withhold a verdict for a trace or replay attempt whose check did not run. */
|
|
1529
|
-
skip(target: LabelTarget,
|
|
1530
|
+
skip(target: LabelTarget, experimentId?: string): Promise<LabelOutcome>;
|
|
1530
1531
|
/** Clear a previous verdict for a trace, replay attempt, or assertion. */
|
|
1531
|
-
archive(target: LabelTarget,
|
|
1532
|
+
archive(target: LabelTarget, experimentId?: string): Promise<LabelOutcome>;
|
|
1532
1533
|
saveHuman(update: HumanLabelUpdate): Promise<HumanLabelOutcome>;
|
|
1533
1534
|
saveHumanAll(updates: HumanLabelUpdate[]): Promise<HumanLabelOutcome[]>;
|
|
1534
1535
|
get(traceId: string): Promise<TraceLabels | null>;
|
|
@@ -1829,12 +1830,12 @@ declare class OrganizationMembersClient {
|
|
|
1829
1830
|
}
|
|
1830
1831
|
|
|
1831
1832
|
/**
|
|
1832
|
-
* Replay historical traces through a function and create
|
|
1833
|
+
* Replay historical traces through a function and create an experiment.
|
|
1833
1834
|
*
|
|
1834
1835
|
* The replay flow has three phases:
|
|
1835
|
-
* 1. Start: fetches historical traces from the server and creates
|
|
1836
|
+
* 1. Start: fetches historical traces from the server and creates an experiment
|
|
1836
1837
|
* 2. Execute: re-runs each trace's inputs through the provided function locally
|
|
1837
|
-
* 3. Complete: marks the
|
|
1838
|
+
* 3. Complete: marks the experiment as completed on the server
|
|
1838
1839
|
*/
|
|
1839
1840
|
|
|
1840
1841
|
type MockStrategy = "none" | "all" | "marked";
|
|
@@ -1886,7 +1887,7 @@ interface ReplayOptions {
|
|
|
1886
1887
|
* it selects by ID with no dataset attribution.
|
|
1887
1888
|
*/
|
|
1888
1889
|
traceIds?: string[];
|
|
1889
|
-
/** Optional display name for the resulting experiment
|
|
1890
|
+
/** Optional display name for the resulting experiment. */
|
|
1890
1891
|
name?: string;
|
|
1891
1892
|
/** Positive integer limiting parallel items. Set to 1 for sequential. Default 10. */
|
|
1892
1893
|
maxConcurrency?: number;
|
|
@@ -1944,14 +1945,14 @@ interface ReplayOptions {
|
|
|
1944
1945
|
* Dataset this replay runs against. Mutually exclusive with `datasetIds`.
|
|
1945
1946
|
* Alone it replays the dataset's full membership, and with `traceIds` it
|
|
1946
1947
|
* replays only those members. When set, the resulting experiment is
|
|
1947
|
-
* durably attributed to the dataset (stored on the
|
|
1948
|
+
* durably attributed to the dataset (stored on the experiment), so it appears
|
|
1948
1949
|
* under the dataset's experiments even if the trace lineage can't be
|
|
1949
1950
|
* reconstructed. Validated server-side against the org.
|
|
1950
1951
|
*/
|
|
1951
1952
|
datasetId?: string;
|
|
1952
1953
|
datasetIds?: string[];
|
|
1953
1954
|
/**
|
|
1954
|
-
* Graders to attach directly to this experiment
|
|
1955
|
+
* Graders to attach directly to this experiment, independent of any
|
|
1955
1956
|
* graders already on the dataset. The resulting experiment is graded by the
|
|
1956
1957
|
* union of these and the dataset's runnable graders at completion, so use this
|
|
1957
1958
|
* to grade a single run with a check you don't want to add to the dataset
|
|
@@ -2035,11 +2036,27 @@ interface ReplayOptions {
|
|
|
2035
2036
|
* are still in flight. A throwing callback never crashes the run.
|
|
2036
2037
|
*/
|
|
2037
2038
|
onItemStart?: (progress: ReplayItemStartProgress) => void;
|
|
2039
|
+
/**
|
|
2040
|
+
* Called once, right after the server creates the experiment and before any
|
|
2041
|
+
* item runs, with the experiment ID and its dashboard URL. Use it to show
|
|
2042
|
+
* where results will appear while the replay is still running. A throwing
|
|
2043
|
+
* callback never crashes the run.
|
|
2044
|
+
*/
|
|
2045
|
+
onExperimentStart?: (experiment: ReplayExperiment) => void;
|
|
2046
|
+
}
|
|
2047
|
+
/** The experiment a replay records into, passed to {@link ReplayOptions.onExperimentStart}. */
|
|
2048
|
+
interface ReplayExperiment {
|
|
2049
|
+
/** Experiment ID created for this replay. */
|
|
2050
|
+
experimentId: string;
|
|
2051
|
+
/** Full URL to view the experiment in the dashboard. */
|
|
2052
|
+
experimentUrl: string;
|
|
2038
2053
|
}
|
|
2039
2054
|
/** Emitted through {@link ReplayOptions.onItemStart} when a worker starts an item. */
|
|
2040
2055
|
interface ReplayItemStartProgress {
|
|
2041
2056
|
type: "started";
|
|
2042
|
-
/**
|
|
2057
|
+
/** Experiment ID created for this replay. */
|
|
2058
|
+
experimentId: string;
|
|
2059
|
+
/** @deprecated Use {@link experimentId}. Same value. */
|
|
2043
2060
|
testRunId: string;
|
|
2044
2061
|
/** Items whose processing has started so far. */
|
|
2045
2062
|
started: number;
|
|
@@ -2066,7 +2083,9 @@ interface ReplayItemStartProgress {
|
|
|
2066
2083
|
interface ReplayItemFinishProgress {
|
|
2067
2084
|
/** Event kind, omitted for backward-compatible per-item events. */
|
|
2068
2085
|
type?: "item";
|
|
2069
|
-
/**
|
|
2086
|
+
/** Experiment ID created for this replay. */
|
|
2087
|
+
experimentId: string;
|
|
2088
|
+
/** @deprecated Use {@link experimentId}. Same value. */
|
|
2070
2089
|
testRunId: string;
|
|
2071
2090
|
/** Items that have finished so far, whether they succeeded or errored. */
|
|
2072
2091
|
completed: number;
|
|
@@ -2136,6 +2155,8 @@ interface ReplayProgressItem {
|
|
|
2136
2155
|
interface ReplayProgress {
|
|
2137
2156
|
type?: "item" | "complete";
|
|
2138
2157
|
result?: ReplayResult<unknown>;
|
|
2158
|
+
experimentId?: string;
|
|
2159
|
+
/** @deprecated Use {@link experimentId}. Same value. */
|
|
2139
2160
|
testRunId?: string;
|
|
2140
2161
|
completed: number;
|
|
2141
2162
|
total: number;
|
|
@@ -2202,7 +2223,7 @@ interface ReplayItem<T> {
|
|
|
2202
2223
|
* trace row; the client-side id used to correlate spans during the run is
|
|
2203
2224
|
* never surfaced here. Null until completion, on older servers that omit the
|
|
2204
2225
|
* mapping, or if the item produced no trace. Not the verdict-persistence key:
|
|
2205
|
-
* that is the original-trace lineage (`originalTraceId` + `
|
|
2226
|
+
* that is the original-trace lineage (`originalTraceId` + `experimentId`).
|
|
2206
2227
|
*/
|
|
2207
2228
|
traceId: string | null;
|
|
2208
2229
|
/** Bitfab trace ID of the original (historical) trace being replayed. */
|
|
@@ -2285,9 +2306,13 @@ interface ReplayItem<T> {
|
|
|
2285
2306
|
interface ReplayResult<T> {
|
|
2286
2307
|
/** Individual replay items with inputs, results, and comparison data. */
|
|
2287
2308
|
items: ReplayItem<T>[];
|
|
2288
|
-
/** The
|
|
2309
|
+
/** The experiment ID created on the server. */
|
|
2310
|
+
experimentId: string;
|
|
2311
|
+
/** Full URL to view the experiment in the dashboard. */
|
|
2312
|
+
experimentUrl: string;
|
|
2313
|
+
/** @deprecated Use {@link experimentId}. Same value. */
|
|
2289
2314
|
testRunId: string;
|
|
2290
|
-
/**
|
|
2315
|
+
/** @deprecated Use {@link experimentUrl}. Same value. */
|
|
2291
2316
|
testRunUrl: string;
|
|
2292
2317
|
attempts: number;
|
|
2293
2318
|
}
|
|
@@ -2297,10 +2322,14 @@ interface ReplayResult<T> {
|
|
|
2297
2322
|
*/
|
|
2298
2323
|
declare class ReplayError<T = unknown> extends BitfabError {
|
|
2299
2324
|
readonly items: ReplayItem<T>[];
|
|
2325
|
+
readonly experimentId: string;
|
|
2326
|
+
readonly experimentUrl: string;
|
|
2327
|
+
readonly cause: unknown;
|
|
2328
|
+
/** @deprecated Use {@link experimentId}. Same value. */
|
|
2300
2329
|
readonly testRunId: string;
|
|
2330
|
+
/** @deprecated Use {@link experimentUrl}. Same value. */
|
|
2301
2331
|
readonly testRunUrl: string;
|
|
2302
|
-
|
|
2303
|
-
constructor(message: string, items: ReplayItem<T>[], testRunId: string, testRunUrl: string, cause: unknown);
|
|
2332
|
+
constructor(message: string, items: ReplayItem<T>[], experimentId: string, experimentUrl: string, cause: unknown);
|
|
2304
2333
|
}
|
|
2305
2334
|
/**
|
|
2306
2335
|
* A database branch requested for one replay item could not be resolved.
|
|
@@ -2668,7 +2697,8 @@ interface CurrentSpan {
|
|
|
2668
2697
|
* Unlike `getCurrentTrace()`, this handle is not tied to AsyncLocalStorage -
|
|
2669
2698
|
* each method sends to the server immediately. Useful for adding context
|
|
2670
2699
|
* to a trace from a different process, request, or thread (e.g. a forked
|
|
2671
|
-
* agent that wants to annotate the original conversation's trace).
|
|
2700
|
+
* agent that wants to annotate the original conversation's trace). Its methods
|
|
2701
|
+
* write whether or not capture is on.
|
|
2672
2702
|
*/
|
|
2673
2703
|
interface DetachedTrace {
|
|
2674
2704
|
/** The canonical Bitfab trace ID this handle resolves. */
|
|
@@ -2875,7 +2905,12 @@ interface SpanOptions {
|
|
|
2875
2905
|
* real child.
|
|
2876
2906
|
*/
|
|
2877
2907
|
mockOnReplay?: boolean;
|
|
2878
|
-
/** Optional
|
|
2908
|
+
/** Optional experiment ID included on the span and on the trace it starts. */
|
|
2909
|
+
experimentId?: string;
|
|
2910
|
+
/**
|
|
2911
|
+
* @deprecated Use {@link experimentId}. Same meaning. Passing both with
|
|
2912
|
+
* different values throws.
|
|
2913
|
+
*/
|
|
2879
2914
|
testRunId?: string;
|
|
2880
2915
|
/**
|
|
2881
2916
|
* Record a serializable view of a non-serializable result (e.g. a live
|
|
@@ -3404,14 +3439,14 @@ declare class Bitfab {
|
|
|
3404
3439
|
*/
|
|
3405
3440
|
private sendWrapperSpan;
|
|
3406
3441
|
/**
|
|
3407
|
-
* Replay historical traces through a function and create
|
|
3442
|
+
* Replay historical traces through a function and create an experiment.
|
|
3408
3443
|
*
|
|
3409
3444
|
* Fetches the last N traces for the given trace function key, re-runs each
|
|
3410
3445
|
* through the provided function, and returns comparison data.
|
|
3411
3446
|
*
|
|
3412
3447
|
* Accepts either a `withSpan`-wrapped function (under the same key) or any
|
|
3413
3448
|
* plain callable: plain callables are wrapped internally so each replayed
|
|
3414
|
-
* invocation records a trace tied to the
|
|
3449
|
+
* invocation records a trace tied to the experiment. The plain-callable form
|
|
3415
3450
|
* is how handler-instrumented workflows (LangGraph/LangChain, Claude Agent
|
|
3416
3451
|
* SDK) replay - those record traces under a key with no `withSpan`-wrapped
|
|
3417
3452
|
* root in the app.
|
|
@@ -3421,7 +3456,7 @@ declare class Bitfab {
|
|
|
3421
3456
|
* @param options - Optional replay options. When `traceIds` is passed,
|
|
3422
3457
|
* `limit` is ignored (with a warning): an explicit ID list already
|
|
3423
3458
|
* determines how many traces replay.
|
|
3424
|
-
* @returns ReplayResult with items,
|
|
3459
|
+
* @returns ReplayResult with items, experimentId, and experimentUrl
|
|
3425
3460
|
*/
|
|
3426
3461
|
/**
|
|
3427
3462
|
* Register a mock override applied to every subsequent `replay` on this
|
|
@@ -3681,7 +3716,7 @@ interface CommitRef {
|
|
|
3681
3716
|
/**
|
|
3682
3717
|
* SDK version from package.json (injected at build time)
|
|
3683
3718
|
*/
|
|
3684
|
-
declare const __version__ = "0.
|
|
3719
|
+
declare const __version__ = "0.60.0";
|
|
3685
3720
|
|
|
3686
3721
|
/**
|
|
3687
3722
|
* Constants for the Bitfab SDK.
|
|
@@ -3750,7 +3785,7 @@ declare const finalizers: {
|
|
|
3750
3785
|
};
|
|
3751
3786
|
|
|
3752
3787
|
type ReplayFunction = (...args: any[]) => unknown | Promise<unknown>;
|
|
3753
|
-
type ReplayRegistryOptions = Omit<ReplayOptions, "onItemStart" | "onItemFinish" | "onProgress">;
|
|
3788
|
+
type ReplayRegistryOptions = Omit<ReplayOptions, "onItemStart" | "onItemFinish" | "onProgress" | "onExperimentStart">;
|
|
3754
3789
|
interface ReplayRegistryContext {
|
|
3755
3790
|
/** Values supplied through `--params` and repeated `--param name=value`. */
|
|
3756
3791
|
params: Readonly<Record<string, unknown>>;
|
|
@@ -3820,4 +3855,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
|
|
|
3820
3855
|
run?: boolean;
|
|
3821
3856
|
}): Promise<SeedResult>;
|
|
3822
3857
|
|
|
3823
|
-
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 AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionLabelEvidence, type AssertionVerdict, type Assignee, 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 GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, 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 OrganizationMember, OrganizationMembersClient, 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 };
|
|
3858
|
+
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 AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionLabelEvidence, type AssertionVerdict, type Assignee, 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 GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, 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 OrganizationMember, OrganizationMembersClient, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayExperiment, 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
|
@@ -35,8 +35,8 @@ import {
|
|
|
35
35
|
getCurrentTrace,
|
|
36
36
|
reseedFromRegistry,
|
|
37
37
|
seedFromRegistry
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-
|
|
38
|
+
} from "./chunk-RXKKTRSN.js";
|
|
39
|
+
import "./chunk-5DNB7EN7.js";
|
|
40
40
|
import {
|
|
41
41
|
BITFAB_PROGRESS_PREFIX,
|
|
42
42
|
DbBranchReplayError,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
ReplayError,
|
|
45
45
|
reportReplayProgress,
|
|
46
46
|
serializeReplayResult
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-7GIZS4E2.js";
|
|
48
48
|
import {
|
|
49
49
|
BitfabError,
|
|
50
50
|
DEFAULT_SERVICE_URL,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
MixedTracingError,
|
|
53
53
|
__version__,
|
|
54
54
|
flushTraces
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-HKQGI5WP.js";
|
|
56
56
|
import "./chunk-BAOIRE5T.js";
|
|
57
57
|
export {
|
|
58
58
|
AssertionCategoriesClient,
|