@rivetkit/workflow-engine 0.0.0-sqlite-uds.37f9e48 → 0.0.0-sqlite-profiling-compat.87d61c0

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.
@@ -670,16 +670,6 @@ function writeRemovedEntry(bc, x) {
670
670
  bare.writeString(bc, x.originalType);
671
671
  write1(bc, x.originalName);
672
672
  }
673
- function readVersionCheckEntry(bc) {
674
- return {
675
- resolved: bare.readU32(bc),
676
- latest: bare.readU32(bc)
677
- };
678
- }
679
- function writeVersionCheckEntry(bc, x) {
680
- bare.writeU32(bc, x.resolved);
681
- bare.writeU32(bc, x.latest);
682
- }
683
673
  function readEntryKind(bc) {
684
674
  const offset = bc.offset;
685
675
  const tag = bare.readU8(bc);
@@ -700,8 +690,6 @@ function readEntryKind(bc) {
700
690
  return { tag: "RaceEntry", val: readRaceEntry(bc) };
701
691
  case 7:
702
692
  return { tag: "RemovedEntry", val: readRemovedEntry(bc) };
703
- case 8:
704
- return { tag: "VersionCheckEntry", val: readVersionCheckEntry(bc) };
705
693
  default: {
706
694
  bc.offset = offset;
707
695
  throw new bare.BareError(offset, "invalid tag");
@@ -750,11 +738,6 @@ function writeEntryKind(bc, x) {
750
738
  writeRemovedEntry(bc, x.val);
751
739
  break;
752
740
  }
753
- case "VersionCheckEntry": {
754
- bare.writeU8(bc, 8);
755
- writeVersionCheckEntry(bc, x.val);
756
- break;
757
- }
758
741
  }
759
742
  }
760
743
  function readEntry(bc) {
@@ -1199,14 +1182,6 @@ function entryKindToBare(kind) {
1199
1182
  originalName: kind.data.originalName ?? null
1200
1183
  }
1201
1184
  };
1202
- case "version_check":
1203
- return {
1204
- tag: "VersionCheckEntry",
1205
- val: {
1206
- resolved: kind.data.resolved,
1207
- latest: kind.data.latest
1208
- }
1209
- };
1210
1185
  }
1211
1186
  }
1212
1187
  function entryKindFromBare(kind) {
@@ -1288,14 +1263,6 @@ function entryKindFromBare(kind) {
1288
1263
  originalName: kind.val.originalName ?? void 0
1289
1264
  }
1290
1265
  };
1291
- case "VersionCheckEntry":
1292
- return {
1293
- type: "version_check",
1294
- data: {
1295
- resolved: kind.val.resolved,
1296
- latest: kind.val.latest
1297
- }
1298
- };
1299
1266
  default:
1300
1267
  throw new Error(
1301
1268
  `Unknown entry kind: ${kind.tag}`
@@ -3521,65 +3488,6 @@ var WorkflowContextImpl = class _WorkflowContextImpl {
3521
3488
  setEntry(this.storage, location, entry);
3522
3489
  await this.flushStorage();
3523
3490
  }
3524
- // === Version ===
3525
- async getVersion(name, latest) {
3526
- this.assertNotInProgress();
3527
- this.checkEvicted();
3528
- this.entryInProgress = true;
3529
- try {
3530
- return await this.executeGetVersion(name, latest);
3531
- } finally {
3532
- this.entryInProgress = false;
3533
- }
3534
- }
3535
- async executeGetVersion(name, latest) {
3536
- if (!Number.isInteger(latest) || latest < 1) {
3537
- throw new Error(
3538
- `getVersion("${name}", ${latest}): latest must be an integer >= 1`
3539
- );
3540
- }
3541
- this.checkDuplicateName(name);
3542
- const location = appendName(this.storage, this.currentLocation, name);
3543
- const key = locationToKey(this.storage, location);
3544
- const existing = this.storage.history.entries.get(key);
3545
- this.markVisited(key);
3546
- this.stopRollbackIfMissing(existing);
3547
- if (existing) {
3548
- if (existing.kind.type !== "version_check") {
3549
- throw new HistoryDivergedError(
3550
- `Expected version_check at ${key}, found ${existing.kind.type}`
3551
- );
3552
- }
3553
- return existing.kind.data.resolved;
3554
- }
3555
- const resolved = this.hasUnvisitedUnderCurrentScope(key) ? 1 : latest;
3556
- const entry = createEntry(location, {
3557
- type: "version_check",
3558
- data: { resolved, latest }
3559
- });
3560
- setEntry(this.storage, location, entry);
3561
- await this.flushStorage();
3562
- return resolved;
3563
- }
3564
- /**
3565
- * Returns true if any history entry under the current location scope
3566
- * (other than `excludeKey`) has not yet been visited this run. Used by
3567
- * getVersion to detect an old in-flight instance whose scope was already
3568
- * executed by code that predates a version gate.
3569
- */
3570
- hasUnvisitedUnderCurrentScope(excludeKey) {
3571
- const prefix = locationToKey(this.storage, this.currentLocation);
3572
- for (const key of this.storage.history.entries.keys()) {
3573
- if (key === excludeKey) {
3574
- continue;
3575
- }
3576
- const isUnderPrefix = prefix === "" ? true : key.startsWith(`${prefix}/`) || key === prefix;
3577
- if (isUnderPrefix && !this.visitedKeys.has(key)) {
3578
- return true;
3579
- }
3580
- }
3581
- return false;
3582
- }
3583
3491
  };
3584
3492
 
3585
3493
  // src/utils.ts
@@ -4317,4 +4225,4 @@ export {
4317
4225
  runWorkflow,
4318
4226
  replayWorkflowFromStep
4319
4227
  };
4320
- //# sourceMappingURL=chunk-Z3WC5MXC.js.map
4228
+ //# sourceMappingURL=chunk-KA2T56AJ.js.map