@bitfab/sdk 0.76.2 → 0.76.3
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/{babelPlugin-BpEeVvk4.cjs → babelPlugin-C4ERQ8DW.cjs} +118 -69
- package/dist/babelPlugin-C4ERQ8DW.cjs.map +1 -0
- package/dist/{babelPlugin-PgjdBuQe.js → babelPlugin-tupc_WZS.js} +50 -1
- package/dist/babelPlugin-tupc_WZS.js.map +1 -0
- package/dist/baml.cjs +1 -1
- package/dist/baml.js +1 -1
- package/dist/bamlPeer-BxJO7-pm.cjs +169 -0
- package/dist/bamlPeer-BxJO7-pm.cjs.map +1 -0
- package/dist/bamlPeer-CWPgBSlJ.js +109 -0
- package/dist/bamlPeer-CWPgBSlJ.js.map +1 -0
- package/dist/{http-DscPFMlr.cjs → http-7exfDbAK.cjs} +3 -3
- package/dist/{http-DscPFMlr.cjs.map → http-7exfDbAK.cjs.map} +1 -1
- package/dist/{http-wadCG_ec.js → http-BA7vmvuC.js} +2 -2
- package/dist/{http-wadCG_ec.js.map → http-BA7vmvuC.js.map} +1 -1
- package/dist/{index-D5NpBqF3.d.cts → index-CmO7Xmwl.d.cts} +1 -1
- package/dist/{index-D5NpBqF3.d.ts → index-CmO7Xmwl.d.ts} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{loaderRuntime-0huddOOP.d.ts → loaderRuntime-AETv8Pt4.d.ts} +1 -1
- package/dist/{loaderRuntime-CslfDFO7.d.cts → loaderRuntime-BGUu666e.d.cts} +1 -1
- package/dist/node.cjs +2 -2
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +2 -2
- package/dist/registryCommand-M1u4H9PI.js.map +1 -1
- package/dist/{src-B6zSnPpb.cjs → src-BMMKf1sR.cjs} +29 -16
- package/dist/src-BMMKf1sR.cjs.map +1 -0
- package/dist/{src-CcYVtNMw.js → src-CYs1uXoX.js} +29 -16
- package/dist/{src-CcYVtNMw.js.map → src-CYs1uXoX.js.map} +1 -1
- package/dist/transform/babel.cjs +1 -1
- package/dist/transform/babel.d.cts +1 -1
- package/dist/transform/babel.d.ts +1 -1
- package/dist/transform/babel.js +1 -1
- package/dist/transform/bun.d.cts +1 -1
- package/dist/transform/bun.d.ts +1 -1
- package/dist/transform/esbuild.d.cts +1 -1
- package/dist/transform/esbuild.d.ts +1 -1
- package/dist/transform/loaderRuntime.cjs +3 -3
- package/dist/transform/loaderRuntime.d.cts +1 -1
- package/dist/transform/loaderRuntime.d.ts +1 -1
- package/dist/transform/loaderRuntime.js +3 -3
- package/dist/transform/nest.d.cts +1 -1
- package/dist/transform/nest.d.ts +1 -1
- package/dist/transform/next.d.cts +1 -1
- package/dist/transform/next.d.ts +1 -1
- package/dist/transform/nodeLoader.js +56 -2
- package/dist/transform/nodeLoader.js.map +1 -1
- package/dist/transform/rolldown.d.cts +1 -1
- package/dist/transform/rolldown.d.ts +1 -1
- package/dist/transform/rollup.d.cts +1 -1
- package/dist/transform/rollup.d.ts +1 -1
- package/dist/transform/rsbuild.d.cts +1 -1
- package/dist/transform/rsbuild.d.ts +1 -1
- package/dist/transform/rspack.d.cts +1 -1
- package/dist/transform/rspack.d.ts +1 -1
- package/dist/transform/swc.cjs +1 -1
- package/dist/transform/swc.d.cts +1 -1
- package/dist/transform/swc.d.ts +1 -1
- package/dist/transform/swc.js +1 -1
- package/dist/transform/unplugin.cjs +2 -2
- package/dist/transform/unplugin.d.cts +1 -1
- package/dist/transform/unplugin.d.ts +1 -1
- package/dist/transform/unplugin.js +2 -2
- package/dist/transform/vite.d.cts +1 -1
- package/dist/transform/vite.d.ts +1 -1
- package/dist/transform/webpack.d.cts +1 -1
- package/dist/transform/webpack.d.ts +1 -1
- package/dist/{transform-Cdg7CSbP.cjs → transform-CcNCVr8A.cjs} +2 -2
- package/dist/{transform-Cdg7CSbP.cjs.map → transform-CcNCVr8A.cjs.map} +1 -1
- package/dist/{transform-BhazCKOg.js → transform-mb6EwHsJ.js} +2 -2
- package/dist/{transform-BhazCKOg.js.map → transform-mb6EwHsJ.js.map} +1 -1
- package/dist/{transformOptions-BsjCELkh.d.cts → transformOptions-uNuIpBAA.d.cts} +2 -0
- package/dist/{transformOptions-BsjCELkh.d.ts → transformOptions-uNuIpBAA.d.ts} +2 -0
- package/package.json +1 -1
- package/dist/babelPlugin-BpEeVvk4.cjs.map +0 -1
- package/dist/babelPlugin-PgjdBuQe.js.map +0 -1
- package/dist/bamlPeer-5Ohpq8q9.cjs +0 -74
- package/dist/bamlPeer-5Ohpq8q9.cjs.map +0 -1
- package/dist/bamlPeer-Dyeb3e5o.js +0 -20
- package/dist/bamlPeer-Dyeb3e5o.js.map +0 -1
- package/dist/src-B6zSnPpb.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_bamlPeer = require("./bamlPeer-
|
|
2
|
-
const require_http = require("./http-
|
|
1
|
+
const require_bamlPeer = require("./bamlPeer-BxJO7-pm.cjs");
|
|
2
|
+
const require_http = require("./http-7exfDbAK.cjs");
|
|
3
3
|
const require_autoTrace = require("./autoTrace-pZKu5Nk2.cjs");
|
|
4
4
|
const require_optionalPeer = require("./optionalPeer-CUH756lt.cjs");
|
|
5
5
|
let superjson = require("superjson");
|
|
@@ -5712,12 +5712,18 @@ function wrapAsyncGenerator(source, spanStack, sendSpan, recordYielded) {
|
|
|
5712
5712
|
return wrapped;
|
|
5713
5713
|
}
|
|
5714
5714
|
let cachedCollectorClass;
|
|
5715
|
-
async function loadCollectorClass() {
|
|
5716
|
-
if (cachedCollectorClass !== void 0) return cachedCollectorClass;
|
|
5717
|
-
const baml = await require_bamlPeer.loadBamlModule();
|
|
5715
|
+
async function loadCollectorClass(options) {
|
|
5716
|
+
if (cachedCollectorClass !== void 0 && (cachedCollectorClass === null || options?.clientRuntime === void 0)) return cachedCollectorClass;
|
|
5717
|
+
const baml = await require_bamlPeer.loadBamlModule(options);
|
|
5718
5718
|
if (!baml) return null;
|
|
5719
|
-
|
|
5720
|
-
|
|
5719
|
+
const CollectorClass = baml.Collector;
|
|
5720
|
+
if (require_bamlPeer.isSharedBamlModule(baml)) cachedCollectorClass = CollectorClass;
|
|
5721
|
+
return CollectorClass;
|
|
5722
|
+
}
|
|
5723
|
+
function bamlRuntimeOf(bamlClient) {
|
|
5724
|
+
if (typeof bamlClient !== "object" || bamlClient === null) return;
|
|
5725
|
+
const runtime = bamlClient.runtime;
|
|
5726
|
+
return typeof runtime === "object" && runtime !== null ? runtime : void 0;
|
|
5721
5727
|
}
|
|
5722
5728
|
function extractPromptFromCollector(collector) {
|
|
5723
5729
|
try {
|
|
@@ -5837,13 +5843,19 @@ function invokeBamlWithCollector(invokeFn, CollectorClass) {
|
|
|
5837
5843
|
settle();
|
|
5838
5844
|
return result;
|
|
5839
5845
|
}
|
|
5846
|
+
function warnIfAutoTracedBamlUntraced(CollectorClass) {
|
|
5847
|
+
if (!CollectorClass) require_autoTrace.warnOnce("autoTrace-baml-collector-unavailable", `@boundaryml/baml could not be loaded, so BAML calls under a trace root are recorded without their prompt, model, or token usage. If @boundaryml/baml is installed but your bundler hides it, add \`import "@bitfab/sdk/baml"\` once in your server code.`);
|
|
5848
|
+
}
|
|
5840
5849
|
function invokeAutoTracedBaml(invokeFn, isAsync) {
|
|
5841
5850
|
if (cachedCollectorClass) return invokeBamlWithCollector(invokeFn, cachedCollectorClass);
|
|
5842
5851
|
if (cachedCollectorClass === null || !isAsync) {
|
|
5843
|
-
loadCollectorClass();
|
|
5852
|
+
loadCollectorClass().then(warnIfAutoTracedBamlUntraced).catch(() => {});
|
|
5844
5853
|
return invokeFn();
|
|
5845
5854
|
}
|
|
5846
|
-
return loadCollectorClass().then((CollectorClass) =>
|
|
5855
|
+
return loadCollectorClass().then((CollectorClass) => {
|
|
5856
|
+
warnIfAutoTracedBamlUntraced(CollectorClass);
|
|
5857
|
+
return CollectorClass ? invokeBamlWithCollector(invokeFn, CollectorClass) : invokeFn();
|
|
5858
|
+
});
|
|
5847
5859
|
}
|
|
5848
5860
|
function isSpanType(value) {
|
|
5849
5861
|
return require_http.SPAN_TYPES.some((spanType) => spanType === value);
|
|
@@ -6118,7 +6130,7 @@ var Bitfab = class {
|
|
|
6118
6130
|
createAutoTraceRoot(traceFunctionKey, name, options, fn, rootFunctionName = "") {
|
|
6119
6131
|
const self = this;
|
|
6120
6132
|
self.simulationPlan.refresh();
|
|
6121
|
-
loadCollectorClass();
|
|
6133
|
+
loadCollectorClass({ searchLoadedModules: false });
|
|
6122
6134
|
require_autoTrace.installLangChainRunScopes();
|
|
6123
6135
|
const runRootFunction = (receiver, args) => require_autoTrace.runAsAutoTraceRootFunction(rootFunctionName, () => fn.apply(receiver, args));
|
|
6124
6136
|
const maxDepth = autoTraceLimit(options.maxDepth, DEFAULT_AUTO_TRACE_MAX_DEPTH);
|
|
@@ -6488,11 +6500,12 @@ var Bitfab = class {
|
|
|
6488
6500
|
}
|
|
6489
6501
|
const methodName = method.name;
|
|
6490
6502
|
if (!methodName) throw new require_http.BitfabError("wrapBAML requires a named function (e.g., b.ClassifyText).");
|
|
6491
|
-
|
|
6503
|
+
const collectorOptions = { clientRuntime: bamlRuntimeOf(bamlClient) };
|
|
6504
|
+
loadCollectorClass(collectorOptions);
|
|
6492
6505
|
const wrappedFn = async (...args) => {
|
|
6493
|
-
const CollectorClass = await loadCollectorClass();
|
|
6506
|
+
const CollectorClass = await loadCollectorClass(collectorOptions);
|
|
6494
6507
|
if (!CollectorClass) {
|
|
6495
|
-
require_autoTrace.warnOnce("wrapBAML-collector-unavailable", `@boundaryml/baml could not be loaded, so "${methodName}" and every other wrapBAML call run untraced: no prompt, model, or token usage is recorded and onCollector is not called. If @boundaryml/baml is installed
|
|
6508
|
+
require_autoTrace.warnOnce("wrapBAML-collector-unavailable", `@boundaryml/baml could not be loaded, so "${methodName}" and every other wrapBAML call run untraced: no prompt, model, or token usage is recorded and onCollector is not called. If @boundaryml/baml is installed but your bundler hides it, add \`import "@bitfab/sdk/baml"\` once in your server code.`);
|
|
6496
6509
|
wrappedFn.collector = null;
|
|
6497
6510
|
return await bamlClient[methodName](...args);
|
|
6498
6511
|
}
|
|
@@ -7228,7 +7241,7 @@ var Bitfab = class {
|
|
|
7228
7241
|
await runWithSeedContext({ traceId }, async () => target(...args));
|
|
7229
7242
|
} finally {
|
|
7230
7243
|
try {
|
|
7231
|
-
const { flushTraces } = await Promise.resolve().then(() => require("./http-
|
|
7244
|
+
const { flushTraces } = await Promise.resolve().then(() => require("./http-7exfDbAK.cjs")).then((n) => n.http_exports);
|
|
7232
7245
|
await flushTraces(3e4);
|
|
7233
7246
|
} finally {
|
|
7234
7247
|
unrecorded = activeTraceStates.delete(traceId);
|
|
@@ -7446,7 +7459,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
|
|
|
7446
7459
|
metadata: seedCase.metadata,
|
|
7447
7460
|
sessionId: seedCase.sessionId
|
|
7448
7461
|
}));
|
|
7449
|
-
const { flushTraces } = await Promise.resolve().then(() => require("./http-
|
|
7462
|
+
const { flushTraces } = await Promise.resolve().then(() => require("./http-7exfDbAK.cjs")).then((n) => n.http_exports);
|
|
7450
7463
|
await flushTraces(3e4);
|
|
7451
7464
|
return {
|
|
7452
7465
|
pipeline,
|
|
@@ -7696,4 +7709,4 @@ Object.defineProperty(exports, "serializeReplayResult", {
|
|
|
7696
7709
|
}
|
|
7697
7710
|
});
|
|
7698
7711
|
|
|
7699
|
-
//# sourceMappingURL=src-
|
|
7712
|
+
//# sourceMappingURL=src-BMMKf1sR.cjs.map
|