bitfab 0.64.19 → 0.64.20
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-7EV4YMRD.js → chunk-G2SZ2Q4B.js} +17 -3
- package/dist/{chunk-7EV4YMRD.js.map → chunk-G2SZ2Q4B.js.map} +1 -1
- package/dist/{chunk-3UO6K3AW.js → chunk-NEZUD2GD.js} +62 -22
- package/dist/chunk-NEZUD2GD.js.map +1 -0
- package/dist/{chunk-ESJWDNQ3.js → chunk-RZ3GXYXE.js} +2 -2
- package/dist/{chunk-2AF2YC5E.js → chunk-XA5E27HS.js} +4 -4
- package/dist/chunk-XA5E27HS.js.map +1 -0
- package/dist/{chunk-32HNQOMD.js → chunk-YZKNF5CY.js} +17 -3
- package/dist/{chunk-32HNQOMD.js.map → chunk-YZKNF5CY.js.map} +1 -1
- package/dist/{chunk-CPXWII7O.js → chunk-ZQHUYPMY.js} +2 -2
- package/dist/{http-4BFV25XH.js → http-C4QTUACG.js} +4 -2
- package/dist/{http-LYM24ZLM.js → http-MZHDPA7V.js} +4 -2
- package/dist/index.cjs +76 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +73 -14
- package/dist/index.d.ts +73 -14
- package/dist/index.js +5 -3
- package/dist/node.cjs +76 -19
- 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-HEOH4UWB.js → replay-DDS5DRTW.js} +3 -3
- package/dist/{replay-33HTIOR7.js → replay-G2ZJDPUZ.js} +3 -3
- package/dist/replayCli.js +3 -3
- package/dist/seedCli.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-2AF2YC5E.js.map +0 -1
- package/dist/chunk-3UO6K3AW.js.map +0 -1
- /package/dist/{chunk-ESJWDNQ3.js.map → chunk-RZ3GXYXE.js.map} +0 -0
- /package/dist/{chunk-CPXWII7O.js.map → chunk-ZQHUYPMY.js.map} +0 -0
- /package/dist/{http-4BFV25XH.js.map → http-C4QTUACG.js.map} +0 -0
- /package/dist/{http-LYM24ZLM.js.map → http-MZHDPA7V.js.map} +0 -0
- /package/dist/{replay-33HTIOR7.js.map → replay-DDS5DRTW.js.map} +0 -0
- /package/dist/{replay-HEOH4UWB.js.map → replay-G2ZJDPUZ.js.map} +0 -0
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
unrefTimer,
|
|
10
10
|
warnOnce,
|
|
11
11
|
writeOnce
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-G2SZ2Q4B.js";
|
|
13
13
|
|
|
14
14
|
// src/codeChange.ts
|
|
15
15
|
var MAX_FILES = 60;
|
|
@@ -1902,4 +1902,4 @@ export {
|
|
|
1902
1902
|
warnJudgeAssertionsDeprecated,
|
|
1903
1903
|
replay
|
|
1904
1904
|
};
|
|
1905
|
-
//# sourceMappingURL=chunk-
|
|
1905
|
+
//# sourceMappingURL=chunk-ZQHUYPMY.js.map
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BitfabError,
|
|
3
3
|
HttpClient,
|
|
4
|
+
SPAN_TYPES,
|
|
4
5
|
awaitOnExit,
|
|
5
6
|
awaitPendingRequests,
|
|
6
7
|
experimentIdWireFields,
|
|
7
8
|
flushTraces,
|
|
8
9
|
parseRetryAfterMs,
|
|
9
10
|
serializePayloadBody
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YZKNF5CY.js";
|
|
11
12
|
import "./chunk-MT36GJMW.js";
|
|
12
13
|
export {
|
|
13
14
|
BitfabError,
|
|
14
15
|
HttpClient,
|
|
16
|
+
SPAN_TYPES,
|
|
15
17
|
awaitOnExit,
|
|
16
18
|
awaitPendingRequests,
|
|
17
19
|
experimentIdWireFields,
|
|
@@ -19,4 +21,4 @@ export {
|
|
|
19
21
|
parseRetryAfterMs,
|
|
20
22
|
serializePayloadBody
|
|
21
23
|
};
|
|
22
|
-
//# sourceMappingURL=http-
|
|
24
|
+
//# sourceMappingURL=http-C4QTUACG.js.map
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BitfabError,
|
|
3
3
|
HttpClient,
|
|
4
|
+
SPAN_TYPES,
|
|
4
5
|
awaitOnExit,
|
|
5
6
|
awaitPendingRequests,
|
|
6
7
|
experimentIdWireFields,
|
|
7
8
|
flushTraces,
|
|
8
9
|
parseRetryAfterMs,
|
|
9
10
|
serializePayloadBody
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-G2SZ2Q4B.js";
|
|
11
12
|
export {
|
|
12
13
|
BitfabError,
|
|
13
14
|
HttpClient,
|
|
15
|
+
SPAN_TYPES,
|
|
14
16
|
awaitOnExit,
|
|
15
17
|
awaitPendingRequests,
|
|
16
18
|
experimentIdWireFields,
|
|
@@ -18,4 +20,4 @@ export {
|
|
|
18
20
|
parseRetryAfterMs,
|
|
19
21
|
serializePayloadBody
|
|
20
22
|
};
|
|
21
|
-
//# sourceMappingURL=http-
|
|
23
|
+
//# sourceMappingURL=http-MZHDPA7V.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -51,7 +51,7 @@ var __version__, __packageName__;
|
|
|
51
51
|
var init_version_generated = __esm({
|
|
52
52
|
"src/version.generated.ts"() {
|
|
53
53
|
"use strict";
|
|
54
|
-
__version__ = "0.64.
|
|
54
|
+
__version__ = "0.64.20";
|
|
55
55
|
__packageName__ = "bitfab";
|
|
56
56
|
}
|
|
57
57
|
});
|
|
@@ -2123,6 +2123,7 @@ var http_exports = {};
|
|
|
2123
2123
|
__export(http_exports, {
|
|
2124
2124
|
BitfabError: () => BitfabError,
|
|
2125
2125
|
HttpClient: () => HttpClient,
|
|
2126
|
+
SPAN_TYPES: () => SPAN_TYPES,
|
|
2126
2127
|
awaitOnExit: () => awaitOnExit,
|
|
2127
2128
|
awaitPendingRequests: () => awaitPendingRequests,
|
|
2128
2129
|
experimentIdWireFields: () => experimentIdWireFields,
|
|
@@ -2297,7 +2298,7 @@ function warnDroppedExternalTrace(error) {
|
|
|
2297
2298
|
function experimentIdWireFields(experimentId) {
|
|
2298
2299
|
return { experimentId, testRunId: experimentId };
|
|
2299
2300
|
}
|
|
2300
|
-
var REPLAY_DB_BRANCH_REQUEST_TIMEOUT_MS, REPLAY_COMPLETE_REQUEST_TIMEOUT_MS, REPLAY_INTERRUPT_REQUEST_TIMEOUT_MS, REPLAY_HEARTBEAT_REQUEST_TIMEOUT_MS, OTLP_TRACES_ENDPOINT, RETRYABLE_STATUSES, EXIT_FLUSH_TIMEOUT_MS, DEFAULT_LIFECYCLE_TIMEOUT_MS2, pendingTracePromises, liveHttpClients, carrierSeq, HttpClient;
|
|
2301
|
+
var REPLAY_DB_BRANCH_REQUEST_TIMEOUT_MS, REPLAY_COMPLETE_REQUEST_TIMEOUT_MS, REPLAY_INTERRUPT_REQUEST_TIMEOUT_MS, REPLAY_HEARTBEAT_REQUEST_TIMEOUT_MS, OTLP_TRACES_ENDPOINT, RETRYABLE_STATUSES, EXIT_FLUSH_TIMEOUT_MS, DEFAULT_LIFECYCLE_TIMEOUT_MS2, pendingTracePromises, liveHttpClients, SPAN_TYPES, carrierSeq, HttpClient;
|
|
2301
2302
|
var init_http = __esm({
|
|
2302
2303
|
"src/http.ts"() {
|
|
2303
2304
|
"use strict";
|
|
@@ -2355,6 +2356,14 @@ var init_http = __esm({
|
|
|
2355
2356
|
});
|
|
2356
2357
|
});
|
|
2357
2358
|
}
|
|
2359
|
+
SPAN_TYPES = [
|
|
2360
|
+
"llm",
|
|
2361
|
+
"agent",
|
|
2362
|
+
"function",
|
|
2363
|
+
"guardrail",
|
|
2364
|
+
"handoff",
|
|
2365
|
+
"custom"
|
|
2366
|
+
];
|
|
2358
2367
|
carrierSeq = 0;
|
|
2359
2368
|
HttpClient = class {
|
|
2360
2369
|
constructor(config) {
|
|
@@ -2739,7 +2748,12 @@ var init_http = __esm({
|
|
|
2739
2748
|
if (lookup.id !== void 0) {
|
|
2740
2749
|
searchParams.set("id", lookup.id);
|
|
2741
2750
|
} else {
|
|
2742
|
-
|
|
2751
|
+
if (lookup.name !== void 0) {
|
|
2752
|
+
searchParams.set("name", lookup.name);
|
|
2753
|
+
}
|
|
2754
|
+
if (lookup.type !== void 0) {
|
|
2755
|
+
searchParams.set("type", lookup.type);
|
|
2756
|
+
}
|
|
2743
2757
|
searchParams.set("occurrence", String(lookup.occurrence ?? "last"));
|
|
2744
2758
|
}
|
|
2745
2759
|
const endpoint = `/api/sdk/traces/${encodeURIComponent(traceId)}/span?${searchParams.toString()}`;
|
|
@@ -5366,6 +5380,7 @@ __export(index_exports, {
|
|
|
5366
5380
|
OrganizationMembersClient: () => OrganizationMembersClient,
|
|
5367
5381
|
ReplayError: () => ReplayError,
|
|
5368
5382
|
SUPPORTED_PROVIDERS: () => SUPPORTED_PROVIDERS,
|
|
5383
|
+
SpansClient: () => SpansClient,
|
|
5369
5384
|
TracesClient: () => TracesClient,
|
|
5370
5385
|
__version__: () => __version__,
|
|
5371
5386
|
defineReplayRegistry: () => defineReplayRegistry,
|
|
@@ -6518,6 +6533,20 @@ async function runFunctionWithBaml(bamlSource, inputs, providers, envVars) {
|
|
|
6518
6533
|
};
|
|
6519
6534
|
}
|
|
6520
6535
|
|
|
6536
|
+
// src/bitfabIds.ts
|
|
6537
|
+
init_errors();
|
|
6538
|
+
var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
6539
|
+
function validateTraceId(traceId) {
|
|
6540
|
+
if (typeof traceId !== "string" || !UUID_PATTERN.test(traceId)) {
|
|
6541
|
+
throw new BitfabError("traceId must be a valid Bitfab trace ID");
|
|
6542
|
+
}
|
|
6543
|
+
}
|
|
6544
|
+
function validateSpanId(id) {
|
|
6545
|
+
if (typeof id !== "string" || !UUID_PATTERN.test(id)) {
|
|
6546
|
+
throw new BitfabError("id must be a valid Bitfab span ID");
|
|
6547
|
+
}
|
|
6548
|
+
}
|
|
6549
|
+
|
|
6521
6550
|
// src/client.ts
|
|
6522
6551
|
init_captureSuppression();
|
|
6523
6552
|
|
|
@@ -8890,6 +8919,35 @@ function runWithSeedContext(ctx, fn) {
|
|
|
8890
8919
|
init_serialize();
|
|
8891
8920
|
init_simulationPlan();
|
|
8892
8921
|
init_spanOrigin();
|
|
8922
|
+
|
|
8923
|
+
// src/spans.ts
|
|
8924
|
+
var LIST_PATH = "/api/sdk/spans/list";
|
|
8925
|
+
function withoutUndefined(params) {
|
|
8926
|
+
return Object.fromEntries(
|
|
8927
|
+
Object.entries(params).filter(([, value]) => value !== void 0)
|
|
8928
|
+
);
|
|
8929
|
+
}
|
|
8930
|
+
var SpansClient = class {
|
|
8931
|
+
constructor(httpClient) {
|
|
8932
|
+
this.httpClient = httpClient;
|
|
8933
|
+
}
|
|
8934
|
+
/**
|
|
8935
|
+
* List one trace's spans in the order they ran, one page at a time. No
|
|
8936
|
+
* filter is required: omit `spanType` and `spanName` to page through every
|
|
8937
|
+
* span. Each span carries one extra key per requested `fields` entry. Pass
|
|
8938
|
+
* the returned `nextCursor` back as `cursor` for the next page. Throws a
|
|
8939
|
+
* `BitfabError` with status 404 when the trace is not in your organization.
|
|
8940
|
+
*/
|
|
8941
|
+
async list(traceId, params = {}) {
|
|
8942
|
+
validateTraceId(traceId);
|
|
8943
|
+
return this.httpClient.request(
|
|
8944
|
+
LIST_PATH,
|
|
8945
|
+
withoutUndefined({ traceId, ...params })
|
|
8946
|
+
);
|
|
8947
|
+
}
|
|
8948
|
+
};
|
|
8949
|
+
|
|
8950
|
+
// src/client.ts
|
|
8893
8951
|
init_traceMetadata();
|
|
8894
8952
|
|
|
8895
8953
|
// src/traces.ts
|
|
@@ -9770,16 +9828,8 @@ function extractContextFromCollector(collector) {
|
|
|
9770
9828
|
return null;
|
|
9771
9829
|
}
|
|
9772
9830
|
}
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
if (typeof traceId !== "string" || !UUID_PATTERN.test(traceId)) {
|
|
9776
|
-
throw new BitfabError("traceId must be a valid Bitfab trace ID");
|
|
9777
|
-
}
|
|
9778
|
-
}
|
|
9779
|
-
function validateSpanId(id) {
|
|
9780
|
-
if (typeof id !== "string" || !UUID_PATTERN.test(id)) {
|
|
9781
|
-
throw new BitfabError("id must be a valid Bitfab span ID");
|
|
9782
|
-
}
|
|
9831
|
+
function isSpanType(value) {
|
|
9832
|
+
return SPAN_TYPES.some((spanType) => spanType === value);
|
|
9783
9833
|
}
|
|
9784
9834
|
var noOpSpan = {
|
|
9785
9835
|
id: "",
|
|
@@ -10013,6 +10063,7 @@ var Bitfab = class {
|
|
|
10013
10063
|
this.assertionCategories = new AssertionCategoriesClient(this.httpClient);
|
|
10014
10064
|
this.organizationMembers = new OrganizationMembersClient(this.httpClient);
|
|
10015
10065
|
this.traces = new TracesClient(this.httpClient);
|
|
10066
|
+
this.spans = new SpansClient(this.httpClient);
|
|
10016
10067
|
this.labels = new LabelsClient(this.httpClient);
|
|
10017
10068
|
this.graders = new GradersClient(this.httpClient);
|
|
10018
10069
|
this.experiments = new ExperimentsClient(this.httpClient);
|
|
@@ -11491,22 +11542,27 @@ var Bitfab = class {
|
|
|
11491
11542
|
}
|
|
11492
11543
|
/**
|
|
11493
11544
|
* Fetch one persisted span from a trace without loading the full trace.
|
|
11494
|
-
*
|
|
11495
|
-
*
|
|
11545
|
+
* Look up by `id` alone, or by `name` and/or `type` (both must match when
|
|
11546
|
+
* both are given). Name and type lookups return the last matching span by
|
|
11547
|
+
* default. Pass `occurrence` as `"first"` or a zero-based index to select a
|
|
11548
|
+
* different match. Returns `null` when no span matches.
|
|
11496
11549
|
*/
|
|
11497
11550
|
async getTraceSpan(traceId, lookup) {
|
|
11498
11551
|
validateTraceId(traceId);
|
|
11499
11552
|
const hasId = lookup.id !== void 0;
|
|
11500
|
-
const
|
|
11501
|
-
if (hasId ===
|
|
11502
|
-
throw new BitfabError("Provide
|
|
11553
|
+
const hasNameOrType = lookup.name !== void 0 || lookup.type !== void 0;
|
|
11554
|
+
if (hasId === hasNameOrType) {
|
|
11555
|
+
throw new BitfabError("Provide id, or name and/or type");
|
|
11503
11556
|
}
|
|
11504
11557
|
if (hasId) {
|
|
11505
11558
|
validateSpanId(lookup.id);
|
|
11506
11559
|
} else {
|
|
11507
|
-
if (lookup.name.length === 0) {
|
|
11560
|
+
if (lookup.name !== void 0 && lookup.name.length === 0) {
|
|
11508
11561
|
throw new BitfabError("name must be a non-empty string");
|
|
11509
11562
|
}
|
|
11563
|
+
if (lookup.type !== void 0 && !isSpanType(lookup.type)) {
|
|
11564
|
+
throw new BitfabError(`type must be one of ${SPAN_TYPES.join(", ")}`);
|
|
11565
|
+
}
|
|
11510
11566
|
const occurrence = lookup.occurrence ?? "last";
|
|
11511
11567
|
if (occurrence !== "first" && occurrence !== "last" && (!Number.isInteger(occurrence) || occurrence < 0)) {
|
|
11512
11568
|
throw new BitfabError(
|
|
@@ -12337,6 +12393,7 @@ function resolveTraceFunctionKey(registration) {
|
|
|
12337
12393
|
OrganizationMembersClient,
|
|
12338
12394
|
ReplayError,
|
|
12339
12395
|
SUPPORTED_PROVIDERS,
|
|
12396
|
+
SpansClient,
|
|
12340
12397
|
TracesClient,
|
|
12341
12398
|
__version__,
|
|
12342
12399
|
defineReplayRegistry,
|