bitfab 0.64.1 → 0.64.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.
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.3";
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.3";
3984
3984
 
3985
3985
  /**
3986
3986
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  getCurrentTrace,
37
37
  reseedFromRegistry,
38
38
  seedFromRegistry
39
- } from "./chunk-BBBAQPIW.js";
39
+ } from "./chunk-UZU2PNO7.js";
40
40
  import "./chunk-YWXQM6J3.js";
41
41
  import {
42
42
  BITFAB_PROGRESS_PREFIX,
@@ -45,7 +45,7 @@ import {
45
45
  ReplayError,
46
46
  reportReplayProgress,
47
47
  serializeReplayResult
48
- } from "./chunk-WX5DWEZM.js";
48
+ } from "./chunk-2YDH4SPS.js";
49
49
  import {
50
50
  BitfabError,
51
51
  DEFAULT_SERVICE_URL,
@@ -53,7 +53,7 @@ import {
53
53
  MixedTracingError,
54
54
  __version__,
55
55
  flushTraces
56
- } from "./chunk-2Y4FK7ND.js";
56
+ } from "./chunk-JIPKI6RB.js";
57
57
  import "./chunk-MT36GJMW.js";
58
58
  export {
59
59
  AssertionCategoriesClient,
package/dist/node.cjs CHANGED
@@ -97,7 +97,7 @@ var __version__, __packageName__;
97
97
  var init_version_generated = __esm({
98
98
  "src/version.generated.ts"() {
99
99
  "use strict";
100
- __version__ = "0.64.1";
100
+ __version__ = "0.64.3";
101
101
  __packageName__ = "bitfab";
102
102
  }
103
103
  });
@@ -9300,6 +9300,22 @@ var BitfabVercelAiHandler = class {
9300
9300
 
9301
9301
  // src/client.ts
9302
9302
  init_warnOnce();
9303
+ function markTracedFunction(target, traceFunctionKey, original) {
9304
+ Object.defineProperty(target, "_bitfabTraceFunctionKey", {
9305
+ value: traceFunctionKey
9306
+ });
9307
+ Object.defineProperty(target, "_bitfabWrappedFn", { value: original });
9308
+ Object.defineProperty(target, "bind", {
9309
+ value(thisArg, ...boundArgs) {
9310
+ return markTracedFunction(
9311
+ Function.prototype.bind.call(this, thisArg, ...boundArgs),
9312
+ traceFunctionKey,
9313
+ original
9314
+ );
9315
+ }
9316
+ });
9317
+ return target;
9318
+ }
9303
9319
  function resolveSpanExperimentId(options) {
9304
9320
  const { experimentId, testRunId } = options;
9305
9321
  if (experimentId !== void 0 && testRunId !== void 0 && experimentId !== testRunId) {
@@ -10150,11 +10166,7 @@ var Bitfab = class {
10150
10166
  }
10151
10167
  );
10152
10168
  };
10153
- Object.defineProperty(autoTraceRoot, "_bitfabTraceFunctionKey", {
10154
- value: traceFunctionKey
10155
- });
10156
- Object.defineProperty(autoTraceRoot, "_bitfabWrappedFn", { value: fn });
10157
- return autoTraceRoot;
10169
+ return markTracedFunction(autoTraceRoot, traceFunctionKey, fn);
10158
10170
  }
10159
10171
  applySimulationPlan(payload, submit, drop) {
10160
10172
  this.simulationPlan.send(
@@ -11169,11 +11181,7 @@ var Bitfab = class {
11169
11181
  }
11170
11182
  return runWithSpanStack(newStack, executeWithContext);
11171
11183
  };
11172
- Object.defineProperty(wrappedFn, "_bitfabTraceFunctionKey", {
11173
- value: traceFunctionKey
11174
- });
11175
- Object.defineProperty(wrappedFn, "_bitfabWrappedFn", { value: fn });
11176
- return wrappedFn;
11184
+ return markTracedFunction(wrappedFn, traceFunctionKey, fn);
11177
11185
  }
11178
11186
  /**
11179
11187
  * Create a standard ECMAScript method decorator that records each invocation
@@ -11978,9 +11986,36 @@ init_replay();
11978
11986
  init_errors();
11979
11987
  init_replay();
11980
11988
  init_replayInterrupt();
11989
+ init_warnOnce();
11981
11990
  function defineReplayRegistry(registry) {
11991
+ validateReplayRegistry(registry);
11982
11992
  return registry;
11983
11993
  }
11994
+ var REGISTRATION_FIELDS = /* @__PURE__ */ new Set([
11995
+ "client",
11996
+ "fn",
11997
+ "traceFunctionKey",
11998
+ "options",
11999
+ "optionsFactory"
12000
+ ]);
12001
+ function validateReplayRegistry(registry) {
12002
+ for (const [pipeline, registration] of Object.entries(registry)) {
12003
+ if (typeof registration !== "object" || registration === null) {
12004
+ throw new BitfabError(
12005
+ `Replay registry entry '${pipeline}' must be an object with client and fn.`
12006
+ );
12007
+ }
12008
+ const unknownFields = Object.keys(registration).filter(
12009
+ (field) => !REGISTRATION_FIELDS.has(field)
12010
+ );
12011
+ if (unknownFields.length > 0) {
12012
+ warnOnce(
12013
+ `replay-registry-unknown-fields:${pipeline}:${unknownFields.join(",")}`,
12014
+ `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.`
12015
+ );
12016
+ }
12017
+ }
12018
+ }
11984
12019
  async function reseedFromRegistry(registry, pipeline, traceIds) {
11985
12020
  const registration = registry[pipeline];
11986
12021
  if (registration === void 0) {