@rivetkit/engine-envoy-protocol 0.0.0-main.17e6a1a → 0.0.0-main.17f6330

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +140 -170
  2. package/dist/index.js +398 -386
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -366,28 +366,16 @@ function writeKvResponseData(bc, x) {
366
366
  }
367
367
  }
368
368
  }
369
- function readSqliteGeneration(bc) {
370
- return bare.readU64(bc);
371
- }
372
- function writeSqliteGeneration(bc, x) {
373
- bare.writeU64(bc, x);
374
- }
375
- function readSqliteTxid(bc) {
376
- return bare.readU64(bc);
377
- }
378
- function writeSqliteTxid(bc, x) {
379
- bare.writeU64(bc, x);
380
- }
381
369
  function readSqlitePgno(bc) {
382
370
  return bare.readU32(bc);
383
371
  }
384
372
  function writeSqlitePgno(bc, x) {
385
373
  bare.writeU32(bc, x);
386
374
  }
387
- function readSqliteStageId(bc) {
375
+ function readSqliteGeneration(bc) {
388
376
  return bare.readU64(bc);
389
377
  }
390
- function writeSqliteStageId(bc, x) {
378
+ function writeSqliteGeneration(bc, x) {
391
379
  bare.writeU64(bc, x);
392
380
  }
393
381
  function readSqlitePageBytes(bc) {
@@ -396,36 +384,6 @@ function readSqlitePageBytes(bc) {
396
384
  function writeSqlitePageBytes(bc, x) {
397
385
  bare.writeData(bc, x);
398
386
  }
399
- function readSqliteMeta(bc) {
400
- return {
401
- generation: readSqliteGeneration(bc),
402
- headTxid: readSqliteTxid(bc),
403
- materializedTxid: readSqliteTxid(bc),
404
- dbSizePages: bare.readU32(bc),
405
- pageSize: bare.readU32(bc),
406
- creationTsMs: bare.readI64(bc),
407
- maxDeltaBytes: bare.readU64(bc)
408
- };
409
- }
410
- function writeSqliteMeta(bc, x) {
411
- writeSqliteGeneration(bc, x.generation);
412
- writeSqliteTxid(bc, x.headTxid);
413
- writeSqliteTxid(bc, x.materializedTxid);
414
- bare.writeU32(bc, x.dbSizePages);
415
- bare.writeU32(bc, x.pageSize);
416
- bare.writeI64(bc, x.creationTsMs);
417
- bare.writeU64(bc, x.maxDeltaBytes);
418
- }
419
- function readSqliteFenceMismatch(bc) {
420
- return {
421
- actualMeta: readSqliteMeta(bc),
422
- reason: bare.readString(bc)
423
- };
424
- }
425
- function writeSqliteFenceMismatch(bc, x) {
426
- writeSqliteMeta(bc, x.actualMeta);
427
- bare.writeString(bc, x.reason);
428
- }
429
387
  function readSqliteDirtyPage(bc) {
430
388
  return {
431
389
  pgno: readSqlitePgno(bc),
@@ -475,14 +433,16 @@ function write6(bc, x) {
475
433
  function readSqliteGetPagesRequest(bc) {
476
434
  return {
477
435
  actorId: readId(bc),
478
- generation: readSqliteGeneration(bc),
479
- pgnos: read6(bc)
436
+ pgnos: read6(bc),
437
+ expectedGeneration: read2(bc),
438
+ expectedHeadTxid: read2(bc)
480
439
  };
481
440
  }
482
441
  function writeSqliteGetPagesRequest(bc, x) {
483
442
  writeId(bc, x.actorId);
484
- writeSqliteGeneration(bc, x.generation);
485
443
  write6(bc, x.pgnos);
444
+ write2(bc, x.expectedGeneration);
445
+ write2(bc, x.expectedHeadTxid);
486
446
  }
487
447
  function read7(bc) {
488
448
  const len = bare.readUintSafe(bc);
@@ -504,19 +464,23 @@ function write7(bc, x) {
504
464
  function readSqliteGetPagesOk(bc) {
505
465
  return {
506
466
  pages: read7(bc),
507
- meta: readSqliteMeta(bc)
467
+ headTxid: read2(bc)
508
468
  };
509
469
  }
510
470
  function writeSqliteGetPagesOk(bc, x) {
511
471
  write7(bc, x.pages);
512
- writeSqliteMeta(bc, x.meta);
472
+ write2(bc, x.headTxid);
513
473
  }
514
474
  function readSqliteErrorResponse(bc) {
515
475
  return {
476
+ group: bare.readString(bc),
477
+ code: bare.readString(bc),
516
478
  message: bare.readString(bc)
517
479
  };
518
480
  }
519
481
  function writeSqliteErrorResponse(bc, x) {
482
+ bare.writeString(bc, x.group);
483
+ bare.writeString(bc, x.code);
520
484
  bare.writeString(bc, x.message);
521
485
  }
522
486
  function readSqliteGetPagesResponse(bc) {
@@ -526,8 +490,6 @@ function readSqliteGetPagesResponse(bc) {
526
490
  case 0:
527
491
  return { tag: "SqliteGetPagesOk", val: readSqliteGetPagesOk(bc) };
528
492
  case 1:
529
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
530
- case 2:
531
493
  return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
532
494
  default: {
533
495
  bc.offset = offset;
@@ -542,13 +504,8 @@ function writeSqliteGetPagesResponse(bc, x) {
542
504
  writeSqliteGetPagesOk(bc, x.val);
543
505
  break;
544
506
  }
545
- case "SqliteFenceMismatch": {
546
- bare.writeU8(bc, 1);
547
- writeSqliteFenceMismatch(bc, x.val);
548
- break;
549
- }
550
507
  case "SqliteErrorResponse": {
551
- bare.writeU8(bc, 2);
508
+ bare.writeU8(bc, 1);
552
509
  writeSqliteErrorResponse(bc, x.val);
553
510
  break;
554
511
  }
@@ -574,38 +531,28 @@ function write8(bc, x) {
574
531
  function readSqliteCommitRequest(bc) {
575
532
  return {
576
533
  actorId: readId(bc),
577
- generation: readSqliteGeneration(bc),
578
- expectedHeadTxid: readSqliteTxid(bc),
579
534
  dirtyPages: read8(bc),
580
- newDbSizePages: bare.readU32(bc)
535
+ dbSizePages: bare.readU32(bc),
536
+ nowMs: bare.readI64(bc),
537
+ expectedGeneration: read2(bc),
538
+ expectedHeadTxid: read2(bc)
581
539
  };
582
540
  }
583
541
  function writeSqliteCommitRequest(bc, x) {
584
542
  writeId(bc, x.actorId);
585
- writeSqliteGeneration(bc, x.generation);
586
- writeSqliteTxid(bc, x.expectedHeadTxid);
587
543
  write8(bc, x.dirtyPages);
588
- bare.writeU32(bc, x.newDbSizePages);
544
+ bare.writeU32(bc, x.dbSizePages);
545
+ bare.writeI64(bc, x.nowMs);
546
+ write2(bc, x.expectedGeneration);
547
+ write2(bc, x.expectedHeadTxid);
589
548
  }
590
549
  function readSqliteCommitOk(bc) {
591
550
  return {
592
- newHeadTxid: readSqliteTxid(bc),
593
- meta: readSqliteMeta(bc)
551
+ headTxid: read2(bc)
594
552
  };
595
553
  }
596
554
  function writeSqliteCommitOk(bc, x) {
597
- writeSqliteTxid(bc, x.newHeadTxid);
598
- writeSqliteMeta(bc, x.meta);
599
- }
600
- function readSqliteCommitTooLarge(bc) {
601
- return {
602
- actualSizeBytes: bare.readU64(bc),
603
- maxSizeBytes: bare.readU64(bc)
604
- };
605
- }
606
- function writeSqliteCommitTooLarge(bc, x) {
607
- bare.writeU64(bc, x.actualSizeBytes);
608
- bare.writeU64(bc, x.maxSizeBytes);
555
+ write2(bc, x.headTxid);
609
556
  }
610
557
  function readSqliteCommitResponse(bc) {
611
558
  const offset = bc.offset;
@@ -614,10 +561,6 @@ function readSqliteCommitResponse(bc) {
614
561
  case 0:
615
562
  return { tag: "SqliteCommitOk", val: readSqliteCommitOk(bc) };
616
563
  case 1:
617
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
618
- case 2:
619
- return { tag: "SqliteCommitTooLarge", val: readSqliteCommitTooLarge(bc) };
620
- case 3:
621
564
  return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
622
565
  default: {
623
566
  bc.offset = offset;
@@ -632,182 +575,307 @@ function writeSqliteCommitResponse(bc, x) {
632
575
  writeSqliteCommitOk(bc, x.val);
633
576
  break;
634
577
  }
635
- case "SqliteFenceMismatch": {
636
- bare.writeU8(bc, 1);
637
- writeSqliteFenceMismatch(bc, x.val);
638
- break;
639
- }
640
- case "SqliteCommitTooLarge": {
641
- bare.writeU8(bc, 2);
642
- writeSqliteCommitTooLarge(bc, x.val);
643
- break;
644
- }
645
578
  case "SqliteErrorResponse": {
646
- bare.writeU8(bc, 3);
579
+ bare.writeU8(bc, 1);
647
580
  writeSqliteErrorResponse(bc, x.val);
648
581
  break;
649
582
  }
650
583
  }
651
584
  }
652
- function readSqliteCommitStageBeginRequest(bc) {
585
+ function readSqliteValueInteger(bc) {
653
586
  return {
654
- actorId: readId(bc),
655
- generation: readSqliteGeneration(bc)
587
+ value: bare.readI64(bc)
656
588
  };
657
589
  }
658
- function writeSqliteCommitStageBeginRequest(bc, x) {
659
- writeId(bc, x.actorId);
660
- writeSqliteGeneration(bc, x.generation);
590
+ function writeSqliteValueInteger(bc, x) {
591
+ bare.writeI64(bc, x.value);
592
+ }
593
+ function readSqliteValueFloat(bc) {
594
+ return {
595
+ value: bare.readFixedData(bc, 8)
596
+ };
661
597
  }
662
- function readSqliteCommitStageBeginOk(bc) {
598
+ function writeSqliteValueFloat(bc, x) {
599
+ {
600
+ assert(x.value.byteLength === 8);
601
+ bare.writeFixedData(bc, x.value);
602
+ }
603
+ }
604
+ function readSqliteValueText(bc) {
663
605
  return {
664
- txid: readSqliteTxid(bc)
606
+ value: bare.readString(bc)
665
607
  };
666
608
  }
667
- function writeSqliteCommitStageBeginOk(bc, x) {
668
- writeSqliteTxid(bc, x.txid);
609
+ function writeSqliteValueText(bc, x) {
610
+ bare.writeString(bc, x.value);
669
611
  }
670
- function readSqliteCommitStageBeginResponse(bc) {
612
+ function readSqliteValueBlob(bc) {
613
+ return {
614
+ value: bare.readData(bc)
615
+ };
616
+ }
617
+ function writeSqliteValueBlob(bc, x) {
618
+ bare.writeData(bc, x.value);
619
+ }
620
+ function readSqliteBindParam(bc) {
671
621
  const offset = bc.offset;
672
622
  const tag = bare.readU8(bc);
673
623
  switch (tag) {
674
624
  case 0:
675
- return { tag: "SqliteCommitStageBeginOk", val: readSqliteCommitStageBeginOk(bc) };
625
+ return { tag: "SqliteValueNull", val: null };
676
626
  case 1:
677
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
627
+ return { tag: "SqliteValueInteger", val: readSqliteValueInteger(bc) };
678
628
  case 2:
679
- return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
629
+ return { tag: "SqliteValueFloat", val: readSqliteValueFloat(bc) };
630
+ case 3:
631
+ return { tag: "SqliteValueText", val: readSqliteValueText(bc) };
632
+ case 4:
633
+ return { tag: "SqliteValueBlob", val: readSqliteValueBlob(bc) };
680
634
  default: {
681
635
  bc.offset = offset;
682
636
  throw new bare.BareError(offset, "invalid tag");
683
637
  }
684
638
  }
685
639
  }
686
- function writeSqliteCommitStageBeginResponse(bc, x) {
640
+ function writeSqliteBindParam(bc, x) {
687
641
  switch (x.tag) {
688
- case "SqliteCommitStageBeginOk": {
642
+ case "SqliteValueNull": {
689
643
  bare.writeU8(bc, 0);
690
- writeSqliteCommitStageBeginOk(bc, x.val);
691
644
  break;
692
645
  }
693
- case "SqliteFenceMismatch": {
646
+ case "SqliteValueInteger": {
694
647
  bare.writeU8(bc, 1);
695
- writeSqliteFenceMismatch(bc, x.val);
648
+ writeSqliteValueInteger(bc, x.val);
696
649
  break;
697
650
  }
698
- case "SqliteErrorResponse": {
651
+ case "SqliteValueFloat": {
699
652
  bare.writeU8(bc, 2);
700
- writeSqliteErrorResponse(bc, x.val);
653
+ writeSqliteValueFloat(bc, x.val);
654
+ break;
655
+ }
656
+ case "SqliteValueText": {
657
+ bare.writeU8(bc, 3);
658
+ writeSqliteValueText(bc, x.val);
659
+ break;
660
+ }
661
+ case "SqliteValueBlob": {
662
+ bare.writeU8(bc, 4);
663
+ writeSqliteValueBlob(bc, x.val);
701
664
  break;
702
665
  }
703
666
  }
704
667
  }
705
- function readSqliteCommitStageRequest(bc) {
706
- return {
707
- actorId: readId(bc),
708
- generation: readSqliteGeneration(bc),
709
- txid: readSqliteTxid(bc),
710
- chunkIdx: bare.readU32(bc),
711
- bytes: bare.readData(bc),
712
- isLast: bare.readBool(bc)
713
- };
714
- }
715
- function writeSqliteCommitStageRequest(bc, x) {
716
- writeId(bc, x.actorId);
717
- writeSqliteGeneration(bc, x.generation);
718
- writeSqliteTxid(bc, x.txid);
719
- bare.writeU32(bc, x.chunkIdx);
720
- bare.writeData(bc, x.bytes);
721
- bare.writeBool(bc, x.isLast);
722
- }
723
- function readSqliteCommitStageOk(bc) {
724
- return {
725
- chunkIdxCommitted: bare.readU32(bc)
726
- };
727
- }
728
- function writeSqliteCommitStageOk(bc, x) {
729
- bare.writeU32(bc, x.chunkIdxCommitted);
730
- }
731
- function readSqliteCommitStageResponse(bc) {
668
+ function readSqliteColumnValue(bc) {
732
669
  const offset = bc.offset;
733
670
  const tag = bare.readU8(bc);
734
671
  switch (tag) {
735
672
  case 0:
736
- return { tag: "SqliteCommitStageOk", val: readSqliteCommitStageOk(bc) };
673
+ return { tag: "SqliteValueNull", val: null };
737
674
  case 1:
738
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
675
+ return { tag: "SqliteValueInteger", val: readSqliteValueInteger(bc) };
739
676
  case 2:
740
- return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
677
+ return { tag: "SqliteValueFloat", val: readSqliteValueFloat(bc) };
678
+ case 3:
679
+ return { tag: "SqliteValueText", val: readSqliteValueText(bc) };
680
+ case 4:
681
+ return { tag: "SqliteValueBlob", val: readSqliteValueBlob(bc) };
741
682
  default: {
742
683
  bc.offset = offset;
743
684
  throw new bare.BareError(offset, "invalid tag");
744
685
  }
745
686
  }
746
687
  }
747
- function writeSqliteCommitStageResponse(bc, x) {
688
+ function writeSqliteColumnValue(bc, x) {
748
689
  switch (x.tag) {
749
- case "SqliteCommitStageOk": {
690
+ case "SqliteValueNull": {
750
691
  bare.writeU8(bc, 0);
751
- writeSqliteCommitStageOk(bc, x.val);
752
692
  break;
753
693
  }
754
- case "SqliteFenceMismatch": {
694
+ case "SqliteValueInteger": {
755
695
  bare.writeU8(bc, 1);
756
- writeSqliteFenceMismatch(bc, x.val);
696
+ writeSqliteValueInteger(bc, x.val);
757
697
  break;
758
698
  }
759
- case "SqliteErrorResponse": {
699
+ case "SqliteValueFloat": {
760
700
  bare.writeU8(bc, 2);
761
- writeSqliteErrorResponse(bc, x.val);
701
+ writeSqliteValueFloat(bc, x.val);
762
702
  break;
763
703
  }
704
+ case "SqliteValueText": {
705
+ bare.writeU8(bc, 3);
706
+ writeSqliteValueText(bc, x.val);
707
+ break;
708
+ }
709
+ case "SqliteValueBlob": {
710
+ bare.writeU8(bc, 4);
711
+ writeSqliteValueBlob(bc, x.val);
712
+ break;
713
+ }
714
+ }
715
+ }
716
+ function read9(bc) {
717
+ const len = bare.readUintSafe(bc);
718
+ if (len === 0) {
719
+ return [];
720
+ }
721
+ const result = [bare.readString(bc)];
722
+ for (let i = 1; i < len; i++) {
723
+ result[i] = bare.readString(bc);
724
+ }
725
+ return result;
726
+ }
727
+ function write9(bc, x) {
728
+ bare.writeUintSafe(bc, x.length);
729
+ for (let i = 0; i < x.length; i++) {
730
+ bare.writeString(bc, x[i]);
731
+ }
732
+ }
733
+ function read10(bc) {
734
+ const len = bare.readUintSafe(bc);
735
+ if (len === 0) {
736
+ return [];
737
+ }
738
+ const result = [readSqliteColumnValue(bc)];
739
+ for (let i = 1; i < len; i++) {
740
+ result[i] = readSqliteColumnValue(bc);
741
+ }
742
+ return result;
743
+ }
744
+ function write10(bc, x) {
745
+ bare.writeUintSafe(bc, x.length);
746
+ for (let i = 0; i < x.length; i++) {
747
+ writeSqliteColumnValue(bc, x[i]);
748
+ }
749
+ }
750
+ function read11(bc) {
751
+ const len = bare.readUintSafe(bc);
752
+ if (len === 0) {
753
+ return [];
754
+ }
755
+ const result = [read10(bc)];
756
+ for (let i = 1; i < len; i++) {
757
+ result[i] = read10(bc);
758
+ }
759
+ return result;
760
+ }
761
+ function write11(bc, x) {
762
+ bare.writeUintSafe(bc, x.length);
763
+ for (let i = 0; i < x.length; i++) {
764
+ write10(bc, x[i]);
764
765
  }
765
766
  }
766
- function readSqliteCommitFinalizeRequest(bc) {
767
+ function readSqliteQueryResult(bc) {
767
768
  return {
769
+ columns: read9(bc),
770
+ rows: read11(bc)
771
+ };
772
+ }
773
+ function writeSqliteQueryResult(bc, x) {
774
+ write9(bc, x.columns);
775
+ write11(bc, x.rows);
776
+ }
777
+ function read12(bc) {
778
+ return bare.readBool(bc) ? bare.readI64(bc) : null;
779
+ }
780
+ function write12(bc, x) {
781
+ bare.writeBool(bc, x != null);
782
+ if (x != null) {
783
+ bare.writeI64(bc, x);
784
+ }
785
+ }
786
+ function readSqliteExecuteResult(bc) {
787
+ return {
788
+ columns: read9(bc),
789
+ rows: read11(bc),
790
+ changes: bare.readI64(bc),
791
+ lastInsertRowId: read12(bc)
792
+ };
793
+ }
794
+ function writeSqliteExecuteResult(bc, x) {
795
+ write9(bc, x.columns);
796
+ write11(bc, x.rows);
797
+ bare.writeI64(bc, x.changes);
798
+ write12(bc, x.lastInsertRowId);
799
+ }
800
+ function readSqliteExecRequest(bc) {
801
+ return {
802
+ namespaceId: readId(bc),
803
+ actorId: readId(bc),
804
+ generation: readSqliteGeneration(bc),
805
+ sql: bare.readString(bc)
806
+ };
807
+ }
808
+ function writeSqliteExecRequest(bc, x) {
809
+ writeId(bc, x.namespaceId);
810
+ writeId(bc, x.actorId);
811
+ writeSqliteGeneration(bc, x.generation);
812
+ bare.writeString(bc, x.sql);
813
+ }
814
+ function read13(bc) {
815
+ const len = bare.readUintSafe(bc);
816
+ if (len === 0) {
817
+ return [];
818
+ }
819
+ const result = [readSqliteBindParam(bc)];
820
+ for (let i = 1; i < len; i++) {
821
+ result[i] = readSqliteBindParam(bc);
822
+ }
823
+ return result;
824
+ }
825
+ function write13(bc, x) {
826
+ bare.writeUintSafe(bc, x.length);
827
+ for (let i = 0; i < x.length; i++) {
828
+ writeSqliteBindParam(bc, x[i]);
829
+ }
830
+ }
831
+ function read14(bc) {
832
+ return bare.readBool(bc) ? read13(bc) : null;
833
+ }
834
+ function write14(bc, x) {
835
+ bare.writeBool(bc, x != null);
836
+ if (x != null) {
837
+ write13(bc, x);
838
+ }
839
+ }
840
+ function readSqliteExecuteRequest(bc) {
841
+ return {
842
+ namespaceId: readId(bc),
768
843
  actorId: readId(bc),
769
844
  generation: readSqliteGeneration(bc),
770
- expectedHeadTxid: readSqliteTxid(bc),
771
- txid: readSqliteTxid(bc),
772
- newDbSizePages: bare.readU32(bc)
845
+ sql: bare.readString(bc),
846
+ params: read14(bc)
773
847
  };
774
848
  }
775
- function writeSqliteCommitFinalizeRequest(bc, x) {
849
+ function writeSqliteExecuteRequest(bc, x) {
850
+ writeId(bc, x.namespaceId);
776
851
  writeId(bc, x.actorId);
777
852
  writeSqliteGeneration(bc, x.generation);
778
- writeSqliteTxid(bc, x.expectedHeadTxid);
779
- writeSqliteTxid(bc, x.txid);
780
- bare.writeU32(bc, x.newDbSizePages);
853
+ bare.writeString(bc, x.sql);
854
+ write14(bc, x.params);
781
855
  }
782
- function readSqliteCommitFinalizeOk(bc) {
856
+ function readSqliteExecOk(bc) {
783
857
  return {
784
- newHeadTxid: readSqliteTxid(bc),
785
- meta: readSqliteMeta(bc)
858
+ result: readSqliteQueryResult(bc)
786
859
  };
787
860
  }
788
- function writeSqliteCommitFinalizeOk(bc, x) {
789
- writeSqliteTxid(bc, x.newHeadTxid);
790
- writeSqliteMeta(bc, x.meta);
861
+ function writeSqliteExecOk(bc, x) {
862
+ writeSqliteQueryResult(bc, x.result);
791
863
  }
792
- function readSqliteStageNotFound(bc) {
864
+ function readSqliteExecuteOk(bc) {
793
865
  return {
794
- stageId: readSqliteStageId(bc)
866
+ result: readSqliteExecuteResult(bc)
795
867
  };
796
868
  }
797
- function writeSqliteStageNotFound(bc, x) {
798
- writeSqliteStageId(bc, x.stageId);
869
+ function writeSqliteExecuteOk(bc, x) {
870
+ writeSqliteExecuteResult(bc, x.result);
799
871
  }
800
- function readSqliteCommitFinalizeResponse(bc) {
872
+ function readSqliteExecResponse(bc) {
801
873
  const offset = bc.offset;
802
874
  const tag = bare.readU8(bc);
803
875
  switch (tag) {
804
876
  case 0:
805
- return { tag: "SqliteCommitFinalizeOk", val: readSqliteCommitFinalizeOk(bc) };
877
+ return { tag: "SqliteExecOk", val: readSqliteExecOk(bc) };
806
878
  case 1:
807
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
808
- case 2:
809
- return { tag: "SqliteStageNotFound", val: readSqliteStageNotFound(bc) };
810
- case 3:
811
879
  return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
812
880
  default: {
813
881
  bc.offset = offset;
@@ -815,42 +883,48 @@ function readSqliteCommitFinalizeResponse(bc) {
815
883
  }
816
884
  }
817
885
  }
818
- function writeSqliteCommitFinalizeResponse(bc, x) {
886
+ function writeSqliteExecResponse(bc, x) {
819
887
  switch (x.tag) {
820
- case "SqliteCommitFinalizeOk": {
888
+ case "SqliteExecOk": {
821
889
  bare.writeU8(bc, 0);
822
- writeSqliteCommitFinalizeOk(bc, x.val);
890
+ writeSqliteExecOk(bc, x.val);
823
891
  break;
824
892
  }
825
- case "SqliteFenceMismatch": {
893
+ case "SqliteErrorResponse": {
826
894
  bare.writeU8(bc, 1);
827
- writeSqliteFenceMismatch(bc, x.val);
895
+ writeSqliteErrorResponse(bc, x.val);
828
896
  break;
829
897
  }
830
- case "SqliteStageNotFound": {
831
- bare.writeU8(bc, 2);
832
- writeSqliteStageNotFound(bc, x.val);
898
+ }
899
+ }
900
+ function readSqliteExecuteResponse(bc) {
901
+ const offset = bc.offset;
902
+ const tag = bare.readU8(bc);
903
+ switch (tag) {
904
+ case 0:
905
+ return { tag: "SqliteExecuteOk", val: readSqliteExecuteOk(bc) };
906
+ case 1:
907
+ return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
908
+ default: {
909
+ bc.offset = offset;
910
+ throw new bare.BareError(offset, "invalid tag");
911
+ }
912
+ }
913
+ }
914
+ function writeSqliteExecuteResponse(bc, x) {
915
+ switch (x.tag) {
916
+ case "SqliteExecuteOk": {
917
+ bare.writeU8(bc, 0);
918
+ writeSqliteExecuteOk(bc, x.val);
833
919
  break;
834
920
  }
835
921
  case "SqliteErrorResponse": {
836
- bare.writeU8(bc, 3);
922
+ bare.writeU8(bc, 1);
837
923
  writeSqliteErrorResponse(bc, x.val);
838
924
  break;
839
925
  }
840
926
  }
841
927
  }
842
- function readSqliteStartupData(bc) {
843
- return {
844
- generation: readSqliteGeneration(bc),
845
- meta: readSqliteMeta(bc),
846
- preloadedPages: read7(bc)
847
- };
848
- }
849
- function writeSqliteStartupData(bc, x) {
850
- writeSqliteGeneration(bc, x.generation);
851
- writeSqliteMeta(bc, x.meta);
852
- write7(bc, x.preloadedPages);
853
- }
854
928
  var StopCode = /* @__PURE__ */ ((StopCode2) => {
855
929
  StopCode2["Ok"] = "Ok";
856
930
  StopCode2["Error"] = "Error";
@@ -890,19 +964,19 @@ function readActorName(bc) {
890
964
  function writeActorName(bc, x) {
891
965
  writeJson(bc, x.metadata);
892
966
  }
893
- function read9(bc) {
967
+ function read15(bc) {
894
968
  return bare.readBool(bc) ? bare.readString(bc) : null;
895
969
  }
896
- function write9(bc, x) {
970
+ function write15(bc, x) {
897
971
  bare.writeBool(bc, x != null);
898
972
  if (x != null) {
899
973
  bare.writeString(bc, x);
900
974
  }
901
975
  }
902
- function read10(bc) {
976
+ function read16(bc) {
903
977
  return bare.readBool(bc) ? bare.readData(bc) : null;
904
978
  }
905
- function write10(bc, x) {
979
+ function write16(bc, x) {
906
980
  bare.writeBool(bc, x != null);
907
981
  if (x != null) {
908
982
  bare.writeData(bc, x);
@@ -911,16 +985,16 @@ function write10(bc, x) {
911
985
  function readActorConfig(bc) {
912
986
  return {
913
987
  name: bare.readString(bc),
914
- key: read9(bc),
988
+ key: read15(bc),
915
989
  createTs: bare.readI64(bc),
916
- input: read10(bc)
990
+ input: read16(bc)
917
991
  };
918
992
  }
919
993
  function writeActorConfig(bc, x) {
920
994
  bare.writeString(bc, x.name);
921
- write9(bc, x.key);
995
+ write15(bc, x.key);
922
996
  bare.writeI64(bc, x.createTs);
923
- write10(bc, x.input);
997
+ write16(bc, x.input);
924
998
  }
925
999
  function readActorCheckpoint(bc) {
926
1000
  return {
@@ -963,12 +1037,12 @@ function writeActorIntent(bc, x) {
963
1037
  function readActorStateStopped(bc) {
964
1038
  return {
965
1039
  code: readStopCode(bc),
966
- message: read9(bc)
1040
+ message: read15(bc)
967
1041
  };
968
1042
  }
969
1043
  function writeActorStateStopped(bc, x) {
970
1044
  writeStopCode(bc, x.code);
971
- write9(bc, x.message);
1045
+ write15(bc, x.message);
972
1046
  }
973
1047
  function readActorState(bc) {
974
1048
  const offset = bc.offset;
@@ -1013,22 +1087,13 @@ function readEventActorStateUpdate(bc) {
1013
1087
  function writeEventActorStateUpdate(bc, x) {
1014
1088
  writeActorState(bc, x.state);
1015
1089
  }
1016
- function read11(bc) {
1017
- return bare.readBool(bc) ? bare.readI64(bc) : null;
1018
- }
1019
- function write11(bc, x) {
1020
- bare.writeBool(bc, x != null);
1021
- if (x != null) {
1022
- bare.writeI64(bc, x);
1023
- }
1024
- }
1025
1090
  function readEventActorSetAlarm(bc) {
1026
1091
  return {
1027
- alarmTs: read11(bc)
1092
+ alarmTs: read12(bc)
1028
1093
  };
1029
1094
  }
1030
1095
  function writeEventActorSetAlarm(bc, x) {
1031
- write11(bc, x.alarmTs);
1096
+ write12(bc, x.alarmTs);
1032
1097
  }
1033
1098
  function readEvent(bc) {
1034
1099
  const offset = bc.offset;
@@ -1087,7 +1152,7 @@ function writePreloadedKvEntry(bc, x) {
1087
1152
  writeKvValue(bc, x.value);
1088
1153
  writeKvMetadata(bc, x.metadata);
1089
1154
  }
1090
- function read12(bc) {
1155
+ function read17(bc) {
1091
1156
  const len = bare.readUintSafe(bc);
1092
1157
  if (len === 0) {
1093
1158
  return [];
@@ -1098,7 +1163,7 @@ function read12(bc) {
1098
1163
  }
1099
1164
  return result;
1100
1165
  }
1101
- function write12(bc, x) {
1166
+ function write17(bc, x) {
1102
1167
  bare.writeUintSafe(bc, x.length);
1103
1168
  for (let i = 0; i < x.length; i++) {
1104
1169
  writePreloadedKvEntry(bc, x[i]);
@@ -1106,13 +1171,13 @@ function write12(bc, x) {
1106
1171
  }
1107
1172
  function readPreloadedKv(bc) {
1108
1173
  return {
1109
- entries: read12(bc),
1174
+ entries: read17(bc),
1110
1175
  requestedGetKeys: read0(bc),
1111
1176
  requestedPrefixes: read0(bc)
1112
1177
  };
1113
1178
  }
1114
1179
  function writePreloadedKv(bc, x) {
1115
- write12(bc, x.entries);
1180
+ write17(bc, x.entries);
1116
1181
  write0(bc, x.requestedGetKeys);
1117
1182
  write0(bc, x.requestedPrefixes);
1118
1183
  }
@@ -1126,7 +1191,7 @@ function writeHibernatingRequest(bc, x) {
1126
1191
  writeGatewayId(bc, x.gatewayId);
1127
1192
  writeRequestId(bc, x.requestId);
1128
1193
  }
1129
- function read13(bc) {
1194
+ function read18(bc) {
1130
1195
  const len = bare.readUintSafe(bc);
1131
1196
  if (len === 0) {
1132
1197
  return [];
@@ -1137,43 +1202,32 @@ function read13(bc) {
1137
1202
  }
1138
1203
  return result;
1139
1204
  }
1140
- function write13(bc, x) {
1205
+ function write18(bc, x) {
1141
1206
  bare.writeUintSafe(bc, x.length);
1142
1207
  for (let i = 0; i < x.length; i++) {
1143
1208
  writeHibernatingRequest(bc, x[i]);
1144
1209
  }
1145
1210
  }
1146
- function read14(bc) {
1211
+ function read19(bc) {
1147
1212
  return bare.readBool(bc) ? readPreloadedKv(bc) : null;
1148
1213
  }
1149
- function write14(bc, x) {
1214
+ function write19(bc, x) {
1150
1215
  bare.writeBool(bc, x != null);
1151
1216
  if (x != null) {
1152
1217
  writePreloadedKv(bc, x);
1153
1218
  }
1154
1219
  }
1155
- function read15(bc) {
1156
- return bare.readBool(bc) ? readSqliteStartupData(bc) : null;
1157
- }
1158
- function write15(bc, x) {
1159
- bare.writeBool(bc, x != null);
1160
- if (x != null) {
1161
- writeSqliteStartupData(bc, x);
1162
- }
1163
- }
1164
1220
  function readCommandStartActor(bc) {
1165
1221
  return {
1166
1222
  config: readActorConfig(bc),
1167
- hibernatingRequests: read13(bc),
1168
- preloadedKv: read14(bc),
1169
- sqliteStartupData: read15(bc)
1223
+ hibernatingRequests: read18(bc),
1224
+ preloadedKv: read19(bc)
1170
1225
  };
1171
1226
  }
1172
1227
  function writeCommandStartActor(bc, x) {
1173
1228
  writeActorConfig(bc, x.config);
1174
- write13(bc, x.hibernatingRequests);
1175
- write14(bc, x.preloadedKv);
1176
- write15(bc, x.sqliteStartupData);
1229
+ write18(bc, x.hibernatingRequests);
1230
+ write19(bc, x.preloadedKv);
1177
1231
  }
1178
1232
  var StopActorReason = /* @__PURE__ */ ((StopActorReason2) => {
1179
1233
  StopActorReason2["SleepIntent"] = "SleepIntent";
@@ -1330,7 +1384,7 @@ function writeMessageId(bc, x) {
1330
1384
  writeRequestId(bc, x.requestId);
1331
1385
  writeMessageIndex(bc, x.messageIndex);
1332
1386
  }
1333
- function read16(bc) {
1387
+ function read20(bc) {
1334
1388
  const len = bare.readUintSafe(bc);
1335
1389
  const result = /* @__PURE__ */ new Map();
1336
1390
  for (let i = 0; i < len; i++) {
@@ -1344,7 +1398,7 @@ function read16(bc) {
1344
1398
  }
1345
1399
  return result;
1346
1400
  }
1347
- function write16(bc, x) {
1401
+ function write20(bc, x) {
1348
1402
  bare.writeUintSafe(bc, x.size);
1349
1403
  for (const kv of x) {
1350
1404
  bare.writeString(bc, kv[0]);
@@ -1356,8 +1410,8 @@ function readToEnvoyRequestStart(bc) {
1356
1410
  actorId: readId(bc),
1357
1411
  method: bare.readString(bc),
1358
1412
  path: bare.readString(bc),
1359
- headers: read16(bc),
1360
- body: read10(bc),
1413
+ headers: read20(bc),
1414
+ body: read16(bc),
1361
1415
  stream: bare.readBool(bc)
1362
1416
  };
1363
1417
  }
@@ -1365,8 +1419,8 @@ function writeToEnvoyRequestStart(bc, x) {
1365
1419
  writeId(bc, x.actorId);
1366
1420
  bare.writeString(bc, x.method);
1367
1421
  bare.writeString(bc, x.path);
1368
- write16(bc, x.headers);
1369
- write10(bc, x.body);
1422
+ write20(bc, x.headers);
1423
+ write16(bc, x.body);
1370
1424
  bare.writeBool(bc, x.stream);
1371
1425
  }
1372
1426
  function readToEnvoyRequestChunk(bc) {
@@ -1382,15 +1436,15 @@ function writeToEnvoyRequestChunk(bc, x) {
1382
1436
  function readToRivetResponseStart(bc) {
1383
1437
  return {
1384
1438
  status: bare.readU16(bc),
1385
- headers: read16(bc),
1386
- body: read10(bc),
1439
+ headers: read20(bc),
1440
+ body: read16(bc),
1387
1441
  stream: bare.readBool(bc)
1388
1442
  };
1389
1443
  }
1390
1444
  function writeToRivetResponseStart(bc, x) {
1391
1445
  bare.writeU16(bc, x.status);
1392
- write16(bc, x.headers);
1393
- write10(bc, x.body);
1446
+ write20(bc, x.headers);
1447
+ write16(bc, x.body);
1394
1448
  bare.writeBool(bc, x.stream);
1395
1449
  }
1396
1450
  function readToRivetResponseChunk(bc) {
@@ -1407,13 +1461,13 @@ function readToEnvoyWebSocketOpen(bc) {
1407
1461
  return {
1408
1462
  actorId: readId(bc),
1409
1463
  path: bare.readString(bc),
1410
- headers: read16(bc)
1464
+ headers: read20(bc)
1411
1465
  };
1412
1466
  }
1413
1467
  function writeToEnvoyWebSocketOpen(bc, x) {
1414
1468
  writeId(bc, x.actorId);
1415
1469
  bare.writeString(bc, x.path);
1416
- write16(bc, x.headers);
1470
+ write20(bc, x.headers);
1417
1471
  }
1418
1472
  function readToEnvoyWebSocketMessage(bc) {
1419
1473
  return {
@@ -1425,10 +1479,10 @@ function writeToEnvoyWebSocketMessage(bc, x) {
1425
1479
  bare.writeData(bc, x.data);
1426
1480
  bare.writeBool(bc, x.binary);
1427
1481
  }
1428
- function read17(bc) {
1482
+ function read21(bc) {
1429
1483
  return bare.readBool(bc) ? bare.readU16(bc) : null;
1430
1484
  }
1431
- function write17(bc, x) {
1485
+ function write21(bc, x) {
1432
1486
  bare.writeBool(bc, x != null);
1433
1487
  if (x != null) {
1434
1488
  bare.writeU16(bc, x);
@@ -1436,13 +1490,13 @@ function write17(bc, x) {
1436
1490
  }
1437
1491
  function readToEnvoyWebSocketClose(bc) {
1438
1492
  return {
1439
- code: read17(bc),
1440
- reason: read9(bc)
1493
+ code: read21(bc),
1494
+ reason: read15(bc)
1441
1495
  };
1442
1496
  }
1443
1497
  function writeToEnvoyWebSocketClose(bc, x) {
1444
- write17(bc, x.code);
1445
- write9(bc, x.reason);
1498
+ write21(bc, x.code);
1499
+ write15(bc, x.reason);
1446
1500
  }
1447
1501
  function readToRivetWebSocketOpen(bc) {
1448
1502
  return {
@@ -1472,14 +1526,14 @@ function writeToRivetWebSocketMessageAck(bc, x) {
1472
1526
  }
1473
1527
  function readToRivetWebSocketClose(bc) {
1474
1528
  return {
1475
- code: read17(bc),
1476
- reason: read9(bc),
1529
+ code: read21(bc),
1530
+ reason: read15(bc),
1477
1531
  hibernate: bare.readBool(bc)
1478
1532
  };
1479
1533
  }
1480
1534
  function writeToRivetWebSocketClose(bc, x) {
1481
- write17(bc, x.code);
1482
- write9(bc, x.reason);
1535
+ write21(bc, x.code);
1536
+ write15(bc, x.reason);
1483
1537
  bare.writeBool(bc, x.hibernate);
1484
1538
  }
1485
1539
  function readToRivetTunnelMessageKind(bc) {
@@ -1627,7 +1681,7 @@ function readToEnvoyPing(bc) {
1627
1681
  function writeToEnvoyPing(bc, x) {
1628
1682
  bare.writeI64(bc, x.ts);
1629
1683
  }
1630
- function read18(bc) {
1684
+ function read22(bc) {
1631
1685
  const len = bare.readUintSafe(bc);
1632
1686
  const result = /* @__PURE__ */ new Map();
1633
1687
  for (let i = 0; i < len; i++) {
@@ -1641,26 +1695,26 @@ function read18(bc) {
1641
1695
  }
1642
1696
  return result;
1643
1697
  }
1644
- function write18(bc, x) {
1698
+ function write22(bc, x) {
1645
1699
  bare.writeUintSafe(bc, x.size);
1646
1700
  for (const kv of x) {
1647
1701
  bare.writeString(bc, kv[0]);
1648
1702
  writeActorName(bc, kv[1]);
1649
1703
  }
1650
1704
  }
1651
- function read19(bc) {
1652
- return bare.readBool(bc) ? read18(bc) : null;
1705
+ function read23(bc) {
1706
+ return bare.readBool(bc) ? read22(bc) : null;
1653
1707
  }
1654
- function write19(bc, x) {
1708
+ function write23(bc, x) {
1655
1709
  bare.writeBool(bc, x != null);
1656
1710
  if (x != null) {
1657
- write18(bc, x);
1711
+ write22(bc, x);
1658
1712
  }
1659
1713
  }
1660
- function read20(bc) {
1714
+ function read24(bc) {
1661
1715
  return bare.readBool(bc) ? readJson(bc) : null;
1662
1716
  }
1663
- function write20(bc, x) {
1717
+ function write24(bc, x) {
1664
1718
  bare.writeBool(bc, x != null);
1665
1719
  if (x != null) {
1666
1720
  writeJson(bc, x);
@@ -1668,13 +1722,13 @@ function write20(bc, x) {
1668
1722
  }
1669
1723
  function readToRivetMetadata(bc) {
1670
1724
  return {
1671
- prepopulateActorNames: read19(bc),
1672
- metadata: read20(bc)
1725
+ prepopulateActorNames: read23(bc),
1726
+ metadata: read24(bc)
1673
1727
  };
1674
1728
  }
1675
1729
  function writeToRivetMetadata(bc, x) {
1676
- write19(bc, x.prepopulateActorNames);
1677
- write20(bc, x.metadata);
1730
+ write23(bc, x.prepopulateActorNames);
1731
+ write24(bc, x.metadata);
1678
1732
  }
1679
1733
  function readToRivetEvents(bc) {
1680
1734
  const len = bare.readUintSafe(bc);
@@ -1693,7 +1747,7 @@ function writeToRivetEvents(bc, x) {
1693
1747
  writeEventWrapper(bc, x[i]);
1694
1748
  }
1695
1749
  }
1696
- function read21(bc) {
1750
+ function read25(bc) {
1697
1751
  const len = bare.readUintSafe(bc);
1698
1752
  if (len === 0) {
1699
1753
  return [];
@@ -1704,7 +1758,7 @@ function read21(bc) {
1704
1758
  }
1705
1759
  return result;
1706
1760
  }
1707
- function write21(bc, x) {
1761
+ function write25(bc, x) {
1708
1762
  bare.writeUintSafe(bc, x.length);
1709
1763
  for (let i = 0; i < x.length; i++) {
1710
1764
  writeActorCheckpoint(bc, x[i]);
@@ -1712,11 +1766,11 @@ function write21(bc, x) {
1712
1766
  }
1713
1767
  function readToRivetAckCommands(bc) {
1714
1768
  return {
1715
- lastCommandCheckpoints: read21(bc)
1769
+ lastCommandCheckpoints: read25(bc)
1716
1770
  };
1717
1771
  }
1718
1772
  function writeToRivetAckCommands(bc, x) {
1719
- write21(bc, x.lastCommandCheckpoints);
1773
+ write25(bc, x.lastCommandCheckpoints);
1720
1774
  }
1721
1775
  function readToRivetPong(bc) {
1722
1776
  return {
@@ -1758,35 +1812,25 @@ function writeToRivetSqliteCommitRequest(bc, x) {
1758
1812
  bare.writeU32(bc, x.requestId);
1759
1813
  writeSqliteCommitRequest(bc, x.data);
1760
1814
  }
1761
- function readToRivetSqliteCommitStageBeginRequest(bc) {
1815
+ function readToRivetSqliteExecRequest(bc) {
1762
1816
  return {
1763
1817
  requestId: bare.readU32(bc),
1764
- data: readSqliteCommitStageBeginRequest(bc)
1818
+ data: readSqliteExecRequest(bc)
1765
1819
  };
1766
1820
  }
1767
- function writeToRivetSqliteCommitStageBeginRequest(bc, x) {
1821
+ function writeToRivetSqliteExecRequest(bc, x) {
1768
1822
  bare.writeU32(bc, x.requestId);
1769
- writeSqliteCommitStageBeginRequest(bc, x.data);
1823
+ writeSqliteExecRequest(bc, x.data);
1770
1824
  }
1771
- function readToRivetSqliteCommitStageRequest(bc) {
1825
+ function readToRivetSqliteExecuteRequest(bc) {
1772
1826
  return {
1773
1827
  requestId: bare.readU32(bc),
1774
- data: readSqliteCommitStageRequest(bc)
1828
+ data: readSqliteExecuteRequest(bc)
1775
1829
  };
1776
1830
  }
1777
- function writeToRivetSqliteCommitStageRequest(bc, x) {
1831
+ function writeToRivetSqliteExecuteRequest(bc, x) {
1778
1832
  bare.writeU32(bc, x.requestId);
1779
- writeSqliteCommitStageRequest(bc, x.data);
1780
- }
1781
- function readToRivetSqliteCommitFinalizeRequest(bc) {
1782
- return {
1783
- requestId: bare.readU32(bc),
1784
- data: readSqliteCommitFinalizeRequest(bc)
1785
- };
1786
- }
1787
- function writeToRivetSqliteCommitFinalizeRequest(bc, x) {
1788
- bare.writeU32(bc, x.requestId);
1789
- writeSqliteCommitFinalizeRequest(bc, x.data);
1833
+ writeSqliteExecuteRequest(bc, x.data);
1790
1834
  }
1791
1835
  function readToRivet(bc) {
1792
1836
  const offset = bc.offset;
@@ -1811,11 +1855,9 @@ function readToRivet(bc) {
1811
1855
  case 8:
1812
1856
  return { tag: "ToRivetSqliteCommitRequest", val: readToRivetSqliteCommitRequest(bc) };
1813
1857
  case 9:
1814
- return { tag: "ToRivetSqliteCommitStageBeginRequest", val: readToRivetSqliteCommitStageBeginRequest(bc) };
1858
+ return { tag: "ToRivetSqliteExecRequest", val: readToRivetSqliteExecRequest(bc) };
1815
1859
  case 10:
1816
- return { tag: "ToRivetSqliteCommitStageRequest", val: readToRivetSqliteCommitStageRequest(bc) };
1817
- case 11:
1818
- return { tag: "ToRivetSqliteCommitFinalizeRequest", val: readToRivetSqliteCommitFinalizeRequest(bc) };
1860
+ return { tag: "ToRivetSqliteExecuteRequest", val: readToRivetSqliteExecuteRequest(bc) };
1819
1861
  default: {
1820
1862
  bc.offset = offset;
1821
1863
  throw new bare.BareError(offset, "invalid tag");
@@ -1868,19 +1910,14 @@ function writeToRivet(bc, x) {
1868
1910
  writeToRivetSqliteCommitRequest(bc, x.val);
1869
1911
  break;
1870
1912
  }
1871
- case "ToRivetSqliteCommitStageBeginRequest": {
1913
+ case "ToRivetSqliteExecRequest": {
1872
1914
  bare.writeU8(bc, 9);
1873
- writeToRivetSqliteCommitStageBeginRequest(bc, x.val);
1915
+ writeToRivetSqliteExecRequest(bc, x.val);
1874
1916
  break;
1875
1917
  }
1876
- case "ToRivetSqliteCommitStageRequest": {
1918
+ case "ToRivetSqliteExecuteRequest": {
1877
1919
  bare.writeU8(bc, 10);
1878
- writeToRivetSqliteCommitStageRequest(bc, x.val);
1879
- break;
1880
- }
1881
- case "ToRivetSqliteCommitFinalizeRequest": {
1882
- bare.writeU8(bc, 11);
1883
- writeToRivetSqliteCommitFinalizeRequest(bc, x.val);
1920
+ writeToRivetSqliteExecuteRequest(bc, x.val);
1884
1921
  break;
1885
1922
  }
1886
1923
  }
@@ -1941,11 +1978,11 @@ function writeToEnvoyCommands(bc, x) {
1941
1978
  }
1942
1979
  function readToEnvoyAckEvents(bc) {
1943
1980
  return {
1944
- lastEventCheckpoints: read21(bc)
1981
+ lastEventCheckpoints: read25(bc)
1945
1982
  };
1946
1983
  }
1947
1984
  function writeToEnvoyAckEvents(bc, x) {
1948
- write21(bc, x.lastEventCheckpoints);
1985
+ write25(bc, x.lastEventCheckpoints);
1949
1986
  }
1950
1987
  function readToEnvoyKvResponse(bc) {
1951
1988
  return {
@@ -1977,35 +2014,25 @@ function writeToEnvoySqliteCommitResponse(bc, x) {
1977
2014
  bare.writeU32(bc, x.requestId);
1978
2015
  writeSqliteCommitResponse(bc, x.data);
1979
2016
  }
1980
- function readToEnvoySqliteCommitStageBeginResponse(bc) {
2017
+ function readToEnvoySqliteExecResponse(bc) {
1981
2018
  return {
1982
2019
  requestId: bare.readU32(bc),
1983
- data: readSqliteCommitStageBeginResponse(bc)
2020
+ data: readSqliteExecResponse(bc)
1984
2021
  };
1985
2022
  }
1986
- function writeToEnvoySqliteCommitStageBeginResponse(bc, x) {
2023
+ function writeToEnvoySqliteExecResponse(bc, x) {
1987
2024
  bare.writeU32(bc, x.requestId);
1988
- writeSqliteCommitStageBeginResponse(bc, x.data);
2025
+ writeSqliteExecResponse(bc, x.data);
1989
2026
  }
1990
- function readToEnvoySqliteCommitStageResponse(bc) {
2027
+ function readToEnvoySqliteExecuteResponse(bc) {
1991
2028
  return {
1992
2029
  requestId: bare.readU32(bc),
1993
- data: readSqliteCommitStageResponse(bc)
2030
+ data: readSqliteExecuteResponse(bc)
1994
2031
  };
1995
2032
  }
1996
- function writeToEnvoySqliteCommitStageResponse(bc, x) {
2033
+ function writeToEnvoySqliteExecuteResponse(bc, x) {
1997
2034
  bare.writeU32(bc, x.requestId);
1998
- writeSqliteCommitStageResponse(bc, x.data);
1999
- }
2000
- function readToEnvoySqliteCommitFinalizeResponse(bc) {
2001
- return {
2002
- requestId: bare.readU32(bc),
2003
- data: readSqliteCommitFinalizeResponse(bc)
2004
- };
2005
- }
2006
- function writeToEnvoySqliteCommitFinalizeResponse(bc, x) {
2007
- bare.writeU32(bc, x.requestId);
2008
- writeSqliteCommitFinalizeResponse(bc, x.data);
2035
+ writeSqliteExecuteResponse(bc, x.data);
2009
2036
  }
2010
2037
  function readToEnvoy(bc) {
2011
2038
  const offset = bc.offset;
@@ -2028,11 +2055,9 @@ function readToEnvoy(bc) {
2028
2055
  case 7:
2029
2056
  return { tag: "ToEnvoySqliteCommitResponse", val: readToEnvoySqliteCommitResponse(bc) };
2030
2057
  case 8:
2031
- return { tag: "ToEnvoySqliteCommitStageBeginResponse", val: readToEnvoySqliteCommitStageBeginResponse(bc) };
2058
+ return { tag: "ToEnvoySqliteExecResponse", val: readToEnvoySqliteExecResponse(bc) };
2032
2059
  case 9:
2033
- return { tag: "ToEnvoySqliteCommitStageResponse", val: readToEnvoySqliteCommitStageResponse(bc) };
2034
- case 10:
2035
- return { tag: "ToEnvoySqliteCommitFinalizeResponse", val: readToEnvoySqliteCommitFinalizeResponse(bc) };
2060
+ return { tag: "ToEnvoySqliteExecuteResponse", val: readToEnvoySqliteExecuteResponse(bc) };
2036
2061
  default: {
2037
2062
  bc.offset = offset;
2038
2063
  throw new bare.BareError(offset, "invalid tag");
@@ -2081,19 +2106,14 @@ function writeToEnvoy(bc, x) {
2081
2106
  writeToEnvoySqliteCommitResponse(bc, x.val);
2082
2107
  break;
2083
2108
  }
2084
- case "ToEnvoySqliteCommitStageBeginResponse": {
2109
+ case "ToEnvoySqliteExecResponse": {
2085
2110
  bare.writeU8(bc, 8);
2086
- writeToEnvoySqliteCommitStageBeginResponse(bc, x.val);
2111
+ writeToEnvoySqliteExecResponse(bc, x.val);
2087
2112
  break;
2088
2113
  }
2089
- case "ToEnvoySqliteCommitStageResponse": {
2114
+ case "ToEnvoySqliteExecuteResponse": {
2090
2115
  bare.writeU8(bc, 9);
2091
- writeToEnvoySqliteCommitStageResponse(bc, x.val);
2092
- break;
2093
- }
2094
- case "ToEnvoySqliteCommitFinalizeResponse": {
2095
- bare.writeU8(bc, 10);
2096
- writeToEnvoySqliteCommitFinalizeResponse(bc, x.val);
2116
+ writeToEnvoySqliteExecuteResponse(bc, x.val);
2097
2117
  break;
2098
2118
  }
2099
2119
  }
@@ -2302,7 +2322,7 @@ function decodeToOutbound(bytes) {
2302
2322
  function assert(condition, message) {
2303
2323
  if (!condition) throw new Error(message ?? "Assertion failed");
2304
2324
  }
2305
- var VERSION = 2;
2325
+ var VERSION = 5;
2306
2326
  export {
2307
2327
  StopActorReason,
2308
2328
  StopCode,
@@ -2361,34 +2381,32 @@ export {
2361
2381
  readPreloadedKvEntry,
2362
2382
  readProtocolMetadata,
2363
2383
  readRequestId,
2364
- readSqliteCommitFinalizeOk,
2365
- readSqliteCommitFinalizeRequest,
2366
- readSqliteCommitFinalizeResponse,
2384
+ readSqliteBindParam,
2385
+ readSqliteColumnValue,
2367
2386
  readSqliteCommitOk,
2368
2387
  readSqliteCommitRequest,
2369
2388
  readSqliteCommitResponse,
2370
- readSqliteCommitStageBeginOk,
2371
- readSqliteCommitStageBeginRequest,
2372
- readSqliteCommitStageBeginResponse,
2373
- readSqliteCommitStageOk,
2374
- readSqliteCommitStageRequest,
2375
- readSqliteCommitStageResponse,
2376
- readSqliteCommitTooLarge,
2377
2389
  readSqliteDirtyPage,
2378
2390
  readSqliteErrorResponse,
2379
- readSqliteFenceMismatch,
2391
+ readSqliteExecOk,
2392
+ readSqliteExecRequest,
2393
+ readSqliteExecResponse,
2394
+ readSqliteExecuteOk,
2395
+ readSqliteExecuteRequest,
2396
+ readSqliteExecuteResponse,
2397
+ readSqliteExecuteResult,
2380
2398
  readSqliteFetchedPage,
2381
2399
  readSqliteGeneration,
2382
2400
  readSqliteGetPagesOk,
2383
2401
  readSqliteGetPagesRequest,
2384
2402
  readSqliteGetPagesResponse,
2385
- readSqliteMeta,
2386
2403
  readSqlitePageBytes,
2387
2404
  readSqlitePgno,
2388
- readSqliteStageId,
2389
- readSqliteStageNotFound,
2390
- readSqliteStartupData,
2391
- readSqliteTxid,
2405
+ readSqliteQueryResult,
2406
+ readSqliteValueBlob,
2407
+ readSqliteValueFloat,
2408
+ readSqliteValueInteger,
2409
+ readSqliteValueText,
2392
2410
  readStopActorReason,
2393
2411
  readStopCode,
2394
2412
  readToEnvoy,
@@ -2401,10 +2419,9 @@ export {
2401
2419
  readToEnvoyPing,
2402
2420
  readToEnvoyRequestChunk,
2403
2421
  readToEnvoyRequestStart,
2404
- readToEnvoySqliteCommitFinalizeResponse,
2405
2422
  readToEnvoySqliteCommitResponse,
2406
- readToEnvoySqliteCommitStageBeginResponse,
2407
- readToEnvoySqliteCommitStageResponse,
2423
+ readToEnvoySqliteExecResponse,
2424
+ readToEnvoySqliteExecuteResponse,
2408
2425
  readToEnvoySqliteGetPagesResponse,
2409
2426
  readToEnvoyTunnelMessage,
2410
2427
  readToEnvoyTunnelMessageKind,
@@ -2423,10 +2440,9 @@ export {
2423
2440
  readToRivetPong,
2424
2441
  readToRivetResponseChunk,
2425
2442
  readToRivetResponseStart,
2426
- readToRivetSqliteCommitFinalizeRequest,
2427
2443
  readToRivetSqliteCommitRequest,
2428
- readToRivetSqliteCommitStageBeginRequest,
2429
- readToRivetSqliteCommitStageRequest,
2444
+ readToRivetSqliteExecRequest,
2445
+ readToRivetSqliteExecuteRequest,
2430
2446
  readToRivetSqliteGetPagesRequest,
2431
2447
  readToRivetTunnelMessage,
2432
2448
  readToRivetTunnelMessageKind,
@@ -2476,34 +2492,32 @@ export {
2476
2492
  writePreloadedKvEntry,
2477
2493
  writeProtocolMetadata,
2478
2494
  writeRequestId,
2479
- writeSqliteCommitFinalizeOk,
2480
- writeSqliteCommitFinalizeRequest,
2481
- writeSqliteCommitFinalizeResponse,
2495
+ writeSqliteBindParam,
2496
+ writeSqliteColumnValue,
2482
2497
  writeSqliteCommitOk,
2483
2498
  writeSqliteCommitRequest,
2484
2499
  writeSqliteCommitResponse,
2485
- writeSqliteCommitStageBeginOk,
2486
- writeSqliteCommitStageBeginRequest,
2487
- writeSqliteCommitStageBeginResponse,
2488
- writeSqliteCommitStageOk,
2489
- writeSqliteCommitStageRequest,
2490
- writeSqliteCommitStageResponse,
2491
- writeSqliteCommitTooLarge,
2492
2500
  writeSqliteDirtyPage,
2493
2501
  writeSqliteErrorResponse,
2494
- writeSqliteFenceMismatch,
2502
+ writeSqliteExecOk,
2503
+ writeSqliteExecRequest,
2504
+ writeSqliteExecResponse,
2505
+ writeSqliteExecuteOk,
2506
+ writeSqliteExecuteRequest,
2507
+ writeSqliteExecuteResponse,
2508
+ writeSqliteExecuteResult,
2495
2509
  writeSqliteFetchedPage,
2496
2510
  writeSqliteGeneration,
2497
2511
  writeSqliteGetPagesOk,
2498
2512
  writeSqliteGetPagesRequest,
2499
2513
  writeSqliteGetPagesResponse,
2500
- writeSqliteMeta,
2501
2514
  writeSqlitePageBytes,
2502
2515
  writeSqlitePgno,
2503
- writeSqliteStageId,
2504
- writeSqliteStageNotFound,
2505
- writeSqliteStartupData,
2506
- writeSqliteTxid,
2516
+ writeSqliteQueryResult,
2517
+ writeSqliteValueBlob,
2518
+ writeSqliteValueFloat,
2519
+ writeSqliteValueInteger,
2520
+ writeSqliteValueText,
2507
2521
  writeStopActorReason,
2508
2522
  writeStopCode,
2509
2523
  writeToEnvoy,
@@ -2516,10 +2530,9 @@ export {
2516
2530
  writeToEnvoyPing,
2517
2531
  writeToEnvoyRequestChunk,
2518
2532
  writeToEnvoyRequestStart,
2519
- writeToEnvoySqliteCommitFinalizeResponse,
2520
2533
  writeToEnvoySqliteCommitResponse,
2521
- writeToEnvoySqliteCommitStageBeginResponse,
2522
- writeToEnvoySqliteCommitStageResponse,
2534
+ writeToEnvoySqliteExecResponse,
2535
+ writeToEnvoySqliteExecuteResponse,
2523
2536
  writeToEnvoySqliteGetPagesResponse,
2524
2537
  writeToEnvoyTunnelMessage,
2525
2538
  writeToEnvoyTunnelMessageKind,
@@ -2538,10 +2551,9 @@ export {
2538
2551
  writeToRivetPong,
2539
2552
  writeToRivetResponseChunk,
2540
2553
  writeToRivetResponseStart,
2541
- writeToRivetSqliteCommitFinalizeRequest,
2542
2554
  writeToRivetSqliteCommitRequest,
2543
- writeToRivetSqliteCommitStageBeginRequest,
2544
- writeToRivetSqliteCommitStageRequest,
2555
+ writeToRivetSqliteExecRequest,
2556
+ writeToRivetSqliteExecuteRequest,
2545
2557
  writeToRivetSqliteGetPagesRequest,
2546
2558
  writeToRivetTunnelMessage,
2547
2559
  writeToRivetTunnelMessageKind,