bitfab 0.64.30 → 0.65.1
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 +28 -0
- package/dist/autoTrace.cjs.map +1 -1
- package/dist/autoTrace.d.cts +2 -1
- package/dist/autoTrace.d.ts +2 -1
- package/dist/autoTrace.js +3 -1
- package/dist/{chunk-FY5WZ6M4.js → chunk-3FTI76L6.js} +2 -2
- package/dist/{chunk-OREQTFEI.js → chunk-4SBOBQGH.js} +4 -4
- package/dist/chunk-4SBOBQGH.js.map +1 -0
- package/dist/{chunk-GUPAIDK4.js → chunk-GS7FUQ6U.js} +2 -2
- package/dist/chunk-GS7FUQ6U.js.map +1 -0
- package/dist/{chunk-KDNS4BVZ.js → chunk-HW4ZKFYV.js} +65 -21
- package/dist/chunk-HW4ZKFYV.js.map +1 -0
- package/dist/{chunk-GSHCHCB5.js → chunk-LXBV37XY.js} +2 -39
- package/dist/chunk-LXBV37XY.js.map +1 -0
- package/dist/{chunk-IBWW3SP4.js → chunk-P7JUVRYZ.js} +2 -2
- package/dist/{chunk-YWXQM6J3.js → chunk-QRNHRY7F.js} +28 -1
- package/dist/chunk-QRNHRY7F.js.map +1 -0
- package/dist/{chunk-FXYVGFBP.js → chunk-U2GQPMOK.js} +2 -2
- package/dist/{chunk-JTFPBPMC.js → chunk-VG54N52W.js} +2 -2
- package/dist/chunk-VG54N52W.js.map +1 -0
- package/dist/{chunk-MN3E2RUU.js → chunk-VS36LW4L.js} +3 -3
- package/dist/{http-NUZD6TOB.js → http-FN74JEHE.js} +2 -2
- package/dist/{http-EWWU4KU2.js → http-G32WE67W.js} +2 -2
- package/dist/index.cjs +74 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -43
- package/dist/index.d.ts +76 -43
- package/dist/index.js +6 -4
- package/dist/node.cjs +74 -15
- 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 +6 -4
- package/dist/node.js.map +1 -1
- package/dist/{replay-MIZRT2LG.js → replay-FHHOJPX7.js} +3 -3
- package/dist/{replay-7Y5ERBDN.js → replay-SVHAY4S6.js} +3 -3
- package/dist/replayCli.js +3 -3
- package/dist/seedCli.js +3 -3
- package/dist/transform/babel.cjs +1 -38
- package/dist/transform/babel.cjs.map +1 -1
- package/dist/transform/babel.js +1 -1
- package/dist/transform/bun.cjs +1 -38
- package/dist/transform/bun.cjs.map +1 -1
- package/dist/transform/bun.js +3 -3
- package/dist/transform/esbuild.cjs +1 -38
- package/dist/transform/esbuild.cjs.map +1 -1
- package/dist/transform/esbuild.js +3 -3
- package/dist/transform/loaderRuntime.cjs +1 -38
- package/dist/transform/loaderRuntime.cjs.map +1 -1
- package/dist/transform/loaderRuntime.js +2 -2
- package/dist/transform/nest.cjs +1 -38
- package/dist/transform/nest.cjs.map +1 -1
- package/dist/transform/nest.js +3 -3
- package/dist/transform/next.cjs +1 -38
- package/dist/transform/next.cjs.map +1 -1
- package/dist/transform/next.js +3 -3
- package/dist/transform/nodeLoader.js +1 -38
- package/dist/transform/nodeLoader.js.map +1 -1
- package/dist/transform/rolldown.cjs +1 -38
- package/dist/transform/rolldown.cjs.map +1 -1
- package/dist/transform/rolldown.js +3 -3
- package/dist/transform/rollup.cjs +1 -38
- package/dist/transform/rollup.cjs.map +1 -1
- package/dist/transform/rollup.js +3 -3
- package/dist/transform/rsbuild.cjs +1 -38
- package/dist/transform/rsbuild.cjs.map +1 -1
- package/dist/transform/rsbuild.js +3 -3
- package/dist/transform/rspack.cjs +1 -38
- package/dist/transform/rspack.cjs.map +1 -1
- package/dist/transform/rspack.js +3 -3
- package/dist/transform/swc.cjs +1 -38
- package/dist/transform/swc.cjs.map +1 -1
- package/dist/transform/swc.js +2 -2
- package/dist/transform/unplugin.cjs +1 -38
- package/dist/transform/unplugin.cjs.map +1 -1
- package/dist/transform/unplugin.js +3 -3
- package/dist/transform/vite.cjs +1 -38
- package/dist/transform/vite.cjs.map +1 -1
- package/dist/transform/vite.js +3 -3
- package/dist/transform/webpack.cjs +1 -38
- package/dist/transform/webpack.cjs.map +1 -1
- package/dist/transform/webpack.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-GSHCHCB5.js.map +0 -1
- package/dist/chunk-GUPAIDK4.js.map +0 -1
- package/dist/chunk-JTFPBPMC.js.map +0 -1
- package/dist/chunk-KDNS4BVZ.js.map +0 -1
- package/dist/chunk-OREQTFEI.js.map +0 -1
- package/dist/chunk-YWXQM6J3.js.map +0 -1
- /package/dist/{chunk-FY5WZ6M4.js.map → chunk-3FTI76L6.js.map} +0 -0
- /package/dist/{chunk-IBWW3SP4.js.map → chunk-P7JUVRYZ.js.map} +0 -0
- /package/dist/{chunk-FXYVGFBP.js.map → chunk-U2GQPMOK.js.map} +0 -0
- /package/dist/{chunk-MN3E2RUU.js.map → chunk-VS36LW4L.js.map} +0 -0
- /package/dist/{http-EWWU4KU2.js.map → http-FN74JEHE.js.map} +0 -0
- /package/dist/{http-NUZD6TOB.js.map → http-G32WE67W.js.map} +0 -0
- /package/dist/{replay-7Y5ERBDN.js.map → replay-FHHOJPX7.js.map} +0 -0
- /package/dist/{replay-MIZRT2LG.js.map → replay-SVHAY4S6.js.map} +0 -0
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.
|
|
54
|
+
__version__ = "0.65.1";
|
|
55
55
|
__packageName__ = "bitfab";
|
|
56
56
|
}
|
|
57
57
|
});
|
|
@@ -5376,6 +5376,7 @@ __export(index_exports, {
|
|
|
5376
5376
|
BitfabOpenAITracingProcessor: () => BitfabOpenAITracingProcessor,
|
|
5377
5377
|
BitfabRivetIntegration: () => BitfabRivetIntegration,
|
|
5378
5378
|
BitfabVercelAiHandler: () => BitfabVercelAiHandler,
|
|
5379
|
+
CategoriesClient: () => CategoriesClient,
|
|
5379
5380
|
DEFAULT_SERVICE_URL: () => DEFAULT_SERVICE_URL,
|
|
5380
5381
|
DatasetsClient: () => DatasetsClient,
|
|
5381
5382
|
DbBranchReplayError: () => DbBranchReplayError,
|
|
@@ -5406,9 +5407,9 @@ __export(index_exports, {
|
|
|
5406
5407
|
});
|
|
5407
5408
|
module.exports = __toCommonJS(index_exports);
|
|
5408
5409
|
|
|
5409
|
-
// src/
|
|
5410
|
-
var CATEGORIES_PATH = "/api/sdk/
|
|
5411
|
-
var
|
|
5410
|
+
// src/categories.ts
|
|
5411
|
+
var CATEGORIES_PATH = "/api/sdk/categories";
|
|
5412
|
+
var CategoriesClient = class {
|
|
5412
5413
|
constructor(httpClient) {
|
|
5413
5414
|
this.httpClient = httpClient;
|
|
5414
5415
|
}
|
|
@@ -5435,6 +5436,7 @@ var AssertionCategoriesClient = class {
|
|
|
5435
5436
|
return response.category;
|
|
5436
5437
|
}
|
|
5437
5438
|
};
|
|
5439
|
+
var AssertionCategoriesClient = CategoriesClient;
|
|
5438
5440
|
|
|
5439
5441
|
// src/claudeAgentSdk.ts
|
|
5440
5442
|
init_constants();
|
|
@@ -6143,6 +6145,21 @@ function runWithAutoTraceNodeConfiguration(nodeConfiguration, fn) {
|
|
|
6143
6145
|
}
|
|
6144
6146
|
return result;
|
|
6145
6147
|
}
|
|
6148
|
+
function runAsAutoTraceRootFunction(functionName, fn) {
|
|
6149
|
+
const scope = currentAutoTraceScope();
|
|
6150
|
+
if (!scope || scope.entries.length === 0 || functionName === "") {
|
|
6151
|
+
return fn();
|
|
6152
|
+
}
|
|
6153
|
+
const rootFunction = {
|
|
6154
|
+
name: functionName,
|
|
6155
|
+
entering: true
|
|
6156
|
+
};
|
|
6157
|
+
try {
|
|
6158
|
+
return runWithAutoTraceScope({ ...scope, rootFunction }, fn);
|
|
6159
|
+
} finally {
|
|
6160
|
+
rootFunction.entering = false;
|
|
6161
|
+
}
|
|
6162
|
+
}
|
|
6146
6163
|
var SUBTREE_TRACING_DOCS_URL = "https://docs.bitfab.ai/typescript-sdk#experimental-subtree-tracing";
|
|
6147
6164
|
function transformInstalled() {
|
|
6148
6165
|
return autoTraceGlobal.__bitfab_auto_trace_transformed_v1__ === true;
|
|
@@ -9034,6 +9051,27 @@ function draftsInGenerationOrder(assertions, assertionIds) {
|
|
|
9034
9051
|
return assertion === void 0 ? [] : [assertion];
|
|
9035
9052
|
});
|
|
9036
9053
|
}
|
|
9054
|
+
function withCategoryId(assertion) {
|
|
9055
|
+
const categoryId = assertion.category_id ?? assertion.category_assertion_id ?? null;
|
|
9056
|
+
return {
|
|
9057
|
+
...assertion,
|
|
9058
|
+
category_id: categoryId,
|
|
9059
|
+
category_assertion_id: categoryId
|
|
9060
|
+
};
|
|
9061
|
+
}
|
|
9062
|
+
function withCategoryIds(assertions) {
|
|
9063
|
+
return assertions.map(withCategoryId);
|
|
9064
|
+
}
|
|
9065
|
+
function toWireAssertion({
|
|
9066
|
+
category_assertion_id,
|
|
9067
|
+
...assertion
|
|
9068
|
+
}) {
|
|
9069
|
+
const categoryId = assertion.category_id === void 0 ? category_assertion_id : assertion.category_id;
|
|
9070
|
+
if (categoryId === void 0) {
|
|
9071
|
+
return assertion;
|
|
9072
|
+
}
|
|
9073
|
+
return { ...assertion, category_id: categoryId };
|
|
9074
|
+
}
|
|
9037
9075
|
function traceAssertionsPath(traceId, suffix = "") {
|
|
9038
9076
|
return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
|
|
9039
9077
|
}
|
|
@@ -9048,9 +9086,10 @@ var TracesClient = class {
|
|
|
9048
9086
|
return this.httpClient.request(SEARCH_PATH, params);
|
|
9049
9087
|
}
|
|
9050
9088
|
async getAssertions(traceId) {
|
|
9051
|
-
|
|
9089
|
+
const result = await this.httpClient.get(
|
|
9052
9090
|
traceAssertionsPath(traceId)
|
|
9053
9091
|
);
|
|
9092
|
+
return { ...result, assertions: withCategoryIds(result.assertions) };
|
|
9054
9093
|
}
|
|
9055
9094
|
async saveAssertions(params) {
|
|
9056
9095
|
return this.saveAssertionsAll({
|
|
@@ -9063,10 +9102,13 @@ var TracesClient = class {
|
|
|
9063
9102
|
return [];
|
|
9064
9103
|
}
|
|
9065
9104
|
const response = await this.httpClient.request(ASSERTIONS_PATH, {
|
|
9066
|
-
updates: params.updates
|
|
9105
|
+
updates: params.updates.map((update) => ({
|
|
9106
|
+
...update,
|
|
9107
|
+
assertions: update.assertions.map(toWireAssertion)
|
|
9108
|
+
})),
|
|
9067
9109
|
source: params.source ?? "agent"
|
|
9068
9110
|
});
|
|
9069
|
-
return response.assertions;
|
|
9111
|
+
return withCategoryIds(response.assertions);
|
|
9070
9112
|
}
|
|
9071
9113
|
async generateAssertions(traceId, options = {}) {
|
|
9072
9114
|
const started = await this.httpClient.request(
|
|
@@ -9078,7 +9120,7 @@ var TracesClient = class {
|
|
|
9078
9120
|
}
|
|
9079
9121
|
);
|
|
9080
9122
|
if (isGenerationFinished(traceId, started.generation)) {
|
|
9081
|
-
return started.assertions;
|
|
9123
|
+
return withCategoryIds(started.assertions);
|
|
9082
9124
|
}
|
|
9083
9125
|
const timeoutMs = options.timeoutMs ?? DEFAULT_GENERATION_TIMEOUT_MS;
|
|
9084
9126
|
const deadline = Date.now() + timeoutMs;
|
|
@@ -10026,6 +10068,11 @@ function readBooleanEnv(name) {
|
|
|
10026
10068
|
);
|
|
10027
10069
|
return void 0;
|
|
10028
10070
|
}
|
|
10071
|
+
var AUTO_TRACE_NODE_FUNCTION_NAMES = /* @__PURE__ */ new WeakMap();
|
|
10072
|
+
function registerAutoTraceNode(configured, functionName) {
|
|
10073
|
+
AUTO_TRACE_NODE_FUNCTION_NAMES.set(configured, functionName);
|
|
10074
|
+
return configured;
|
|
10075
|
+
}
|
|
10029
10076
|
var DEFAULT_AUTO_TRACE_MAX_DEPTH = 30;
|
|
10030
10077
|
var DEFAULT_AUTO_TRACE_MAX_CAPTURED_SUBTREE_SPANS = 500;
|
|
10031
10078
|
function spanOwnerName(receiver) {
|
|
@@ -10101,7 +10148,8 @@ var Bitfab = class {
|
|
|
10101
10148
|
this.simulationPlan.refresh();
|
|
10102
10149
|
}
|
|
10103
10150
|
this.datasets = new DatasetsClient(this.httpClient);
|
|
10104
|
-
this.
|
|
10151
|
+
this.categories = new CategoriesClient(this.httpClient);
|
|
10152
|
+
this.assertionCategories = this.categories;
|
|
10105
10153
|
this.organizationMembers = new OrganizationMembersClient(this.httpClient);
|
|
10106
10154
|
this.traces = new TracesClient(this.httpClient);
|
|
10107
10155
|
this.spans = new SpansClient(this.httpClient);
|
|
@@ -10160,7 +10208,13 @@ var Bitfab = class {
|
|
|
10160
10208
|
throw new BitfabError("bitfab.withTrace requires a function");
|
|
10161
10209
|
}
|
|
10162
10210
|
const name = fn.name !== "" ? fn.name : traceFunctionKey;
|
|
10163
|
-
return this.createAutoTraceRoot(
|
|
10211
|
+
return this.createAutoTraceRoot(
|
|
10212
|
+
traceFunctionKey,
|
|
10213
|
+
name,
|
|
10214
|
+
options,
|
|
10215
|
+
fn,
|
|
10216
|
+
AUTO_TRACE_NODE_FUNCTION_NAMES.get(fn) ?? fn.name.replace(/^bound /, "")
|
|
10217
|
+
);
|
|
10164
10218
|
}
|
|
10165
10219
|
/**
|
|
10166
10220
|
* Configure a transformed class method when it is discovered beneath a
|
|
@@ -10241,7 +10295,7 @@ var Bitfab = class {
|
|
|
10241
10295
|
}
|
|
10242
10296
|
createAutoTraceNode(configuration, fn, functionName) {
|
|
10243
10297
|
const nodeConfiguration = { ...configuration, functionName };
|
|
10244
|
-
return function(...args) {
|
|
10298
|
+
return registerAutoTraceNode(function(...args) {
|
|
10245
10299
|
if (!__bitfabAutoTraceActive()) {
|
|
10246
10300
|
if (enclosingSurface() === "opt-in") {
|
|
10247
10301
|
throw mixedTracingError("node()", "opt-out", "opt-in");
|
|
@@ -10252,11 +10306,15 @@ var Bitfab = class {
|
|
|
10252
10306
|
nodeConfiguration,
|
|
10253
10307
|
() => fn.apply(this, args)
|
|
10254
10308
|
);
|
|
10255
|
-
};
|
|
10309
|
+
}, functionName);
|
|
10256
10310
|
}
|
|
10257
|
-
createAutoTraceRoot(traceFunctionKey, name, options, fn) {
|
|
10311
|
+
createAutoTraceRoot(traceFunctionKey, name, options, fn, rootFunctionName = "") {
|
|
10258
10312
|
const self = this;
|
|
10259
10313
|
self.simulationPlan.refresh();
|
|
10314
|
+
const runRootFunction = (receiver, args) => runAsAutoTraceRootFunction(
|
|
10315
|
+
rootFunctionName,
|
|
10316
|
+
() => fn.apply(receiver, args)
|
|
10317
|
+
);
|
|
10260
10318
|
const maxDepth = autoTraceLimit(
|
|
10261
10319
|
options.maxDepth,
|
|
10262
10320
|
DEFAULT_AUTO_TRACE_MAX_DEPTH
|
|
@@ -10419,7 +10477,7 @@ var Bitfab = class {
|
|
|
10419
10477
|
return runWithAutoTraceRootContext(
|
|
10420
10478
|
autoTraceContext,
|
|
10421
10479
|
getSpanStack(),
|
|
10422
|
-
() =>
|
|
10480
|
+
() => runRootFunction(this, args)
|
|
10423
10481
|
);
|
|
10424
10482
|
}
|
|
10425
10483
|
);
|
|
@@ -10452,7 +10510,7 @@ var Bitfab = class {
|
|
|
10452
10510
|
),
|
|
10453
10511
|
() => {
|
|
10454
10512
|
if (link === void 0) {
|
|
10455
|
-
return
|
|
10513
|
+
return runRootFunction(this, args);
|
|
10456
10514
|
}
|
|
10457
10515
|
const innermost = enclosing[enclosing.length - 1];
|
|
10458
10516
|
const innermostNow = currentAutoTraceEntries().find(
|
|
@@ -12420,6 +12478,7 @@ function resolveTraceFunctionKey(registration) {
|
|
|
12420
12478
|
BitfabOpenAITracingProcessor,
|
|
12421
12479
|
BitfabRivetIntegration,
|
|
12422
12480
|
BitfabVercelAiHandler,
|
|
12481
|
+
CategoriesClient,
|
|
12423
12482
|
DEFAULT_SERVICE_URL,
|
|
12424
12483
|
DatasetsClient,
|
|
12425
12484
|
DbBranchReplayError,
|