@bitfab/sdk 0.65.5 → 0.65.6
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-KM9pYqk9.cjs → autoTrace-CQw0qMBt.cjs} +3 -2
- package/dist/autoTrace-CQw0qMBt.cjs.map +1 -0
- package/dist/{autoTrace-CZu0BXhG.js → autoTrace-O40k8f5M.js} +3 -2
- package/dist/autoTrace-O40k8f5M.js.map +1 -0
- package/dist/autoTrace.cjs +1 -1
- package/dist/autoTrace.d.cts +6 -2
- package/dist/autoTrace.d.ts +6 -2
- package/dist/autoTrace.js +1 -1
- package/dist/{http-CG1Irqxx.js → http-lnqCEnB1.js} +3 -3
- package/dist/{http-CG1Irqxx.js.map → http-lnqCEnB1.js.map} +1 -1
- package/dist/{index-BFkAwvuc.d.cts → index-CFOLQ1IF.d.cts} +1 -1
- package/dist/{index-BFkAwvuc.d.ts → index-CFOLQ1IF.d.ts} +1 -1
- package/dist/index.cjs +1 -1
- 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 +3 -3
- package/dist/registryCommand-Di8x0YoJ.js.map +1 -1
- package/dist/{src-CfFkki5l.js → src-BungStQw.js} +18 -14
- package/dist/{src-CfFkki5l.js.map → src-BungStQw.js.map} +1 -1
- package/dist/{src-BRKm0P_S.cjs → src-FFSCRXpz.cjs} +16 -12
- package/dist/{src-BRKm0P_S.cjs.map → src-FFSCRXpz.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/autoTrace-CZu0BXhG.js.map +0 -1
- package/dist/autoTrace-KM9pYqk9.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { C as readEnv$1, S as MixedTracingError, _ as getReplayContext, b as gitRunner, 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 replayContextReady, w as __version__, x as BitfabError, y as runWithReplayContext } from "./http-
|
|
3
|
-
import { a as clearAutoTraceNodeConfiguration, b as isAsyncStorageInitDone, c as runAsAutoTraceRootFunction, d as runWithAutoTraceRootContext, g as runWithCaptureSuppressed, h as isCaptureSuppressed, l as runWithAutoTraceEntry, m as writeOnce, n as __bitfabAutoTraceActive, o as currentAutoTraceEntries, p as warnOnce, s as invokeThroughAutoTraceEntries, u as runWithAutoTraceNodeConfiguration, v as asyncStorageReady, y as createAsyncLocalStorage } from "./autoTrace-
|
|
2
|
+
import { C as readEnv$1, S as MixedTracingError, _ as getReplayContext, b as gitRunner, 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 replayContextReady, w as __version__, x as BitfabError, y as runWithReplayContext } from "./http-lnqCEnB1.js";
|
|
3
|
+
import { a as clearAutoTraceNodeConfiguration, b as isAsyncStorageInitDone, c as runAsAutoTraceRootFunction, d as runWithAutoTraceRootContext, g as runWithCaptureSuppressed, h as isCaptureSuppressed, l as runWithAutoTraceEntry, m as writeOnce, n as __bitfabAutoTraceActive, o as currentAutoTraceEntries, p as warnOnce, s as invokeThroughAutoTraceEntries, u as runWithAutoTraceNodeConfiguration, v as asyncStorageReady, y as createAsyncLocalStorage } from "./autoTrace-O40k8f5M.js";
|
|
4
4
|
import superjson from "superjson";
|
|
5
5
|
//#region src/categories.ts
|
|
6
6
|
const CATEGORIES_PATH = "/api/sdk/categories";
|
|
@@ -4576,13 +4576,13 @@ function getCurrentSpan() {
|
|
|
4576
4576
|
addContext(context) {
|
|
4577
4577
|
try {
|
|
4578
4578
|
if (typeof context !== "object" || context === null) return;
|
|
4579
|
-
current.contexts.push(context);
|
|
4579
|
+
current.details.contexts.push(context);
|
|
4580
4580
|
} catch {}
|
|
4581
4581
|
},
|
|
4582
4582
|
setPrompt(prompt) {
|
|
4583
4583
|
try {
|
|
4584
4584
|
if (typeof prompt !== "string") return;
|
|
4585
|
-
current.prompt = prompt;
|
|
4585
|
+
current.details.prompt = prompt;
|
|
4586
4586
|
} catch {}
|
|
4587
4587
|
}
|
|
4588
4588
|
};
|
|
@@ -4863,7 +4863,7 @@ var Bitfab = class {
|
|
|
4863
4863
|
};
|
|
4864
4864
|
const autoTraceContext = {
|
|
4865
4865
|
traceFunctionKey,
|
|
4866
|
-
invoke(definition, inputs, invokeFn, entry, nodeConfiguration) {
|
|
4866
|
+
invoke(definition, inputs, invokeFn, entry, spanDetails, nodeConfiguration) {
|
|
4867
4867
|
const nameParts = definition.name.split(".");
|
|
4868
4868
|
const simpleName = nameParts[nameParts.length - 1];
|
|
4869
4869
|
const invokeWithoutNode = () => nodeConfiguration === void 0 ? invokeFn() : clearAutoTraceNodeConfiguration(invokeFn);
|
|
@@ -4883,6 +4883,7 @@ var Bitfab = class {
|
|
|
4883
4883
|
functionId: definition.id,
|
|
4884
4884
|
captureContent: true,
|
|
4885
4885
|
autoTraceDefinition: definition,
|
|
4886
|
+
spanDetails,
|
|
4886
4887
|
...declaredNode && { declaredNode },
|
|
4887
4888
|
...nodeExperimentId !== void 0 && { experimentId: nodeExperimentId },
|
|
4888
4889
|
...mockOnReplay !== void 0 && { mockOnReplay },
|
|
@@ -4891,7 +4892,7 @@ var Bitfab = class {
|
|
|
4891
4892
|
};
|
|
4892
4893
|
return openChild(entry, childOptions, inputs, definition.async === true, invokeFn);
|
|
4893
4894
|
},
|
|
4894
|
-
invokeNestedRoot(nestedName, nestedFunctionName, inputs, invokeFn, entry, link) {
|
|
4895
|
+
invokeNestedRoot(nestedName, nestedFunctionName, inputs, invokeFn, entry, link, spanDetails) {
|
|
4895
4896
|
if (excluded.has(nestedName) || excluded.has(nestedFunctionName) || !recordsSpan(entry, nestedName, true)) return invokeFn();
|
|
4896
4897
|
const childOptions = {
|
|
4897
4898
|
name: nestedName,
|
|
@@ -4901,6 +4902,7 @@ var Bitfab = class {
|
|
|
4901
4902
|
instrumentation: "trace",
|
|
4902
4903
|
captureContent: true,
|
|
4903
4904
|
declaredNode: true,
|
|
4905
|
+
spanDetails,
|
|
4904
4906
|
...link !== void 0 && { nestedTrace: link }
|
|
4905
4907
|
};
|
|
4906
4908
|
return openChild(entry, childOptions, inputs, false, invokeFn);
|
|
@@ -4919,13 +4921,15 @@ var Bitfab = class {
|
|
|
4919
4921
|
}
|
|
4920
4922
|
const link = getReplayContext() || inSeedScope() ? void 0 : { traceFunctionKey };
|
|
4921
4923
|
const rootName = rootNameFor(this);
|
|
4922
|
-
|
|
4924
|
+
const spanDetails = { contexts: [] };
|
|
4925
|
+
return invokeThroughAutoTraceEntries(enclosing, (entry, next) => entry.context.invokeNestedRoot(rootName, name, args, next, entry, link, spanDetails), () => {
|
|
4923
4926
|
if (link === void 0) return runRootFunction(this, args);
|
|
4924
4927
|
const innermost = enclosing[enclosing.length - 1];
|
|
4925
4928
|
const innermostStack = (currentAutoTraceEntries().find((entry) => entry.context === innermost.context) ?? innermost).spanStack;
|
|
4926
4929
|
const copy = innermostStack[innermostStack.length - 1];
|
|
4927
4930
|
const detachedRoot = buildTracedRoot({
|
|
4928
4931
|
...rootOptions,
|
|
4932
|
+
spanDetails,
|
|
4929
4933
|
...copy !== void 0 && { enclosingTrace: {
|
|
4930
4934
|
traceId: copy.traceId,
|
|
4931
4935
|
spanId: copy.spanId,
|
|
@@ -5091,7 +5095,7 @@ var Bitfab = class {
|
|
|
5091
5095
|
if (!root) return;
|
|
5092
5096
|
const rootId = `${root.traceId}:${root.spanId}`;
|
|
5093
5097
|
if (recordedRoots.has(rootId)) return;
|
|
5094
|
-
root.contexts.push(context);
|
|
5098
|
+
root.details.contexts.push(context);
|
|
5095
5099
|
recordedRoots.add(rootId);
|
|
5096
5100
|
}
|
|
5097
5101
|
}, options);
|
|
@@ -5232,7 +5236,7 @@ var Bitfab = class {
|
|
|
5232
5236
|
const newContext = {
|
|
5233
5237
|
traceId,
|
|
5234
5238
|
spanId,
|
|
5235
|
-
contexts: [],
|
|
5239
|
+
details: options.spanDetails ?? { contexts: [] },
|
|
5236
5240
|
spanName: options.name ?? options.nameFor?.(this) ?? qualifiedSpanName(this, functionNameAtOpen) ?? traceFunctionKey,
|
|
5237
5241
|
rootTraceFunctionKey: rootTraceFunctionKeyOfTrace(traceId, traceFunctionKey),
|
|
5238
5242
|
instrumentation: options.instrumentation ?? "span",
|
|
@@ -5296,8 +5300,8 @@ var Bitfab = class {
|
|
|
5296
5300
|
if (!(activeTraceStates.get(traceId)?.dropped === true)) self.sendWrapperSpan({
|
|
5297
5301
|
...baseSpanParams,
|
|
5298
5302
|
...params,
|
|
5299
|
-
contexts: newContext.contexts,
|
|
5300
|
-
prompt: newContext.prompt,
|
|
5303
|
+
contexts: newContext.details.contexts,
|
|
5304
|
+
prompt: newContext.details.prompt,
|
|
5301
5305
|
endedAt,
|
|
5302
5306
|
...experimentId !== void 0 && { experimentId },
|
|
5303
5307
|
...replayCtx?.inputSourceSpanId && { inputSourceSpanId: replayCtx.inputSourceSpanId }
|
|
@@ -5803,7 +5807,7 @@ var Bitfab = class {
|
|
|
5803
5807
|
await runWithSeedContext({ traceId }, async () => target(...args));
|
|
5804
5808
|
} finally {
|
|
5805
5809
|
try {
|
|
5806
|
-
const { flushTraces } = await import("./http-
|
|
5810
|
+
const { flushTraces } = await import("./http-lnqCEnB1.js").then((n) => n.a);
|
|
5807
5811
|
await flushTraces(3e4);
|
|
5808
5812
|
} finally {
|
|
5809
5813
|
unrecorded = activeTraceStates.delete(traceId);
|
|
@@ -5991,7 +5995,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
|
|
|
5991
5995
|
metadata: seedCase.metadata,
|
|
5992
5996
|
sessionId: seedCase.sessionId
|
|
5993
5997
|
}));
|
|
5994
|
-
const { flushTraces } = await import("./http-
|
|
5998
|
+
const { flushTraces } = await import("./http-lnqCEnB1.js").then((n) => n.a);
|
|
5995
5999
|
await flushTraces(3e4);
|
|
5996
6000
|
return {
|
|
5997
6001
|
pipeline,
|
|
@@ -6008,4 +6012,4 @@ function resolveTraceFunctionKey(registration) {
|
|
|
6008
6012
|
//#endregion
|
|
6009
6013
|
export { SUPPORTED_PROVIDERS as A, BitfabOpenAIAgentHandler as C, LabelsClient as D, BitfabLangGraphCallbackHandler as E, DEFAULT_SERVICE_URL as F, AssertionCategoriesClient as I, CategoriesClient as L, GraderRerunError as M, GraderRerunTimeoutError as N, GradersClient as O, BitfabClaudeAgentHandler as P, OrganizationMembersClient as S, BitfabLangGraphIntegration 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, DatasetsClient as j, ExperimentsClient 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, NO_MOCK_OVERRIDE as w, serializeReplayResult as x, ReplayError as y };
|
|
6010
6014
|
|
|
6011
|
-
//# sourceMappingURL=src-
|
|
6015
|
+
//# sourceMappingURL=src-BungStQw.js.map
|