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/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.65.1";
|
|
101
101
|
__packageName__ = "bitfab";
|
|
102
102
|
}
|
|
103
103
|
});
|
|
@@ -5383,6 +5383,7 @@ __export(node_exports, {
|
|
|
5383
5383
|
BitfabOpenAITracingProcessor: () => BitfabOpenAITracingProcessor,
|
|
5384
5384
|
BitfabRivetIntegration: () => BitfabRivetIntegration,
|
|
5385
5385
|
BitfabVercelAiHandler: () => BitfabVercelAiHandler,
|
|
5386
|
+
CategoriesClient: () => CategoriesClient,
|
|
5386
5387
|
DEFAULT_SERVICE_URL: () => DEFAULT_SERVICE_URL,
|
|
5387
5388
|
DatasetsClient: () => DatasetsClient,
|
|
5388
5389
|
DbBranchReplayError: () => DbBranchReplayError,
|
|
@@ -5420,9 +5421,9 @@ registerAsyncLocalStorageClass(
|
|
|
5420
5421
|
import_node_async_hooks.AsyncLocalStorage
|
|
5421
5422
|
);
|
|
5422
5423
|
|
|
5423
|
-
// src/
|
|
5424
|
-
var CATEGORIES_PATH = "/api/sdk/
|
|
5425
|
-
var
|
|
5424
|
+
// src/categories.ts
|
|
5425
|
+
var CATEGORIES_PATH = "/api/sdk/categories";
|
|
5426
|
+
var CategoriesClient = class {
|
|
5426
5427
|
constructor(httpClient) {
|
|
5427
5428
|
this.httpClient = httpClient;
|
|
5428
5429
|
}
|
|
@@ -5449,6 +5450,7 @@ var AssertionCategoriesClient = class {
|
|
|
5449
5450
|
return response.category;
|
|
5450
5451
|
}
|
|
5451
5452
|
};
|
|
5453
|
+
var AssertionCategoriesClient = CategoriesClient;
|
|
5452
5454
|
|
|
5453
5455
|
// src/claudeAgentSdk.ts
|
|
5454
5456
|
init_constants();
|
|
@@ -6157,6 +6159,21 @@ function runWithAutoTraceNodeConfiguration(nodeConfiguration, fn) {
|
|
|
6157
6159
|
}
|
|
6158
6160
|
return result;
|
|
6159
6161
|
}
|
|
6162
|
+
function runAsAutoTraceRootFunction(functionName, fn) {
|
|
6163
|
+
const scope = currentAutoTraceScope();
|
|
6164
|
+
if (!scope || scope.entries.length === 0 || functionName === "") {
|
|
6165
|
+
return fn();
|
|
6166
|
+
}
|
|
6167
|
+
const rootFunction = {
|
|
6168
|
+
name: functionName,
|
|
6169
|
+
entering: true
|
|
6170
|
+
};
|
|
6171
|
+
try {
|
|
6172
|
+
return runWithAutoTraceScope({ ...scope, rootFunction }, fn);
|
|
6173
|
+
} finally {
|
|
6174
|
+
rootFunction.entering = false;
|
|
6175
|
+
}
|
|
6176
|
+
}
|
|
6160
6177
|
var SUBTREE_TRACING_DOCS_URL = "https://docs.bitfab.ai/typescript-sdk#experimental-subtree-tracing";
|
|
6161
6178
|
function transformInstalled() {
|
|
6162
6179
|
return autoTraceGlobal.__bitfab_auto_trace_transformed_v1__ === true;
|
|
@@ -9048,6 +9065,27 @@ function draftsInGenerationOrder(assertions, assertionIds) {
|
|
|
9048
9065
|
return assertion === void 0 ? [] : [assertion];
|
|
9049
9066
|
});
|
|
9050
9067
|
}
|
|
9068
|
+
function withCategoryId(assertion) {
|
|
9069
|
+
const categoryId = assertion.category_id ?? assertion.category_assertion_id ?? null;
|
|
9070
|
+
return {
|
|
9071
|
+
...assertion,
|
|
9072
|
+
category_id: categoryId,
|
|
9073
|
+
category_assertion_id: categoryId
|
|
9074
|
+
};
|
|
9075
|
+
}
|
|
9076
|
+
function withCategoryIds(assertions) {
|
|
9077
|
+
return assertions.map(withCategoryId);
|
|
9078
|
+
}
|
|
9079
|
+
function toWireAssertion({
|
|
9080
|
+
category_assertion_id,
|
|
9081
|
+
...assertion
|
|
9082
|
+
}) {
|
|
9083
|
+
const categoryId = assertion.category_id === void 0 ? category_assertion_id : assertion.category_id;
|
|
9084
|
+
if (categoryId === void 0) {
|
|
9085
|
+
return assertion;
|
|
9086
|
+
}
|
|
9087
|
+
return { ...assertion, category_id: categoryId };
|
|
9088
|
+
}
|
|
9051
9089
|
function traceAssertionsPath(traceId, suffix = "") {
|
|
9052
9090
|
return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
|
|
9053
9091
|
}
|
|
@@ -9062,9 +9100,10 @@ var TracesClient = class {
|
|
|
9062
9100
|
return this.httpClient.request(SEARCH_PATH, params);
|
|
9063
9101
|
}
|
|
9064
9102
|
async getAssertions(traceId) {
|
|
9065
|
-
|
|
9103
|
+
const result = await this.httpClient.get(
|
|
9066
9104
|
traceAssertionsPath(traceId)
|
|
9067
9105
|
);
|
|
9106
|
+
return { ...result, assertions: withCategoryIds(result.assertions) };
|
|
9068
9107
|
}
|
|
9069
9108
|
async saveAssertions(params) {
|
|
9070
9109
|
return this.saveAssertionsAll({
|
|
@@ -9077,10 +9116,13 @@ var TracesClient = class {
|
|
|
9077
9116
|
return [];
|
|
9078
9117
|
}
|
|
9079
9118
|
const response = await this.httpClient.request(ASSERTIONS_PATH, {
|
|
9080
|
-
updates: params.updates
|
|
9119
|
+
updates: params.updates.map((update) => ({
|
|
9120
|
+
...update,
|
|
9121
|
+
assertions: update.assertions.map(toWireAssertion)
|
|
9122
|
+
})),
|
|
9081
9123
|
source: params.source ?? "agent"
|
|
9082
9124
|
});
|
|
9083
|
-
return response.assertions;
|
|
9125
|
+
return withCategoryIds(response.assertions);
|
|
9084
9126
|
}
|
|
9085
9127
|
async generateAssertions(traceId, options = {}) {
|
|
9086
9128
|
const started = await this.httpClient.request(
|
|
@@ -9092,7 +9134,7 @@ var TracesClient = class {
|
|
|
9092
9134
|
}
|
|
9093
9135
|
);
|
|
9094
9136
|
if (isGenerationFinished(traceId, started.generation)) {
|
|
9095
|
-
return started.assertions;
|
|
9137
|
+
return withCategoryIds(started.assertions);
|
|
9096
9138
|
}
|
|
9097
9139
|
const timeoutMs = options.timeoutMs ?? DEFAULT_GENERATION_TIMEOUT_MS;
|
|
9098
9140
|
const deadline = Date.now() + timeoutMs;
|
|
@@ -10040,6 +10082,11 @@ function readBooleanEnv(name) {
|
|
|
10040
10082
|
);
|
|
10041
10083
|
return void 0;
|
|
10042
10084
|
}
|
|
10085
|
+
var AUTO_TRACE_NODE_FUNCTION_NAMES = /* @__PURE__ */ new WeakMap();
|
|
10086
|
+
function registerAutoTraceNode(configured, functionName) {
|
|
10087
|
+
AUTO_TRACE_NODE_FUNCTION_NAMES.set(configured, functionName);
|
|
10088
|
+
return configured;
|
|
10089
|
+
}
|
|
10043
10090
|
var DEFAULT_AUTO_TRACE_MAX_DEPTH = 30;
|
|
10044
10091
|
var DEFAULT_AUTO_TRACE_MAX_CAPTURED_SUBTREE_SPANS = 500;
|
|
10045
10092
|
function spanOwnerName(receiver) {
|
|
@@ -10115,7 +10162,8 @@ var Bitfab = class {
|
|
|
10115
10162
|
this.simulationPlan.refresh();
|
|
10116
10163
|
}
|
|
10117
10164
|
this.datasets = new DatasetsClient(this.httpClient);
|
|
10118
|
-
this.
|
|
10165
|
+
this.categories = new CategoriesClient(this.httpClient);
|
|
10166
|
+
this.assertionCategories = this.categories;
|
|
10119
10167
|
this.organizationMembers = new OrganizationMembersClient(this.httpClient);
|
|
10120
10168
|
this.traces = new TracesClient(this.httpClient);
|
|
10121
10169
|
this.spans = new SpansClient(this.httpClient);
|
|
@@ -10174,7 +10222,13 @@ var Bitfab = class {
|
|
|
10174
10222
|
throw new BitfabError("bitfab.withTrace requires a function");
|
|
10175
10223
|
}
|
|
10176
10224
|
const name = fn.name !== "" ? fn.name : traceFunctionKey;
|
|
10177
|
-
return this.createAutoTraceRoot(
|
|
10225
|
+
return this.createAutoTraceRoot(
|
|
10226
|
+
traceFunctionKey,
|
|
10227
|
+
name,
|
|
10228
|
+
options,
|
|
10229
|
+
fn,
|
|
10230
|
+
AUTO_TRACE_NODE_FUNCTION_NAMES.get(fn) ?? fn.name.replace(/^bound /, "")
|
|
10231
|
+
);
|
|
10178
10232
|
}
|
|
10179
10233
|
/**
|
|
10180
10234
|
* Configure a transformed class method when it is discovered beneath a
|
|
@@ -10255,7 +10309,7 @@ var Bitfab = class {
|
|
|
10255
10309
|
}
|
|
10256
10310
|
createAutoTraceNode(configuration, fn, functionName) {
|
|
10257
10311
|
const nodeConfiguration = { ...configuration, functionName };
|
|
10258
|
-
return function(...args) {
|
|
10312
|
+
return registerAutoTraceNode(function(...args) {
|
|
10259
10313
|
if (!__bitfabAutoTraceActive()) {
|
|
10260
10314
|
if (enclosingSurface() === "opt-in") {
|
|
10261
10315
|
throw mixedTracingError("node()", "opt-out", "opt-in");
|
|
@@ -10266,11 +10320,15 @@ var Bitfab = class {
|
|
|
10266
10320
|
nodeConfiguration,
|
|
10267
10321
|
() => fn.apply(this, args)
|
|
10268
10322
|
);
|
|
10269
|
-
};
|
|
10323
|
+
}, functionName);
|
|
10270
10324
|
}
|
|
10271
|
-
createAutoTraceRoot(traceFunctionKey, name, options, fn) {
|
|
10325
|
+
createAutoTraceRoot(traceFunctionKey, name, options, fn, rootFunctionName = "") {
|
|
10272
10326
|
const self = this;
|
|
10273
10327
|
self.simulationPlan.refresh();
|
|
10328
|
+
const runRootFunction = (receiver, args) => runAsAutoTraceRootFunction(
|
|
10329
|
+
rootFunctionName,
|
|
10330
|
+
() => fn.apply(receiver, args)
|
|
10331
|
+
);
|
|
10274
10332
|
const maxDepth = autoTraceLimit(
|
|
10275
10333
|
options.maxDepth,
|
|
10276
10334
|
DEFAULT_AUTO_TRACE_MAX_DEPTH
|
|
@@ -10433,7 +10491,7 @@ var Bitfab = class {
|
|
|
10433
10491
|
return runWithAutoTraceRootContext(
|
|
10434
10492
|
autoTraceContext,
|
|
10435
10493
|
getSpanStack(),
|
|
10436
|
-
() =>
|
|
10494
|
+
() => runRootFunction(this, args)
|
|
10437
10495
|
);
|
|
10438
10496
|
}
|
|
10439
10497
|
);
|
|
@@ -10466,7 +10524,7 @@ var Bitfab = class {
|
|
|
10466
10524
|
),
|
|
10467
10525
|
() => {
|
|
10468
10526
|
if (link === void 0) {
|
|
10469
|
-
return
|
|
10527
|
+
return runRootFunction(this, args);
|
|
10470
10528
|
}
|
|
10471
10529
|
const innermost = enclosing[enclosing.length - 1];
|
|
10472
10530
|
const innermostNow = currentAutoTraceEntries().find(
|
|
@@ -12438,6 +12496,7 @@ assertAsyncStorageRegistered();
|
|
|
12438
12496
|
BitfabOpenAITracingProcessor,
|
|
12439
12497
|
BitfabRivetIntegration,
|
|
12440
12498
|
BitfabVercelAiHandler,
|
|
12499
|
+
CategoriesClient,
|
|
12441
12500
|
DEFAULT_SERVICE_URL,
|
|
12442
12501
|
DatasetsClient,
|
|
12443
12502
|
DbBranchReplayError,
|