bitfab 0.47.0 → 0.50.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/{chunk-VBKLWDPP.js → chunk-NHT7BLPJ.js} +62 -6
- package/dist/chunk-NHT7BLPJ.js.map +1 -0
- package/dist/{chunk-4SGG6G4O.js → chunk-SXHG2H6U.js} +4 -3
- package/dist/chunk-SXHG2H6U.js.map +1 -0
- package/dist/{chunk-DGVHJW43.js → chunk-VC3CVN2P.js} +6 -3
- package/dist/{chunk-DGVHJW43.js.map → chunk-VC3CVN2P.js.map} +1 -1
- package/dist/{chunk-2TVORTY7.js → chunk-WKSZSBRQ.js} +6 -3
- package/dist/{chunk-2TVORTY7.js.map → chunk-WKSZSBRQ.js.map} +1 -1
- package/dist/{http-AMWUT3JO.js → http-UI4FW2QI.js} +2 -2
- package/dist/{http-4VKISP7F.js → http-W7XZFZN3.js} +2 -2
- package/dist/index.cjs +67 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +79 -3
- package/dist/index.d.ts +79 -3
- package/dist/index.js +5 -3
- package/dist/node.cjs +67 -3
- 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-AGVP5TEA.js → replay-G3E5VTPT.js} +3 -3
- package/dist/replayCli.js +8 -2
- package/dist/replayCli.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-4SGG6G4O.js.map +0 -1
- package/dist/chunk-VBKLWDPP.js.map +0 -1
- /package/dist/{http-4VKISP7F.js.map → http-UI4FW2QI.js.map} +0 -0
- /package/dist/{http-AMWUT3JO.js.map → http-W7XZFZN3.js.map} +0 -0
- /package/dist/{replay-AGVP5TEA.js.map → replay-G3E5VTPT.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -556,7 +556,7 @@ declare class HttpClient {
|
|
|
556
556
|
* Start a replay session by fetching historical traces.
|
|
557
557
|
* Blocking call - creates a test run and returns lightweight item references.
|
|
558
558
|
*/
|
|
559
|
-
startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetId?: string, graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean): Promise<StartReplayResponse>;
|
|
559
|
+
startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetId?: string, graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean): Promise<StartReplayResponse>;
|
|
560
560
|
/**
|
|
561
561
|
* Fetch an external span by ID.
|
|
562
562
|
* Blocking GET request.
|
|
@@ -1259,6 +1259,8 @@ declare class DatasetsClient {
|
|
|
1259
1259
|
|
|
1260
1260
|
type LabelConfidence = "VeryLow" | "Low" | "Medium" | "High" | "VeryHigh";
|
|
1261
1261
|
type LabelAction = "set" | "archived" | "no-active-label" | "skipped";
|
|
1262
|
+
type LabelStatus = "labeled" | "skipped" | "unlabeled";
|
|
1263
|
+
type LabelSource = "human" | "agent";
|
|
1262
1264
|
type LabelTarget = ({
|
|
1263
1265
|
traceId: string;
|
|
1264
1266
|
originalTraceId?: never;
|
|
@@ -1285,11 +1287,72 @@ type LabelOutcome = {
|
|
|
1285
1287
|
traceId: string;
|
|
1286
1288
|
action: LabelAction;
|
|
1287
1289
|
};
|
|
1290
|
+
type HumanLabelUpdate = {
|
|
1291
|
+
traceId: string;
|
|
1292
|
+
assertionId?: string;
|
|
1293
|
+
label: boolean;
|
|
1294
|
+
annotation: string;
|
|
1295
|
+
confidence?: LabelConfidence;
|
|
1296
|
+
};
|
|
1297
|
+
type HumanLabelOutcome = {
|
|
1298
|
+
traceId: string;
|
|
1299
|
+
assertionId: string | null;
|
|
1300
|
+
label: boolean;
|
|
1301
|
+
action: "set";
|
|
1302
|
+
};
|
|
1303
|
+
type AssertionVerdict = {
|
|
1304
|
+
assertionId: string;
|
|
1305
|
+
assertion: string | null;
|
|
1306
|
+
labelStatus: LabelStatus;
|
|
1307
|
+
label: boolean | null;
|
|
1308
|
+
annotation: string | null;
|
|
1309
|
+
confidence: LabelConfidence | null;
|
|
1310
|
+
labelSource: LabelSource;
|
|
1311
|
+
approved: boolean;
|
|
1312
|
+
};
|
|
1313
|
+
type TraceLabels = {
|
|
1314
|
+
traceId: string;
|
|
1315
|
+
labelStatus: LabelStatus;
|
|
1316
|
+
label: boolean | null;
|
|
1317
|
+
annotation: string | null;
|
|
1318
|
+
approved: boolean;
|
|
1319
|
+
passed: number;
|
|
1320
|
+
failed: number;
|
|
1321
|
+
assertions: AssertionVerdict[];
|
|
1322
|
+
};
|
|
1288
1323
|
declare class LabelsClient {
|
|
1289
1324
|
private readonly httpClient;
|
|
1290
1325
|
constructor(httpClient: HttpClient);
|
|
1291
1326
|
save(update: LabelUpdate, testRunId?: string): Promise<LabelOutcome>;
|
|
1292
1327
|
saveAll(updates: LabelUpdate[], testRunId?: string): Promise<LabelOutcome[]>;
|
|
1328
|
+
saveHuman(update: HumanLabelUpdate): Promise<HumanLabelOutcome>;
|
|
1329
|
+
saveHumanAll(updates: HumanLabelUpdate[]): Promise<HumanLabelOutcome[]>;
|
|
1330
|
+
get(traceId: string): Promise<TraceLabels | null>;
|
|
1331
|
+
getAll(traceIds: string[]): Promise<TraceLabels[]>;
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
type GraderLabelSource = "human" | "live_grader";
|
|
1335
|
+
type GraderLabel = {
|
|
1336
|
+
traceId: string;
|
|
1337
|
+
graderId: string;
|
|
1338
|
+
graderName: string | null;
|
|
1339
|
+
graderStatus: string;
|
|
1340
|
+
label: boolean | null;
|
|
1341
|
+
labelReason: string | null;
|
|
1342
|
+
failureDiagnostic: string | null;
|
|
1343
|
+
labelConfidence: LabelConfidence | null;
|
|
1344
|
+
source: GraderLabelSource;
|
|
1345
|
+
evaluatedAt: string | null;
|
|
1346
|
+
};
|
|
1347
|
+
type GetGraderLabelsParams = {
|
|
1348
|
+
traceIds?: string[];
|
|
1349
|
+
graderId?: string;
|
|
1350
|
+
limit?: number;
|
|
1351
|
+
};
|
|
1352
|
+
declare class GradersClient {
|
|
1353
|
+
private readonly httpClient;
|
|
1354
|
+
constructor(httpClient: HttpClient);
|
|
1355
|
+
getLabels(params: GetGraderLabelsParams): Promise<GraderLabel[]>;
|
|
1293
1356
|
}
|
|
1294
1357
|
|
|
1295
1358
|
/**
|
|
@@ -1660,6 +1723,18 @@ interface ReplayOptions {
|
|
|
1660
1723
|
* organization and trace function, otherwise the server rejects the replay.
|
|
1661
1724
|
*/
|
|
1662
1725
|
graderIds?: string[];
|
|
1726
|
+
/**
|
|
1727
|
+
* Replay only the selected traces that carry at least one assertion.
|
|
1728
|
+
*
|
|
1729
|
+
* Narrows whatever `limit`, `traceIds` or `datasetId` selected, so a run that
|
|
1730
|
+
* measures assertion outcomes does not pay to re-execute traces nothing can
|
|
1731
|
+
* grade. The server applies it as part of selection, which is what makes it
|
|
1732
|
+
* compose with `limit`: `{ limit: 10, onlyWithAssertions: true }` is the ten
|
|
1733
|
+
* most recent traces that HAVE assertions, not the ten most recent filtered
|
|
1734
|
+
* down to however few do. An archived assertion does not count, and a
|
|
1735
|
+
* selection that narrows to nothing replays nothing.
|
|
1736
|
+
*/
|
|
1737
|
+
onlyWithAssertions?: boolean;
|
|
1663
1738
|
/**
|
|
1664
1739
|
* Reshape recorded inputs before they are spread into `fn`.
|
|
1665
1740
|
*
|
|
@@ -2554,6 +2629,7 @@ declare class Bitfab {
|
|
|
2554
2629
|
readonly datasets: DatasetsClient;
|
|
2555
2630
|
readonly traces: TracesClient;
|
|
2556
2631
|
readonly labels: LabelsClient;
|
|
2632
|
+
readonly graders: GradersClient;
|
|
2557
2633
|
private readonly bamlClient;
|
|
2558
2634
|
private readonly dbSnapshot;
|
|
2559
2635
|
private readonly autoTracePolicyRefreshes;
|
|
@@ -3199,7 +3275,7 @@ declare class BitfabFunction {
|
|
|
3199
3275
|
/**
|
|
3200
3276
|
* SDK version from package.json (injected at build time)
|
|
3201
3277
|
*/
|
|
3202
|
-
declare const __version__ = "0.
|
|
3278
|
+
declare const __version__ = "0.50.0";
|
|
3203
3279
|
|
|
3204
3280
|
/**
|
|
3205
3281
|
* Constants for the Bitfab SDK.
|
|
@@ -3329,4 +3405,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
|
|
|
3329
3405
|
run?: boolean;
|
|
3330
3406
|
}): Promise<SeedResult>;
|
|
3331
3407
|
|
|
3332
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, 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 GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, HttpClient, type LabelAction, type LabelConfidence, type LabelOutcome, 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 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 TraceIngestionType, 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 };
|
|
3408
|
+
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 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 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -556,7 +556,7 @@ declare class HttpClient {
|
|
|
556
556
|
* Start a replay session by fetching historical traces.
|
|
557
557
|
* Blocking call - creates a test run and returns lightweight item references.
|
|
558
558
|
*/
|
|
559
|
-
startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetId?: string, graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean): Promise<StartReplayResponse>;
|
|
559
|
+
startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetId?: string, graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean): Promise<StartReplayResponse>;
|
|
560
560
|
/**
|
|
561
561
|
* Fetch an external span by ID.
|
|
562
562
|
* Blocking GET request.
|
|
@@ -1259,6 +1259,8 @@ declare class DatasetsClient {
|
|
|
1259
1259
|
|
|
1260
1260
|
type LabelConfidence = "VeryLow" | "Low" | "Medium" | "High" | "VeryHigh";
|
|
1261
1261
|
type LabelAction = "set" | "archived" | "no-active-label" | "skipped";
|
|
1262
|
+
type LabelStatus = "labeled" | "skipped" | "unlabeled";
|
|
1263
|
+
type LabelSource = "human" | "agent";
|
|
1262
1264
|
type LabelTarget = ({
|
|
1263
1265
|
traceId: string;
|
|
1264
1266
|
originalTraceId?: never;
|
|
@@ -1285,11 +1287,72 @@ type LabelOutcome = {
|
|
|
1285
1287
|
traceId: string;
|
|
1286
1288
|
action: LabelAction;
|
|
1287
1289
|
};
|
|
1290
|
+
type HumanLabelUpdate = {
|
|
1291
|
+
traceId: string;
|
|
1292
|
+
assertionId?: string;
|
|
1293
|
+
label: boolean;
|
|
1294
|
+
annotation: string;
|
|
1295
|
+
confidence?: LabelConfidence;
|
|
1296
|
+
};
|
|
1297
|
+
type HumanLabelOutcome = {
|
|
1298
|
+
traceId: string;
|
|
1299
|
+
assertionId: string | null;
|
|
1300
|
+
label: boolean;
|
|
1301
|
+
action: "set";
|
|
1302
|
+
};
|
|
1303
|
+
type AssertionVerdict = {
|
|
1304
|
+
assertionId: string;
|
|
1305
|
+
assertion: string | null;
|
|
1306
|
+
labelStatus: LabelStatus;
|
|
1307
|
+
label: boolean | null;
|
|
1308
|
+
annotation: string | null;
|
|
1309
|
+
confidence: LabelConfidence | null;
|
|
1310
|
+
labelSource: LabelSource;
|
|
1311
|
+
approved: boolean;
|
|
1312
|
+
};
|
|
1313
|
+
type TraceLabels = {
|
|
1314
|
+
traceId: string;
|
|
1315
|
+
labelStatus: LabelStatus;
|
|
1316
|
+
label: boolean | null;
|
|
1317
|
+
annotation: string | null;
|
|
1318
|
+
approved: boolean;
|
|
1319
|
+
passed: number;
|
|
1320
|
+
failed: number;
|
|
1321
|
+
assertions: AssertionVerdict[];
|
|
1322
|
+
};
|
|
1288
1323
|
declare class LabelsClient {
|
|
1289
1324
|
private readonly httpClient;
|
|
1290
1325
|
constructor(httpClient: HttpClient);
|
|
1291
1326
|
save(update: LabelUpdate, testRunId?: string): Promise<LabelOutcome>;
|
|
1292
1327
|
saveAll(updates: LabelUpdate[], testRunId?: string): Promise<LabelOutcome[]>;
|
|
1328
|
+
saveHuman(update: HumanLabelUpdate): Promise<HumanLabelOutcome>;
|
|
1329
|
+
saveHumanAll(updates: HumanLabelUpdate[]): Promise<HumanLabelOutcome[]>;
|
|
1330
|
+
get(traceId: string): Promise<TraceLabels | null>;
|
|
1331
|
+
getAll(traceIds: string[]): Promise<TraceLabels[]>;
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
type GraderLabelSource = "human" | "live_grader";
|
|
1335
|
+
type GraderLabel = {
|
|
1336
|
+
traceId: string;
|
|
1337
|
+
graderId: string;
|
|
1338
|
+
graderName: string | null;
|
|
1339
|
+
graderStatus: string;
|
|
1340
|
+
label: boolean | null;
|
|
1341
|
+
labelReason: string | null;
|
|
1342
|
+
failureDiagnostic: string | null;
|
|
1343
|
+
labelConfidence: LabelConfidence | null;
|
|
1344
|
+
source: GraderLabelSource;
|
|
1345
|
+
evaluatedAt: string | null;
|
|
1346
|
+
};
|
|
1347
|
+
type GetGraderLabelsParams = {
|
|
1348
|
+
traceIds?: string[];
|
|
1349
|
+
graderId?: string;
|
|
1350
|
+
limit?: number;
|
|
1351
|
+
};
|
|
1352
|
+
declare class GradersClient {
|
|
1353
|
+
private readonly httpClient;
|
|
1354
|
+
constructor(httpClient: HttpClient);
|
|
1355
|
+
getLabels(params: GetGraderLabelsParams): Promise<GraderLabel[]>;
|
|
1293
1356
|
}
|
|
1294
1357
|
|
|
1295
1358
|
/**
|
|
@@ -1660,6 +1723,18 @@ interface ReplayOptions {
|
|
|
1660
1723
|
* organization and trace function, otherwise the server rejects the replay.
|
|
1661
1724
|
*/
|
|
1662
1725
|
graderIds?: string[];
|
|
1726
|
+
/**
|
|
1727
|
+
* Replay only the selected traces that carry at least one assertion.
|
|
1728
|
+
*
|
|
1729
|
+
* Narrows whatever `limit`, `traceIds` or `datasetId` selected, so a run that
|
|
1730
|
+
* measures assertion outcomes does not pay to re-execute traces nothing can
|
|
1731
|
+
* grade. The server applies it as part of selection, which is what makes it
|
|
1732
|
+
* compose with `limit`: `{ limit: 10, onlyWithAssertions: true }` is the ten
|
|
1733
|
+
* most recent traces that HAVE assertions, not the ten most recent filtered
|
|
1734
|
+
* down to however few do. An archived assertion does not count, and a
|
|
1735
|
+
* selection that narrows to nothing replays nothing.
|
|
1736
|
+
*/
|
|
1737
|
+
onlyWithAssertions?: boolean;
|
|
1663
1738
|
/**
|
|
1664
1739
|
* Reshape recorded inputs before they are spread into `fn`.
|
|
1665
1740
|
*
|
|
@@ -2554,6 +2629,7 @@ declare class Bitfab {
|
|
|
2554
2629
|
readonly datasets: DatasetsClient;
|
|
2555
2630
|
readonly traces: TracesClient;
|
|
2556
2631
|
readonly labels: LabelsClient;
|
|
2632
|
+
readonly graders: GradersClient;
|
|
2557
2633
|
private readonly bamlClient;
|
|
2558
2634
|
private readonly dbSnapshot;
|
|
2559
2635
|
private readonly autoTracePolicyRefreshes;
|
|
@@ -3199,7 +3275,7 @@ declare class BitfabFunction {
|
|
|
3199
3275
|
/**
|
|
3200
3276
|
* SDK version from package.json (injected at build time)
|
|
3201
3277
|
*/
|
|
3202
|
-
declare const __version__ = "0.
|
|
3278
|
+
declare const __version__ = "0.50.0";
|
|
3203
3279
|
|
|
3204
3280
|
/**
|
|
3205
3281
|
* Constants for the Bitfab SDK.
|
|
@@ -3329,4 +3405,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
|
|
|
3329
3405
|
run?: boolean;
|
|
3330
3406
|
}): Promise<SeedResult>;
|
|
3331
3407
|
|
|
3332
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, 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 GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, HttpClient, type LabelAction, type LabelConfidence, type LabelOutcome, 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 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 TraceIngestionType, 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 };
|
|
3408
|
+
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 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 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 };
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
BitfabOpenAITracingProcessor,
|
|
18
18
|
BitfabVercelAiHandler,
|
|
19
19
|
DatasetsClient,
|
|
20
|
+
GradersClient,
|
|
20
21
|
LabelsClient,
|
|
21
22
|
SUPPORTED_PROVIDERS,
|
|
22
23
|
TracesClient,
|
|
@@ -26,7 +27,7 @@ import {
|
|
|
26
27
|
getCurrentSpan,
|
|
27
28
|
getCurrentTrace,
|
|
28
29
|
seedFromRegistry
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-NHT7BLPJ.js";
|
|
30
31
|
import "./chunk-ZUD7OFYB.js";
|
|
31
32
|
import {
|
|
32
33
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -35,7 +36,7 @@ import {
|
|
|
35
36
|
ReplayError,
|
|
36
37
|
reportReplayProgress,
|
|
37
38
|
serializeReplayResult
|
|
38
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-SXHG2H6U.js";
|
|
39
40
|
import {
|
|
40
41
|
BitfabError,
|
|
41
42
|
DEFAULT_SERVICE_URL,
|
|
@@ -43,7 +44,7 @@ import {
|
|
|
43
44
|
MixedTracingError,
|
|
44
45
|
__version__,
|
|
45
46
|
flushTraces
|
|
46
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-WKSZSBRQ.js";
|
|
47
48
|
import "./chunk-H6LZRFMN.js";
|
|
48
49
|
export {
|
|
49
50
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -60,6 +61,7 @@ export {
|
|
|
60
61
|
DEFAULT_SERVICE_URL,
|
|
61
62
|
DatasetsClient,
|
|
62
63
|
DbBranchReplayError,
|
|
64
|
+
GradersClient,
|
|
63
65
|
HttpClient,
|
|
64
66
|
LabelsClient,
|
|
65
67
|
MixedTracingError,
|
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.
|
|
100
|
+
__version__ = "0.50.0";
|
|
101
101
|
__packageName__ = "bitfab";
|
|
102
102
|
}
|
|
103
103
|
});
|
|
@@ -1863,7 +1863,7 @@ var init_http = __esm({
|
|
|
1863
1863
|
* Start a replay session by fetching historical traces.
|
|
1864
1864
|
* Blocking call - creates a test run and returns lightweight item references.
|
|
1865
1865
|
*/
|
|
1866
|
-
async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetId, graderIds, dbBranchSettings, attempts, includeOriginalMetadata) {
|
|
1866
|
+
async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetId, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions) {
|
|
1867
1867
|
const payload = { traceFunctionKey };
|
|
1868
1868
|
if (limit !== void 0) {
|
|
1869
1869
|
payload.limit = limit;
|
|
@@ -1902,6 +1902,9 @@ var init_http = __esm({
|
|
|
1902
1902
|
if (includeOriginalMetadata) {
|
|
1903
1903
|
payload.includeOriginalMetadata = true;
|
|
1904
1904
|
}
|
|
1905
|
+
if (onlyWithAssertions) {
|
|
1906
|
+
payload.onlyWithAssertions = true;
|
|
1907
|
+
}
|
|
1905
1908
|
const timeout = includeDbBranchLease ? REPLAY_DB_BRANCH_REQUEST_TIMEOUT_MS : 3e4;
|
|
1906
1909
|
return this.request("/api/sdk/replay/start", payload, {
|
|
1907
1910
|
timeout
|
|
@@ -2967,7 +2970,8 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
2967
2970
|
options?.graderIds,
|
|
2968
2971
|
resolveDbBranchSettings(options?.dbBranch),
|
|
2969
2972
|
attempts,
|
|
2970
|
-
options?.adaptInputs !== void 0
|
|
2973
|
+
options?.adaptInputs !== void 0,
|
|
2974
|
+
options?.onlyWithAssertions
|
|
2971
2975
|
);
|
|
2972
2976
|
if (serverItems.length === 0) {
|
|
2973
2977
|
try {
|
|
@@ -3284,6 +3288,7 @@ __export(node_exports, {
|
|
|
3284
3288
|
DEFAULT_SERVICE_URL: () => DEFAULT_SERVICE_URL,
|
|
3285
3289
|
DatasetsClient: () => DatasetsClient,
|
|
3286
3290
|
DbBranchReplayError: () => DbBranchReplayError,
|
|
3291
|
+
GradersClient: () => GradersClient,
|
|
3287
3292
|
HttpClient: () => HttpClient,
|
|
3288
3293
|
LabelsClient: () => LabelsClient,
|
|
3289
3294
|
MixedTracingError: () => MixedTracingError,
|
|
@@ -4586,10 +4591,45 @@ function buildSnapshotRef(config, sdkWallClockBeforeFn) {
|
|
|
4586
4591
|
|
|
4587
4592
|
// src/client.ts
|
|
4588
4593
|
init_errors();
|
|
4594
|
+
|
|
4595
|
+
// src/graders.ts
|
|
4596
|
+
init_errors();
|
|
4597
|
+
var GRADER_LABELS_PATH = "/api/sdk/graderLabels";
|
|
4598
|
+
var GradersClient = class {
|
|
4599
|
+
constructor(httpClient) {
|
|
4600
|
+
this.httpClient = httpClient;
|
|
4601
|
+
}
|
|
4602
|
+
async getLabels(params) {
|
|
4603
|
+
const hasTraceIds = params.traceIds !== void 0 && params.traceIds.length > 0;
|
|
4604
|
+
const hasGraderId = params.graderId !== void 0;
|
|
4605
|
+
if (!hasTraceIds && !hasGraderId) {
|
|
4606
|
+
throw new BitfabError(
|
|
4607
|
+
"Pass traceIds, graderId, or both: there is nothing to read otherwise."
|
|
4608
|
+
);
|
|
4609
|
+
}
|
|
4610
|
+
const query = new URLSearchParams();
|
|
4611
|
+
if (params.traceIds !== void 0 && params.traceIds.length > 0) {
|
|
4612
|
+
query.set("traceIds", params.traceIds.join(","));
|
|
4613
|
+
}
|
|
4614
|
+
if (params.graderId !== void 0) {
|
|
4615
|
+
query.set("graderId", params.graderId);
|
|
4616
|
+
}
|
|
4617
|
+
if (params.limit !== void 0) {
|
|
4618
|
+
query.set("limit", String(params.limit));
|
|
4619
|
+
}
|
|
4620
|
+
const response = await this.httpClient.get(
|
|
4621
|
+
`${GRADER_LABELS_PATH}?${query.toString()}`
|
|
4622
|
+
);
|
|
4623
|
+
return response.labels;
|
|
4624
|
+
}
|
|
4625
|
+
};
|
|
4626
|
+
|
|
4627
|
+
// src/client.ts
|
|
4589
4628
|
init_http();
|
|
4590
4629
|
|
|
4591
4630
|
// src/labels.ts
|
|
4592
4631
|
var LABELS_PATH = "/api/sdk/traces/labels";
|
|
4632
|
+
var HUMAN_LABELS_PATH = "/api/sdk/traces/labels/human";
|
|
4593
4633
|
var LabelsClient = class {
|
|
4594
4634
|
constructor(httpClient) {
|
|
4595
4635
|
this.httpClient = httpClient;
|
|
@@ -4608,6 +4648,28 @@ var LabelsClient = class {
|
|
|
4608
4648
|
);
|
|
4609
4649
|
return response.labels;
|
|
4610
4650
|
}
|
|
4651
|
+
async saveHuman(update) {
|
|
4652
|
+
const [outcome] = await this.saveHumanAll([update]);
|
|
4653
|
+
return outcome;
|
|
4654
|
+
}
|
|
4655
|
+
async saveHumanAll(updates) {
|
|
4656
|
+
const response = await this.httpClient.request(HUMAN_LABELS_PATH, { labels: updates });
|
|
4657
|
+
return response.labels;
|
|
4658
|
+
}
|
|
4659
|
+
async get(traceId) {
|
|
4660
|
+
const [labels] = await this.getAll([traceId]);
|
|
4661
|
+
return labels ?? null;
|
|
4662
|
+
}
|
|
4663
|
+
async getAll(traceIds) {
|
|
4664
|
+
if (traceIds.length === 0) {
|
|
4665
|
+
return [];
|
|
4666
|
+
}
|
|
4667
|
+
const query = new URLSearchParams({ traceIds: traceIds.join(",") });
|
|
4668
|
+
const response = await this.httpClient.get(
|
|
4669
|
+
`${LABELS_PATH}?${query.toString()}`
|
|
4670
|
+
);
|
|
4671
|
+
return response.labels;
|
|
4672
|
+
}
|
|
4611
4673
|
};
|
|
4612
4674
|
|
|
4613
4675
|
// src/langgraph.ts
|
|
@@ -6385,6 +6447,7 @@ var Bitfab = class {
|
|
|
6385
6447
|
this.datasets = new DatasetsClient(this.httpClient);
|
|
6386
6448
|
this.traces = new TracesClient(this.httpClient);
|
|
6387
6449
|
this.labels = new LabelsClient(this.httpClient);
|
|
6450
|
+
this.graders = new GradersClient(this.httpClient);
|
|
6388
6451
|
}
|
|
6389
6452
|
/**
|
|
6390
6453
|
* Decorate a class method as an automatically expanded trace root.
|
|
@@ -8289,6 +8352,7 @@ assertAsyncStorageRegistered();
|
|
|
8289
8352
|
DEFAULT_SERVICE_URL,
|
|
8290
8353
|
DatasetsClient,
|
|
8291
8354
|
DbBranchReplayError,
|
|
8355
|
+
GradersClient,
|
|
8292
8356
|
HttpClient,
|
|
8293
8357
|
LabelsClient,
|
|
8294
8358
|
MixedTracingError,
|