@bitfab/sdk 0.33.3 → 0.33.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.
package/dist/index.cjs CHANGED
@@ -1005,7 +1005,7 @@ __export(index_exports, {
1005
1005
  module.exports = __toCommonJS(index_exports);
1006
1006
 
1007
1007
  // src/version.generated.ts
1008
- var __version__ = "0.33.3";
1008
+ var __version__ = "0.33.4";
1009
1009
 
1010
1010
  // src/constants.ts
1011
1011
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";
@@ -4304,6 +4304,38 @@ var Bitfab = class {
4304
4304
  () => wrappedFn.apply(this, args)
4305
4305
  );
4306
4306
  }
4307
+ const captureWhen = options.captureWhen === void 0 ? "always" : options.captureWhen;
4308
+ const resolvedCaptureWhen = captureWhen === "always" || captureWhen === "nested" ? captureWhen : "always";
4309
+ if (resolvedCaptureWhen !== captureWhen) {
4310
+ let invalidValue;
4311
+ try {
4312
+ invalidValue = String(captureWhen);
4313
+ } catch {
4314
+ invalidValue = "<unprintable>";
4315
+ }
4316
+ warnOnce(
4317
+ `invalid-capture-when:${traceFunctionKey}`,
4318
+ `unknown captureWhen value "${invalidValue}"; defaulting to "always". Valid values: "always", "nested".`
4319
+ );
4320
+ }
4321
+ if (resolvedCaptureWhen === "nested") {
4322
+ let hasParent = false;
4323
+ try {
4324
+ hasParent = getSpanStack().length > 0;
4325
+ } catch (setupError) {
4326
+ if (getReplayContext()) {
4327
+ throw setupError;
4328
+ }
4329
+ warnOnce(
4330
+ `withSpan-setup:${traceFunctionKey}`,
4331
+ `tracing setup failed for "${traceFunctionKey}"; running it untraced. The function still runs and returns normally; no span is recorded.`
4332
+ );
4333
+ return fn.apply(this, args);
4334
+ }
4335
+ if (!hasParent) {
4336
+ return fn.apply(this, args);
4337
+ }
4338
+ }
4307
4339
  let newStack;
4308
4340
  let executeWithContext;
4309
4341
  let registeredTraceId;