@bitfab/sdk 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-T5MTBF4Q.js → chunk-4GMZN76Y.js} +3 -3
  5. package/dist/chunk-4GMZN76Y.js.map +1 -0
  6. package/dist/{chunk-6J5LDOLY.js → chunk-BZML7OQD.js} +11 -2
  7. package/dist/chunk-BZML7OQD.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-W76KGDVL.js → chunk-KTBWJLIN.js} +10 -4
  11. package/dist/chunk-KTBWJLIN.js.map +1 -0
  12. package/dist/{chunk-DZVMVRI2.js → chunk-OWZF23WR.js} +20 -2
  13. package/dist/chunk-OWZF23WR.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-VRGVD6LA.js → chunk-WQOA3SFF.js} +12 -11
  17. package/dist/chunk-WQOA3SFF.js.map +1 -0
  18. package/dist/{http-MXEESNBT.js → http-6NM3JD5W.js} +3 -3
  19. package/dist/{http-OG5FURDU.js → http-HSCOLYYK.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-USQSY73Q.js → replay-V3AN37XH.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-6J5LDOLY.js.map +0 -1
  33. package/dist/chunk-DZVMVRI2.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-T5MTBF4Q.js.map +0 -1
  37. package/dist/chunk-VRGVD6LA.js.map +0 -1
  38. package/dist/chunk-W76KGDVL.js.map +0 -1
  39. /package/dist/{http-MXEESNBT.js.map → http-6NM3JD5W.js.map} +0 -0
  40. /package/dist/{http-OG5FURDU.js.map → http-HSCOLYYK.js.map} +0 -0
  41. /package/dist/{replay-USQSY73Q.js.map → replay-V3AN37XH.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
@@ -19,8 +19,8 @@ import {
19
19
  getCurrentTrace,
20
20
  reseedFromRegistry,
21
21
  seedFromRegistry
22
- } from "./chunk-VRGVD6LA.js";
23
- import "./chunk-E5BLYL5X.js";
22
+ } from "./chunk-WQOA3SFF.js";
23
+ import "./chunk-EGWJYCNT.js";
24
24
  import {
25
25
  BITFAB_PROGRESS_PREFIX,
26
26
  DbBranchReplayError,
@@ -28,7 +28,7 @@ import {
28
28
  ReplayError,
29
29
  reportReplayProgress,
30
30
  serializeReplayResult
31
- } from "./chunk-6J5LDOLY.js";
31
+ } from "./chunk-BZML7OQD.js";
32
32
  import {
33
33
  BitfabError,
34
34
  DEFAULT_SERVICE_URL,
@@ -36,8 +36,8 @@ import {
36
36
  MixedTracingError,
37
37
  __version__,
38
38
  flushTraces
39
- } from "./chunk-W76KGDVL.js";
40
- import "./chunk-H6LZRFMN.js";
39
+ } from "./chunk-KTBWJLIN.js";
40
+ import "./chunk-VCRFFCLY.js";
41
41
  export {
42
42
  BITFAB_PROGRESS_PREFIX,
43
43
  Bitfab,
package/dist/node.cjs CHANGED
@@ -88,7 +88,7 @@ var __version__, __packageName__;
88
88
  var init_version_generated = __esm({
89
89
  "src/version.generated.ts"() {
90
90
  "use strict";
91
- __version__ = "0.53.2";
91
+ __version__ = "0.53.4";
92
92
  __packageName__ = "@bitfab/sdk";
93
93
  }
94
94
  });
@@ -265,6 +265,28 @@ var init_replayContext = __esm({
265
265
  }
266
266
  });
267
267
 
268
+ // src/captureSuppression.ts
269
+ function isCaptureSuppressed() {
270
+ return suppressionState.depth > 0;
271
+ }
272
+ function runWithCaptureSuppressed(fn) {
273
+ suppressionState.depth += 1;
274
+ try {
275
+ return fn();
276
+ } finally {
277
+ suppressionState.depth -= 1;
278
+ }
279
+ }
280
+ var suppressionGlobal, suppressionState;
281
+ var init_captureSuppression = __esm({
282
+ "src/captureSuppression.ts"() {
283
+ "use strict";
284
+ suppressionGlobal = globalThis;
285
+ suppressionState = suppressionGlobal.__bitfabCaptureSuppressionV1 ?? { depth: 0 };
286
+ suppressionGlobal.__bitfabCaptureSuppressionV1 = suppressionState;
287
+ }
288
+ });
289
+
268
290
  // src/payloadBudget.ts
269
291
  function byteLength(value) {
270
292
  return textEncoder ? textEncoder.encode(value).length : value.length;
@@ -415,6 +437,11 @@ var init_warnOnce = __esm({
415
437
 
416
438
  // src/serializePayload.ts
417
439
  function serializePayloadBody(payload, maxCarrierBytes = MAX_SPAN_CARRIER_BYTES) {
440
+ return runWithCaptureSuppressed(
441
+ () => encodeWithinBudget(payload, maxCarrierBytes)
442
+ );
443
+ }
444
+ function encodeWithinBudget(payload, maxCarrierBytes) {
418
445
  const encoded = encodePayloadBody(payload);
419
446
  if (fitsCarrierBudget(encoded.body, maxCarrierBytes)) {
420
447
  return { body: encoded.body, dropped: encoded.dropped };
@@ -539,6 +566,7 @@ function encodePayloadBody(payload) {
539
566
  var init_serializePayload = __esm({
540
567
  "src/serializePayload.ts"() {
541
568
  "use strict";
569
+ init_captureSuppression();
542
570
  init_payloadBudget();
543
571
  init_warnOnce();
544
572
  }
@@ -2721,6 +2749,9 @@ function unserializableStub(value, reason) {
2721
2749
  return { json: summary };
2722
2750
  }
2723
2751
  function serializeValue(value) {
2752
+ return runWithCaptureSuppressed(() => serializeWithSuperjson(value));
2753
+ }
2754
+ function serializeWithSuperjson(value) {
2724
2755
  try {
2725
2756
  const { json, meta } = import_superjson.default.serialize(value);
2726
2757
  let size;
@@ -2754,6 +2785,9 @@ function toJsonSafe(value) {
2754
2785
  return toJsonSafeReport(value).safe;
2755
2786
  }
2756
2787
  function toJsonSafeReport(value) {
2788
+ return runWithCaptureSuppressed(() => jsonSafeReport(value));
2789
+ }
2790
+ function jsonSafeReport(value) {
2757
2791
  const dropped = [];
2758
2792
  const safe = toJsonSafeInner(value, 0, /* @__PURE__ */ new WeakSet(), dropped);
2759
2793
  try {
@@ -2839,6 +2873,7 @@ var init_serialize = __esm({
2839
2873
  "src/serialize.ts"() {
2840
2874
  "use strict";
2841
2875
  import_superjson = __toESM(require("superjson"), 1);
2876
+ init_captureSuppression();
2842
2877
  init_payloadBudget();
2843
2878
  init_warnOnce();
2844
2879
  MAX_SERIALIZED_BYTES = MAX_COMPRESSIBLE_SPAN_CARRIER_BYTES;
@@ -4745,6 +4780,7 @@ init_asyncStorage();
4745
4780
 
4746
4781
  // src/autoTrace.ts
4747
4782
  init_asyncStorage();
4783
+ init_captureSuppression();
4748
4784
  var autoTraceGlobal = globalThis;
4749
4785
  var autoTraceState = autoTraceGlobal.__bitfabAutoTraceStateV4 ?? {
4750
4786
  storage: null,
@@ -4877,7 +4913,7 @@ function wrapAutoTraceNodeAsyncGenerator(nodeConfiguration, source) {
4877
4913
  return wrapped;
4878
4914
  }
4879
4915
  function __bitfabAutoTraceActive() {
4880
- if (autoTraceState.activeRoots === 0) {
4916
+ if (autoTraceState.activeRoots === 0 || isCaptureSuppressed()) {
4881
4917
  return false;
4882
4918
  }
4883
4919
  return currentAutoTraceEntries().length > 0;
@@ -5207,6 +5243,9 @@ async function runFunctionWithBaml(bamlSource, inputs, providers, envVars) {
5207
5243
  };
5208
5244
  }
5209
5245
 
5246
+ // src/client.ts
5247
+ init_captureSuppression();
5248
+
5210
5249
  // src/captureSurface.ts
5211
5250
  init_errors();
5212
5251
  var DEFAULT_SURFACE = "opt-in";
@@ -7909,7 +7948,7 @@ var Bitfab = class {
7909
7948
  );
7910
7949
  const tracedRoot = buildTracedRoot(rootOptions);
7911
7950
  const autoTraceRoot = function(...args) {
7912
- if (!self.shouldRecord()) {
7951
+ if (!self.shouldRecord() || isCaptureSuppressed()) {
7913
7952
  return fn.apply(this, args);
7914
7953
  }
7915
7954
  const enclosing = currentAutoTraceEntries();
@@ -8486,7 +8525,7 @@ var Bitfab = class {
8486
8525
  }
8487
8526
  })();
8488
8527
  const wrappedFn = function(...args) {
8489
- if (!self.shouldRecord()) {
8528
+ if (!self.shouldRecord() || isCaptureSuppressed()) {
8490
8529
  return fn.apply(this, args);
8491
8530
  }
8492
8531
  initializeAsyncContext();