@bitfab/sdk 0.64.1 → 0.64.2

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.d.cts CHANGED
@@ -3980,7 +3980,7 @@ interface CommitRef {
3980
3980
  /**
3981
3981
  * SDK version from package.json (injected at build time)
3982
3982
  */
3983
- declare const __version__ = "0.64.1";
3983
+ declare const __version__ = "0.64.2";
3984
3984
 
3985
3985
  /**
3986
3986
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -3980,7 +3980,7 @@ interface CommitRef {
3980
3980
  /**
3981
3981
  * SDK version from package.json (injected at build time)
3982
3982
  */
3983
- declare const __version__ = "0.64.1";
3983
+ declare const __version__ = "0.64.2";
3984
3984
 
3985
3985
  /**
3986
3986
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  getCurrentTrace,
28
28
  reseedFromRegistry,
29
29
  seedFromRegistry
30
- } from "./chunk-THEO6T6H.js";
30
+ } from "./chunk-F5E4FJM4.js";
31
31
  import "./chunk-YWXQM6J3.js";
32
32
  import {
33
33
  BITFAB_PROGRESS_PREFIX,
@@ -36,7 +36,7 @@ import {
36
36
  ReplayError,
37
37
  reportReplayProgress,
38
38
  serializeReplayResult
39
- } from "./chunk-2XXG7HNH.js";
39
+ } from "./chunk-NZBKTVEZ.js";
40
40
  import {
41
41
  BitfabError,
42
42
  DEFAULT_SERVICE_URL,
@@ -44,7 +44,7 @@ import {
44
44
  MixedTracingError,
45
45
  __version__,
46
46
  flushTraces
47
- } from "./chunk-ALXL4OQU.js";
47
+ } from "./chunk-YM4CEDSB.js";
48
48
  import "./chunk-MT36GJMW.js";
49
49
  export {
50
50
  AssertionCategoriesClient,
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.64.1";
91
+ __version__ = "0.64.2";
92
92
  __packageName__ = "@bitfab/sdk";
93
93
  }
94
94
  });
@@ -9291,6 +9291,22 @@ var BitfabVercelAiHandler = class {
9291
9291
 
9292
9292
  // src/client.ts
9293
9293
  init_warnOnce();
9294
+ function markTracedFunction(target, traceFunctionKey, original) {
9295
+ Object.defineProperty(target, "_bitfabTraceFunctionKey", {
9296
+ value: traceFunctionKey
9297
+ });
9298
+ Object.defineProperty(target, "_bitfabWrappedFn", { value: original });
9299
+ Object.defineProperty(target, "bind", {
9300
+ value(thisArg, ...boundArgs) {
9301
+ return markTracedFunction(
9302
+ Function.prototype.bind.call(this, thisArg, ...boundArgs),
9303
+ traceFunctionKey,
9304
+ original
9305
+ );
9306
+ }
9307
+ });
9308
+ return target;
9309
+ }
9294
9310
  function resolveSpanExperimentId(options) {
9295
9311
  const { experimentId, testRunId } = options;
9296
9312
  if (experimentId !== void 0 && testRunId !== void 0 && experimentId !== testRunId) {
@@ -10141,11 +10157,7 @@ var Bitfab = class {
10141
10157
  }
10142
10158
  );
10143
10159
  };
10144
- Object.defineProperty(autoTraceRoot, "_bitfabTraceFunctionKey", {
10145
- value: traceFunctionKey
10146
- });
10147
- Object.defineProperty(autoTraceRoot, "_bitfabWrappedFn", { value: fn });
10148
- return autoTraceRoot;
10160
+ return markTracedFunction(autoTraceRoot, traceFunctionKey, fn);
10149
10161
  }
10150
10162
  applySimulationPlan(payload, submit, drop) {
10151
10163
  this.simulationPlan.send(
@@ -11160,11 +11172,7 @@ var Bitfab = class {
11160
11172
  }
11161
11173
  return runWithSpanStack(newStack, executeWithContext);
11162
11174
  };
11163
- Object.defineProperty(wrappedFn, "_bitfabTraceFunctionKey", {
11164
- value: traceFunctionKey
11165
- });
11166
- Object.defineProperty(wrappedFn, "_bitfabWrappedFn", { value: fn });
11167
- return wrappedFn;
11175
+ return markTracedFunction(wrappedFn, traceFunctionKey, fn);
11168
11176
  }
11169
11177
  /**
11170
11178
  * Create a standard ECMAScript method decorator that records each invocation
@@ -11969,9 +11977,36 @@ init_replay();
11969
11977
  init_errors();
11970
11978
  init_replay();
11971
11979
  init_replayInterrupt();
11980
+ init_warnOnce();
11972
11981
  function defineReplayRegistry(registry) {
11982
+ validateReplayRegistry(registry);
11973
11983
  return registry;
11974
11984
  }
11985
+ var REGISTRATION_FIELDS = /* @__PURE__ */ new Set([
11986
+ "client",
11987
+ "fn",
11988
+ "traceFunctionKey",
11989
+ "options",
11990
+ "optionsFactory"
11991
+ ]);
11992
+ function validateReplayRegistry(registry) {
11993
+ for (const [pipeline, registration] of Object.entries(registry)) {
11994
+ if (typeof registration !== "object" || registration === null) {
11995
+ throw new BitfabError(
11996
+ `Replay registry entry '${pipeline}' must be an object with client and fn.`
11997
+ );
11998
+ }
11999
+ const unknownFields = Object.keys(registration).filter(
12000
+ (field) => !REGISTRATION_FIELDS.has(field)
12001
+ );
12002
+ if (unknownFields.length > 0) {
12003
+ warnOnce(
12004
+ `replay-registry-unknown-fields:${pipeline}:${unknownFields.join(",")}`,
12005
+ `Replay registry entry '${pipeline}' has unknown field(s): ${unknownFields.join(", ")}. They are ignored. An entry takes client, fn, traceFunctionKey, options, and optionsFactory. Put replay options such as adaptInputs, mock, and mockOverride inside options. A later SDK release will reject unknown fields.`
12006
+ );
12007
+ }
12008
+ }
12009
+ }
11975
12010
  async function reseedFromRegistry(registry, pipeline, traceIds) {
11976
12011
  const registration = registry[pipeline];
11977
12012
  if (registration === void 0) {