@bitfab/sdk 0.65.0 → 0.65.3

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 (93) hide show
  1. package/cloudReplay.py +207 -30
  2. package/dist/autoTrace.cjs +28 -0
  3. package/dist/autoTrace.cjs.map +1 -1
  4. package/dist/autoTrace.d.cts +2 -1
  5. package/dist/autoTrace.d.ts +2 -1
  6. package/dist/autoTrace.js +3 -1
  7. package/dist/{chunk-3W6RLPGK.js → chunk-BRMGNMDO.js} +4 -4
  8. package/dist/chunk-BRMGNMDO.js.map +1 -0
  9. package/dist/{chunk-WW2RMMTA.js → chunk-CLP2L5PU.js} +2 -2
  10. package/dist/{chunk-WW2RMMTA.js.map → chunk-CLP2L5PU.js.map} +1 -1
  11. package/dist/{chunk-JIGT4NC5.js → chunk-HLH7TN2A.js} +2 -2
  12. package/dist/{chunk-TNIJXUGC.js → chunk-LCV2JYXL.js} +2 -2
  13. package/dist/{chunk-TNIJXUGC.js.map → chunk-LCV2JYXL.js.map} +1 -1
  14. package/dist/{chunk-SUXEIG4U.js → chunk-NRE5CJPR.js} +29 -13
  15. package/dist/chunk-NRE5CJPR.js.map +1 -0
  16. package/dist/{chunk-MN3E2RUU.js → chunk-PTCLRG4E.js} +3 -3
  17. package/dist/{chunk-YWXQM6J3.js → chunk-QRNHRY7F.js} +28 -1
  18. package/dist/chunk-QRNHRY7F.js.map +1 -0
  19. package/dist/{chunk-IBWW3SP4.js → chunk-YVJAOGHE.js} +2 -2
  20. package/dist/{chunk-JXIW4FOF.js → chunk-Z26K57WZ.js} +2 -2
  21. package/dist/{chunk-GSHCHCB5.js → chunk-ZG6SHKEF.js} +12 -41
  22. package/dist/chunk-ZG6SHKEF.js.map +1 -0
  23. package/dist/{http-7LTYEMJO.js → http-VN52X47M.js} +2 -2
  24. package/dist/{http-NNVOMI63.js → http-WP4YPPKC.js} +2 -2
  25. package/dist/index.cjs +37 -7
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +1 -1
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +4 -4
  30. package/dist/node.cjs +37 -7
  31. package/dist/node.cjs.map +1 -1
  32. package/dist/node.js +4 -4
  33. package/dist/{replay-D7AN6O25.js → replay-463SEV53.js} +3 -3
  34. package/dist/{replay-L56SESG7.js → replay-OT4A4HVF.js} +3 -3
  35. package/dist/replayCli.js +3 -3
  36. package/dist/seedCli.js +3 -3
  37. package/dist/transform/babel.cjs +11 -40
  38. package/dist/transform/babel.cjs.map +1 -1
  39. package/dist/transform/babel.js +1 -1
  40. package/dist/transform/bun.cjs +11 -40
  41. package/dist/transform/bun.cjs.map +1 -1
  42. package/dist/transform/bun.js +3 -3
  43. package/dist/transform/esbuild.cjs +11 -40
  44. package/dist/transform/esbuild.cjs.map +1 -1
  45. package/dist/transform/esbuild.js +3 -3
  46. package/dist/transform/loaderRuntime.cjs +11 -40
  47. package/dist/transform/loaderRuntime.cjs.map +1 -1
  48. package/dist/transform/loaderRuntime.js +2 -2
  49. package/dist/transform/nest.cjs +11 -40
  50. package/dist/transform/nest.cjs.map +1 -1
  51. package/dist/transform/nest.js +3 -3
  52. package/dist/transform/next.cjs +11 -40
  53. package/dist/transform/next.cjs.map +1 -1
  54. package/dist/transform/next.js +3 -3
  55. package/dist/transform/nodeLoader.js +11 -40
  56. package/dist/transform/nodeLoader.js.map +1 -1
  57. package/dist/transform/rolldown.cjs +11 -40
  58. package/dist/transform/rolldown.cjs.map +1 -1
  59. package/dist/transform/rolldown.js +3 -3
  60. package/dist/transform/rollup.cjs +11 -40
  61. package/dist/transform/rollup.cjs.map +1 -1
  62. package/dist/transform/rollup.js +3 -3
  63. package/dist/transform/rsbuild.cjs +11 -40
  64. package/dist/transform/rsbuild.cjs.map +1 -1
  65. package/dist/transform/rsbuild.js +3 -3
  66. package/dist/transform/rspack.cjs +11 -40
  67. package/dist/transform/rspack.cjs.map +1 -1
  68. package/dist/transform/rspack.js +3 -3
  69. package/dist/transform/swc.cjs +11 -40
  70. package/dist/transform/swc.cjs.map +1 -1
  71. package/dist/transform/swc.js +2 -2
  72. package/dist/transform/unplugin.cjs +11 -40
  73. package/dist/transform/unplugin.cjs.map +1 -1
  74. package/dist/transform/unplugin.js +3 -3
  75. package/dist/transform/vite.cjs +11 -40
  76. package/dist/transform/vite.cjs.map +1 -1
  77. package/dist/transform/vite.js +3 -3
  78. package/dist/transform/webpack.cjs +11 -40
  79. package/dist/transform/webpack.cjs.map +1 -1
  80. package/dist/transform/webpack.js +3 -3
  81. package/package.json +11 -11
  82. package/dist/chunk-3W6RLPGK.js.map +0 -1
  83. package/dist/chunk-GSHCHCB5.js.map +0 -1
  84. package/dist/chunk-SUXEIG4U.js.map +0 -1
  85. package/dist/chunk-YWXQM6J3.js.map +0 -1
  86. /package/dist/{chunk-JIGT4NC5.js.map → chunk-HLH7TN2A.js.map} +0 -0
  87. /package/dist/{chunk-MN3E2RUU.js.map → chunk-PTCLRG4E.js.map} +0 -0
  88. /package/dist/{chunk-IBWW3SP4.js.map → chunk-YVJAOGHE.js.map} +0 -0
  89. /package/dist/{chunk-JXIW4FOF.js.map → chunk-Z26K57WZ.js.map} +0 -0
  90. /package/dist/{http-7LTYEMJO.js.map → http-VN52X47M.js.map} +0 -0
  91. /package/dist/{http-NNVOMI63.js.map → http-WP4YPPKC.js.map} +0 -0
  92. /package/dist/{replay-D7AN6O25.js.map → replay-463SEV53.js.map} +0 -0
  93. /package/dist/{replay-L56SESG7.js.map → replay-OT4A4HVF.js.map} +0 -0
@@ -3,10 +3,11 @@ import {
3
3
  clearAutoTraceNodeConfiguration,
4
4
  currentAutoTraceEntries,
5
5
  invokeThroughAutoTraceEntries,
6
+ runAsAutoTraceRootFunction,
6
7
  runWithAutoTraceEntry,
7
8
  runWithAutoTraceNodeConfiguration,
8
9
  runWithAutoTraceRootContext
9
- } from "./chunk-YWXQM6J3.js";
10
+ } from "./chunk-QRNHRY7F.js";
10
11
  import {
11
12
  NO_MOCK_OVERRIDE,
12
13
  createIntegrationFixtureContext,
@@ -17,7 +18,7 @@ import {
17
18
  serializeValue,
18
19
  toJsonSafe,
19
20
  toJsonSafeReport
20
- } from "./chunk-JIGT4NC5.js";
21
+ } from "./chunk-HLH7TN2A.js";
21
22
  import {
22
23
  BitfabError,
23
24
  CONTENT_OFF_KEY,
@@ -37,7 +38,7 @@ import {
37
38
  readEnv,
38
39
  recordCallerTraceMetadata,
39
40
  retireTraceMetadata
40
- } from "./chunk-TNIJXUGC.js";
41
+ } from "./chunk-LCV2JYXL.js";
41
42
  import {
42
43
  __privateAdd,
43
44
  __privateGet,
@@ -4457,6 +4458,11 @@ function readBooleanEnv(name) {
4457
4458
  );
4458
4459
  return void 0;
4459
4460
  }
4461
+ var AUTO_TRACE_NODE_FUNCTION_NAMES = /* @__PURE__ */ new WeakMap();
4462
+ function registerAutoTraceNode(configured, functionName) {
4463
+ AUTO_TRACE_NODE_FUNCTION_NAMES.set(configured, functionName);
4464
+ return configured;
4465
+ }
4460
4466
  var DEFAULT_AUTO_TRACE_MAX_DEPTH = 30;
4461
4467
  var DEFAULT_AUTO_TRACE_MAX_CAPTURED_SUBTREE_SPANS = 500;
4462
4468
  function spanOwnerName(receiver) {
@@ -4592,7 +4598,13 @@ var Bitfab = class {
4592
4598
  throw new BitfabError("bitfab.withTrace requires a function");
4593
4599
  }
4594
4600
  const name = fn.name !== "" ? fn.name : traceFunctionKey;
4595
- return this.createAutoTraceRoot(traceFunctionKey, name, options, fn);
4601
+ return this.createAutoTraceRoot(
4602
+ traceFunctionKey,
4603
+ name,
4604
+ options,
4605
+ fn,
4606
+ AUTO_TRACE_NODE_FUNCTION_NAMES.get(fn) ?? fn.name.replace(/^bound /, "")
4607
+ );
4596
4608
  }
4597
4609
  /**
4598
4610
  * Configure a transformed class method when it is discovered beneath a
@@ -4673,7 +4685,7 @@ var Bitfab = class {
4673
4685
  }
4674
4686
  createAutoTraceNode(configuration, fn, functionName) {
4675
4687
  const nodeConfiguration = { ...configuration, functionName };
4676
- return function(...args) {
4688
+ return registerAutoTraceNode(function(...args) {
4677
4689
  if (!__bitfabAutoTraceActive()) {
4678
4690
  if (enclosingSurface() === "opt-in") {
4679
4691
  throw mixedTracingError("node()", "opt-out", "opt-in");
@@ -4684,11 +4696,15 @@ var Bitfab = class {
4684
4696
  nodeConfiguration,
4685
4697
  () => fn.apply(this, args)
4686
4698
  );
4687
- };
4699
+ }, functionName);
4688
4700
  }
4689
- createAutoTraceRoot(traceFunctionKey, name, options, fn) {
4701
+ createAutoTraceRoot(traceFunctionKey, name, options, fn, rootFunctionName = "") {
4690
4702
  const self = this;
4691
4703
  self.simulationPlan.refresh();
4704
+ const runRootFunction = (receiver, args) => runAsAutoTraceRootFunction(
4705
+ rootFunctionName,
4706
+ () => fn.apply(receiver, args)
4707
+ );
4692
4708
  const maxDepth = autoTraceLimit(
4693
4709
  options.maxDepth,
4694
4710
  DEFAULT_AUTO_TRACE_MAX_DEPTH
@@ -4851,7 +4867,7 @@ var Bitfab = class {
4851
4867
  return runWithAutoTraceRootContext(
4852
4868
  autoTraceContext,
4853
4869
  getSpanStack(),
4854
- () => fn.apply(this, args)
4870
+ () => runRootFunction(this, args)
4855
4871
  );
4856
4872
  }
4857
4873
  );
@@ -4884,7 +4900,7 @@ var Bitfab = class {
4884
4900
  ),
4885
4901
  () => {
4886
4902
  if (link === void 0) {
4887
- return fn.apply(this, args);
4903
+ return runRootFunction(this, args);
4888
4904
  }
4889
4905
  const innermost = enclosing[enclosing.length - 1];
4890
4906
  const innermostNow = currentAutoTraceEntries().find(
@@ -6403,7 +6419,7 @@ var Bitfab = class {
6403
6419
  await runWithSeedContext({ traceId }, async () => target(...args));
6404
6420
  } finally {
6405
6421
  try {
6406
- const { flushTraces: flushTraces2 } = await import("./http-7LTYEMJO.js");
6422
+ const { flushTraces: flushTraces2 } = await import("./http-VN52X47M.js");
6407
6423
  await flushTraces2(3e4);
6408
6424
  } finally {
6409
6425
  unrecorded = activeTraceStates.delete(traceId);
@@ -6462,7 +6478,7 @@ var Bitfab = class {
6462
6478
  `Function is wrapped with trace function key '${wrappedKey}' but replay was called with '${traceFunctionKey}'. Pass matching keys, or pass the unwrapped function to replay it under the explicit key.`
6463
6479
  );
6464
6480
  }
6465
- const { replay: doReplay } = await import("./replay-L56SESG7.js");
6481
+ const { replay: doReplay } = await import("./replay-OT4A4HVF.js");
6466
6482
  return doReplay(
6467
6483
  this.httpClient,
6468
6484
  this.serviceUrl,
@@ -6808,7 +6824,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
6808
6824
  sessionId: seedCase.sessionId
6809
6825
  })
6810
6826
  );
6811
- const { flushTraces: flushTraces2 } = await import("./http-7LTYEMJO.js");
6827
+ const { flushTraces: flushTraces2 } = await import("./http-VN52X47M.js");
6812
6828
  await flushTraces2(3e4);
6813
6829
  return { pipeline, traceFunctionKey, traceIds };
6814
6830
  }
@@ -6855,4 +6871,4 @@ export {
6855
6871
  reseedFromRegistry,
6856
6872
  seedFromRegistry
6857
6873
  };
6858
- //# sourceMappingURL=chunk-SUXEIG4U.js.map
6874
+ //# sourceMappingURL=chunk-NRE5CJPR.js.map