@bitfab/sdk 0.65.6 → 0.65.7

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.
@@ -1,5 +1,5 @@
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-lnqCEnB1.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-BaLzqv9W.js";
3
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
@@ -4709,7 +4709,10 @@ var Bitfab = class {
4709
4709
  serviceUrl: this.serviceUrl,
4710
4710
  timeout: this.timeout
4711
4711
  });
4712
- this.simulationPlan = new SimulationPlan(this.httpClient, config.simulationPlan ?? true);
4712
+ this.simulationPlan = new SimulationPlan({
4713
+ getSimulationPlan: () => this.httpClient.getSimulationPlan(),
4714
+ canRead: () => this.canReadSimulationPlan()
4715
+ }, config.simulationPlan ?? true);
4713
4716
  this.httpClient.externalSpanTransform = (payload, submit, drop) => this.applySimulationPlan(payload, submit, drop);
4714
4717
  this.httpClient.externalTraceTransform = (payload, submit) => this.simulationPlan.sendTrace(payload, submit);
4715
4718
  this.httpClient.releaseHeldExternalSpans = (timeoutMs) => this.simulationPlan.release(timeoutMs);
@@ -4981,6 +4984,9 @@ var Bitfab = class {
4981
4984
  if (!this.isCaptureConfigured() && !getReplayContext() && !inSeedScope()) return false;
4982
4985
  return this.resolveApiKey() !== void 0;
4983
4986
  }
4987
+ canReadSimulationPlan() {
4988
+ return ((this.captureConfiguredInCode ?? this.captureConfiguredFromEnv ?? readBooleanEnv(CAPTURE_ENABLED_ENV) ?? true) || getReplayContext() !== null || inSeedScope()) && this.findApiKey(true) !== void 0;
4989
+ }
4984
4990
  prepareFrameworkIntegration() {
4985
4991
  if (this.isCaptureConfigured() && this.strict) this.resolveApiKey();
4986
4992
  }
@@ -5807,7 +5813,7 @@ var Bitfab = class {
5807
5813
  await runWithSeedContext({ traceId }, async () => target(...args));
5808
5814
  } finally {
5809
5815
  try {
5810
- const { flushTraces } = await import("./http-lnqCEnB1.js").then((n) => n.a);
5816
+ const { flushTraces } = await import("./http-BaLzqv9W.js").then((n) => n.a);
5811
5817
  await flushTraces(3e4);
5812
5818
  } finally {
5813
5819
  unrecorded = activeTraceStates.delete(traceId);
@@ -5995,7 +6001,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
5995
6001
  metadata: seedCase.metadata,
5996
6002
  sessionId: seedCase.sessionId
5997
6003
  }));
5998
- const { flushTraces } = await import("./http-lnqCEnB1.js").then((n) => n.a);
6004
+ const { flushTraces } = await import("./http-BaLzqv9W.js").then((n) => n.a);
5999
6005
  await flushTraces(3e4);
6000
6006
  return {
6001
6007
  pipeline,
@@ -6012,4 +6018,4 @@ function resolveTraceFunctionKey(registration) {
6012
6018
  //#endregion
6013
6019
  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 };
6014
6020
 
6015
- //# sourceMappingURL=src-BungStQw.js.map
6021
+ //# sourceMappingURL=src-BblbvWfU.js.map