@bitfab/sdk 0.54.11 → 0.54.12

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BitfabError
3
- } from "./chunk-GQNLAY72.js";
3
+ } from "./chunk-GZI455WP.js";
4
4
 
5
5
  // src/codeChange.ts
6
6
  var NUL = String.fromCharCode(0);
@@ -207,7 +207,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
207
207
  sessionId: seedCase.sessionId
208
208
  })
209
209
  );
210
- const { flushTraces: flushTraces2 } = await import("./http-3NVEDIBT.js");
210
+ const { flushTraces: flushTraces2 } = await import("./http-FJVBYZES.js");
211
211
  await flushTraces2(3e4);
212
212
  return { pipeline, traceFunctionKey, traceIds };
213
213
  }
@@ -744,4 +744,4 @@ export {
744
744
  runRegistryMain,
745
745
  runIfEntrypoint
746
746
  };
747
- //# sourceMappingURL=chunk-EG2BK73V.js.map
747
+ //# sourceMappingURL=chunk-Q3X54UPA.js.map
@@ -6,7 +6,7 @@ import {
6
6
  replayContextReady,
7
7
  runWithReplayContext,
8
8
  warnOnce
9
- } from "./chunk-MC2NKYDY.js";
9
+ } from "./chunk-I5NJU64I.js";
10
10
  import {
11
11
  runWithCaptureSuppressed
12
12
  } from "./chunk-VCRFFCLY.js";
@@ -1257,4 +1257,4 @@ export {
1257
1257
  sleepForReplayPersistence,
1258
1258
  replay
1259
1259
  };
1260
- //# sourceMappingURL=chunk-WEUG3N7A.js.map
1260
+ //# sourceMappingURL=chunk-XTUINMAL.js.map
@@ -6,7 +6,7 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-GQNLAY72.js";
9
+ } from "./chunk-GZI455WP.js";
10
10
  export {
11
11
  BitfabError,
12
12
  HttpClient,
@@ -16,4 +16,4 @@ export {
16
16
  parseRetryAfterMs,
17
17
  serializePayloadBody
18
18
  };
19
- //# sourceMappingURL=http-3NVEDIBT.js.map
19
+ //# sourceMappingURL=http-FJVBYZES.js.map
@@ -6,7 +6,7 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-MC2NKYDY.js";
9
+ } from "./chunk-I5NJU64I.js";
10
10
  import "./chunk-VCRFFCLY.js";
11
11
  export {
12
12
  BitfabError,
@@ -17,4 +17,4 @@ export {
17
17
  parseRetryAfterMs,
18
18
  serializePayloadBody
19
19
  };
20
- //# sourceMappingURL=http-L357FQLN.js.map
20
+ //# sourceMappingURL=http-X4YOOM54.js.map
package/dist/index.cjs CHANGED
@@ -42,7 +42,7 @@ var __version__, __packageName__;
42
42
  var init_version_generated = __esm({
43
43
  "src/version.generated.ts"() {
44
44
  "use strict";
45
- __version__ = "0.54.11";
45
+ __version__ = "0.54.12";
46
46
  __packageName__ = "@bitfab/sdk";
47
47
  }
48
48
  });
@@ -7197,18 +7197,42 @@ var RIVET_TOP_LEVEL_EFFECTS = [
7197
7197
  "broadcast",
7198
7198
  "saveState",
7199
7199
  "sleep",
7200
- "destroy"
7200
+ "destroy",
7201
+ "step",
7202
+ "tryStep",
7203
+ "try",
7204
+ "loop",
7205
+ "sleepUntil",
7206
+ "rollbackCheckpoint",
7207
+ "join",
7208
+ "race",
7209
+ "removed",
7210
+ "getVersion"
7201
7211
  ];
7202
7212
  var TOP_LEVEL_UNAVAILABLE_CAPABILITIES = /* @__PURE__ */ new Set([
7203
7213
  "conn",
7204
7214
  "conns",
7205
- "log",
7206
7215
  "request",
7207
7216
  "actorRuntimeSocket",
7208
7217
  "keepAwake",
7209
7218
  "waitUntil",
7210
7219
  "client"
7211
7220
  ]);
7221
+ var replayLog = () => void 0;
7222
+ var replayLogger = {
7223
+ level: "silent",
7224
+ msgPrefix: void 0,
7225
+ fatal: replayLog,
7226
+ trace: replayLog,
7227
+ silent: replayLog,
7228
+ debug: replayLog,
7229
+ info: replayLog,
7230
+ warn: replayLog,
7231
+ error: replayLog,
7232
+ child: () => replayLogger,
7233
+ bindings: () => ({}),
7234
+ isLevelEnabled: () => false
7235
+ };
7212
7236
  var SYNC_VOID_EFFECTS = /* @__PURE__ */ new Set([
7213
7237
  "broadcast",
7214
7238
  "sleep",
@@ -7238,16 +7262,28 @@ function snapshotContext(context) {
7238
7262
  "state",
7239
7263
  "vars",
7240
7264
  "actorId",
7265
+ "workflowId",
7241
7266
  "name",
7242
7267
  "key",
7243
- "region",
7244
- "aborted"
7268
+ "region"
7245
7269
  ]) {
7246
7270
  const value = readProperty(source, property);
7247
7271
  if (value !== void 0) {
7248
7272
  snapshot[property] = value;
7249
7273
  }
7250
7274
  }
7275
+ const aborted = readProperty(source, "aborted");
7276
+ if (typeof aborted === "boolean") {
7277
+ snapshot.aborted = aborted;
7278
+ } else {
7279
+ const abortSignal = readProperty(source, "abortSignal");
7280
+ if (isRecord5(abortSignal)) {
7281
+ const signalAborted = readProperty(abortSignal, "aborted");
7282
+ if (typeof signalAborted === "boolean") {
7283
+ snapshot.aborted = signalAborted;
7284
+ }
7285
+ }
7286
+ }
7251
7287
  return snapshot;
7252
7288
  }
7253
7289
  function unavailableCapability(path) {
@@ -7339,7 +7375,8 @@ var BitfabRivetIntegration = class {
7339
7375
  }
7340
7376
  /**
7341
7377
  * Adapt a traced function into a Rivet handler whose first argument is the
7342
- * live actor context. The context is not added to the traced root's inputs.
7378
+ * live actor or workflow context. The context is not added to the traced
7379
+ * root's inputs.
7343
7380
  */
7344
7381
  bind(fn) {
7345
7382
  const integration = this;
@@ -7350,7 +7387,8 @@ var BitfabRivetIntegration = class {
7350
7387
  /**
7351
7388
  * Return the current Rivet context proxy. In production it delegates to the
7352
7389
  * bound live context. During replay it hydrates recorded actor state and
7353
- * intercepts supported effects without requiring a live Rivet actor.
7390
+ * intercepts supported effects without requiring a live Rivet actor or
7391
+ * workflow.
7354
7392
  */
7355
7393
  getContext() {
7356
7394
  const replay2 = getReplayContext();
@@ -7434,6 +7472,12 @@ var BitfabRivetIntegration = class {
7434
7472
  if (property === "setPreventSleep" && replay2) {
7435
7473
  return (_preventSleep) => void 0;
7436
7474
  }
7475
+ if (property === "isEvicted" && replay2) {
7476
+ return () => replayTarget.abortSignal?.aborted === true;
7477
+ }
7478
+ if (property === "log" && replay2) {
7479
+ return replayLogger;
7480
+ }
7437
7481
  if (replay2 && typeof property === "string" && TOP_LEVEL_UNAVAILABLE_CAPABILITIES.has(property)) {
7438
7482
  throw unavailableCapability(property);
7439
7483
  }
@@ -7607,7 +7651,7 @@ var BitfabRivetIntegration = class {
7607
7651
  return { ...value, complete };
7608
7652
  }
7609
7653
  queueCallIsCompletable(effect, args) {
7610
- const options = effect === "queue.waitForNames" ? args[1] : args[0];
7654
+ const options = effect === "queue.waitForNames" || (effect === "queue.next" || effect === "queue.nextBatch") && typeof args[0] === "string" ? args[1] : args[0];
7611
7655
  return isRecord5(options) && options.completable === true;
7612
7656
  }
7613
7657
  createQueueIterator(queue, options) {
@@ -9348,9 +9392,9 @@ var Bitfab = class {
9348
9392
  });
9349
9393
  }
9350
9394
  /**
9351
- * Get the first-class Rivet actor-context integration for an existing trace
9352
- * root. The integration binds context and records effect spans; it never
9353
- * creates another root.
9395
+ * Get the first-class Rivet actor/workflow-context integration for an
9396
+ * existing trace root. The integration binds context and records effect
9397
+ * spans; it never creates another root.
9354
9398
  *
9355
9399
  * @param traceFunctionKey - Key used by the enclosing `withTrace()` root
9356
9400
  * @param options - Explicit per-context-path replay mocking policy