@bitfab/sdk 0.74.3 → 0.74.5
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-Dd0XLEqA.js → http-C_t7m9b_.js} +4 -3
- package/dist/{http-Dd0XLEqA.js.map → http-C_t7m9b_.js.map} +1 -1
- package/dist/{http-BHgwaBjv.cjs → http-DNmzk2gf.cjs} +4 -3
- package/dist/{http-BHgwaBjv.cjs.map → http-DNmzk2gf.cjs.map} +1 -1
- package/dist/{index-eZPhpygX.d.cts → index-PwbvfBty.d.cts} +52 -9
- package/dist/{index-eZPhpygX.d.ts → index-PwbvfBty.d.ts} +52 -9
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/node.cjs +2 -2
- package/dist/node.d.cts +2 -2
- package/dist/node.d.ts +2 -2
- package/dist/node.js +2 -2
- package/dist/{registryCommand-BQcyBmhN.js → registryCommand-Bm2-Peq8.js} +27 -12
- package/dist/registryCommand-Bm2-Peq8.js.map +1 -0
- package/dist/replayCli.js +1 -1
- package/dist/seedCli.js +1 -1
- package/dist/{src-KAtu1Cmn.cjs → src-B7Xv4aR2.cjs} +18 -7
- package/dist/src-B7Xv4aR2.cjs.map +1 -0
- package/dist/{src-v9Cp4amm.js → src-Ch86hs9i.js} +18 -7
- package/dist/src-Ch86hs9i.js.map +1 -0
- package/package.json +1 -1
- package/dist/registryCommand-BQcyBmhN.js.map +0 -1
- package/dist/src-KAtu1Cmn.cjs.map +0 -1
- package/dist/src-v9Cp4amm.js.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 readEnv$1, _ 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-
|
|
2
|
+
import { C as BitfabError, E as __version__, S as gitRunner, T as readEnv$1, _ 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-C_t7m9b_.js";
|
|
3
3
|
import { A as unmapOpenAiAgentsTrace, B as asyncStorageReady, C as recordAutoTracedClientCall, D as mapOpenAiAgentsTrace, E as endOpenAiAgentsSpan, F as warnOnce, H as isAsyncStorageInitDone, I as writeOnce, L as isCaptureSuppressed, M as installLangChainRunScopes, N as markLangChainRunRecorded, O as openAiAgentsParentSpanId, R as runWithCaptureSuppressed, S as frameworkRecordsClientCall, T as watchClientCall, V as createAsyncLocalStorage, _ as runWithAutoTraceRootContext, b as OPENROUTER, f as invokeThroughAutoTraceEntries, g as runWithAutoTraceNodeConfiguration, h as runWithAutoTraceFramesAt, j as forgetLangChainRun, k as openAiAgentsSpanChain, l as clearAutoTraceNodeConfiguration, m as runWithAutoTraceEntry, o as __bitfabAutoTraceActive, p as runAsAutoTraceRootFunction, u as currentAutoTraceEntries, v as ANTHROPIC, w as recordWatchedClientCall, x as clientCallProvider, y as OPENAI_RESPONSES } from "./autoTrace-kHOBg49M.js";
|
|
4
4
|
import { t as importOptionalPeer } from "./optionalPeer-CczrzrXx.js";
|
|
5
5
|
import { t as loadBamlModule } from "./bamlPeer-Dyeb3e5o.js";
|
|
@@ -3735,6 +3735,7 @@ const RESUME_CONFLICTING_OPTIONS = [
|
|
|
3735
3735
|
"attempts",
|
|
3736
3736
|
"graderIds",
|
|
3737
3737
|
"onlyWithAssertions",
|
|
3738
|
+
"categoryIds",
|
|
3738
3739
|
"dryRun",
|
|
3739
3740
|
"experimentalSelectiveReplay"
|
|
3740
3741
|
];
|
|
@@ -3842,6 +3843,7 @@ const REPLAY_OPTION_NAMES = [
|
|
|
3842
3843
|
"datasetIds",
|
|
3843
3844
|
"graderIds",
|
|
3844
3845
|
"onlyWithAssertions",
|
|
3846
|
+
"categoryIds",
|
|
3845
3847
|
"skipAssertionJudging",
|
|
3846
3848
|
"judgeAssertions",
|
|
3847
3849
|
"adaptInputs",
|
|
@@ -4212,6 +4214,10 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
4212
4214
|
if (options.traceIds.length > 100) throw new BitfabError(`traceIds supports at most 100 trace IDs per replay (got ${options.traceIds.length}).`);
|
|
4213
4215
|
}
|
|
4214
4216
|
const datasetIds = resolveDatasetIds(options);
|
|
4217
|
+
if (options?.categoryIds !== void 0) {
|
|
4218
|
+
if (options.categoryIds.length === 0) throw new BitfabError("categoryIds must contain at least one category ID.");
|
|
4219
|
+
if (options.traceIds === void 0 && datasetIds === void 0) throw new BitfabError("categoryIds narrows a trace ID or dataset selection. Pass it with traceIds, datasetId or datasetIds.");
|
|
4220
|
+
}
|
|
4215
4221
|
if (options?.limit !== void 0 && options?.traceIds !== void 0) try {
|
|
4216
4222
|
console.warn("Bitfab: limit is ignored when traceIds is passed: the explicit trace ID list already determines how many traces replay.");
|
|
4217
4223
|
} catch {}
|
|
@@ -4223,7 +4229,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
|
|
|
4223
4229
|
const includeDbBranchLease = dbBranchEnabled(options?.dbBranch) && options?.dryRun !== true;
|
|
4224
4230
|
let session;
|
|
4225
4231
|
if (options?.resume === void 0) {
|
|
4226
|
-
const started = await httpClient.startReplay(traceFunctionKey, options?.traceIds ? void 0 : options?.limit ?? 5, options?.traceIds, options?.name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, options?.experimentGroupId, datasetIds, options?.graderIds, resolveDbBranchSettings(options?.dbBranch), requestedAttempts, options?.adaptInputs !== void 0, options?.onlyWithAssertions, options?.skipAssertionJudging === true || options?.judgeAssertions === false, options?.experimentalSelectiveReplay, options?.notes, options?.metadata, options?.dryRun === true, options?.experimentGroupName, safeReplayInvocation(() => buildReplayInvocation(Object.entries(cliFlags(options) ?? explicitReplayOptions(options)))), codeChangeType);
|
|
4232
|
+
const started = await httpClient.startReplay(traceFunctionKey, options?.traceIds ? void 0 : options?.limit ?? 5, options?.traceIds, options?.name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, options?.experimentGroupId, datasetIds, options?.graderIds, resolveDbBranchSettings(options?.dbBranch), requestedAttempts, options?.adaptInputs !== void 0, options?.onlyWithAssertions, options?.skipAssertionJudging === true || options?.judgeAssertions === false, options?.experimentalSelectiveReplay, options?.notes, options?.metadata, options?.dryRun === true, options?.experimentGroupName, safeReplayInvocation(() => buildReplayInvocation(Object.entries(cliFlags(options) ?? explicitReplayOptions(options)))), codeChangeType, options?.categoryIds);
|
|
4227
4233
|
if (started.items.length === 0) try {
|
|
4228
4234
|
console.warn(`Bitfab: no traces matched "${traceFunctionKey}", so this replay ran nothing. Capture a trace, or seed one with seedTrace, before replaying.`);
|
|
4229
4235
|
} catch {}
|
|
@@ -4952,6 +4958,7 @@ var SpansClient = class {
|
|
|
4952
4958
|
//#region src/traces.ts
|
|
4953
4959
|
const ASSERTIONS_PATH = "/api/sdk/traces/assertions";
|
|
4954
4960
|
const SEARCH_PATH = "/api/sdk/traces/search";
|
|
4961
|
+
const CODE_DRAFT_SAVE_TIMEOUT_MS = 3e5;
|
|
4955
4962
|
const DEFAULT_GENERATION_TIMEOUT_MS = 6e5;
|
|
4956
4963
|
const GENERATION_POLL_INTERVAL_MS = 2e3;
|
|
4957
4964
|
var AssertionGenerationError = class extends Error {
|
|
@@ -5001,6 +5008,9 @@ function toWireAssertion({ category_assertion_id, ...assertion }) {
|
|
|
5001
5008
|
category_id: categoryId
|
|
5002
5009
|
};
|
|
5003
5010
|
}
|
|
5011
|
+
function asksBitfabToWriteCode(assertion) {
|
|
5012
|
+
return (assertion.kind === "code" || assertion.kind === "hybrid") && assertion.code === void 0;
|
|
5013
|
+
}
|
|
5004
5014
|
function traceAssertionsPath(traceId, suffix = "") {
|
|
5005
5015
|
return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
|
|
5006
5016
|
}
|
|
@@ -5033,14 +5043,15 @@ var TracesClient = class {
|
|
|
5033
5043
|
}
|
|
5034
5044
|
async saveAssertionsAll(params) {
|
|
5035
5045
|
if (params.updates.length === 0) return [];
|
|
5036
|
-
|
|
5046
|
+
const body = {
|
|
5037
5047
|
updates: params.updates.map((update) => ({
|
|
5038
5048
|
...update,
|
|
5039
5049
|
assertions: update.assertions.map(toWireAssertion)
|
|
5040
5050
|
})),
|
|
5041
5051
|
source: params.source ?? "agent",
|
|
5042
5052
|
guidedRewrite: params.skipGuidedRewrite !== true
|
|
5043
|
-
}
|
|
5053
|
+
};
|
|
5054
|
+
return withCategoryIds((params.updates.some((update) => update.assertions.some(asksBitfabToWriteCode)) ? await this.httpClient.request(ASSERTIONS_PATH, body, { timeout: CODE_DRAFT_SAVE_TIMEOUT_MS }) : await this.httpClient.request(ASSERTIONS_PATH, body)).assertions);
|
|
5044
5055
|
}
|
|
5045
5056
|
async generateAssertions(traceId, options = {}) {
|
|
5046
5057
|
const started = await this.httpClient.request(traceAssertionsPath(traceId, "/generate"), {
|
|
@@ -7073,7 +7084,7 @@ var Bitfab = class {
|
|
|
7073
7084
|
await runWithSeedContext({ traceId }, async () => target(...args));
|
|
7074
7085
|
} finally {
|
|
7075
7086
|
try {
|
|
7076
|
-
const { flushTraces } = await import("./http-
|
|
7087
|
+
const { flushTraces } = await import("./http-C_t7m9b_.js").then((n) => n.a);
|
|
7077
7088
|
await flushTraces(3e4);
|
|
7078
7089
|
} finally {
|
|
7079
7090
|
unrecorded = activeTraceStates.delete(traceId);
|
|
@@ -7279,7 +7290,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
|
|
|
7279
7290
|
metadata: seedCase.metadata,
|
|
7280
7291
|
sessionId: seedCase.sessionId
|
|
7281
7292
|
}));
|
|
7282
|
-
const { flushTraces } = await import("./http-
|
|
7293
|
+
const { flushTraces } = await import("./http-C_t7m9b_.js").then((n) => n.a);
|
|
7283
7294
|
await flushTraces(3e4);
|
|
7284
7295
|
return {
|
|
7285
7296
|
pipeline,
|
|
@@ -7296,4 +7307,4 @@ function resolveTraceFunctionKey(registration) {
|
|
|
7296
7307
|
//#endregion
|
|
7297
7308
|
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 };
|
|
7298
7309
|
|
|
7299
|
-
//# sourceMappingURL=src-
|
|
7310
|
+
//# sourceMappingURL=src-Ch86hs9i.js.map
|