@rivetkit/engine-envoy-protocol 0.0.0-pr.4882.e847a5c → 0.0.0-pr.4931.7575e83

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 +137 -174
  2. package/dist/index.js +392 -397
  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);
@@ -503,13 +463,11 @@ function write7(bc, x) {
503
463
  }
504
464
  function readSqliteGetPagesOk(bc) {
505
465
  return {
506
- pages: read7(bc),
507
- meta: readSqliteMeta(bc)
466
+ pages: read7(bc)
508
467
  };
509
468
  }
510
469
  function writeSqliteGetPagesOk(bc, x) {
511
470
  write7(bc, x.pages);
512
- writeSqliteMeta(bc, x.meta);
513
471
  }
514
472
  function readSqliteErrorResponse(bc) {
515
473
  return {
@@ -526,8 +484,6 @@ function readSqliteGetPagesResponse(bc) {
526
484
  case 0:
527
485
  return { tag: "SqliteGetPagesOk", val: readSqliteGetPagesOk(bc) };
528
486
  case 1:
529
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
530
- case 2:
531
487
  return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
532
488
  default: {
533
489
  bc.offset = offset;
@@ -542,13 +498,8 @@ function writeSqliteGetPagesResponse(bc, x) {
542
498
  writeSqliteGetPagesOk(bc, x.val);
543
499
  break;
544
500
  }
545
- case "SqliteFenceMismatch": {
546
- bare.writeU8(bc, 1);
547
- writeSqliteFenceMismatch(bc, x.val);
548
- break;
549
- }
550
501
  case "SqliteErrorResponse": {
551
- bare.writeU8(bc, 2);
502
+ bare.writeU8(bc, 1);
552
503
  writeSqliteErrorResponse(bc, x.val);
553
504
  break;
554
505
  }
@@ -574,50 +525,28 @@ function write8(bc, x) {
574
525
  function readSqliteCommitRequest(bc) {
575
526
  return {
576
527
  actorId: readId(bc),
577
- generation: readSqliteGeneration(bc),
578
- expectedHeadTxid: readSqliteTxid(bc),
579
528
  dirtyPages: read8(bc),
580
- newDbSizePages: bare.readU32(bc)
529
+ dbSizePages: bare.readU32(bc),
530
+ nowMs: bare.readI64(bc),
531
+ expectedGeneration: read2(bc),
532
+ expectedHeadTxid: read2(bc)
581
533
  };
582
534
  }
583
535
  function writeSqliteCommitRequest(bc, x) {
584
536
  writeId(bc, x.actorId);
585
- writeSqliteGeneration(bc, x.generation);
586
- writeSqliteTxid(bc, x.expectedHeadTxid);
587
537
  write8(bc, x.dirtyPages);
588
- bare.writeU32(bc, x.newDbSizePages);
589
- }
590
- function readSqliteCommitOk(bc) {
591
- return {
592
- newHeadTxid: readSqliteTxid(bc),
593
- meta: readSqliteMeta(bc)
594
- };
595
- }
596
- 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);
538
+ bare.writeU32(bc, x.dbSizePages);
539
+ bare.writeI64(bc, x.nowMs);
540
+ write2(bc, x.expectedGeneration);
541
+ write2(bc, x.expectedHeadTxid);
609
542
  }
610
543
  function readSqliteCommitResponse(bc) {
611
544
  const offset = bc.offset;
612
545
  const tag = bare.readU8(bc);
613
546
  switch (tag) {
614
547
  case 0:
615
- return { tag: "SqliteCommitOk", val: readSqliteCommitOk(bc) };
548
+ return { tag: "SqliteCommitOk", val: null };
616
549
  case 1:
617
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
618
- case 2:
619
- return { tag: "SqliteCommitTooLarge", val: readSqliteCommitTooLarge(bc) };
620
- case 3:
621
550
  return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
622
551
  default: {
623
552
  bc.offset = offset;
@@ -629,185 +558,309 @@ function writeSqliteCommitResponse(bc, x) {
629
558
  switch (x.tag) {
630
559
  case "SqliteCommitOk": {
631
560
  bare.writeU8(bc, 0);
632
- writeSqliteCommitOk(bc, x.val);
633
- break;
634
- }
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
561
  break;
644
562
  }
645
563
  case "SqliteErrorResponse": {
646
- bare.writeU8(bc, 3);
564
+ bare.writeU8(bc, 1);
647
565
  writeSqliteErrorResponse(bc, x.val);
648
566
  break;
649
567
  }
650
568
  }
651
569
  }
652
- function readSqliteCommitStageBeginRequest(bc) {
570
+ function readSqliteValueInteger(bc) {
653
571
  return {
654
- actorId: readId(bc),
655
- generation: readSqliteGeneration(bc)
572
+ value: bare.readI64(bc)
656
573
  };
657
574
  }
658
- function writeSqliteCommitStageBeginRequest(bc, x) {
659
- writeId(bc, x.actorId);
660
- writeSqliteGeneration(bc, x.generation);
575
+ function writeSqliteValueInteger(bc, x) {
576
+ bare.writeI64(bc, x.value);
577
+ }
578
+ function readSqliteValueFloat(bc) {
579
+ return {
580
+ value: bare.readFixedData(bc, 8)
581
+ };
582
+ }
583
+ function writeSqliteValueFloat(bc, x) {
584
+ {
585
+ assert(x.value.byteLength === 8);
586
+ bare.writeFixedData(bc, x.value);
587
+ }
588
+ }
589
+ function readSqliteValueText(bc) {
590
+ return {
591
+ value: bare.readString(bc)
592
+ };
593
+ }
594
+ function writeSqliteValueText(bc, x) {
595
+ bare.writeString(bc, x.value);
661
596
  }
662
- function readSqliteCommitStageBeginOk(bc) {
597
+ function readSqliteValueBlob(bc) {
663
598
  return {
664
- txid: readSqliteTxid(bc)
599
+ value: bare.readData(bc)
665
600
  };
666
601
  }
667
- function writeSqliteCommitStageBeginOk(bc, x) {
668
- writeSqliteTxid(bc, x.txid);
602
+ function writeSqliteValueBlob(bc, x) {
603
+ bare.writeData(bc, x.value);
669
604
  }
670
- function readSqliteCommitStageBeginResponse(bc) {
605
+ function readSqliteBindParam(bc) {
671
606
  const offset = bc.offset;
672
607
  const tag = bare.readU8(bc);
673
608
  switch (tag) {
674
609
  case 0:
675
- return { tag: "SqliteCommitStageBeginOk", val: readSqliteCommitStageBeginOk(bc) };
610
+ return { tag: "SqliteValueNull", val: null };
676
611
  case 1:
677
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
612
+ return { tag: "SqliteValueInteger", val: readSqliteValueInteger(bc) };
678
613
  case 2:
679
- return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
614
+ return { tag: "SqliteValueFloat", val: readSqliteValueFloat(bc) };
615
+ case 3:
616
+ return { tag: "SqliteValueText", val: readSqliteValueText(bc) };
617
+ case 4:
618
+ return { tag: "SqliteValueBlob", val: readSqliteValueBlob(bc) };
680
619
  default: {
681
620
  bc.offset = offset;
682
621
  throw new bare.BareError(offset, "invalid tag");
683
622
  }
684
623
  }
685
624
  }
686
- function writeSqliteCommitStageBeginResponse(bc, x) {
625
+ function writeSqliteBindParam(bc, x) {
687
626
  switch (x.tag) {
688
- case "SqliteCommitStageBeginOk": {
627
+ case "SqliteValueNull": {
689
628
  bare.writeU8(bc, 0);
690
- writeSqliteCommitStageBeginOk(bc, x.val);
691
629
  break;
692
630
  }
693
- case "SqliteFenceMismatch": {
631
+ case "SqliteValueInteger": {
694
632
  bare.writeU8(bc, 1);
695
- writeSqliteFenceMismatch(bc, x.val);
633
+ writeSqliteValueInteger(bc, x.val);
696
634
  break;
697
635
  }
698
- case "SqliteErrorResponse": {
636
+ case "SqliteValueFloat": {
699
637
  bare.writeU8(bc, 2);
700
- writeSqliteErrorResponse(bc, x.val);
638
+ writeSqliteValueFloat(bc, x.val);
639
+ break;
640
+ }
641
+ case "SqliteValueText": {
642
+ bare.writeU8(bc, 3);
643
+ writeSqliteValueText(bc, x.val);
644
+ break;
645
+ }
646
+ case "SqliteValueBlob": {
647
+ bare.writeU8(bc, 4);
648
+ writeSqliteValueBlob(bc, x.val);
701
649
  break;
702
650
  }
703
651
  }
704
652
  }
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) {
653
+ function readSqliteColumnValue(bc) {
732
654
  const offset = bc.offset;
733
655
  const tag = bare.readU8(bc);
734
656
  switch (tag) {
735
657
  case 0:
736
- return { tag: "SqliteCommitStageOk", val: readSqliteCommitStageOk(bc) };
658
+ return { tag: "SqliteValueNull", val: null };
737
659
  case 1:
738
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
660
+ return { tag: "SqliteValueInteger", val: readSqliteValueInteger(bc) };
739
661
  case 2:
740
- return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
662
+ return { tag: "SqliteValueFloat", val: readSqliteValueFloat(bc) };
663
+ case 3:
664
+ return { tag: "SqliteValueText", val: readSqliteValueText(bc) };
665
+ case 4:
666
+ return { tag: "SqliteValueBlob", val: readSqliteValueBlob(bc) };
741
667
  default: {
742
668
  bc.offset = offset;
743
669
  throw new bare.BareError(offset, "invalid tag");
744
670
  }
745
671
  }
746
672
  }
747
- function writeSqliteCommitStageResponse(bc, x) {
673
+ function writeSqliteColumnValue(bc, x) {
748
674
  switch (x.tag) {
749
- case "SqliteCommitStageOk": {
675
+ case "SqliteValueNull": {
750
676
  bare.writeU8(bc, 0);
751
- writeSqliteCommitStageOk(bc, x.val);
752
677
  break;
753
678
  }
754
- case "SqliteFenceMismatch": {
679
+ case "SqliteValueInteger": {
755
680
  bare.writeU8(bc, 1);
756
- writeSqliteFenceMismatch(bc, x.val);
681
+ writeSqliteValueInteger(bc, x.val);
757
682
  break;
758
683
  }
759
- case "SqliteErrorResponse": {
684
+ case "SqliteValueFloat": {
760
685
  bare.writeU8(bc, 2);
761
- writeSqliteErrorResponse(bc, x.val);
686
+ writeSqliteValueFloat(bc, x.val);
687
+ break;
688
+ }
689
+ case "SqliteValueText": {
690
+ bare.writeU8(bc, 3);
691
+ writeSqliteValueText(bc, x.val);
762
692
  break;
763
693
  }
694
+ case "SqliteValueBlob": {
695
+ bare.writeU8(bc, 4);
696
+ writeSqliteValueBlob(bc, x.val);
697
+ break;
698
+ }
699
+ }
700
+ }
701
+ function read9(bc) {
702
+ const len = bare.readUintSafe(bc);
703
+ if (len === 0) {
704
+ return [];
764
705
  }
706
+ const result = [bare.readString(bc)];
707
+ for (let i = 1; i < len; i++) {
708
+ result[i] = bare.readString(bc);
709
+ }
710
+ return result;
765
711
  }
766
- function readSqliteCommitFinalizeRequest(bc) {
712
+ function write9(bc, x) {
713
+ bare.writeUintSafe(bc, x.length);
714
+ for (let i = 0; i < x.length; i++) {
715
+ bare.writeString(bc, x[i]);
716
+ }
717
+ }
718
+ function read10(bc) {
719
+ const len = bare.readUintSafe(bc);
720
+ if (len === 0) {
721
+ return [];
722
+ }
723
+ const result = [readSqliteColumnValue(bc)];
724
+ for (let i = 1; i < len; i++) {
725
+ result[i] = readSqliteColumnValue(bc);
726
+ }
727
+ return result;
728
+ }
729
+ function write10(bc, x) {
730
+ bare.writeUintSafe(bc, x.length);
731
+ for (let i = 0; i < x.length; i++) {
732
+ writeSqliteColumnValue(bc, x[i]);
733
+ }
734
+ }
735
+ function read11(bc) {
736
+ const len = bare.readUintSafe(bc);
737
+ if (len === 0) {
738
+ return [];
739
+ }
740
+ const result = [read10(bc)];
741
+ for (let i = 1; i < len; i++) {
742
+ result[i] = read10(bc);
743
+ }
744
+ return result;
745
+ }
746
+ function write11(bc, x) {
747
+ bare.writeUintSafe(bc, x.length);
748
+ for (let i = 0; i < x.length; i++) {
749
+ write10(bc, x[i]);
750
+ }
751
+ }
752
+ function readSqliteQueryResult(bc) {
767
753
  return {
754
+ columns: read9(bc),
755
+ rows: read11(bc)
756
+ };
757
+ }
758
+ function writeSqliteQueryResult(bc, x) {
759
+ write9(bc, x.columns);
760
+ write11(bc, x.rows);
761
+ }
762
+ function read12(bc) {
763
+ return bare.readBool(bc) ? bare.readI64(bc) : null;
764
+ }
765
+ function write12(bc, x) {
766
+ bare.writeBool(bc, x != null);
767
+ if (x != null) {
768
+ bare.writeI64(bc, x);
769
+ }
770
+ }
771
+ function readSqliteExecuteResult(bc) {
772
+ return {
773
+ columns: read9(bc),
774
+ rows: read11(bc),
775
+ changes: bare.readI64(bc),
776
+ lastInsertRowId: read12(bc)
777
+ };
778
+ }
779
+ function writeSqliteExecuteResult(bc, x) {
780
+ write9(bc, x.columns);
781
+ write11(bc, x.rows);
782
+ bare.writeI64(bc, x.changes);
783
+ write12(bc, x.lastInsertRowId);
784
+ }
785
+ function readSqliteExecRequest(bc) {
786
+ return {
787
+ namespaceId: readId(bc),
768
788
  actorId: readId(bc),
769
789
  generation: readSqliteGeneration(bc),
770
- expectedHeadTxid: readSqliteTxid(bc),
771
- txid: readSqliteTxid(bc),
772
- newDbSizePages: bare.readU32(bc)
790
+ sql: bare.readString(bc)
773
791
  };
774
792
  }
775
- function writeSqliteCommitFinalizeRequest(bc, x) {
793
+ function writeSqliteExecRequest(bc, x) {
794
+ writeId(bc, x.namespaceId);
776
795
  writeId(bc, x.actorId);
777
796
  writeSqliteGeneration(bc, x.generation);
778
- writeSqliteTxid(bc, x.expectedHeadTxid);
779
- writeSqliteTxid(bc, x.txid);
780
- bare.writeU32(bc, x.newDbSizePages);
797
+ bare.writeString(bc, x.sql);
781
798
  }
782
- function readSqliteCommitFinalizeOk(bc) {
799
+ function read13(bc) {
800
+ const len = bare.readUintSafe(bc);
801
+ if (len === 0) {
802
+ return [];
803
+ }
804
+ const result = [readSqliteBindParam(bc)];
805
+ for (let i = 1; i < len; i++) {
806
+ result[i] = readSqliteBindParam(bc);
807
+ }
808
+ return result;
809
+ }
810
+ function write13(bc, x) {
811
+ bare.writeUintSafe(bc, x.length);
812
+ for (let i = 0; i < x.length; i++) {
813
+ writeSqliteBindParam(bc, x[i]);
814
+ }
815
+ }
816
+ function read14(bc) {
817
+ return bare.readBool(bc) ? read13(bc) : null;
818
+ }
819
+ function write14(bc, x) {
820
+ bare.writeBool(bc, x != null);
821
+ if (x != null) {
822
+ write13(bc, x);
823
+ }
824
+ }
825
+ function readSqliteExecuteRequest(bc) {
783
826
  return {
784
- newHeadTxid: readSqliteTxid(bc),
785
- meta: readSqliteMeta(bc)
827
+ namespaceId: readId(bc),
828
+ actorId: readId(bc),
829
+ generation: readSqliteGeneration(bc),
830
+ sql: bare.readString(bc),
831
+ params: read14(bc)
832
+ };
833
+ }
834
+ function writeSqliteExecuteRequest(bc, x) {
835
+ writeId(bc, x.namespaceId);
836
+ writeId(bc, x.actorId);
837
+ writeSqliteGeneration(bc, x.generation);
838
+ bare.writeString(bc, x.sql);
839
+ write14(bc, x.params);
840
+ }
841
+ function readSqliteExecOk(bc) {
842
+ return {
843
+ result: readSqliteQueryResult(bc)
786
844
  };
787
845
  }
788
- function writeSqliteCommitFinalizeOk(bc, x) {
789
- writeSqliteTxid(bc, x.newHeadTxid);
790
- writeSqliteMeta(bc, x.meta);
846
+ function writeSqliteExecOk(bc, x) {
847
+ writeSqliteQueryResult(bc, x.result);
791
848
  }
792
- function readSqliteStageNotFound(bc) {
849
+ function readSqliteExecuteOk(bc) {
793
850
  return {
794
- stageId: readSqliteStageId(bc)
851
+ result: readSqliteExecuteResult(bc)
795
852
  };
796
853
  }
797
- function writeSqliteStageNotFound(bc, x) {
798
- writeSqliteStageId(bc, x.stageId);
854
+ function writeSqliteExecuteOk(bc, x) {
855
+ writeSqliteExecuteResult(bc, x.result);
799
856
  }
800
- function readSqliteCommitFinalizeResponse(bc) {
857
+ function readSqliteExecResponse(bc) {
801
858
  const offset = bc.offset;
802
859
  const tag = bare.readU8(bc);
803
860
  switch (tag) {
804
861
  case 0:
805
- return { tag: "SqliteCommitFinalizeOk", val: readSqliteCommitFinalizeOk(bc) };
862
+ return { tag: "SqliteExecOk", val: readSqliteExecOk(bc) };
806
863
  case 1:
807
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
808
- case 2:
809
- return { tag: "SqliteStageNotFound", val: readSqliteStageNotFound(bc) };
810
- case 3:
811
864
  return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
812
865
  default: {
813
866
  bc.offset = offset;
@@ -815,42 +868,48 @@ function readSqliteCommitFinalizeResponse(bc) {
815
868
  }
816
869
  }
817
870
  }
818
- function writeSqliteCommitFinalizeResponse(bc, x) {
871
+ function writeSqliteExecResponse(bc, x) {
819
872
  switch (x.tag) {
820
- case "SqliteCommitFinalizeOk": {
873
+ case "SqliteExecOk": {
821
874
  bare.writeU8(bc, 0);
822
- writeSqliteCommitFinalizeOk(bc, x.val);
875
+ writeSqliteExecOk(bc, x.val);
823
876
  break;
824
877
  }
825
- case "SqliteFenceMismatch": {
878
+ case "SqliteErrorResponse": {
826
879
  bare.writeU8(bc, 1);
827
- writeSqliteFenceMismatch(bc, x.val);
880
+ writeSqliteErrorResponse(bc, x.val);
828
881
  break;
829
882
  }
830
- case "SqliteStageNotFound": {
831
- bare.writeU8(bc, 2);
832
- writeSqliteStageNotFound(bc, x.val);
883
+ }
884
+ }
885
+ function readSqliteExecuteResponse(bc) {
886
+ const offset = bc.offset;
887
+ const tag = bare.readU8(bc);
888
+ switch (tag) {
889
+ case 0:
890
+ return { tag: "SqliteExecuteOk", val: readSqliteExecuteOk(bc) };
891
+ case 1:
892
+ return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
893
+ default: {
894
+ bc.offset = offset;
895
+ throw new bare.BareError(offset, "invalid tag");
896
+ }
897
+ }
898
+ }
899
+ function writeSqliteExecuteResponse(bc, x) {
900
+ switch (x.tag) {
901
+ case "SqliteExecuteOk": {
902
+ bare.writeU8(bc, 0);
903
+ writeSqliteExecuteOk(bc, x.val);
833
904
  break;
834
905
  }
835
906
  case "SqliteErrorResponse": {
836
- bare.writeU8(bc, 3);
907
+ bare.writeU8(bc, 1);
837
908
  writeSqliteErrorResponse(bc, x.val);
838
909
  break;
839
910
  }
840
911
  }
841
912
  }
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
913
  var StopCode = /* @__PURE__ */ ((StopCode2) => {
855
914
  StopCode2["Ok"] = "Ok";
856
915
  StopCode2["Error"] = "Error";
@@ -890,19 +949,19 @@ function readActorName(bc) {
890
949
  function writeActorName(bc, x) {
891
950
  writeJson(bc, x.metadata);
892
951
  }
893
- function read9(bc) {
952
+ function read15(bc) {
894
953
  return bare.readBool(bc) ? bare.readString(bc) : null;
895
954
  }
896
- function write9(bc, x) {
955
+ function write15(bc, x) {
897
956
  bare.writeBool(bc, x != null);
898
957
  if (x != null) {
899
958
  bare.writeString(bc, x);
900
959
  }
901
960
  }
902
- function read10(bc) {
961
+ function read16(bc) {
903
962
  return bare.readBool(bc) ? bare.readData(bc) : null;
904
963
  }
905
- function write10(bc, x) {
964
+ function write16(bc, x) {
906
965
  bare.writeBool(bc, x != null);
907
966
  if (x != null) {
908
967
  bare.writeData(bc, x);
@@ -911,16 +970,16 @@ function write10(bc, x) {
911
970
  function readActorConfig(bc) {
912
971
  return {
913
972
  name: bare.readString(bc),
914
- key: read9(bc),
973
+ key: read15(bc),
915
974
  createTs: bare.readI64(bc),
916
- input: read10(bc)
975
+ input: read16(bc)
917
976
  };
918
977
  }
919
978
  function writeActorConfig(bc, x) {
920
979
  bare.writeString(bc, x.name);
921
- write9(bc, x.key);
980
+ write15(bc, x.key);
922
981
  bare.writeI64(bc, x.createTs);
923
- write10(bc, x.input);
982
+ write16(bc, x.input);
924
983
  }
925
984
  function readActorCheckpoint(bc) {
926
985
  return {
@@ -963,12 +1022,12 @@ function writeActorIntent(bc, x) {
963
1022
  function readActorStateStopped(bc) {
964
1023
  return {
965
1024
  code: readStopCode(bc),
966
- message: read9(bc)
1025
+ message: read15(bc)
967
1026
  };
968
1027
  }
969
1028
  function writeActorStateStopped(bc, x) {
970
1029
  writeStopCode(bc, x.code);
971
- write9(bc, x.message);
1030
+ write15(bc, x.message);
972
1031
  }
973
1032
  function readActorState(bc) {
974
1033
  const offset = bc.offset;
@@ -1013,22 +1072,13 @@ function readEventActorStateUpdate(bc) {
1013
1072
  function writeEventActorStateUpdate(bc, x) {
1014
1073
  writeActorState(bc, x.state);
1015
1074
  }
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
1075
  function readEventActorSetAlarm(bc) {
1026
1076
  return {
1027
- alarmTs: read11(bc)
1077
+ alarmTs: read12(bc)
1028
1078
  };
1029
1079
  }
1030
1080
  function writeEventActorSetAlarm(bc, x) {
1031
- write11(bc, x.alarmTs);
1081
+ write12(bc, x.alarmTs);
1032
1082
  }
1033
1083
  function readEvent(bc) {
1034
1084
  const offset = bc.offset;
@@ -1087,7 +1137,7 @@ function writePreloadedKvEntry(bc, x) {
1087
1137
  writeKvValue(bc, x.value);
1088
1138
  writeKvMetadata(bc, x.metadata);
1089
1139
  }
1090
- function read12(bc) {
1140
+ function read17(bc) {
1091
1141
  const len = bare.readUintSafe(bc);
1092
1142
  if (len === 0) {
1093
1143
  return [];
@@ -1098,7 +1148,7 @@ function read12(bc) {
1098
1148
  }
1099
1149
  return result;
1100
1150
  }
1101
- function write12(bc, x) {
1151
+ function write17(bc, x) {
1102
1152
  bare.writeUintSafe(bc, x.length);
1103
1153
  for (let i = 0; i < x.length; i++) {
1104
1154
  writePreloadedKvEntry(bc, x[i]);
@@ -1106,13 +1156,13 @@ function write12(bc, x) {
1106
1156
  }
1107
1157
  function readPreloadedKv(bc) {
1108
1158
  return {
1109
- entries: read12(bc),
1159
+ entries: read17(bc),
1110
1160
  requestedGetKeys: read0(bc),
1111
1161
  requestedPrefixes: read0(bc)
1112
1162
  };
1113
1163
  }
1114
1164
  function writePreloadedKv(bc, x) {
1115
- write12(bc, x.entries);
1165
+ write17(bc, x.entries);
1116
1166
  write0(bc, x.requestedGetKeys);
1117
1167
  write0(bc, x.requestedPrefixes);
1118
1168
  }
@@ -1126,7 +1176,7 @@ function writeHibernatingRequest(bc, x) {
1126
1176
  writeGatewayId(bc, x.gatewayId);
1127
1177
  writeRequestId(bc, x.requestId);
1128
1178
  }
1129
- function read13(bc) {
1179
+ function read18(bc) {
1130
1180
  const len = bare.readUintSafe(bc);
1131
1181
  if (len === 0) {
1132
1182
  return [];
@@ -1137,43 +1187,32 @@ function read13(bc) {
1137
1187
  }
1138
1188
  return result;
1139
1189
  }
1140
- function write13(bc, x) {
1190
+ function write18(bc, x) {
1141
1191
  bare.writeUintSafe(bc, x.length);
1142
1192
  for (let i = 0; i < x.length; i++) {
1143
1193
  writeHibernatingRequest(bc, x[i]);
1144
1194
  }
1145
1195
  }
1146
- function read14(bc) {
1196
+ function read19(bc) {
1147
1197
  return bare.readBool(bc) ? readPreloadedKv(bc) : null;
1148
1198
  }
1149
- function write14(bc, x) {
1199
+ function write19(bc, x) {
1150
1200
  bare.writeBool(bc, x != null);
1151
1201
  if (x != null) {
1152
1202
  writePreloadedKv(bc, x);
1153
1203
  }
1154
1204
  }
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
1205
  function readCommandStartActor(bc) {
1165
1206
  return {
1166
1207
  config: readActorConfig(bc),
1167
- hibernatingRequests: read13(bc),
1168
- preloadedKv: read14(bc),
1169
- sqliteStartupData: read15(bc)
1208
+ hibernatingRequests: read18(bc),
1209
+ preloadedKv: read19(bc)
1170
1210
  };
1171
1211
  }
1172
1212
  function writeCommandStartActor(bc, x) {
1173
1213
  writeActorConfig(bc, x.config);
1174
- write13(bc, x.hibernatingRequests);
1175
- write14(bc, x.preloadedKv);
1176
- write15(bc, x.sqliteStartupData);
1214
+ write18(bc, x.hibernatingRequests);
1215
+ write19(bc, x.preloadedKv);
1177
1216
  }
1178
1217
  var StopActorReason = /* @__PURE__ */ ((StopActorReason2) => {
1179
1218
  StopActorReason2["SleepIntent"] = "SleepIntent";
@@ -1330,7 +1369,7 @@ function writeMessageId(bc, x) {
1330
1369
  writeRequestId(bc, x.requestId);
1331
1370
  writeMessageIndex(bc, x.messageIndex);
1332
1371
  }
1333
- function read16(bc) {
1372
+ function read20(bc) {
1334
1373
  const len = bare.readUintSafe(bc);
1335
1374
  const result = /* @__PURE__ */ new Map();
1336
1375
  for (let i = 0; i < len; i++) {
@@ -1344,7 +1383,7 @@ function read16(bc) {
1344
1383
  }
1345
1384
  return result;
1346
1385
  }
1347
- function write16(bc, x) {
1386
+ function write20(bc, x) {
1348
1387
  bare.writeUintSafe(bc, x.size);
1349
1388
  for (const kv of x) {
1350
1389
  bare.writeString(bc, kv[0]);
@@ -1356,8 +1395,8 @@ function readToEnvoyRequestStart(bc) {
1356
1395
  actorId: readId(bc),
1357
1396
  method: bare.readString(bc),
1358
1397
  path: bare.readString(bc),
1359
- headers: read16(bc),
1360
- body: read10(bc),
1398
+ headers: read20(bc),
1399
+ body: read16(bc),
1361
1400
  stream: bare.readBool(bc)
1362
1401
  };
1363
1402
  }
@@ -1365,8 +1404,8 @@ function writeToEnvoyRequestStart(bc, x) {
1365
1404
  writeId(bc, x.actorId);
1366
1405
  bare.writeString(bc, x.method);
1367
1406
  bare.writeString(bc, x.path);
1368
- write16(bc, x.headers);
1369
- write10(bc, x.body);
1407
+ write20(bc, x.headers);
1408
+ write16(bc, x.body);
1370
1409
  bare.writeBool(bc, x.stream);
1371
1410
  }
1372
1411
  function readToEnvoyRequestChunk(bc) {
@@ -1382,15 +1421,15 @@ function writeToEnvoyRequestChunk(bc, x) {
1382
1421
  function readToRivetResponseStart(bc) {
1383
1422
  return {
1384
1423
  status: bare.readU16(bc),
1385
- headers: read16(bc),
1386
- body: read10(bc),
1424
+ headers: read20(bc),
1425
+ body: read16(bc),
1387
1426
  stream: bare.readBool(bc)
1388
1427
  };
1389
1428
  }
1390
1429
  function writeToRivetResponseStart(bc, x) {
1391
1430
  bare.writeU16(bc, x.status);
1392
- write16(bc, x.headers);
1393
- write10(bc, x.body);
1431
+ write20(bc, x.headers);
1432
+ write16(bc, x.body);
1394
1433
  bare.writeBool(bc, x.stream);
1395
1434
  }
1396
1435
  function readToRivetResponseChunk(bc) {
@@ -1407,13 +1446,13 @@ function readToEnvoyWebSocketOpen(bc) {
1407
1446
  return {
1408
1447
  actorId: readId(bc),
1409
1448
  path: bare.readString(bc),
1410
- headers: read16(bc)
1449
+ headers: read20(bc)
1411
1450
  };
1412
1451
  }
1413
1452
  function writeToEnvoyWebSocketOpen(bc, x) {
1414
1453
  writeId(bc, x.actorId);
1415
1454
  bare.writeString(bc, x.path);
1416
- write16(bc, x.headers);
1455
+ write20(bc, x.headers);
1417
1456
  }
1418
1457
  function readToEnvoyWebSocketMessage(bc) {
1419
1458
  return {
@@ -1425,10 +1464,10 @@ function writeToEnvoyWebSocketMessage(bc, x) {
1425
1464
  bare.writeData(bc, x.data);
1426
1465
  bare.writeBool(bc, x.binary);
1427
1466
  }
1428
- function read17(bc) {
1467
+ function read21(bc) {
1429
1468
  return bare.readBool(bc) ? bare.readU16(bc) : null;
1430
1469
  }
1431
- function write17(bc, x) {
1470
+ function write21(bc, x) {
1432
1471
  bare.writeBool(bc, x != null);
1433
1472
  if (x != null) {
1434
1473
  bare.writeU16(bc, x);
@@ -1436,13 +1475,13 @@ function write17(bc, x) {
1436
1475
  }
1437
1476
  function readToEnvoyWebSocketClose(bc) {
1438
1477
  return {
1439
- code: read17(bc),
1440
- reason: read9(bc)
1478
+ code: read21(bc),
1479
+ reason: read15(bc)
1441
1480
  };
1442
1481
  }
1443
1482
  function writeToEnvoyWebSocketClose(bc, x) {
1444
- write17(bc, x.code);
1445
- write9(bc, x.reason);
1483
+ write21(bc, x.code);
1484
+ write15(bc, x.reason);
1446
1485
  }
1447
1486
  function readToRivetWebSocketOpen(bc) {
1448
1487
  return {
@@ -1472,14 +1511,14 @@ function writeToRivetWebSocketMessageAck(bc, x) {
1472
1511
  }
1473
1512
  function readToRivetWebSocketClose(bc) {
1474
1513
  return {
1475
- code: read17(bc),
1476
- reason: read9(bc),
1514
+ code: read21(bc),
1515
+ reason: read15(bc),
1477
1516
  hibernate: bare.readBool(bc)
1478
1517
  };
1479
1518
  }
1480
1519
  function writeToRivetWebSocketClose(bc, x) {
1481
- write17(bc, x.code);
1482
- write9(bc, x.reason);
1520
+ write21(bc, x.code);
1521
+ write15(bc, x.reason);
1483
1522
  bare.writeBool(bc, x.hibernate);
1484
1523
  }
1485
1524
  function readToRivetTunnelMessageKind(bc) {
@@ -1627,7 +1666,7 @@ function readToEnvoyPing(bc) {
1627
1666
  function writeToEnvoyPing(bc, x) {
1628
1667
  bare.writeI64(bc, x.ts);
1629
1668
  }
1630
- function read18(bc) {
1669
+ function read22(bc) {
1631
1670
  const len = bare.readUintSafe(bc);
1632
1671
  const result = /* @__PURE__ */ new Map();
1633
1672
  for (let i = 0; i < len; i++) {
@@ -1641,26 +1680,26 @@ function read18(bc) {
1641
1680
  }
1642
1681
  return result;
1643
1682
  }
1644
- function write18(bc, x) {
1683
+ function write22(bc, x) {
1645
1684
  bare.writeUintSafe(bc, x.size);
1646
1685
  for (const kv of x) {
1647
1686
  bare.writeString(bc, kv[0]);
1648
1687
  writeActorName(bc, kv[1]);
1649
1688
  }
1650
1689
  }
1651
- function read19(bc) {
1652
- return bare.readBool(bc) ? read18(bc) : null;
1690
+ function read23(bc) {
1691
+ return bare.readBool(bc) ? read22(bc) : null;
1653
1692
  }
1654
- function write19(bc, x) {
1693
+ function write23(bc, x) {
1655
1694
  bare.writeBool(bc, x != null);
1656
1695
  if (x != null) {
1657
- write18(bc, x);
1696
+ write22(bc, x);
1658
1697
  }
1659
1698
  }
1660
- function read20(bc) {
1699
+ function read24(bc) {
1661
1700
  return bare.readBool(bc) ? readJson(bc) : null;
1662
1701
  }
1663
- function write20(bc, x) {
1702
+ function write24(bc, x) {
1664
1703
  bare.writeBool(bc, x != null);
1665
1704
  if (x != null) {
1666
1705
  writeJson(bc, x);
@@ -1668,13 +1707,13 @@ function write20(bc, x) {
1668
1707
  }
1669
1708
  function readToRivetMetadata(bc) {
1670
1709
  return {
1671
- prepopulateActorNames: read19(bc),
1672
- metadata: read20(bc)
1710
+ prepopulateActorNames: read23(bc),
1711
+ metadata: read24(bc)
1673
1712
  };
1674
1713
  }
1675
1714
  function writeToRivetMetadata(bc, x) {
1676
- write19(bc, x.prepopulateActorNames);
1677
- write20(bc, x.metadata);
1715
+ write23(bc, x.prepopulateActorNames);
1716
+ write24(bc, x.metadata);
1678
1717
  }
1679
1718
  function readToRivetEvents(bc) {
1680
1719
  const len = bare.readUintSafe(bc);
@@ -1693,7 +1732,7 @@ function writeToRivetEvents(bc, x) {
1693
1732
  writeEventWrapper(bc, x[i]);
1694
1733
  }
1695
1734
  }
1696
- function read21(bc) {
1735
+ function read25(bc) {
1697
1736
  const len = bare.readUintSafe(bc);
1698
1737
  if (len === 0) {
1699
1738
  return [];
@@ -1704,7 +1743,7 @@ function read21(bc) {
1704
1743
  }
1705
1744
  return result;
1706
1745
  }
1707
- function write21(bc, x) {
1746
+ function write25(bc, x) {
1708
1747
  bare.writeUintSafe(bc, x.length);
1709
1748
  for (let i = 0; i < x.length; i++) {
1710
1749
  writeActorCheckpoint(bc, x[i]);
@@ -1712,11 +1751,11 @@ function write21(bc, x) {
1712
1751
  }
1713
1752
  function readToRivetAckCommands(bc) {
1714
1753
  return {
1715
- lastCommandCheckpoints: read21(bc)
1754
+ lastCommandCheckpoints: read25(bc)
1716
1755
  };
1717
1756
  }
1718
1757
  function writeToRivetAckCommands(bc, x) {
1719
- write21(bc, x.lastCommandCheckpoints);
1758
+ write25(bc, x.lastCommandCheckpoints);
1720
1759
  }
1721
1760
  function readToRivetPong(bc) {
1722
1761
  return {
@@ -1758,35 +1797,25 @@ function writeToRivetSqliteCommitRequest(bc, x) {
1758
1797
  bare.writeU32(bc, x.requestId);
1759
1798
  writeSqliteCommitRequest(bc, x.data);
1760
1799
  }
1761
- function readToRivetSqliteCommitStageBeginRequest(bc) {
1800
+ function readToRivetSqliteExecRequest(bc) {
1762
1801
  return {
1763
1802
  requestId: bare.readU32(bc),
1764
- data: readSqliteCommitStageBeginRequest(bc)
1803
+ data: readSqliteExecRequest(bc)
1765
1804
  };
1766
1805
  }
1767
- function writeToRivetSqliteCommitStageBeginRequest(bc, x) {
1806
+ function writeToRivetSqliteExecRequest(bc, x) {
1768
1807
  bare.writeU32(bc, x.requestId);
1769
- writeSqliteCommitStageBeginRequest(bc, x.data);
1808
+ writeSqliteExecRequest(bc, x.data);
1770
1809
  }
1771
- function readToRivetSqliteCommitStageRequest(bc) {
1810
+ function readToRivetSqliteExecuteRequest(bc) {
1772
1811
  return {
1773
1812
  requestId: bare.readU32(bc),
1774
- data: readSqliteCommitStageRequest(bc)
1813
+ data: readSqliteExecuteRequest(bc)
1775
1814
  };
1776
1815
  }
1777
- function writeToRivetSqliteCommitStageRequest(bc, x) {
1816
+ function writeToRivetSqliteExecuteRequest(bc, x) {
1778
1817
  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);
1818
+ writeSqliteExecuteRequest(bc, x.data);
1790
1819
  }
1791
1820
  function readToRivet(bc) {
1792
1821
  const offset = bc.offset;
@@ -1811,11 +1840,9 @@ function readToRivet(bc) {
1811
1840
  case 8:
1812
1841
  return { tag: "ToRivetSqliteCommitRequest", val: readToRivetSqliteCommitRequest(bc) };
1813
1842
  case 9:
1814
- return { tag: "ToRivetSqliteCommitStageBeginRequest", val: readToRivetSqliteCommitStageBeginRequest(bc) };
1843
+ return { tag: "ToRivetSqliteExecRequest", val: readToRivetSqliteExecRequest(bc) };
1815
1844
  case 10:
1816
- return { tag: "ToRivetSqliteCommitStageRequest", val: readToRivetSqliteCommitStageRequest(bc) };
1817
- case 11:
1818
- return { tag: "ToRivetSqliteCommitFinalizeRequest", val: readToRivetSqliteCommitFinalizeRequest(bc) };
1845
+ return { tag: "ToRivetSqliteExecuteRequest", val: readToRivetSqliteExecuteRequest(bc) };
1819
1846
  default: {
1820
1847
  bc.offset = offset;
1821
1848
  throw new bare.BareError(offset, "invalid tag");
@@ -1868,19 +1895,14 @@ function writeToRivet(bc, x) {
1868
1895
  writeToRivetSqliteCommitRequest(bc, x.val);
1869
1896
  break;
1870
1897
  }
1871
- case "ToRivetSqliteCommitStageBeginRequest": {
1898
+ case "ToRivetSqliteExecRequest": {
1872
1899
  bare.writeU8(bc, 9);
1873
- writeToRivetSqliteCommitStageBeginRequest(bc, x.val);
1900
+ writeToRivetSqliteExecRequest(bc, x.val);
1874
1901
  break;
1875
1902
  }
1876
- case "ToRivetSqliteCommitStageRequest": {
1903
+ case "ToRivetSqliteExecuteRequest": {
1877
1904
  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);
1905
+ writeToRivetSqliteExecuteRequest(bc, x.val);
1884
1906
  break;
1885
1907
  }
1886
1908
  }
@@ -1941,11 +1963,11 @@ function writeToEnvoyCommands(bc, x) {
1941
1963
  }
1942
1964
  function readToEnvoyAckEvents(bc) {
1943
1965
  return {
1944
- lastEventCheckpoints: read21(bc)
1966
+ lastEventCheckpoints: read25(bc)
1945
1967
  };
1946
1968
  }
1947
1969
  function writeToEnvoyAckEvents(bc, x) {
1948
- write21(bc, x.lastEventCheckpoints);
1970
+ write25(bc, x.lastEventCheckpoints);
1949
1971
  }
1950
1972
  function readToEnvoyKvResponse(bc) {
1951
1973
  return {
@@ -1977,35 +1999,25 @@ function writeToEnvoySqliteCommitResponse(bc, x) {
1977
1999
  bare.writeU32(bc, x.requestId);
1978
2000
  writeSqliteCommitResponse(bc, x.data);
1979
2001
  }
1980
- function readToEnvoySqliteCommitStageBeginResponse(bc) {
1981
- return {
1982
- requestId: bare.readU32(bc),
1983
- data: readSqliteCommitStageBeginResponse(bc)
1984
- };
1985
- }
1986
- function writeToEnvoySqliteCommitStageBeginResponse(bc, x) {
1987
- bare.writeU32(bc, x.requestId);
1988
- writeSqliteCommitStageBeginResponse(bc, x.data);
1989
- }
1990
- function readToEnvoySqliteCommitStageResponse(bc) {
2002
+ function readToEnvoySqliteExecResponse(bc) {
1991
2003
  return {
1992
2004
  requestId: bare.readU32(bc),
1993
- data: readSqliteCommitStageResponse(bc)
2005
+ data: readSqliteExecResponse(bc)
1994
2006
  };
1995
2007
  }
1996
- function writeToEnvoySqliteCommitStageResponse(bc, x) {
2008
+ function writeToEnvoySqliteExecResponse(bc, x) {
1997
2009
  bare.writeU32(bc, x.requestId);
1998
- writeSqliteCommitStageResponse(bc, x.data);
2010
+ writeSqliteExecResponse(bc, x.data);
1999
2011
  }
2000
- function readToEnvoySqliteCommitFinalizeResponse(bc) {
2012
+ function readToEnvoySqliteExecuteResponse(bc) {
2001
2013
  return {
2002
2014
  requestId: bare.readU32(bc),
2003
- data: readSqliteCommitFinalizeResponse(bc)
2015
+ data: readSqliteExecuteResponse(bc)
2004
2016
  };
2005
2017
  }
2006
- function writeToEnvoySqliteCommitFinalizeResponse(bc, x) {
2018
+ function writeToEnvoySqliteExecuteResponse(bc, x) {
2007
2019
  bare.writeU32(bc, x.requestId);
2008
- writeSqliteCommitFinalizeResponse(bc, x.data);
2020
+ writeSqliteExecuteResponse(bc, x.data);
2009
2021
  }
2010
2022
  function readToEnvoy(bc) {
2011
2023
  const offset = bc.offset;
@@ -2028,11 +2040,9 @@ function readToEnvoy(bc) {
2028
2040
  case 7:
2029
2041
  return { tag: "ToEnvoySqliteCommitResponse", val: readToEnvoySqliteCommitResponse(bc) };
2030
2042
  case 8:
2031
- return { tag: "ToEnvoySqliteCommitStageBeginResponse", val: readToEnvoySqliteCommitStageBeginResponse(bc) };
2043
+ return { tag: "ToEnvoySqliteExecResponse", val: readToEnvoySqliteExecResponse(bc) };
2032
2044
  case 9:
2033
- return { tag: "ToEnvoySqliteCommitStageResponse", val: readToEnvoySqliteCommitStageResponse(bc) };
2034
- case 10:
2035
- return { tag: "ToEnvoySqliteCommitFinalizeResponse", val: readToEnvoySqliteCommitFinalizeResponse(bc) };
2045
+ return { tag: "ToEnvoySqliteExecuteResponse", val: readToEnvoySqliteExecuteResponse(bc) };
2036
2046
  default: {
2037
2047
  bc.offset = offset;
2038
2048
  throw new bare.BareError(offset, "invalid tag");
@@ -2081,19 +2091,14 @@ function writeToEnvoy(bc, x) {
2081
2091
  writeToEnvoySqliteCommitResponse(bc, x.val);
2082
2092
  break;
2083
2093
  }
2084
- case "ToEnvoySqliteCommitStageBeginResponse": {
2094
+ case "ToEnvoySqliteExecResponse": {
2085
2095
  bare.writeU8(bc, 8);
2086
- writeToEnvoySqliteCommitStageBeginResponse(bc, x.val);
2096
+ writeToEnvoySqliteExecResponse(bc, x.val);
2087
2097
  break;
2088
2098
  }
2089
- case "ToEnvoySqliteCommitStageResponse": {
2099
+ case "ToEnvoySqliteExecuteResponse": {
2090
2100
  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);
2101
+ writeToEnvoySqliteExecuteResponse(bc, x.val);
2097
2102
  break;
2098
2103
  }
2099
2104
  }
@@ -2302,7 +2307,7 @@ function decodeToOutbound(bytes) {
2302
2307
  function assert(condition, message) {
2303
2308
  if (!condition) throw new Error(message ?? "Assertion failed");
2304
2309
  }
2305
- var VERSION = 2;
2310
+ var VERSION = 4;
2306
2311
  export {
2307
2312
  StopActorReason,
2308
2313
  StopCode,
@@ -2361,34 +2366,31 @@ export {
2361
2366
  readPreloadedKvEntry,
2362
2367
  readProtocolMetadata,
2363
2368
  readRequestId,
2364
- readSqliteCommitFinalizeOk,
2365
- readSqliteCommitFinalizeRequest,
2366
- readSqliteCommitFinalizeResponse,
2367
- readSqliteCommitOk,
2369
+ readSqliteBindParam,
2370
+ readSqliteColumnValue,
2368
2371
  readSqliteCommitRequest,
2369
2372
  readSqliteCommitResponse,
2370
- readSqliteCommitStageBeginOk,
2371
- readSqliteCommitStageBeginRequest,
2372
- readSqliteCommitStageBeginResponse,
2373
- readSqliteCommitStageOk,
2374
- readSqliteCommitStageRequest,
2375
- readSqliteCommitStageResponse,
2376
- readSqliteCommitTooLarge,
2377
2373
  readSqliteDirtyPage,
2378
2374
  readSqliteErrorResponse,
2379
- readSqliteFenceMismatch,
2375
+ readSqliteExecOk,
2376
+ readSqliteExecRequest,
2377
+ readSqliteExecResponse,
2378
+ readSqliteExecuteOk,
2379
+ readSqliteExecuteRequest,
2380
+ readSqliteExecuteResponse,
2381
+ readSqliteExecuteResult,
2380
2382
  readSqliteFetchedPage,
2381
2383
  readSqliteGeneration,
2382
2384
  readSqliteGetPagesOk,
2383
2385
  readSqliteGetPagesRequest,
2384
2386
  readSqliteGetPagesResponse,
2385
- readSqliteMeta,
2386
2387
  readSqlitePageBytes,
2387
2388
  readSqlitePgno,
2388
- readSqliteStageId,
2389
- readSqliteStageNotFound,
2390
- readSqliteStartupData,
2391
- readSqliteTxid,
2389
+ readSqliteQueryResult,
2390
+ readSqliteValueBlob,
2391
+ readSqliteValueFloat,
2392
+ readSqliteValueInteger,
2393
+ readSqliteValueText,
2392
2394
  readStopActorReason,
2393
2395
  readStopCode,
2394
2396
  readToEnvoy,
@@ -2401,10 +2403,9 @@ export {
2401
2403
  readToEnvoyPing,
2402
2404
  readToEnvoyRequestChunk,
2403
2405
  readToEnvoyRequestStart,
2404
- readToEnvoySqliteCommitFinalizeResponse,
2405
2406
  readToEnvoySqliteCommitResponse,
2406
- readToEnvoySqliteCommitStageBeginResponse,
2407
- readToEnvoySqliteCommitStageResponse,
2407
+ readToEnvoySqliteExecResponse,
2408
+ readToEnvoySqliteExecuteResponse,
2408
2409
  readToEnvoySqliteGetPagesResponse,
2409
2410
  readToEnvoyTunnelMessage,
2410
2411
  readToEnvoyTunnelMessageKind,
@@ -2423,10 +2424,9 @@ export {
2423
2424
  readToRivetPong,
2424
2425
  readToRivetResponseChunk,
2425
2426
  readToRivetResponseStart,
2426
- readToRivetSqliteCommitFinalizeRequest,
2427
2427
  readToRivetSqliteCommitRequest,
2428
- readToRivetSqliteCommitStageBeginRequest,
2429
- readToRivetSqliteCommitStageRequest,
2428
+ readToRivetSqliteExecRequest,
2429
+ readToRivetSqliteExecuteRequest,
2430
2430
  readToRivetSqliteGetPagesRequest,
2431
2431
  readToRivetTunnelMessage,
2432
2432
  readToRivetTunnelMessageKind,
@@ -2476,34 +2476,31 @@ export {
2476
2476
  writePreloadedKvEntry,
2477
2477
  writeProtocolMetadata,
2478
2478
  writeRequestId,
2479
- writeSqliteCommitFinalizeOk,
2480
- writeSqliteCommitFinalizeRequest,
2481
- writeSqliteCommitFinalizeResponse,
2482
- writeSqliteCommitOk,
2479
+ writeSqliteBindParam,
2480
+ writeSqliteColumnValue,
2483
2481
  writeSqliteCommitRequest,
2484
2482
  writeSqliteCommitResponse,
2485
- writeSqliteCommitStageBeginOk,
2486
- writeSqliteCommitStageBeginRequest,
2487
- writeSqliteCommitStageBeginResponse,
2488
- writeSqliteCommitStageOk,
2489
- writeSqliteCommitStageRequest,
2490
- writeSqliteCommitStageResponse,
2491
- writeSqliteCommitTooLarge,
2492
2483
  writeSqliteDirtyPage,
2493
2484
  writeSqliteErrorResponse,
2494
- writeSqliteFenceMismatch,
2485
+ writeSqliteExecOk,
2486
+ writeSqliteExecRequest,
2487
+ writeSqliteExecResponse,
2488
+ writeSqliteExecuteOk,
2489
+ writeSqliteExecuteRequest,
2490
+ writeSqliteExecuteResponse,
2491
+ writeSqliteExecuteResult,
2495
2492
  writeSqliteFetchedPage,
2496
2493
  writeSqliteGeneration,
2497
2494
  writeSqliteGetPagesOk,
2498
2495
  writeSqliteGetPagesRequest,
2499
2496
  writeSqliteGetPagesResponse,
2500
- writeSqliteMeta,
2501
2497
  writeSqlitePageBytes,
2502
2498
  writeSqlitePgno,
2503
- writeSqliteStageId,
2504
- writeSqliteStageNotFound,
2505
- writeSqliteStartupData,
2506
- writeSqliteTxid,
2499
+ writeSqliteQueryResult,
2500
+ writeSqliteValueBlob,
2501
+ writeSqliteValueFloat,
2502
+ writeSqliteValueInteger,
2503
+ writeSqliteValueText,
2507
2504
  writeStopActorReason,
2508
2505
  writeStopCode,
2509
2506
  writeToEnvoy,
@@ -2516,10 +2513,9 @@ export {
2516
2513
  writeToEnvoyPing,
2517
2514
  writeToEnvoyRequestChunk,
2518
2515
  writeToEnvoyRequestStart,
2519
- writeToEnvoySqliteCommitFinalizeResponse,
2520
2516
  writeToEnvoySqliteCommitResponse,
2521
- writeToEnvoySqliteCommitStageBeginResponse,
2522
- writeToEnvoySqliteCommitStageResponse,
2517
+ writeToEnvoySqliteExecResponse,
2518
+ writeToEnvoySqliteExecuteResponse,
2523
2519
  writeToEnvoySqliteGetPagesResponse,
2524
2520
  writeToEnvoyTunnelMessage,
2525
2521
  writeToEnvoyTunnelMessageKind,
@@ -2538,10 +2534,9 @@ export {
2538
2534
  writeToRivetPong,
2539
2535
  writeToRivetResponseChunk,
2540
2536
  writeToRivetResponseStart,
2541
- writeToRivetSqliteCommitFinalizeRequest,
2542
2537
  writeToRivetSqliteCommitRequest,
2543
- writeToRivetSqliteCommitStageBeginRequest,
2544
- writeToRivetSqliteCommitStageRequest,
2538
+ writeToRivetSqliteExecRequest,
2539
+ writeToRivetSqliteExecuteRequest,
2545
2540
  writeToRivetSqliteGetPagesRequest,
2546
2541
  writeToRivetTunnelMessage,
2547
2542
  writeToRivetTunnelMessageKind,