@bitfab/sdk 0.53.4 → 0.54.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-KTBWJLIN.js → chunk-EPWQ43SC.js} +2 -2
- package/dist/{chunk-KTBWJLIN.js.map → chunk-EPWQ43SC.js.map} +1 -1
- package/dist/{chunk-4GMZN76Y.js → chunk-IDUFXDV6.js} +3 -3
- package/dist/{chunk-BZML7OQD.js → chunk-MZ42HQ7N.js} +2 -2
- package/dist/{chunk-WQOA3SFF.js → chunk-SOYIEIGU.js} +65 -16
- package/dist/chunk-SOYIEIGU.js.map +1 -0
- package/dist/{chunk-OWZF23WR.js → chunk-X2FL37KB.js} +2 -2
- package/dist/{chunk-OWZF23WR.js.map → chunk-X2FL37KB.js.map} +1 -1
- package/dist/{http-HSCOLYYK.js → http-EQ4PDMDO.js} +2 -2
- package/dist/{http-6NM3JD5W.js → http-WTRCGTCE.js} +2 -2
- package/dist/index.cjs +61 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -6
- package/dist/index.d.ts +40 -6
- package/dist/index.js +5 -3
- package/dist/node.cjs +61 -11
- 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-V3AN37XH.js → replay-5ZF55JZX.js} +3 -3
- package/dist/replayCli.js +2 -2
- package/dist/seedCli.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-WQOA3SFF.js.map +0 -1
- /package/dist/{chunk-4GMZN76Y.js.map → chunk-IDUFXDV6.js.map} +0 -0
- /package/dist/{chunk-BZML7OQD.js.map → chunk-MZ42HQ7N.js.map} +0 -0
- /package/dist/{http-6NM3JD5W.js.map → http-EQ4PDMDO.js.map} +0 -0
- /package/dist/{http-HSCOLYYK.js.map → http-WTRCGTCE.js.map} +0 -0
- /package/dist/{replay-V3AN37XH.js.map → replay-5ZF55JZX.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
flushTraces,
|
|
7
7
|
parseRetryAfterMs,
|
|
8
8
|
serializePayloadBody
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-X2FL37KB.js";
|
|
10
10
|
export {
|
|
11
11
|
BitfabError,
|
|
12
12
|
HttpClient,
|
|
@@ -16,4 +16,4 @@ export {
|
|
|
16
16
|
parseRetryAfterMs,
|
|
17
17
|
serializePayloadBody
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=http-
|
|
19
|
+
//# sourceMappingURL=http-EQ4PDMDO.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
flushTraces,
|
|
7
7
|
parseRetryAfterMs,
|
|
8
8
|
serializePayloadBody
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EPWQ43SC.js";
|
|
10
10
|
import "./chunk-VCRFFCLY.js";
|
|
11
11
|
export {
|
|
12
12
|
BitfabError,
|
|
@@ -17,4 +17,4 @@ export {
|
|
|
17
17
|
parseRetryAfterMs,
|
|
18
18
|
serializePayloadBody
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=http-
|
|
20
|
+
//# sourceMappingURL=http-WTRCGTCE.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -42,7 +42,7 @@ var __version__, __packageName__;
|
|
|
42
42
|
var init_version_generated = __esm({
|
|
43
43
|
"src/version.generated.ts"() {
|
|
44
44
|
"use strict";
|
|
45
|
-
__version__ = "0.
|
|
45
|
+
__version__ = "0.54.0";
|
|
46
46
|
__packageName__ = "@bitfab/sdk";
|
|
47
47
|
}
|
|
48
48
|
});
|
|
@@ -4062,6 +4062,7 @@ var init_replay = __esm({
|
|
|
4062
4062
|
// src/index.ts
|
|
4063
4063
|
var index_exports = {};
|
|
4064
4064
|
__export(index_exports, {
|
|
4065
|
+
AssertionCategoriesClient: () => AssertionCategoriesClient,
|
|
4065
4066
|
BITFAB_PROGRESS_PREFIX: () => BITFAB_PROGRESS_PREFIX,
|
|
4066
4067
|
Bitfab: () => Bitfab,
|
|
4067
4068
|
BitfabClaudeAgentHandler: () => BitfabClaudeAgentHandler,
|
|
@@ -4098,6 +4099,36 @@ __export(index_exports, {
|
|
|
4098
4099
|
});
|
|
4099
4100
|
module.exports = __toCommonJS(index_exports);
|
|
4100
4101
|
|
|
4102
|
+
// src/assertionCategories.ts
|
|
4103
|
+
var CATEGORIES_PATH = "/api/sdk/assertionCategories";
|
|
4104
|
+
var AssertionCategoriesClient = class {
|
|
4105
|
+
constructor(httpClient) {
|
|
4106
|
+
this.httpClient = httpClient;
|
|
4107
|
+
}
|
|
4108
|
+
/** Create a category, or update it by ID. Omitted descriptions are preserved. */
|
|
4109
|
+
async save(params) {
|
|
4110
|
+
const response = await this.httpClient.request(CATEGORIES_PATH, params);
|
|
4111
|
+
return response.category;
|
|
4112
|
+
}
|
|
4113
|
+
/** Read one category in the API key's organization. */
|
|
4114
|
+
async get(id) {
|
|
4115
|
+
const response = await this.httpClient.get(
|
|
4116
|
+
`${CATEGORIES_PATH}/${encodeURIComponent(id)}`
|
|
4117
|
+
);
|
|
4118
|
+
return response.category;
|
|
4119
|
+
}
|
|
4120
|
+
/** List the organization's categories ordered by title. */
|
|
4121
|
+
async list() {
|
|
4122
|
+
const response = await this.httpClient.get(CATEGORIES_PATH);
|
|
4123
|
+
return response.categories;
|
|
4124
|
+
}
|
|
4125
|
+
/** Delete a category and clear its assignments, preserving assertions and verdicts. */
|
|
4126
|
+
async delete(id) {
|
|
4127
|
+
const response = await this.httpClient.request(`${CATEGORIES_PATH}/${encodeURIComponent(id)}`, {}, { method: "DELETE" });
|
|
4128
|
+
return response.category;
|
|
4129
|
+
}
|
|
4130
|
+
};
|
|
4131
|
+
|
|
4101
4132
|
// src/assertions.ts
|
|
4102
4133
|
var ASSERTIONS_PATH = "/api/sdk/traces/assertions";
|
|
4103
4134
|
function traceAssertionsPath(traceId, suffix = "") {
|
|
@@ -5525,14 +5556,24 @@ var DatasetsClient = class {
|
|
|
5525
5556
|
}
|
|
5526
5557
|
/**
|
|
5527
5558
|
* List datasets, scoped to one trace function when `traceFunctionKey` is
|
|
5528
|
-
* given and organization-wide otherwise.
|
|
5559
|
+
* given and organization-wide otherwise. Fetches all pages automatically.
|
|
5529
5560
|
*/
|
|
5530
5561
|
async list(params = {}) {
|
|
5531
|
-
const
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5562
|
+
const datasets = [];
|
|
5563
|
+
let cursor;
|
|
5564
|
+
do {
|
|
5565
|
+
const query = new URLSearchParams({ limit: "100" });
|
|
5566
|
+
if (params.traceFunctionKey !== void 0) {
|
|
5567
|
+
query.set("traceFunctionKey", params.traceFunctionKey);
|
|
5568
|
+
}
|
|
5569
|
+
if (cursor !== void 0) {
|
|
5570
|
+
query.set("cursor", cursor);
|
|
5571
|
+
}
|
|
5572
|
+
const response = await this.httpClient.get(`/api/sdk/datasets?${query}`);
|
|
5573
|
+
datasets.push(...response.datasets);
|
|
5574
|
+
cursor = response.nextCursor ?? void 0;
|
|
5575
|
+
} while (cursor !== void 0);
|
|
5576
|
+
return datasets;
|
|
5536
5577
|
}
|
|
5537
5578
|
/** Fetch one dataset by id. Rejects with a 404 `BitfabError` when it is not in this organization. */
|
|
5538
5579
|
async get(datasetId) {
|
|
@@ -5541,11 +5582,18 @@ var DatasetsClient = class {
|
|
|
5541
5582
|
);
|
|
5542
5583
|
return response.dataset;
|
|
5543
5584
|
}
|
|
5544
|
-
/**
|
|
5585
|
+
/** Fetches all trace-ID pages, the same membership a replay with `datasetId` selects. */
|
|
5545
5586
|
async listTraces(datasetId) {
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
)
|
|
5587
|
+
const traceIds = [];
|
|
5588
|
+
const query = new URLSearchParams({ limit: "100" });
|
|
5589
|
+
for (; ; ) {
|
|
5590
|
+
const page = await this.httpClient.get(`${datasetPath(datasetId, "/traces")}?${query}`);
|
|
5591
|
+
traceIds.push(...page.traceIds);
|
|
5592
|
+
if (page.nextCursor === void 0 || page.nextCursor === null) {
|
|
5593
|
+
return { datasetId: page.datasetId, traceIds };
|
|
5594
|
+
}
|
|
5595
|
+
query.set("cursor", page.nextCursor);
|
|
5596
|
+
}
|
|
5549
5597
|
}
|
|
5550
5598
|
/**
|
|
5551
5599
|
* Add traces to the dataset (1 to 100 ids per call). Traces outside the
|
|
@@ -7632,6 +7680,7 @@ var Bitfab = class {
|
|
|
7632
7680
|
this.httpClient.releaseHeldExternalSpans = (timeoutMs) => this.simulationPlan.release(timeoutMs);
|
|
7633
7681
|
this.httpClient.stopSimulationPlan = () => this.simulationPlan.stop();
|
|
7634
7682
|
this.datasets = new DatasetsClient(this.httpClient);
|
|
7683
|
+
this.assertionCategories = new AssertionCategoriesClient(this.httpClient);
|
|
7635
7684
|
this.traces = new TracesClient(this.httpClient);
|
|
7636
7685
|
this.labels = new LabelsClient(this.httpClient);
|
|
7637
7686
|
this.graders = new GradersClient(this.httpClient);
|
|
@@ -9703,6 +9752,7 @@ function resolveTraceFunctionKey(registration) {
|
|
|
9703
9752
|
}
|
|
9704
9753
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9705
9754
|
0 && (module.exports = {
|
|
9755
|
+
AssertionCategoriesClient,
|
|
9706
9756
|
BITFAB_PROGRESS_PREFIX,
|
|
9707
9757
|
Bitfab,
|
|
9708
9758
|
BitfabClaudeAgentHandler,
|