@bitfab/sdk 0.76.0 → 0.76.2
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/{http-CWOvmnGL.cjs → http-DscPFMlr.cjs} +67 -2
- package/dist/{http-DeWpv44r.js.map → http-DscPFMlr.cjs.map} +1 -1
- package/dist/{http-DeWpv44r.js → http-wadCG_ec.js} +56 -3
- package/dist/http-wadCG_ec.js.map +1 -0
- package/dist/{index-Dx3MwCB4.d.cts → index-D5NpBqF3.d.cts} +24 -1
- package/dist/{index-Dx3MwCB4.d.ts → index-D5NpBqF3.d.ts} +24 -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/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-D1VgfJjC.js → registryCommand-M1u4H9PI.js} +30 -14
- package/dist/registryCommand-M1u4H9PI.js.map +1 -0
- package/dist/replayCli.js +1 -1
- package/dist/seedCli.js +1 -1
- package/dist/{src-CxsswRYd.cjs → src-B6zSnPpb.cjs} +18 -22
- package/dist/src-B6zSnPpb.cjs.map +1 -0
- package/dist/{src-CFD_cP43.js → src-CcYVtNMw.js} +18 -22
- package/dist/src-CcYVtNMw.js.map +1 -0
- package/package.json +1 -1
- package/dist/http-CWOvmnGL.cjs.map +0 -1
- package/dist/registryCommand-D1VgfJjC.js.map +0 -1
- package/dist/src-CFD_cP43.js.map +0 -1
- package/dist/src-CxsswRYd.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { C as BitfabError, E as __version__, S as gitRunner, T as
|
|
2
|
+
import { C as BitfabError, D as readEnv$1, E as serializeError, O as __version__, S as gitRunner, T as describeError, _ as MAX_SPAN_CARRIER_BYTES, b as replayContextReady, c as recordCallerTraceMetadata, f as ROOT_TRACE_FUNCTION_KEY_FIELD, g as MAX_COMPRESSIBLE_SPAN_CARRIER_BYTES, h as makeSpanOrigin, i as flushTraces, l as retireTraceMetadata, m as isFrameworkInstrumentation, n as SPAN_TYPES, o as unrefTimer, p as SimulationPlan, r as experimentIdWireFields, s as callerTraceMetadata, t as HttpClient, v as byteLength, w as MixedTracingError, x as runWithReplayContext, y as getReplayContext } from "./http-wadCG_ec.js";
|
|
3
3
|
import { A as recordWatchedClientCall, B as installLangChainRunScopes, C as OPENAI_RESPONSES, D as clientCallStreams, E as clientCallProvider, F as mapOpenAiAgentsTrace, G as isCaptureSuppressed, I as openAiAgentsParentSpanId, J as asyncStorageReady, K as runWithCaptureSuppressed, L as openAiAgentsSpanChain, M as watchClientCall, N as StreamFinalizationError, O as frameworkRecordsClientCall, P as endOpenAiAgentsSpan, R as unmapOpenAiAgentsTrace, S as OPENAI_EMBEDDINGS, T as OPENROUTER, U as warnOnce, V as markLangChainRunRecorded, W as writeOnce, X as isAsyncStorageInitDone, Y as createAsyncLocalStorage, _ as runWithAutoTraceNodeConfiguration, b as GEMINI, d as currentAutoTraceEntries, g as runWithAutoTraceFramesAt, h as runWithAutoTraceEntry, j as sharedClientCallStreamRecording, k as recordAutoTracedClientCall, m as runAsAutoTraceRootFunction, p as invokeThroughAutoTraceEntries, s as __bitfabAutoTraceActive, u as clearAutoTraceNodeConfiguration, v as runWithAutoTraceRootContext, w as OPENAI_TRANSCRIPTIONS, x as OPENAI_CHAT, y as ANTHROPIC, z as forgetLangChainRun } from "./autoTrace-BgN0zCQf.js";
|
|
4
4
|
import { t as importOptionalPeer } from "./optionalPeer-CczrzrXx.js";
|
|
5
5
|
import { t as loadBamlModule } from "./bamlPeer-Dyeb3e5o.js";
|
|
@@ -4022,22 +4022,10 @@ function errorMessage(error) {
|
|
|
4022
4022
|
}
|
|
4023
4023
|
function replayItemErrorMessage(error) {
|
|
4024
4024
|
if (error instanceof DbBranchReplayError) return `Replay requested a database branch for trace ${error.originalTraceId} but it could not be resolved (${error.code}): ${error.message}. The function was not run, because replaying it against the live database would produce a result that looks valid but did not use the historical data you asked for.`;
|
|
4025
|
-
return
|
|
4025
|
+
return describeError(error);
|
|
4026
4026
|
}
|
|
4027
4027
|
function replayJsonReplacer(_key, value) {
|
|
4028
|
-
if (value instanceof Error) {
|
|
4029
|
-
const serialized = {
|
|
4030
|
-
name: value.name,
|
|
4031
|
-
message: value.message,
|
|
4032
|
-
stack: value.stack
|
|
4033
|
-
};
|
|
4034
|
-
if (value instanceof DbBranchReplayError) {
|
|
4035
|
-
serialized.code = value.code;
|
|
4036
|
-
serialized.originalTraceId = value.originalTraceId;
|
|
4037
|
-
if (value.cause !== void 0) serialized.cause = value.cause;
|
|
4038
|
-
}
|
|
4039
|
-
return serialized;
|
|
4040
|
-
}
|
|
4028
|
+
if (value instanceof Error) return serializeError(value, (error) => error instanceof DbBranchReplayError ? { originalTraceId: error.originalTraceId } : {});
|
|
4041
4029
|
return value;
|
|
4042
4030
|
}
|
|
4043
4031
|
function serializeReplayResult(result) {
|
|
@@ -4216,7 +4204,7 @@ async function processItem(httpClient, serverItem, fn, experimentId, mockStrateg
|
|
|
4216
4204
|
} catch (e) {
|
|
4217
4205
|
if (replayStarted !== null) replayDurationMs = Math.round(performance.now() - replayStarted);
|
|
4218
4206
|
traceError = e;
|
|
4219
|
-
error =
|
|
4207
|
+
error = describeError(e);
|
|
4220
4208
|
}
|
|
4221
4209
|
} catch (e) {
|
|
4222
4210
|
if (replayStarted !== null) replayDurationMs = Math.round(performance.now() - replayStarted);
|
|
@@ -5700,7 +5688,7 @@ function wrapAsyncGenerator(source, spanStack, sendSpan, recordYielded) {
|
|
|
5700
5688
|
} else yielded.push(result.value);
|
|
5701
5689
|
return result;
|
|
5702
5690
|
} catch (error) {
|
|
5703
|
-
finalize(
|
|
5691
|
+
finalize(describeError(error));
|
|
5704
5692
|
throw error;
|
|
5705
5693
|
}
|
|
5706
5694
|
};
|
|
@@ -5863,10 +5851,12 @@ function isSpanType(value) {
|
|
|
5863
5851
|
const noOpSpan = {
|
|
5864
5852
|
id: "",
|
|
5865
5853
|
traceId: "",
|
|
5854
|
+
traceFunctionKeys: [],
|
|
5866
5855
|
addContext() {},
|
|
5867
5856
|
setPrompt() {}
|
|
5868
5857
|
};
|
|
5869
5858
|
const noOpTrace = {
|
|
5859
|
+
traceFunctionKey: "",
|
|
5870
5860
|
setSessionId() {},
|
|
5871
5861
|
setName() {},
|
|
5872
5862
|
setMetadata() {},
|
|
@@ -5881,6 +5871,9 @@ function currentTraceRootSpan() {
|
|
|
5881
5871
|
if (context?.isRoot && context.traceId === traceId) return context;
|
|
5882
5872
|
}
|
|
5883
5873
|
}
|
|
5874
|
+
function activeTraceFunctionKeys(stack) {
|
|
5875
|
+
return [.../* @__PURE__ */ new Set([...currentAutoTraceEntries().map((entry) => entry.context.traceFunctionKey), ...stack.map((context) => context.traceFunctionKey)])];
|
|
5876
|
+
}
|
|
5884
5877
|
function getCurrentSpan() {
|
|
5885
5878
|
const stack = getSpanStack();
|
|
5886
5879
|
const current = stack[stack.length - 1];
|
|
@@ -5888,6 +5881,7 @@ function getCurrentSpan() {
|
|
|
5888
5881
|
return {
|
|
5889
5882
|
id: current.spanId,
|
|
5890
5883
|
traceId: current.traceId,
|
|
5884
|
+
traceFunctionKeys: activeTraceFunctionKeys(stack),
|
|
5891
5885
|
addContext(context) {
|
|
5892
5886
|
try {
|
|
5893
5887
|
if (typeof context !== "object" || context === null) return;
|
|
@@ -5927,6 +5921,7 @@ function getCurrentTrace() {
|
|
|
5927
5921
|
return traceState;
|
|
5928
5922
|
};
|
|
5929
5923
|
return {
|
|
5924
|
+
traceFunctionKey: current.rootTraceFunctionKey,
|
|
5930
5925
|
setSessionId(sessionId) {
|
|
5931
5926
|
try {
|
|
5932
5927
|
const traceState = getOrCreateTraceState();
|
|
@@ -6663,6 +6658,7 @@ var Bitfab = class {
|
|
|
6663
6658
|
spanId,
|
|
6664
6659
|
details: options.spanDetails ?? { contexts: [] },
|
|
6665
6660
|
spanName: options.name ?? options.nameFor?.(this) ?? qualifiedSpanName(this, functionNameAtOpen) ?? traceFunctionKey,
|
|
6661
|
+
traceFunctionKey,
|
|
6666
6662
|
rootTraceFunctionKey: rootTraceFunctionKeyOfTrace(traceId, traceFunctionKey),
|
|
6667
6663
|
instrumentation: options.instrumentation ?? "span",
|
|
6668
6664
|
declaredNode: options.declaredNode === true,
|
|
@@ -6788,7 +6784,7 @@ var Bitfab = class {
|
|
|
6788
6784
|
} catch (error) {
|
|
6789
6785
|
sendSpan({
|
|
6790
6786
|
result: void 0,
|
|
6791
|
-
error:
|
|
6787
|
+
error: describeError(error)
|
|
6792
6788
|
});
|
|
6793
6789
|
throw error;
|
|
6794
6790
|
}
|
|
@@ -6798,7 +6794,7 @@ var Bitfab = class {
|
|
|
6798
6794
|
}).catch((error) => {
|
|
6799
6795
|
sendSpan({
|
|
6800
6796
|
result: void 0,
|
|
6801
|
-
error:
|
|
6797
|
+
error: describeError(error)
|
|
6802
6798
|
});
|
|
6803
6799
|
throw error;
|
|
6804
6800
|
});
|
|
@@ -7232,7 +7228,7 @@ var Bitfab = class {
|
|
|
7232
7228
|
await runWithSeedContext({ traceId }, async () => target(...args));
|
|
7233
7229
|
} finally {
|
|
7234
7230
|
try {
|
|
7235
|
-
const { flushTraces } = await import("./http-
|
|
7231
|
+
const { flushTraces } = await import("./http-wadCG_ec.js").then((n) => n.a);
|
|
7236
7232
|
await flushTraces(3e4);
|
|
7237
7233
|
} finally {
|
|
7238
7234
|
unrecorded = activeTraceStates.delete(traceId);
|
|
@@ -7450,7 +7446,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
|
|
|
7450
7446
|
metadata: seedCase.metadata,
|
|
7451
7447
|
sessionId: seedCase.sessionId
|
|
7452
7448
|
}));
|
|
7453
|
-
const { flushTraces } = await import("./http-
|
|
7449
|
+
const { flushTraces } = await import("./http-wadCG_ec.js").then((n) => n.a);
|
|
7454
7450
|
await flushTraces(3e4);
|
|
7455
7451
|
return {
|
|
7456
7452
|
pipeline,
|
|
@@ -7467,4 +7463,4 @@ function resolveTraceFunctionKey(registration) {
|
|
|
7467
7463
|
//#endregion
|
|
7468
7464
|
export { VerdictsClient as A, OrganizationMembersClient as C, BitfabLangGraphCallbackHandler as D, BitfabLangGraphIntegration as E, GraderRerunTimeoutError as F, BitfabClaudeAgentHandler as I, DEFAULT_SERVICE_URL as L, SUPPORTED_PROVIDERS as M, DatasetsClient as N, GradersClient as O, GraderRerunError as P, AssertionCategoriesClient as R, BitfabPiIntegration as S, NO_MOCK_OVERRIDE as T, BITFAB_PROGRESS_PREFIX as _, Bitfab as a, reportReplayProgress as b, getCurrentSpan as c, BitfabOpenAITracingProcessor as d, AssertionGenerationError as f, BitfabRivetIntegration as g, SpansClient as h, finalizers as i, ExperimentsClient as j, LabelsClient as k, getCurrentTrace as l, TracesClient as m, reseedFromRegistry as n, BitfabFunction as o, AssertionGenerationTimeoutError as p, seedFromRegistry as r, getCurrentReplayBranch as s, defineReplayRegistry as t, BitfabVercelAiHandler as u, DbBranchReplayError as v, BitfabOpenAIAgentHandler as w, serializeReplayResult as x, ReplayError as y, CategoriesClient as z };
|
|
7469
7465
|
|
|
7470
|
-
//# sourceMappingURL=src-
|
|
7466
|
+
//# sourceMappingURL=src-CcYVtNMw.js.map
|