@rivetkit/engine-runner 2.0.30 → 2.0.32

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/mod.cjs CHANGED
@@ -416,9 +416,10 @@ function stringifyToClient(message) {
416
416
  const metadataStr = `{runnerLostThreshold: ${stringifyBigInt(metadata.runnerLostThreshold)}}`;
417
417
  return `ToClientInit{runnerId: "${runnerId}", metadata: ${metadataStr}}`;
418
418
  }
419
- case "ToClientPing":
419
+ case "ToClientPing": {
420
420
  const { ts } = message.val;
421
421
  return `ToClientPing{ts: ${stringifyBigInt(ts)}}`;
422
+ }
422
423
  case "ToClientCommands": {
423
424
  const commands = message.val;
424
425
  return `ToClientCommands{count: ${commands.length}, commands: [${commands.map((c) => stringifyCommandWrapper(c)).join(", ")}]}`;
@@ -2390,7 +2391,8 @@ var Runner = class {
2390
2391
  commandWrapper.checkpoint.actorId,
2391
2392
  commandWrapper.checkpoint.generation
2392
2393
  );
2393
- if (actor) actor.lastCommandIdx = commandWrapper.checkpoint.index;
2394
+ if (actor)
2395
+ actor.lastCommandIdx = commandWrapper.checkpoint.index;
2394
2396
  } else if (commandWrapper.inner.tag === "CommandStopActor") {
2395
2397
  this.#handleCommandStopActor(commandWrapper).catch((err) => {
2396
2398
  var _a2;
@@ -2407,12 +2409,12 @@ var Runner = class {
2407
2409
  }
2408
2410
  #handleAckEvents(ack) {
2409
2411
  var _a;
2410
- let originalTotalEvents = Array.from(this.#actors).reduce(
2412
+ const originalTotalEvents = Array.from(this.#actors).reduce(
2411
2413
  (s, [_, actor]) => s + actor.eventHistory.length,
2412
2414
  0
2413
2415
  );
2414
2416
  for (const [_, actor] of this.#actors) {
2415
- let checkpoint = ack.lastEventCheckpoints.find(
2417
+ const checkpoint = ack.lastEventCheckpoints.find(
2416
2418
  (x) => x.actorId == actor.actorId
2417
2419
  );
2418
2420
  if (checkpoint) actor.handleAckEvents(checkpoint.index);
@@ -2438,7 +2440,7 @@ var Runner = class {
2438
2440
  const actor = this.getActor(eventWrapper.checkpoint.actorId);
2439
2441
  if (!actor) return;
2440
2442
  actor.recordEvent(eventWrapper);
2441
- let totalEvents = Array.from(this.#actors).reduce(
2443
+ const totalEvents = Array.from(this.#actors).reduce(
2442
2444
  (s, [_, actor2]) => s + actor2.eventHistory.length,
2443
2445
  0
2444
2446
  );