bitfab 0.53.2 → 0.53.4

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.
Files changed (41) hide show
  1. package/dist/autoTrace.cjs +10 -2
  2. package/dist/autoTrace.cjs.map +1 -1
  3. package/dist/autoTrace.js +2 -2
  4. package/dist/{chunk-6SPWEVFD.js → chunk-53RMN23L.js} +12 -11
  5. package/dist/chunk-53RMN23L.js.map +1 -0
  6. package/dist/{chunk-S4UK5HNW.js → chunk-DIYUW2KO.js} +20 -2
  7. package/dist/chunk-DIYUW2KO.js.map +1 -0
  8. package/dist/{chunk-E5BLYL5X.js → chunk-EGWJYCNT.js} +6 -5
  9. package/dist/chunk-EGWJYCNT.js.map +1 -0
  10. package/dist/{chunk-V3KD7B3B.js → chunk-JKVR5436.js} +11 -2
  11. package/dist/chunk-JKVR5436.js.map +1 -0
  12. package/dist/{chunk-JZAKQDGR.js → chunk-RZC7MYVZ.js} +10 -4
  13. package/dist/chunk-RZC7MYVZ.js.map +1 -0
  14. package/dist/{chunk-H6LZRFMN.js → chunk-VCRFFCLY.js} +20 -2
  15. package/dist/chunk-VCRFFCLY.js.map +1 -0
  16. package/dist/{chunk-3LSPOHL7.js → chunk-YD5XI5YH.js} +3 -3
  17. package/dist/chunk-YD5XI5YH.js.map +1 -0
  18. package/dist/{http-PUEEHMKU.js → http-7WGJNBGI.js} +3 -3
  19. package/dist/{http-LOZSAC23.js → http-VRS3FQU3.js} +2 -2
  20. package/dist/index.cjs +43 -4
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +5 -5
  25. package/dist/node.cjs +43 -4
  26. package/dist/node.cjs.map +1 -1
  27. package/dist/node.js +5 -5
  28. package/dist/{replay-SSJ72WEI.js → replay-LRCSZ7IX.js} +4 -4
  29. package/dist/replayCli.js +2 -2
  30. package/dist/seedCli.js +2 -2
  31. package/package.json +1 -1
  32. package/dist/chunk-3LSPOHL7.js.map +0 -1
  33. package/dist/chunk-6SPWEVFD.js.map +0 -1
  34. package/dist/chunk-E5BLYL5X.js.map +0 -1
  35. package/dist/chunk-H6LZRFMN.js.map +0 -1
  36. package/dist/chunk-JZAKQDGR.js.map +0 -1
  37. package/dist/chunk-S4UK5HNW.js.map +0 -1
  38. package/dist/chunk-V3KD7B3B.js.map +0 -1
  39. /package/dist/{http-LOZSAC23.js.map → http-7WGJNBGI.js.map} +0 -0
  40. /package/dist/{http-PUEEHMKU.js.map → http-VRS3FQU3.js.map} +0 -0
  41. /package/dist/{replay-SSJ72WEI.js.map → replay-LRCSZ7IX.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -3344,7 +3344,7 @@ interface CommitRef {
3344
3344
  /**
3345
3345
  * SDK version from package.json (injected at build time)
3346
3346
  */
3347
- declare const __version__ = "0.53.2";
3347
+ declare const __version__ = "0.53.4";
3348
3348
 
3349
3349
  /**
3350
3350
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -3344,7 +3344,7 @@ interface CommitRef {
3344
3344
  /**
3345
3345
  * SDK version from package.json (injected at build time)
3346
3346
  */
3347
- declare const __version__ = "0.53.2";
3347
+ declare const __version__ = "0.53.4";
3348
3348
 
3349
3349
  /**
3350
3350
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -28,8 +28,8 @@ import {
28
28
  getCurrentTrace,
29
29
  reseedFromRegistry,
30
30
  seedFromRegistry
31
- } from "./chunk-6SPWEVFD.js";
32
- import "./chunk-E5BLYL5X.js";
31
+ } from "./chunk-53RMN23L.js";
32
+ import "./chunk-EGWJYCNT.js";
33
33
  import {
34
34
  BITFAB_PROGRESS_PREFIX,
35
35
  DbBranchReplayError,
@@ -37,7 +37,7 @@ import {
37
37
  ReplayError,
38
38
  reportReplayProgress,
39
39
  serializeReplayResult
40
- } from "./chunk-V3KD7B3B.js";
40
+ } from "./chunk-JKVR5436.js";
41
41
  import {
42
42
  BitfabError,
43
43
  DEFAULT_SERVICE_URL,
@@ -45,8 +45,8 @@ import {
45
45
  MixedTracingError,
46
46
  __version__,
47
47
  flushTraces
48
- } from "./chunk-JZAKQDGR.js";
49
- import "./chunk-H6LZRFMN.js";
48
+ } from "./chunk-RZC7MYVZ.js";
49
+ import "./chunk-VCRFFCLY.js";
50
50
  export {
51
51
  BITFAB_PROGRESS_PREFIX,
52
52
  Bitfab,
package/dist/node.cjs CHANGED
@@ -97,7 +97,7 @@ var __version__, __packageName__;
97
97
  var init_version_generated = __esm({
98
98
  "src/version.generated.ts"() {
99
99
  "use strict";
100
- __version__ = "0.53.2";
100
+ __version__ = "0.53.4";
101
101
  __packageName__ = "bitfab";
102
102
  }
103
103
  });
@@ -274,6 +274,28 @@ var init_replayContext = __esm({
274
274
  }
275
275
  });
276
276
 
277
+ // src/captureSuppression.ts
278
+ function isCaptureSuppressed() {
279
+ return suppressionState.depth > 0;
280
+ }
281
+ function runWithCaptureSuppressed(fn) {
282
+ suppressionState.depth += 1;
283
+ try {
284
+ return fn();
285
+ } finally {
286
+ suppressionState.depth -= 1;
287
+ }
288
+ }
289
+ var suppressionGlobal, suppressionState;
290
+ var init_captureSuppression = __esm({
291
+ "src/captureSuppression.ts"() {
292
+ "use strict";
293
+ suppressionGlobal = globalThis;
294
+ suppressionState = suppressionGlobal.__bitfabCaptureSuppressionV1 ?? { depth: 0 };
295
+ suppressionGlobal.__bitfabCaptureSuppressionV1 = suppressionState;
296
+ }
297
+ });
298
+
277
299
  // src/payloadBudget.ts
278
300
  function byteLength(value) {
279
301
  return textEncoder ? textEncoder.encode(value).length : value.length;
@@ -424,6 +446,11 @@ var init_warnOnce = __esm({
424
446
 
425
447
  // src/serializePayload.ts
426
448
  function serializePayloadBody(payload, maxCarrierBytes = MAX_SPAN_CARRIER_BYTES) {
449
+ return runWithCaptureSuppressed(
450
+ () => encodeWithinBudget(payload, maxCarrierBytes)
451
+ );
452
+ }
453
+ function encodeWithinBudget(payload, maxCarrierBytes) {
427
454
  const encoded = encodePayloadBody(payload);
428
455
  if (fitsCarrierBudget(encoded.body, maxCarrierBytes)) {
429
456
  return { body: encoded.body, dropped: encoded.dropped };
@@ -548,6 +575,7 @@ function encodePayloadBody(payload) {
548
575
  var init_serializePayload = __esm({
549
576
  "src/serializePayload.ts"() {
550
577
  "use strict";
578
+ init_captureSuppression();
551
579
  init_payloadBudget();
552
580
  init_warnOnce();
553
581
  }
@@ -2730,6 +2758,9 @@ function unserializableStub(value, reason) {
2730
2758
  return { json: summary };
2731
2759
  }
2732
2760
  function serializeValue(value) {
2761
+ return runWithCaptureSuppressed(() => serializeWithSuperjson(value));
2762
+ }
2763
+ function serializeWithSuperjson(value) {
2733
2764
  try {
2734
2765
  const { json, meta } = import_superjson.default.serialize(value);
2735
2766
  let size;
@@ -2763,6 +2794,9 @@ function toJsonSafe(value) {
2763
2794
  return toJsonSafeReport(value).safe;
2764
2795
  }
2765
2796
  function toJsonSafeReport(value) {
2797
+ return runWithCaptureSuppressed(() => jsonSafeReport(value));
2798
+ }
2799
+ function jsonSafeReport(value) {
2766
2800
  const dropped = [];
2767
2801
  const safe = toJsonSafeInner(value, 0, /* @__PURE__ */ new WeakSet(), dropped);
2768
2802
  try {
@@ -2848,6 +2882,7 @@ var init_serialize = __esm({
2848
2882
  "src/serialize.ts"() {
2849
2883
  "use strict";
2850
2884
  import_superjson = __toESM(require("superjson"), 1);
2885
+ init_captureSuppression();
2851
2886
  init_payloadBudget();
2852
2887
  init_warnOnce();
2853
2888
  MAX_SERIALIZED_BYTES = MAX_COMPRESSIBLE_SPAN_CARRIER_BYTES;
@@ -4754,6 +4789,7 @@ init_asyncStorage();
4754
4789
 
4755
4790
  // src/autoTrace.ts
4756
4791
  init_asyncStorage();
4792
+ init_captureSuppression();
4757
4793
  var autoTraceGlobal = globalThis;
4758
4794
  var autoTraceState = autoTraceGlobal.__bitfabAutoTraceStateV4 ?? {
4759
4795
  storage: null,
@@ -4886,7 +4922,7 @@ function wrapAutoTraceNodeAsyncGenerator(nodeConfiguration, source) {
4886
4922
  return wrapped;
4887
4923
  }
4888
4924
  function __bitfabAutoTraceActive() {
4889
- if (autoTraceState.activeRoots === 0) {
4925
+ if (autoTraceState.activeRoots === 0 || isCaptureSuppressed()) {
4890
4926
  return false;
4891
4927
  }
4892
4928
  return currentAutoTraceEntries().length > 0;
@@ -5216,6 +5252,9 @@ async function runFunctionWithBaml(bamlSource, inputs, providers, envVars) {
5216
5252
  };
5217
5253
  }
5218
5254
 
5255
+ // src/client.ts
5256
+ init_captureSuppression();
5257
+
5219
5258
  // src/captureSurface.ts
5220
5259
  init_errors();
5221
5260
  var DEFAULT_SURFACE = "opt-in";
@@ -7918,7 +7957,7 @@ var Bitfab = class {
7918
7957
  );
7919
7958
  const tracedRoot = buildTracedRoot(rootOptions);
7920
7959
  const autoTraceRoot = function(...args) {
7921
- if (!self.shouldRecord()) {
7960
+ if (!self.shouldRecord() || isCaptureSuppressed()) {
7922
7961
  return fn.apply(this, args);
7923
7962
  }
7924
7963
  const enclosing = currentAutoTraceEntries();
@@ -8495,7 +8534,7 @@ var Bitfab = class {
8495
8534
  }
8496
8535
  })();
8497
8536
  const wrappedFn = function(...args) {
8498
- if (!self.shouldRecord()) {
8537
+ if (!self.shouldRecord() || isCaptureSuppressed()) {
8499
8538
  return fn.apply(this, args);
8500
8539
  }
8501
8540
  initializeAsyncContext();