bitfab 0.33.2 → 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
@@ -799,11 +799,13 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
799
799
  await replayContextReady;
800
800
  let codeChangeDescription = options?.codeChangeDescription;
801
801
  let codeChangeFiles = options?.codeChangeFiles;
802
- if (codeChangeDescription === void 0 && codeChangeFiles === void 0) {
802
+ if (codeChangeFiles === void 0) {
803
803
  const captured = await resolveAutoCodeChange(options?.name);
804
804
  if (captured) {
805
- codeChangeDescription = captured.description;
806
805
  codeChangeFiles = captured.files;
806
+ if (codeChangeDescription === void 0) {
807
+ codeChangeDescription = captured.description;
808
+ }
807
809
  }
808
810
  }
809
811
  const {
@@ -1012,7 +1014,7 @@ __export(index_exports, {
1012
1014
  module.exports = __toCommonJS(index_exports);
1013
1015
 
1014
1016
  // src/version.generated.ts
1015
- var __version__ = "0.33.2";
1017
+ var __version__ = "0.33.4";
1016
1018
 
1017
1019
  // src/constants.ts
1018
1020
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";
@@ -4311,6 +4313,38 @@ var Bitfab = class {
4311
4313
  () => wrappedFn.apply(this, args)
4312
4314
  );
4313
4315
  }
4316
+ const captureWhen = options.captureWhen === void 0 ? "always" : options.captureWhen;
4317
+ const resolvedCaptureWhen = captureWhen === "always" || captureWhen === "nested" ? captureWhen : "always";
4318
+ if (resolvedCaptureWhen !== captureWhen) {
4319
+ let invalidValue;
4320
+ try {
4321
+ invalidValue = String(captureWhen);
4322
+ } catch {
4323
+ invalidValue = "<unprintable>";
4324
+ }
4325
+ warnOnce(
4326
+ `invalid-capture-when:${traceFunctionKey}`,
4327
+ `unknown captureWhen value "${invalidValue}"; defaulting to "always". Valid values: "always", "nested".`
4328
+ );
4329
+ }
4330
+ if (resolvedCaptureWhen === "nested") {
4331
+ let hasParent = false;
4332
+ try {
4333
+ hasParent = getSpanStack().length > 0;
4334
+ } catch (setupError) {
4335
+ if (getReplayContext()) {
4336
+ throw setupError;
4337
+ }
4338
+ warnOnce(
4339
+ `withSpan-setup:${traceFunctionKey}`,
4340
+ `tracing setup failed for "${traceFunctionKey}"; running it untraced. The function still runs and returns normally; no span is recorded.`
4341
+ );
4342
+ return fn.apply(this, args);
4343
+ }
4344
+ if (!hasParent) {
4345
+ return fn.apply(this, args);
4346
+ }
4347
+ }
4314
4348
  let newStack;
4315
4349
  let executeWithContext;
4316
4350
  let registeredTraceId;