@rivetkit/engine-envoy-protocol 0.0.0-pr.4854.b12798b → 0.0.0-pr.4856.c68d9cb

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -165,38 +165,12 @@ type KvResponseData = {
165
165
  };
166
166
  declare function readKvResponseData(bc: bare.ByteCursor): KvResponseData;
167
167
  declare function writeKvResponseData(bc: bare.ByteCursor, x: KvResponseData): void;
168
- type SqliteGeneration = u64;
169
- declare function readSqliteGeneration(bc: bare.ByteCursor): SqliteGeneration;
170
- declare function writeSqliteGeneration(bc: bare.ByteCursor, x: SqliteGeneration): void;
171
- type SqliteTxid = u64;
172
- declare function readSqliteTxid(bc: bare.ByteCursor): SqliteTxid;
173
- declare function writeSqliteTxid(bc: bare.ByteCursor, x: SqliteTxid): void;
174
168
  type SqlitePgno = u32;
175
169
  declare function readSqlitePgno(bc: bare.ByteCursor): SqlitePgno;
176
170
  declare function writeSqlitePgno(bc: bare.ByteCursor, x: SqlitePgno): void;
177
- type SqliteStageId = u64;
178
- declare function readSqliteStageId(bc: bare.ByteCursor): SqliteStageId;
179
- declare function writeSqliteStageId(bc: bare.ByteCursor, x: SqliteStageId): void;
180
171
  type SqlitePageBytes = ArrayBuffer;
181
172
  declare function readSqlitePageBytes(bc: bare.ByteCursor): SqlitePageBytes;
182
173
  declare function writeSqlitePageBytes(bc: bare.ByteCursor, x: SqlitePageBytes): void;
183
- type SqliteMeta = {
184
- readonly generation: SqliteGeneration;
185
- readonly headTxid: SqliteTxid;
186
- readonly materializedTxid: SqliteTxid;
187
- readonly dbSizePages: u32;
188
- readonly pageSize: u32;
189
- readonly creationTsMs: i64;
190
- readonly maxDeltaBytes: u64;
191
- };
192
- declare function readSqliteMeta(bc: bare.ByteCursor): SqliteMeta;
193
- declare function writeSqliteMeta(bc: bare.ByteCursor, x: SqliteMeta): void;
194
- type SqliteFenceMismatch = {
195
- readonly actualMeta: SqliteMeta;
196
- readonly reason: string;
197
- };
198
- declare function readSqliteFenceMismatch(bc: bare.ByteCursor): SqliteFenceMismatch;
199
- declare function writeSqliteFenceMismatch(bc: bare.ByteCursor, x: SqliteFenceMismatch): void;
200
174
  type SqliteDirtyPage = {
201
175
  readonly pgno: SqlitePgno;
202
176
  readonly bytes: SqlitePageBytes;
@@ -211,14 +185,14 @@ declare function readSqliteFetchedPage(bc: bare.ByteCursor): SqliteFetchedPage;
211
185
  declare function writeSqliteFetchedPage(bc: bare.ByteCursor, x: SqliteFetchedPage): void;
212
186
  type SqliteGetPagesRequest = {
213
187
  readonly actorId: Id;
214
- readonly generation: SqliteGeneration;
215
188
  readonly pgnos: readonly SqlitePgno[];
189
+ readonly expectedGeneration: u64 | null;
190
+ readonly expectedHeadTxid: u64 | null;
216
191
  };
217
192
  declare function readSqliteGetPagesRequest(bc: bare.ByteCursor): SqliteGetPagesRequest;
218
193
  declare function writeSqliteGetPagesRequest(bc: bare.ByteCursor, x: SqliteGetPagesRequest): void;
219
194
  type SqliteGetPagesOk = {
220
195
  readonly pages: readonly SqliteFetchedPage[];
221
- readonly meta: SqliteMeta;
222
196
  };
223
197
  declare function readSqliteGetPagesOk(bc: bare.ByteCursor): SqliteGetPagesOk;
224
198
  declare function writeSqliteGetPagesOk(bc: bare.ByteCursor, x: SqliteGetPagesOk): void;
@@ -230,9 +204,6 @@ declare function writeSqliteErrorResponse(bc: bare.ByteCursor, x: SqliteErrorRes
230
204
  type SqliteGetPagesResponse = {
231
205
  readonly tag: "SqliteGetPagesOk";
232
206
  readonly val: SqliteGetPagesOk;
233
- } | {
234
- readonly tag: "SqliteFenceMismatch";
235
- readonly val: SqliteFenceMismatch;
236
207
  } | {
237
208
  readonly tag: "SqliteErrorResponse";
238
209
  readonly val: SqliteErrorResponse;
@@ -241,132 +212,24 @@ declare function readSqliteGetPagesResponse(bc: bare.ByteCursor): SqliteGetPages
241
212
  declare function writeSqliteGetPagesResponse(bc: bare.ByteCursor, x: SqliteGetPagesResponse): void;
242
213
  type SqliteCommitRequest = {
243
214
  readonly actorId: Id;
244
- readonly generation: SqliteGeneration;
245
- readonly expectedHeadTxid: SqliteTxid;
246
215
  readonly dirtyPages: readonly SqliteDirtyPage[];
247
- readonly newDbSizePages: u32;
216
+ readonly dbSizePages: u32;
217
+ readonly nowMs: i64;
218
+ readonly expectedGeneration: u64 | null;
219
+ readonly expectedHeadTxid: u64 | null;
248
220
  };
249
221
  declare function readSqliteCommitRequest(bc: bare.ByteCursor): SqliteCommitRequest;
250
222
  declare function writeSqliteCommitRequest(bc: bare.ByteCursor, x: SqliteCommitRequest): void;
251
- type SqliteCommitOk = {
252
- readonly newHeadTxid: SqliteTxid;
253
- readonly meta: SqliteMeta;
254
- };
255
- declare function readSqliteCommitOk(bc: bare.ByteCursor): SqliteCommitOk;
256
- declare function writeSqliteCommitOk(bc: bare.ByteCursor, x: SqliteCommitOk): void;
257
- type SqliteCommitTooLarge = {
258
- readonly actualSizeBytes: u64;
259
- readonly maxSizeBytes: u64;
260
- };
261
- declare function readSqliteCommitTooLarge(bc: bare.ByteCursor): SqliteCommitTooLarge;
262
- declare function writeSqliteCommitTooLarge(bc: bare.ByteCursor, x: SqliteCommitTooLarge): void;
223
+ type SqliteCommitOk = null;
263
224
  type SqliteCommitResponse = {
264
225
  readonly tag: "SqliteCommitOk";
265
226
  readonly val: SqliteCommitOk;
266
- } | {
267
- readonly tag: "SqliteFenceMismatch";
268
- readonly val: SqliteFenceMismatch;
269
- } | {
270
- readonly tag: "SqliteCommitTooLarge";
271
- readonly val: SqliteCommitTooLarge;
272
227
  } | {
273
228
  readonly tag: "SqliteErrorResponse";
274
229
  readonly val: SqliteErrorResponse;
275
230
  };
276
231
  declare function readSqliteCommitResponse(bc: bare.ByteCursor): SqliteCommitResponse;
277
232
  declare function writeSqliteCommitResponse(bc: bare.ByteCursor, x: SqliteCommitResponse): void;
278
- type SqliteCommitStageBeginRequest = {
279
- readonly actorId: Id;
280
- readonly generation: SqliteGeneration;
281
- };
282
- declare function readSqliteCommitStageBeginRequest(bc: bare.ByteCursor): SqliteCommitStageBeginRequest;
283
- declare function writeSqliteCommitStageBeginRequest(bc: bare.ByteCursor, x: SqliteCommitStageBeginRequest): void;
284
- type SqliteCommitStageBeginOk = {
285
- readonly txid: SqliteTxid;
286
- };
287
- declare function readSqliteCommitStageBeginOk(bc: bare.ByteCursor): SqliteCommitStageBeginOk;
288
- declare function writeSqliteCommitStageBeginOk(bc: bare.ByteCursor, x: SqliteCommitStageBeginOk): void;
289
- type SqliteCommitStageBeginResponse = {
290
- readonly tag: "SqliteCommitStageBeginOk";
291
- readonly val: SqliteCommitStageBeginOk;
292
- } | {
293
- readonly tag: "SqliteFenceMismatch";
294
- readonly val: SqliteFenceMismatch;
295
- } | {
296
- readonly tag: "SqliteErrorResponse";
297
- readonly val: SqliteErrorResponse;
298
- };
299
- declare function readSqliteCommitStageBeginResponse(bc: bare.ByteCursor): SqliteCommitStageBeginResponse;
300
- declare function writeSqliteCommitStageBeginResponse(bc: bare.ByteCursor, x: SqliteCommitStageBeginResponse): void;
301
- type SqliteCommitStageRequest = {
302
- readonly actorId: Id;
303
- readonly generation: SqliteGeneration;
304
- readonly txid: SqliteTxid;
305
- readonly chunkIdx: u32;
306
- readonly bytes: ArrayBuffer;
307
- readonly isLast: boolean;
308
- };
309
- declare function readSqliteCommitStageRequest(bc: bare.ByteCursor): SqliteCommitStageRequest;
310
- declare function writeSqliteCommitStageRequest(bc: bare.ByteCursor, x: SqliteCommitStageRequest): void;
311
- type SqliteCommitStageOk = {
312
- readonly chunkIdxCommitted: u32;
313
- };
314
- declare function readSqliteCommitStageOk(bc: bare.ByteCursor): SqliteCommitStageOk;
315
- declare function writeSqliteCommitStageOk(bc: bare.ByteCursor, x: SqliteCommitStageOk): void;
316
- type SqliteCommitStageResponse = {
317
- readonly tag: "SqliteCommitStageOk";
318
- readonly val: SqliteCommitStageOk;
319
- } | {
320
- readonly tag: "SqliteFenceMismatch";
321
- readonly val: SqliteFenceMismatch;
322
- } | {
323
- readonly tag: "SqliteErrorResponse";
324
- readonly val: SqliteErrorResponse;
325
- };
326
- declare function readSqliteCommitStageResponse(bc: bare.ByteCursor): SqliteCommitStageResponse;
327
- declare function writeSqliteCommitStageResponse(bc: bare.ByteCursor, x: SqliteCommitStageResponse): void;
328
- type SqliteCommitFinalizeRequest = {
329
- readonly actorId: Id;
330
- readonly generation: SqliteGeneration;
331
- readonly expectedHeadTxid: SqliteTxid;
332
- readonly txid: SqliteTxid;
333
- readonly newDbSizePages: u32;
334
- };
335
- declare function readSqliteCommitFinalizeRequest(bc: bare.ByteCursor): SqliteCommitFinalizeRequest;
336
- declare function writeSqliteCommitFinalizeRequest(bc: bare.ByteCursor, x: SqliteCommitFinalizeRequest): void;
337
- type SqliteCommitFinalizeOk = {
338
- readonly newHeadTxid: SqliteTxid;
339
- readonly meta: SqliteMeta;
340
- };
341
- declare function readSqliteCommitFinalizeOk(bc: bare.ByteCursor): SqliteCommitFinalizeOk;
342
- declare function writeSqliteCommitFinalizeOk(bc: bare.ByteCursor, x: SqliteCommitFinalizeOk): void;
343
- type SqliteStageNotFound = {
344
- readonly stageId: SqliteStageId;
345
- };
346
- declare function readSqliteStageNotFound(bc: bare.ByteCursor): SqliteStageNotFound;
347
- declare function writeSqliteStageNotFound(bc: bare.ByteCursor, x: SqliteStageNotFound): void;
348
- type SqliteCommitFinalizeResponse = {
349
- readonly tag: "SqliteCommitFinalizeOk";
350
- readonly val: SqliteCommitFinalizeOk;
351
- } | {
352
- readonly tag: "SqliteFenceMismatch";
353
- readonly val: SqliteFenceMismatch;
354
- } | {
355
- readonly tag: "SqliteStageNotFound";
356
- readonly val: SqliteStageNotFound;
357
- } | {
358
- readonly tag: "SqliteErrorResponse";
359
- readonly val: SqliteErrorResponse;
360
- };
361
- declare function readSqliteCommitFinalizeResponse(bc: bare.ByteCursor): SqliteCommitFinalizeResponse;
362
- declare function writeSqliteCommitFinalizeResponse(bc: bare.ByteCursor, x: SqliteCommitFinalizeResponse): void;
363
- type SqliteStartupData = {
364
- readonly generation: SqliteGeneration;
365
- readonly meta: SqliteMeta;
366
- readonly preloadedPages: readonly SqliteFetchedPage[];
367
- };
368
- declare function readSqliteStartupData(bc: bare.ByteCursor): SqliteStartupData;
369
- declare function writeSqliteStartupData(bc: bare.ByteCursor, x: SqliteStartupData): void;
370
233
  /**
371
234
  * Core
372
235
  */
@@ -489,7 +352,6 @@ type CommandStartActor = {
489
352
  readonly config: ActorConfig;
490
353
  readonly hibernatingRequests: readonly HibernatingRequest[];
491
354
  readonly preloadedKv: PreloadedKv | null;
492
- readonly sqliteStartupData: SqliteStartupData | null;
493
355
  };
494
356
  declare function readCommandStartActor(bc: bare.ByteCursor): CommandStartActor;
495
357
  declare function writeCommandStartActor(bc: bare.ByteCursor, x: CommandStartActor): void;
@@ -758,24 +620,6 @@ type ToRivetSqliteCommitRequest = {
758
620
  };
759
621
  declare function readToRivetSqliteCommitRequest(bc: bare.ByteCursor): ToRivetSqliteCommitRequest;
760
622
  declare function writeToRivetSqliteCommitRequest(bc: bare.ByteCursor, x: ToRivetSqliteCommitRequest): void;
761
- type ToRivetSqliteCommitStageBeginRequest = {
762
- readonly requestId: u32;
763
- readonly data: SqliteCommitStageBeginRequest;
764
- };
765
- declare function readToRivetSqliteCommitStageBeginRequest(bc: bare.ByteCursor): ToRivetSqliteCommitStageBeginRequest;
766
- declare function writeToRivetSqliteCommitStageBeginRequest(bc: bare.ByteCursor, x: ToRivetSqliteCommitStageBeginRequest): void;
767
- type ToRivetSqliteCommitStageRequest = {
768
- readonly requestId: u32;
769
- readonly data: SqliteCommitStageRequest;
770
- };
771
- declare function readToRivetSqliteCommitStageRequest(bc: bare.ByteCursor): ToRivetSqliteCommitStageRequest;
772
- declare function writeToRivetSqliteCommitStageRequest(bc: bare.ByteCursor, x: ToRivetSqliteCommitStageRequest): void;
773
- type ToRivetSqliteCommitFinalizeRequest = {
774
- readonly requestId: u32;
775
- readonly data: SqliteCommitFinalizeRequest;
776
- };
777
- declare function readToRivetSqliteCommitFinalizeRequest(bc: bare.ByteCursor): ToRivetSqliteCommitFinalizeRequest;
778
- declare function writeToRivetSqliteCommitFinalizeRequest(bc: bare.ByteCursor, x: ToRivetSqliteCommitFinalizeRequest): void;
779
623
  type ToRivet = {
780
624
  readonly tag: "ToRivetMetadata";
781
625
  readonly val: ToRivetMetadata;
@@ -803,15 +647,6 @@ type ToRivet = {
803
647
  } | {
804
648
  readonly tag: "ToRivetSqliteCommitRequest";
805
649
  readonly val: ToRivetSqliteCommitRequest;
806
- } | {
807
- readonly tag: "ToRivetSqliteCommitStageBeginRequest";
808
- readonly val: ToRivetSqliteCommitStageBeginRequest;
809
- } | {
810
- readonly tag: "ToRivetSqliteCommitStageRequest";
811
- readonly val: ToRivetSqliteCommitStageRequest;
812
- } | {
813
- readonly tag: "ToRivetSqliteCommitFinalizeRequest";
814
- readonly val: ToRivetSqliteCommitFinalizeRequest;
815
650
  };
816
651
  declare function readToRivet(bc: bare.ByteCursor): ToRivet;
817
652
  declare function writeToRivet(bc: bare.ByteCursor, x: ToRivet): void;
@@ -858,24 +693,6 @@ type ToEnvoySqliteCommitResponse = {
858
693
  };
859
694
  declare function readToEnvoySqliteCommitResponse(bc: bare.ByteCursor): ToEnvoySqliteCommitResponse;
860
695
  declare function writeToEnvoySqliteCommitResponse(bc: bare.ByteCursor, x: ToEnvoySqliteCommitResponse): void;
861
- type ToEnvoySqliteCommitStageBeginResponse = {
862
- readonly requestId: u32;
863
- readonly data: SqliteCommitStageBeginResponse;
864
- };
865
- declare function readToEnvoySqliteCommitStageBeginResponse(bc: bare.ByteCursor): ToEnvoySqliteCommitStageBeginResponse;
866
- declare function writeToEnvoySqliteCommitStageBeginResponse(bc: bare.ByteCursor, x: ToEnvoySqliteCommitStageBeginResponse): void;
867
- type ToEnvoySqliteCommitStageResponse = {
868
- readonly requestId: u32;
869
- readonly data: SqliteCommitStageResponse;
870
- };
871
- declare function readToEnvoySqliteCommitStageResponse(bc: bare.ByteCursor): ToEnvoySqliteCommitStageResponse;
872
- declare function writeToEnvoySqliteCommitStageResponse(bc: bare.ByteCursor, x: ToEnvoySqliteCommitStageResponse): void;
873
- type ToEnvoySqliteCommitFinalizeResponse = {
874
- readonly requestId: u32;
875
- readonly data: SqliteCommitFinalizeResponse;
876
- };
877
- declare function readToEnvoySqliteCommitFinalizeResponse(bc: bare.ByteCursor): ToEnvoySqliteCommitFinalizeResponse;
878
- declare function writeToEnvoySqliteCommitFinalizeResponse(bc: bare.ByteCursor, x: ToEnvoySqliteCommitFinalizeResponse): void;
879
696
  type ToEnvoy = {
880
697
  readonly tag: "ToEnvoyInit";
881
698
  readonly val: ToEnvoyInit;
@@ -900,15 +717,6 @@ type ToEnvoy = {
900
717
  } | {
901
718
  readonly tag: "ToEnvoySqliteCommitResponse";
902
719
  readonly val: ToEnvoySqliteCommitResponse;
903
- } | {
904
- readonly tag: "ToEnvoySqliteCommitStageBeginResponse";
905
- readonly val: ToEnvoySqliteCommitStageBeginResponse;
906
- } | {
907
- readonly tag: "ToEnvoySqliteCommitStageResponse";
908
- readonly val: ToEnvoySqliteCommitStageResponse;
909
- } | {
910
- readonly tag: "ToEnvoySqliteCommitFinalizeResponse";
911
- readonly val: ToEnvoySqliteCommitFinalizeResponse;
912
720
  };
913
721
  declare function readToEnvoy(bc: bare.ByteCursor): ToEnvoy;
914
722
  declare function writeToEnvoy(bc: bare.ByteCursor, x: ToEnvoy): void;
@@ -984,6 +792,6 @@ declare function readToOutbound(bc: bare.ByteCursor): ToOutbound;
984
792
  declare function writeToOutbound(bc: bare.ByteCursor, x: ToOutbound): void;
985
793
  declare function encodeToOutbound(x: ToOutbound, config?: Partial<bare.Config>): Uint8Array;
986
794
  declare function decodeToOutbound(bytes: Uint8Array): ToOutbound;
987
- declare const VERSION = 2;
795
+ declare const VERSION = 3;
988
796
 
989
- export { type ActorCheckpoint, type ActorCommandKeyData, type ActorConfig, type ActorIntent, type ActorIntentSleep, type ActorIntentStop, type ActorName, type ActorState, type ActorStateRunning, type ActorStateStopped, type Command, type CommandStartActor, type CommandStopActor, type CommandWrapper, type Event, type EventActorIntent, type EventActorSetAlarm, type EventActorStateUpdate, type EventWrapper, type GatewayId, type HibernatingRequest, type Id, type Json, type KvDeleteRangeRequest, type KvDeleteRequest, type KvDeleteResponse, type KvDropRequest, type KvDropResponse, type KvErrorResponse, type KvGetRequest, type KvGetResponse, type KvKey, type KvListAllQuery, type KvListPrefixQuery, type KvListQuery, type KvListRangeQuery, type KvListRequest, type KvListResponse, type KvMetadata, type KvPutRequest, type KvPutResponse, type KvRequestData, type KvResponseData, type KvValue, type MessageId, type MessageIndex, type PreloadedKv, type PreloadedKvEntry, type ProtocolMetadata, type RequestId, type SqliteCommitFinalizeOk, type SqliteCommitFinalizeRequest, type SqliteCommitFinalizeResponse, type SqliteCommitOk, type SqliteCommitRequest, type SqliteCommitResponse, type SqliteCommitStageBeginOk, type SqliteCommitStageBeginRequest, type SqliteCommitStageBeginResponse, type SqliteCommitStageOk, type SqliteCommitStageRequest, type SqliteCommitStageResponse, type SqliteCommitTooLarge, type SqliteDirtyPage, type SqliteErrorResponse, type SqliteFenceMismatch, type SqliteFetchedPage, type SqliteGeneration, type SqliteGetPagesOk, type SqliteGetPagesRequest, type SqliteGetPagesResponse, type SqliteMeta, type SqlitePageBytes, type SqlitePgno, type SqliteStageId, type SqliteStageNotFound, type SqliteStartupData, type SqliteTxid, StopActorReason, StopCode, type ToEnvoy, type ToEnvoyAckEvents, type ToEnvoyCommands, type ToEnvoyConn, type ToEnvoyConnClose, type ToEnvoyConnPing, type ToEnvoyInit, type ToEnvoyKvResponse, type ToEnvoyPing, type ToEnvoyRequestAbort, type ToEnvoyRequestChunk, type ToEnvoyRequestStart, type ToEnvoySqliteCommitFinalizeResponse, type ToEnvoySqliteCommitResponse, type ToEnvoySqliteCommitStageBeginResponse, type ToEnvoySqliteCommitStageResponse, type ToEnvoySqliteGetPagesResponse, type ToEnvoyTunnelMessage, type ToEnvoyTunnelMessageKind, type ToEnvoyWebSocketClose, type ToEnvoyWebSocketMessage, type ToEnvoyWebSocketOpen, type ToGateway, type ToGatewayPong, type ToOutbound, type ToOutboundActorStart, type ToRivet, type ToRivetAckCommands, type ToRivetEvents, type ToRivetKvRequest, type ToRivetMetadata, type ToRivetPong, type ToRivetResponseAbort, type ToRivetResponseChunk, type ToRivetResponseStart, type ToRivetSqliteCommitFinalizeRequest, type ToRivetSqliteCommitRequest, type ToRivetSqliteCommitStageBeginRequest, type ToRivetSqliteCommitStageRequest, type ToRivetSqliteGetPagesRequest, type ToRivetStopping, type ToRivetTunnelMessage, type ToRivetTunnelMessageKind, type ToRivetWebSocketClose, type ToRivetWebSocketMessage, type ToRivetWebSocketMessageAck, type ToRivetWebSocketOpen, VERSION, decodeActorCommandKeyData, decodeToEnvoy, decodeToEnvoyConn, decodeToGateway, decodeToOutbound, decodeToRivet, encodeActorCommandKeyData, encodeToEnvoy, encodeToEnvoyConn, encodeToGateway, encodeToOutbound, encodeToRivet, type i64, readActorCheckpoint, readActorCommandKeyData, readActorConfig, readActorIntent, readActorName, readActorState, readActorStateStopped, readCommand, readCommandStartActor, readCommandStopActor, readCommandWrapper, readEvent, readEventActorIntent, readEventActorSetAlarm, readEventActorStateUpdate, readEventWrapper, readGatewayId, readHibernatingRequest, readId, readJson, readKvDeleteRangeRequest, readKvDeleteRequest, readKvErrorResponse, readKvGetRequest, readKvGetResponse, readKvKey, readKvListPrefixQuery, readKvListQuery, readKvListRangeQuery, readKvListRequest, readKvListResponse, readKvMetadata, readKvPutRequest, readKvRequestData, readKvResponseData, readKvValue, readMessageId, readMessageIndex, readPreloadedKv, readPreloadedKvEntry, readProtocolMetadata, readRequestId, readSqliteCommitFinalizeOk, readSqliteCommitFinalizeRequest, readSqliteCommitFinalizeResponse, readSqliteCommitOk, readSqliteCommitRequest, readSqliteCommitResponse, readSqliteCommitStageBeginOk, readSqliteCommitStageBeginRequest, readSqliteCommitStageBeginResponse, readSqliteCommitStageOk, readSqliteCommitStageRequest, readSqliteCommitStageResponse, readSqliteCommitTooLarge, readSqliteDirtyPage, readSqliteErrorResponse, readSqliteFenceMismatch, readSqliteFetchedPage, readSqliteGeneration, readSqliteGetPagesOk, readSqliteGetPagesRequest, readSqliteGetPagesResponse, readSqliteMeta, readSqlitePageBytes, readSqlitePgno, readSqliteStageId, readSqliteStageNotFound, readSqliteStartupData, readSqliteTxid, readStopActorReason, readStopCode, readToEnvoy, readToEnvoyAckEvents, readToEnvoyCommands, readToEnvoyConn, readToEnvoyConnPing, readToEnvoyInit, readToEnvoyKvResponse, readToEnvoyPing, readToEnvoyRequestChunk, readToEnvoyRequestStart, readToEnvoySqliteCommitFinalizeResponse, readToEnvoySqliteCommitResponse, readToEnvoySqliteCommitStageBeginResponse, readToEnvoySqliteCommitStageResponse, readToEnvoySqliteGetPagesResponse, readToEnvoyTunnelMessage, readToEnvoyTunnelMessageKind, readToEnvoyWebSocketClose, readToEnvoyWebSocketMessage, readToEnvoyWebSocketOpen, readToGateway, readToGatewayPong, readToOutbound, readToOutboundActorStart, readToRivet, readToRivetAckCommands, readToRivetEvents, readToRivetKvRequest, readToRivetMetadata, readToRivetPong, readToRivetResponseChunk, readToRivetResponseStart, readToRivetSqliteCommitFinalizeRequest, readToRivetSqliteCommitRequest, readToRivetSqliteCommitStageBeginRequest, readToRivetSqliteCommitStageRequest, readToRivetSqliteGetPagesRequest, readToRivetTunnelMessage, readToRivetTunnelMessageKind, readToRivetWebSocketClose, readToRivetWebSocketMessage, readToRivetWebSocketMessageAck, readToRivetWebSocketOpen, type u16, type u32, type u64, writeActorCheckpoint, writeActorCommandKeyData, writeActorConfig, writeActorIntent, writeActorName, writeActorState, writeActorStateStopped, writeCommand, writeCommandStartActor, writeCommandStopActor, writeCommandWrapper, writeEvent, writeEventActorIntent, writeEventActorSetAlarm, writeEventActorStateUpdate, writeEventWrapper, writeGatewayId, writeHibernatingRequest, writeId, writeJson, writeKvDeleteRangeRequest, writeKvDeleteRequest, writeKvErrorResponse, writeKvGetRequest, writeKvGetResponse, writeKvKey, writeKvListPrefixQuery, writeKvListQuery, writeKvListRangeQuery, writeKvListRequest, writeKvListResponse, writeKvMetadata, writeKvPutRequest, writeKvRequestData, writeKvResponseData, writeKvValue, writeMessageId, writeMessageIndex, writePreloadedKv, writePreloadedKvEntry, writeProtocolMetadata, writeRequestId, writeSqliteCommitFinalizeOk, writeSqliteCommitFinalizeRequest, writeSqliteCommitFinalizeResponse, writeSqliteCommitOk, writeSqliteCommitRequest, writeSqliteCommitResponse, writeSqliteCommitStageBeginOk, writeSqliteCommitStageBeginRequest, writeSqliteCommitStageBeginResponse, writeSqliteCommitStageOk, writeSqliteCommitStageRequest, writeSqliteCommitStageResponse, writeSqliteCommitTooLarge, writeSqliteDirtyPage, writeSqliteErrorResponse, writeSqliteFenceMismatch, writeSqliteFetchedPage, writeSqliteGeneration, writeSqliteGetPagesOk, writeSqliteGetPagesRequest, writeSqliteGetPagesResponse, writeSqliteMeta, writeSqlitePageBytes, writeSqlitePgno, writeSqliteStageId, writeSqliteStageNotFound, writeSqliteStartupData, writeSqliteTxid, writeStopActorReason, writeStopCode, writeToEnvoy, writeToEnvoyAckEvents, writeToEnvoyCommands, writeToEnvoyConn, writeToEnvoyConnPing, writeToEnvoyInit, writeToEnvoyKvResponse, writeToEnvoyPing, writeToEnvoyRequestChunk, writeToEnvoyRequestStart, writeToEnvoySqliteCommitFinalizeResponse, writeToEnvoySqliteCommitResponse, writeToEnvoySqliteCommitStageBeginResponse, writeToEnvoySqliteCommitStageResponse, writeToEnvoySqliteGetPagesResponse, writeToEnvoyTunnelMessage, writeToEnvoyTunnelMessageKind, writeToEnvoyWebSocketClose, writeToEnvoyWebSocketMessage, writeToEnvoyWebSocketOpen, writeToGateway, writeToGatewayPong, writeToOutbound, writeToOutboundActorStart, writeToRivet, writeToRivetAckCommands, writeToRivetEvents, writeToRivetKvRequest, writeToRivetMetadata, writeToRivetPong, writeToRivetResponseChunk, writeToRivetResponseStart, writeToRivetSqliteCommitFinalizeRequest, writeToRivetSqliteCommitRequest, writeToRivetSqliteCommitStageBeginRequest, writeToRivetSqliteCommitStageRequest, writeToRivetSqliteGetPagesRequest, writeToRivetTunnelMessage, writeToRivetTunnelMessageKind, writeToRivetWebSocketClose, writeToRivetWebSocketMessage, writeToRivetWebSocketMessageAck, writeToRivetWebSocketOpen };
797
+ export { type ActorCheckpoint, type ActorCommandKeyData, type ActorConfig, type ActorIntent, type ActorIntentSleep, type ActorIntentStop, type ActorName, type ActorState, type ActorStateRunning, type ActorStateStopped, type Command, type CommandStartActor, type CommandStopActor, type CommandWrapper, type Event, type EventActorIntent, type EventActorSetAlarm, type EventActorStateUpdate, type EventWrapper, type GatewayId, type HibernatingRequest, type Id, type Json, type KvDeleteRangeRequest, type KvDeleteRequest, type KvDeleteResponse, type KvDropRequest, type KvDropResponse, type KvErrorResponse, type KvGetRequest, type KvGetResponse, type KvKey, type KvListAllQuery, type KvListPrefixQuery, type KvListQuery, type KvListRangeQuery, type KvListRequest, type KvListResponse, type KvMetadata, type KvPutRequest, type KvPutResponse, type KvRequestData, type KvResponseData, type KvValue, type MessageId, type MessageIndex, type PreloadedKv, type PreloadedKvEntry, type ProtocolMetadata, type RequestId, type SqliteCommitOk, type SqliteCommitRequest, type SqliteCommitResponse, type SqliteDirtyPage, type SqliteErrorResponse, type SqliteFetchedPage, type SqliteGetPagesOk, type SqliteGetPagesRequest, type SqliteGetPagesResponse, type SqlitePageBytes, type SqlitePgno, StopActorReason, StopCode, type ToEnvoy, type ToEnvoyAckEvents, type ToEnvoyCommands, type ToEnvoyConn, type ToEnvoyConnClose, type ToEnvoyConnPing, type ToEnvoyInit, type ToEnvoyKvResponse, type ToEnvoyPing, type ToEnvoyRequestAbort, type ToEnvoyRequestChunk, type ToEnvoyRequestStart, type ToEnvoySqliteCommitResponse, type ToEnvoySqliteGetPagesResponse, type ToEnvoyTunnelMessage, type ToEnvoyTunnelMessageKind, type ToEnvoyWebSocketClose, type ToEnvoyWebSocketMessage, type ToEnvoyWebSocketOpen, type ToGateway, type ToGatewayPong, type ToOutbound, type ToOutboundActorStart, type ToRivet, type ToRivetAckCommands, type ToRivetEvents, type ToRivetKvRequest, type ToRivetMetadata, type ToRivetPong, type ToRivetResponseAbort, type ToRivetResponseChunk, type ToRivetResponseStart, type ToRivetSqliteCommitRequest, type ToRivetSqliteGetPagesRequest, type ToRivetStopping, type ToRivetTunnelMessage, type ToRivetTunnelMessageKind, type ToRivetWebSocketClose, type ToRivetWebSocketMessage, type ToRivetWebSocketMessageAck, type ToRivetWebSocketOpen, VERSION, decodeActorCommandKeyData, decodeToEnvoy, decodeToEnvoyConn, decodeToGateway, decodeToOutbound, decodeToRivet, encodeActorCommandKeyData, encodeToEnvoy, encodeToEnvoyConn, encodeToGateway, encodeToOutbound, encodeToRivet, type i64, readActorCheckpoint, readActorCommandKeyData, readActorConfig, readActorIntent, readActorName, readActorState, readActorStateStopped, readCommand, readCommandStartActor, readCommandStopActor, readCommandWrapper, readEvent, readEventActorIntent, readEventActorSetAlarm, readEventActorStateUpdate, readEventWrapper, readGatewayId, readHibernatingRequest, readId, readJson, readKvDeleteRangeRequest, readKvDeleteRequest, readKvErrorResponse, readKvGetRequest, readKvGetResponse, readKvKey, readKvListPrefixQuery, readKvListQuery, readKvListRangeQuery, readKvListRequest, readKvListResponse, readKvMetadata, readKvPutRequest, readKvRequestData, readKvResponseData, readKvValue, readMessageId, readMessageIndex, readPreloadedKv, readPreloadedKvEntry, readProtocolMetadata, readRequestId, readSqliteCommitRequest, readSqliteCommitResponse, readSqliteDirtyPage, readSqliteErrorResponse, readSqliteFetchedPage, readSqliteGetPagesOk, readSqliteGetPagesRequest, readSqliteGetPagesResponse, readSqlitePageBytes, readSqlitePgno, readStopActorReason, readStopCode, readToEnvoy, readToEnvoyAckEvents, readToEnvoyCommands, readToEnvoyConn, readToEnvoyConnPing, readToEnvoyInit, readToEnvoyKvResponse, readToEnvoyPing, readToEnvoyRequestChunk, readToEnvoyRequestStart, readToEnvoySqliteCommitResponse, readToEnvoySqliteGetPagesResponse, readToEnvoyTunnelMessage, readToEnvoyTunnelMessageKind, readToEnvoyWebSocketClose, readToEnvoyWebSocketMessage, readToEnvoyWebSocketOpen, readToGateway, readToGatewayPong, readToOutbound, readToOutboundActorStart, readToRivet, readToRivetAckCommands, readToRivetEvents, readToRivetKvRequest, readToRivetMetadata, readToRivetPong, readToRivetResponseChunk, readToRivetResponseStart, readToRivetSqliteCommitRequest, readToRivetSqliteGetPagesRequest, readToRivetTunnelMessage, readToRivetTunnelMessageKind, readToRivetWebSocketClose, readToRivetWebSocketMessage, readToRivetWebSocketMessageAck, readToRivetWebSocketOpen, type u16, type u32, type u64, writeActorCheckpoint, writeActorCommandKeyData, writeActorConfig, writeActorIntent, writeActorName, writeActorState, writeActorStateStopped, writeCommand, writeCommandStartActor, writeCommandStopActor, writeCommandWrapper, writeEvent, writeEventActorIntent, writeEventActorSetAlarm, writeEventActorStateUpdate, writeEventWrapper, writeGatewayId, writeHibernatingRequest, writeId, writeJson, writeKvDeleteRangeRequest, writeKvDeleteRequest, writeKvErrorResponse, writeKvGetRequest, writeKvGetResponse, writeKvKey, writeKvListPrefixQuery, writeKvListQuery, writeKvListRangeQuery, writeKvListRequest, writeKvListResponse, writeKvMetadata, writeKvPutRequest, writeKvRequestData, writeKvResponseData, writeKvValue, writeMessageId, writeMessageIndex, writePreloadedKv, writePreloadedKvEntry, writeProtocolMetadata, writeRequestId, writeSqliteCommitRequest, writeSqliteCommitResponse, writeSqliteDirtyPage, writeSqliteErrorResponse, writeSqliteFetchedPage, writeSqliteGetPagesOk, writeSqliteGetPagesRequest, writeSqliteGetPagesResponse, writeSqlitePageBytes, writeSqlitePgno, writeStopActorReason, writeStopCode, writeToEnvoy, writeToEnvoyAckEvents, writeToEnvoyCommands, writeToEnvoyConn, writeToEnvoyConnPing, writeToEnvoyInit, writeToEnvoyKvResponse, writeToEnvoyPing, writeToEnvoyRequestChunk, writeToEnvoyRequestStart, writeToEnvoySqliteCommitResponse, writeToEnvoySqliteGetPagesResponse, writeToEnvoyTunnelMessage, writeToEnvoyTunnelMessageKind, writeToEnvoyWebSocketClose, writeToEnvoyWebSocketMessage, writeToEnvoyWebSocketOpen, writeToGateway, writeToGatewayPong, writeToOutbound, writeToOutboundActorStart, writeToRivet, writeToRivetAckCommands, writeToRivetEvents, writeToRivetKvRequest, writeToRivetMetadata, writeToRivetPong, writeToRivetResponseChunk, writeToRivetResponseStart, writeToRivetSqliteCommitRequest, writeToRivetSqliteGetPagesRequest, writeToRivetTunnelMessage, writeToRivetTunnelMessageKind, writeToRivetWebSocketClose, writeToRivetWebSocketMessage, writeToRivetWebSocketMessageAck, writeToRivetWebSocketOpen };
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  // src/index.ts
2
2
  import * as bare from "@rivetkit/bare-ts";
3
- var DEFAULT_CONFIG = /* @__PURE__ */ bare.Config({});
4
3
  function readId(bc) {
5
4
  return bare.readString(bc);
6
5
  }
@@ -366,66 +365,18 @@ function writeKvResponseData(bc, x) {
366
365
  }
367
366
  }
368
367
  }
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
368
  function readSqlitePgno(bc) {
382
369
  return bare.readU32(bc);
383
370
  }
384
371
  function writeSqlitePgno(bc, x) {
385
372
  bare.writeU32(bc, x);
386
373
  }
387
- function readSqliteStageId(bc) {
388
- return bare.readU64(bc);
389
- }
390
- function writeSqliteStageId(bc, x) {
391
- bare.writeU64(bc, x);
392
- }
393
374
  function readSqlitePageBytes(bc) {
394
375
  return bare.readData(bc);
395
376
  }
396
377
  function writeSqlitePageBytes(bc, x) {
397
378
  bare.writeData(bc, x);
398
379
  }
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
380
  function readSqliteDirtyPage(bc) {
430
381
  return {
431
382
  pgno: readSqlitePgno(bc),
@@ -475,14 +426,16 @@ function write6(bc, x) {
475
426
  function readSqliteGetPagesRequest(bc) {
476
427
  return {
477
428
  actorId: readId(bc),
478
- generation: readSqliteGeneration(bc),
479
- pgnos: read6(bc)
429
+ pgnos: read6(bc),
430
+ expectedGeneration: read2(bc),
431
+ expectedHeadTxid: read2(bc)
480
432
  };
481
433
  }
482
434
  function writeSqliteGetPagesRequest(bc, x) {
483
435
  writeId(bc, x.actorId);
484
- writeSqliteGeneration(bc, x.generation);
485
436
  write6(bc, x.pgnos);
437
+ write2(bc, x.expectedGeneration);
438
+ write2(bc, x.expectedHeadTxid);
486
439
  }
487
440
  function read7(bc) {
488
441
  const len = bare.readUintSafe(bc);
@@ -503,13 +456,11 @@ function write7(bc, x) {
503
456
  }
504
457
  function readSqliteGetPagesOk(bc) {
505
458
  return {
506
- pages: read7(bc),
507
- meta: readSqliteMeta(bc)
459
+ pages: read7(bc)
508
460
  };
509
461
  }
510
462
  function writeSqliteGetPagesOk(bc, x) {
511
463
  write7(bc, x.pages);
512
- writeSqliteMeta(bc, x.meta);
513
464
  }
514
465
  function readSqliteErrorResponse(bc) {
515
466
  return {
@@ -526,8 +477,6 @@ function readSqliteGetPagesResponse(bc) {
526
477
  case 0:
527
478
  return { tag: "SqliteGetPagesOk", val: readSqliteGetPagesOk(bc) };
528
479
  case 1:
529
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
530
- case 2:
531
480
  return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
532
481
  default: {
533
482
  bc.offset = offset;
@@ -542,13 +491,8 @@ function writeSqliteGetPagesResponse(bc, x) {
542
491
  writeSqliteGetPagesOk(bc, x.val);
543
492
  break;
544
493
  }
545
- case "SqliteFenceMismatch": {
546
- bare.writeU8(bc, 1);
547
- writeSqliteFenceMismatch(bc, x.val);
548
- break;
549
- }
550
494
  case "SqliteErrorResponse": {
551
- bare.writeU8(bc, 2);
495
+ bare.writeU8(bc, 1);
552
496
  writeSqliteErrorResponse(bc, x.val);
553
497
  break;
554
498
  }
@@ -574,50 +518,28 @@ function write8(bc, x) {
574
518
  function readSqliteCommitRequest(bc) {
575
519
  return {
576
520
  actorId: readId(bc),
577
- generation: readSqliteGeneration(bc),
578
- expectedHeadTxid: readSqliteTxid(bc),
579
521
  dirtyPages: read8(bc),
580
- newDbSizePages: bare.readU32(bc)
522
+ dbSizePages: bare.readU32(bc),
523
+ nowMs: bare.readI64(bc),
524
+ expectedGeneration: read2(bc),
525
+ expectedHeadTxid: read2(bc)
581
526
  };
582
527
  }
583
528
  function writeSqliteCommitRequest(bc, x) {
584
529
  writeId(bc, x.actorId);
585
- writeSqliteGeneration(bc, x.generation);
586
- writeSqliteTxid(bc, x.expectedHeadTxid);
587
530
  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);
531
+ bare.writeU32(bc, x.dbSizePages);
532
+ bare.writeI64(bc, x.nowMs);
533
+ write2(bc, x.expectedGeneration);
534
+ write2(bc, x.expectedHeadTxid);
609
535
  }
610
536
  function readSqliteCommitResponse(bc) {
611
537
  const offset = bc.offset;
612
538
  const tag = bare.readU8(bc);
613
539
  switch (tag) {
614
540
  case 0:
615
- return { tag: "SqliteCommitOk", val: readSqliteCommitOk(bc) };
541
+ return { tag: "SqliteCommitOk", val: null };
616
542
  case 1:
617
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
618
- case 2:
619
- return { tag: "SqliteCommitTooLarge", val: readSqliteCommitTooLarge(bc) };
620
- case 3:
621
543
  return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
622
544
  default: {
623
545
  bc.offset = offset;
@@ -629,228 +551,15 @@ function writeSqliteCommitResponse(bc, x) {
629
551
  switch (x.tag) {
630
552
  case "SqliteCommitOk": {
631
553
  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
554
  break;
644
555
  }
645
556
  case "SqliteErrorResponse": {
646
- bare.writeU8(bc, 3);
647
- writeSqliteErrorResponse(bc, x.val);
648
- break;
649
- }
650
- }
651
- }
652
- function readSqliteCommitStageBeginRequest(bc) {
653
- return {
654
- actorId: readId(bc),
655
- generation: readSqliteGeneration(bc)
656
- };
657
- }
658
- function writeSqliteCommitStageBeginRequest(bc, x) {
659
- writeId(bc, x.actorId);
660
- writeSqliteGeneration(bc, x.generation);
661
- }
662
- function readSqliteCommitStageBeginOk(bc) {
663
- return {
664
- txid: readSqliteTxid(bc)
665
- };
666
- }
667
- function writeSqliteCommitStageBeginOk(bc, x) {
668
- writeSqliteTxid(bc, x.txid);
669
- }
670
- function readSqliteCommitStageBeginResponse(bc) {
671
- const offset = bc.offset;
672
- const tag = bare.readU8(bc);
673
- switch (tag) {
674
- case 0:
675
- return { tag: "SqliteCommitStageBeginOk", val: readSqliteCommitStageBeginOk(bc) };
676
- case 1:
677
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
678
- case 2:
679
- return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
680
- default: {
681
- bc.offset = offset;
682
- throw new bare.BareError(offset, "invalid tag");
683
- }
684
- }
685
- }
686
- function writeSqliteCommitStageBeginResponse(bc, x) {
687
- switch (x.tag) {
688
- case "SqliteCommitStageBeginOk": {
689
- bare.writeU8(bc, 0);
690
- writeSqliteCommitStageBeginOk(bc, x.val);
691
- break;
692
- }
693
- case "SqliteFenceMismatch": {
694
- bare.writeU8(bc, 1);
695
- writeSqliteFenceMismatch(bc, x.val);
696
- break;
697
- }
698
- case "SqliteErrorResponse": {
699
- bare.writeU8(bc, 2);
700
- writeSqliteErrorResponse(bc, x.val);
701
- break;
702
- }
703
- }
704
- }
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) {
732
- const offset = bc.offset;
733
- const tag = bare.readU8(bc);
734
- switch (tag) {
735
- case 0:
736
- return { tag: "SqliteCommitStageOk", val: readSqliteCommitStageOk(bc) };
737
- case 1:
738
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
739
- case 2:
740
- return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
741
- default: {
742
- bc.offset = offset;
743
- throw new bare.BareError(offset, "invalid tag");
744
- }
745
- }
746
- }
747
- function writeSqliteCommitStageResponse(bc, x) {
748
- switch (x.tag) {
749
- case "SqliteCommitStageOk": {
750
- bare.writeU8(bc, 0);
751
- writeSqliteCommitStageOk(bc, x.val);
752
- break;
753
- }
754
- case "SqliteFenceMismatch": {
755
- bare.writeU8(bc, 1);
756
- writeSqliteFenceMismatch(bc, x.val);
757
- break;
758
- }
759
- case "SqliteErrorResponse": {
760
- bare.writeU8(bc, 2);
761
- writeSqliteErrorResponse(bc, x.val);
762
- break;
763
- }
764
- }
765
- }
766
- function readSqliteCommitFinalizeRequest(bc) {
767
- return {
768
- actorId: readId(bc),
769
- generation: readSqliteGeneration(bc),
770
- expectedHeadTxid: readSqliteTxid(bc),
771
- txid: readSqliteTxid(bc),
772
- newDbSizePages: bare.readU32(bc)
773
- };
774
- }
775
- function writeSqliteCommitFinalizeRequest(bc, x) {
776
- writeId(bc, x.actorId);
777
- writeSqliteGeneration(bc, x.generation);
778
- writeSqliteTxid(bc, x.expectedHeadTxid);
779
- writeSqliteTxid(bc, x.txid);
780
- bare.writeU32(bc, x.newDbSizePages);
781
- }
782
- function readSqliteCommitFinalizeOk(bc) {
783
- return {
784
- newHeadTxid: readSqliteTxid(bc),
785
- meta: readSqliteMeta(bc)
786
- };
787
- }
788
- function writeSqliteCommitFinalizeOk(bc, x) {
789
- writeSqliteTxid(bc, x.newHeadTxid);
790
- writeSqliteMeta(bc, x.meta);
791
- }
792
- function readSqliteStageNotFound(bc) {
793
- return {
794
- stageId: readSqliteStageId(bc)
795
- };
796
- }
797
- function writeSqliteStageNotFound(bc, x) {
798
- writeSqliteStageId(bc, x.stageId);
799
- }
800
- function readSqliteCommitFinalizeResponse(bc) {
801
- const offset = bc.offset;
802
- const tag = bare.readU8(bc);
803
- switch (tag) {
804
- case 0:
805
- return { tag: "SqliteCommitFinalizeOk", val: readSqliteCommitFinalizeOk(bc) };
806
- case 1:
807
- return { tag: "SqliteFenceMismatch", val: readSqliteFenceMismatch(bc) };
808
- case 2:
809
- return { tag: "SqliteStageNotFound", val: readSqliteStageNotFound(bc) };
810
- case 3:
811
- return { tag: "SqliteErrorResponse", val: readSqliteErrorResponse(bc) };
812
- default: {
813
- bc.offset = offset;
814
- throw new bare.BareError(offset, "invalid tag");
815
- }
816
- }
817
- }
818
- function writeSqliteCommitFinalizeResponse(bc, x) {
819
- switch (x.tag) {
820
- case "SqliteCommitFinalizeOk": {
821
- bare.writeU8(bc, 0);
822
- writeSqliteCommitFinalizeOk(bc, x.val);
823
- break;
824
- }
825
- case "SqliteFenceMismatch": {
826
557
  bare.writeU8(bc, 1);
827
- writeSqliteFenceMismatch(bc, x.val);
828
- break;
829
- }
830
- case "SqliteStageNotFound": {
831
- bare.writeU8(bc, 2);
832
- writeSqliteStageNotFound(bc, x.val);
833
- break;
834
- }
835
- case "SqliteErrorResponse": {
836
- bare.writeU8(bc, 3);
837
558
  writeSqliteErrorResponse(bc, x.val);
838
559
  break;
839
560
  }
840
561
  }
841
562
  }
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
563
  var StopCode = /* @__PURE__ */ ((StopCode2) => {
855
564
  StopCode2["Ok"] = "Ok";
856
565
  StopCode2["Error"] = "Error";
@@ -1152,28 +861,17 @@ function write14(bc, x) {
1152
861
  writePreloadedKv(bc, x);
1153
862
  }
1154
863
  }
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
864
  function readCommandStartActor(bc) {
1165
865
  return {
1166
866
  config: readActorConfig(bc),
1167
867
  hibernatingRequests: read13(bc),
1168
- preloadedKv: read14(bc),
1169
- sqliteStartupData: read15(bc)
868
+ preloadedKv: read14(bc)
1170
869
  };
1171
870
  }
1172
871
  function writeCommandStartActor(bc, x) {
1173
872
  writeActorConfig(bc, x.config);
1174
873
  write13(bc, x.hibernatingRequests);
1175
874
  write14(bc, x.preloadedKv);
1176
- write15(bc, x.sqliteStartupData);
1177
875
  }
1178
876
  var StopActorReason = /* @__PURE__ */ ((StopActorReason2) => {
1179
877
  StopActorReason2["SleepIntent"] = "SleepIntent";
@@ -1302,7 +1000,7 @@ function writeActorCommandKeyData(bc, x) {
1302
1000
  }
1303
1001
  }
1304
1002
  function encodeActorCommandKeyData(x, config) {
1305
- const fullConfig = config != null ? bare.Config(config) : DEFAULT_CONFIG;
1003
+ const fullConfig = config != null ? bare.Config(config) : bare.DEFAULT_CONFIG;
1306
1004
  const bc = new bare.ByteCursor(
1307
1005
  new Uint8Array(fullConfig.initialBufferLength),
1308
1006
  fullConfig
@@ -1311,7 +1009,7 @@ function encodeActorCommandKeyData(x, config) {
1311
1009
  return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset);
1312
1010
  }
1313
1011
  function decodeActorCommandKeyData(bytes) {
1314
- const bc = new bare.ByteCursor(bytes, DEFAULT_CONFIG);
1012
+ const bc = new bare.ByteCursor(bytes, bare.DEFAULT_CONFIG);
1315
1013
  const result = readActorCommandKeyData(bc);
1316
1014
  if (bc.offset < bc.view.byteLength) {
1317
1015
  throw new bare.BareError(bc.offset, "remaining bytes");
@@ -1330,7 +1028,7 @@ function writeMessageId(bc, x) {
1330
1028
  writeRequestId(bc, x.requestId);
1331
1029
  writeMessageIndex(bc, x.messageIndex);
1332
1030
  }
1333
- function read16(bc) {
1031
+ function read15(bc) {
1334
1032
  const len = bare.readUintSafe(bc);
1335
1033
  const result = /* @__PURE__ */ new Map();
1336
1034
  for (let i = 0; i < len; i++) {
@@ -1344,7 +1042,7 @@ function read16(bc) {
1344
1042
  }
1345
1043
  return result;
1346
1044
  }
1347
- function write16(bc, x) {
1045
+ function write15(bc, x) {
1348
1046
  bare.writeUintSafe(bc, x.size);
1349
1047
  for (const kv of x) {
1350
1048
  bare.writeString(bc, kv[0]);
@@ -1356,7 +1054,7 @@ function readToEnvoyRequestStart(bc) {
1356
1054
  actorId: readId(bc),
1357
1055
  method: bare.readString(bc),
1358
1056
  path: bare.readString(bc),
1359
- headers: read16(bc),
1057
+ headers: read15(bc),
1360
1058
  body: read10(bc),
1361
1059
  stream: bare.readBool(bc)
1362
1060
  };
@@ -1365,7 +1063,7 @@ function writeToEnvoyRequestStart(bc, x) {
1365
1063
  writeId(bc, x.actorId);
1366
1064
  bare.writeString(bc, x.method);
1367
1065
  bare.writeString(bc, x.path);
1368
- write16(bc, x.headers);
1066
+ write15(bc, x.headers);
1369
1067
  write10(bc, x.body);
1370
1068
  bare.writeBool(bc, x.stream);
1371
1069
  }
@@ -1382,14 +1080,14 @@ function writeToEnvoyRequestChunk(bc, x) {
1382
1080
  function readToRivetResponseStart(bc) {
1383
1081
  return {
1384
1082
  status: bare.readU16(bc),
1385
- headers: read16(bc),
1083
+ headers: read15(bc),
1386
1084
  body: read10(bc),
1387
1085
  stream: bare.readBool(bc)
1388
1086
  };
1389
1087
  }
1390
1088
  function writeToRivetResponseStart(bc, x) {
1391
1089
  bare.writeU16(bc, x.status);
1392
- write16(bc, x.headers);
1090
+ write15(bc, x.headers);
1393
1091
  write10(bc, x.body);
1394
1092
  bare.writeBool(bc, x.stream);
1395
1093
  }
@@ -1407,13 +1105,13 @@ function readToEnvoyWebSocketOpen(bc) {
1407
1105
  return {
1408
1106
  actorId: readId(bc),
1409
1107
  path: bare.readString(bc),
1410
- headers: read16(bc)
1108
+ headers: read15(bc)
1411
1109
  };
1412
1110
  }
1413
1111
  function writeToEnvoyWebSocketOpen(bc, x) {
1414
1112
  writeId(bc, x.actorId);
1415
1113
  bare.writeString(bc, x.path);
1416
- write16(bc, x.headers);
1114
+ write15(bc, x.headers);
1417
1115
  }
1418
1116
  function readToEnvoyWebSocketMessage(bc) {
1419
1117
  return {
@@ -1425,10 +1123,10 @@ function writeToEnvoyWebSocketMessage(bc, x) {
1425
1123
  bare.writeData(bc, x.data);
1426
1124
  bare.writeBool(bc, x.binary);
1427
1125
  }
1428
- function read17(bc) {
1126
+ function read16(bc) {
1429
1127
  return bare.readBool(bc) ? bare.readU16(bc) : null;
1430
1128
  }
1431
- function write17(bc, x) {
1129
+ function write16(bc, x) {
1432
1130
  bare.writeBool(bc, x != null);
1433
1131
  if (x != null) {
1434
1132
  bare.writeU16(bc, x);
@@ -1436,12 +1134,12 @@ function write17(bc, x) {
1436
1134
  }
1437
1135
  function readToEnvoyWebSocketClose(bc) {
1438
1136
  return {
1439
- code: read17(bc),
1137
+ code: read16(bc),
1440
1138
  reason: read9(bc)
1441
1139
  };
1442
1140
  }
1443
1141
  function writeToEnvoyWebSocketClose(bc, x) {
1444
- write17(bc, x.code);
1142
+ write16(bc, x.code);
1445
1143
  write9(bc, x.reason);
1446
1144
  }
1447
1145
  function readToRivetWebSocketOpen(bc) {
@@ -1472,13 +1170,13 @@ function writeToRivetWebSocketMessageAck(bc, x) {
1472
1170
  }
1473
1171
  function readToRivetWebSocketClose(bc) {
1474
1172
  return {
1475
- code: read17(bc),
1173
+ code: read16(bc),
1476
1174
  reason: read9(bc),
1477
1175
  hibernate: bare.readBool(bc)
1478
1176
  };
1479
1177
  }
1480
1178
  function writeToRivetWebSocketClose(bc, x) {
1481
- write17(bc, x.code);
1179
+ write16(bc, x.code);
1482
1180
  write9(bc, x.reason);
1483
1181
  bare.writeBool(bc, x.hibernate);
1484
1182
  }
@@ -1627,7 +1325,7 @@ function readToEnvoyPing(bc) {
1627
1325
  function writeToEnvoyPing(bc, x) {
1628
1326
  bare.writeI64(bc, x.ts);
1629
1327
  }
1630
- function read18(bc) {
1328
+ function read17(bc) {
1631
1329
  const len = bare.readUintSafe(bc);
1632
1330
  const result = /* @__PURE__ */ new Map();
1633
1331
  for (let i = 0; i < len; i++) {
@@ -1641,26 +1339,26 @@ function read18(bc) {
1641
1339
  }
1642
1340
  return result;
1643
1341
  }
1644
- function write18(bc, x) {
1342
+ function write17(bc, x) {
1645
1343
  bare.writeUintSafe(bc, x.size);
1646
1344
  for (const kv of x) {
1647
1345
  bare.writeString(bc, kv[0]);
1648
1346
  writeActorName(bc, kv[1]);
1649
1347
  }
1650
1348
  }
1651
- function read19(bc) {
1652
- return bare.readBool(bc) ? read18(bc) : null;
1349
+ function read18(bc) {
1350
+ return bare.readBool(bc) ? read17(bc) : null;
1653
1351
  }
1654
- function write19(bc, x) {
1352
+ function write18(bc, x) {
1655
1353
  bare.writeBool(bc, x != null);
1656
1354
  if (x != null) {
1657
- write18(bc, x);
1355
+ write17(bc, x);
1658
1356
  }
1659
1357
  }
1660
- function read20(bc) {
1358
+ function read19(bc) {
1661
1359
  return bare.readBool(bc) ? readJson(bc) : null;
1662
1360
  }
1663
- function write20(bc, x) {
1361
+ function write19(bc, x) {
1664
1362
  bare.writeBool(bc, x != null);
1665
1363
  if (x != null) {
1666
1364
  writeJson(bc, x);
@@ -1668,13 +1366,13 @@ function write20(bc, x) {
1668
1366
  }
1669
1367
  function readToRivetMetadata(bc) {
1670
1368
  return {
1671
- prepopulateActorNames: read19(bc),
1672
- metadata: read20(bc)
1369
+ prepopulateActorNames: read18(bc),
1370
+ metadata: read19(bc)
1673
1371
  };
1674
1372
  }
1675
1373
  function writeToRivetMetadata(bc, x) {
1676
- write19(bc, x.prepopulateActorNames);
1677
- write20(bc, x.metadata);
1374
+ write18(bc, x.prepopulateActorNames);
1375
+ write19(bc, x.metadata);
1678
1376
  }
1679
1377
  function readToRivetEvents(bc) {
1680
1378
  const len = bare.readUintSafe(bc);
@@ -1693,7 +1391,7 @@ function writeToRivetEvents(bc, x) {
1693
1391
  writeEventWrapper(bc, x[i]);
1694
1392
  }
1695
1393
  }
1696
- function read21(bc) {
1394
+ function read20(bc) {
1697
1395
  const len = bare.readUintSafe(bc);
1698
1396
  if (len === 0) {
1699
1397
  return [];
@@ -1704,7 +1402,7 @@ function read21(bc) {
1704
1402
  }
1705
1403
  return result;
1706
1404
  }
1707
- function write21(bc, x) {
1405
+ function write20(bc, x) {
1708
1406
  bare.writeUintSafe(bc, x.length);
1709
1407
  for (let i = 0; i < x.length; i++) {
1710
1408
  writeActorCheckpoint(bc, x[i]);
@@ -1712,11 +1410,11 @@ function write21(bc, x) {
1712
1410
  }
1713
1411
  function readToRivetAckCommands(bc) {
1714
1412
  return {
1715
- lastCommandCheckpoints: read21(bc)
1413
+ lastCommandCheckpoints: read20(bc)
1716
1414
  };
1717
1415
  }
1718
1416
  function writeToRivetAckCommands(bc, x) {
1719
- write21(bc, x.lastCommandCheckpoints);
1417
+ write20(bc, x.lastCommandCheckpoints);
1720
1418
  }
1721
1419
  function readToRivetPong(bc) {
1722
1420
  return {
@@ -1758,36 +1456,6 @@ function writeToRivetSqliteCommitRequest(bc, x) {
1758
1456
  bare.writeU32(bc, x.requestId);
1759
1457
  writeSqliteCommitRequest(bc, x.data);
1760
1458
  }
1761
- function readToRivetSqliteCommitStageBeginRequest(bc) {
1762
- return {
1763
- requestId: bare.readU32(bc),
1764
- data: readSqliteCommitStageBeginRequest(bc)
1765
- };
1766
- }
1767
- function writeToRivetSqliteCommitStageBeginRequest(bc, x) {
1768
- bare.writeU32(bc, x.requestId);
1769
- writeSqliteCommitStageBeginRequest(bc, x.data);
1770
- }
1771
- function readToRivetSqliteCommitStageRequest(bc) {
1772
- return {
1773
- requestId: bare.readU32(bc),
1774
- data: readSqliteCommitStageRequest(bc)
1775
- };
1776
- }
1777
- function writeToRivetSqliteCommitStageRequest(bc, x) {
1778
- 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);
1790
- }
1791
1459
  function readToRivet(bc) {
1792
1460
  const offset = bc.offset;
1793
1461
  const tag = bare.readU8(bc);
@@ -1810,12 +1478,6 @@ function readToRivet(bc) {
1810
1478
  return { tag: "ToRivetSqliteGetPagesRequest", val: readToRivetSqliteGetPagesRequest(bc) };
1811
1479
  case 8:
1812
1480
  return { tag: "ToRivetSqliteCommitRequest", val: readToRivetSqliteCommitRequest(bc) };
1813
- case 9:
1814
- return { tag: "ToRivetSqliteCommitStageBeginRequest", val: readToRivetSqliteCommitStageBeginRequest(bc) };
1815
- case 10:
1816
- return { tag: "ToRivetSqliteCommitStageRequest", val: readToRivetSqliteCommitStageRequest(bc) };
1817
- case 11:
1818
- return { tag: "ToRivetSqliteCommitFinalizeRequest", val: readToRivetSqliteCommitFinalizeRequest(bc) };
1819
1481
  default: {
1820
1482
  bc.offset = offset;
1821
1483
  throw new bare.BareError(offset, "invalid tag");
@@ -1868,25 +1530,10 @@ function writeToRivet(bc, x) {
1868
1530
  writeToRivetSqliteCommitRequest(bc, x.val);
1869
1531
  break;
1870
1532
  }
1871
- case "ToRivetSqliteCommitStageBeginRequest": {
1872
- bare.writeU8(bc, 9);
1873
- writeToRivetSqliteCommitStageBeginRequest(bc, x.val);
1874
- break;
1875
- }
1876
- case "ToRivetSqliteCommitStageRequest": {
1877
- 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);
1884
- break;
1885
- }
1886
1533
  }
1887
1534
  }
1888
1535
  function encodeToRivet(x, config) {
1889
- const fullConfig = config != null ? bare.Config(config) : DEFAULT_CONFIG;
1536
+ const fullConfig = config != null ? bare.Config(config) : bare.DEFAULT_CONFIG;
1890
1537
  const bc = new bare.ByteCursor(
1891
1538
  new Uint8Array(fullConfig.initialBufferLength),
1892
1539
  fullConfig
@@ -1895,7 +1542,7 @@ function encodeToRivet(x, config) {
1895
1542
  return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset);
1896
1543
  }
1897
1544
  function decodeToRivet(bytes) {
1898
- const bc = new bare.ByteCursor(bytes, DEFAULT_CONFIG);
1545
+ const bc = new bare.ByteCursor(bytes, bare.DEFAULT_CONFIG);
1899
1546
  const result = readToRivet(bc);
1900
1547
  if (bc.offset < bc.view.byteLength) {
1901
1548
  throw new bare.BareError(bc.offset, "remaining bytes");
@@ -1941,11 +1588,11 @@ function writeToEnvoyCommands(bc, x) {
1941
1588
  }
1942
1589
  function readToEnvoyAckEvents(bc) {
1943
1590
  return {
1944
- lastEventCheckpoints: read21(bc)
1591
+ lastEventCheckpoints: read20(bc)
1945
1592
  };
1946
1593
  }
1947
1594
  function writeToEnvoyAckEvents(bc, x) {
1948
- write21(bc, x.lastEventCheckpoints);
1595
+ write20(bc, x.lastEventCheckpoints);
1949
1596
  }
1950
1597
  function readToEnvoyKvResponse(bc) {
1951
1598
  return {
@@ -1977,36 +1624,6 @@ function writeToEnvoySqliteCommitResponse(bc, x) {
1977
1624
  bare.writeU32(bc, x.requestId);
1978
1625
  writeSqliteCommitResponse(bc, x.data);
1979
1626
  }
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) {
1991
- return {
1992
- requestId: bare.readU32(bc),
1993
- data: readSqliteCommitStageResponse(bc)
1994
- };
1995
- }
1996
- function writeToEnvoySqliteCommitStageResponse(bc, x) {
1997
- 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);
2009
- }
2010
1627
  function readToEnvoy(bc) {
2011
1628
  const offset = bc.offset;
2012
1629
  const tag = bare.readU8(bc);
@@ -2027,12 +1644,6 @@ function readToEnvoy(bc) {
2027
1644
  return { tag: "ToEnvoySqliteGetPagesResponse", val: readToEnvoySqliteGetPagesResponse(bc) };
2028
1645
  case 7:
2029
1646
  return { tag: "ToEnvoySqliteCommitResponse", val: readToEnvoySqliteCommitResponse(bc) };
2030
- case 8:
2031
- return { tag: "ToEnvoySqliteCommitStageBeginResponse", val: readToEnvoySqliteCommitStageBeginResponse(bc) };
2032
- case 9:
2033
- return { tag: "ToEnvoySqliteCommitStageResponse", val: readToEnvoySqliteCommitStageResponse(bc) };
2034
- case 10:
2035
- return { tag: "ToEnvoySqliteCommitFinalizeResponse", val: readToEnvoySqliteCommitFinalizeResponse(bc) };
2036
1647
  default: {
2037
1648
  bc.offset = offset;
2038
1649
  throw new bare.BareError(offset, "invalid tag");
@@ -2081,25 +1692,10 @@ function writeToEnvoy(bc, x) {
2081
1692
  writeToEnvoySqliteCommitResponse(bc, x.val);
2082
1693
  break;
2083
1694
  }
2084
- case "ToEnvoySqliteCommitStageBeginResponse": {
2085
- bare.writeU8(bc, 8);
2086
- writeToEnvoySqliteCommitStageBeginResponse(bc, x.val);
2087
- break;
2088
- }
2089
- case "ToEnvoySqliteCommitStageResponse": {
2090
- 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);
2097
- break;
2098
- }
2099
1695
  }
2100
1696
  }
2101
1697
  function encodeToEnvoy(x, config) {
2102
- const fullConfig = config != null ? bare.Config(config) : DEFAULT_CONFIG;
1698
+ const fullConfig = config != null ? bare.Config(config) : bare.DEFAULT_CONFIG;
2103
1699
  const bc = new bare.ByteCursor(
2104
1700
  new Uint8Array(fullConfig.initialBufferLength),
2105
1701
  fullConfig
@@ -2108,7 +1704,7 @@ function encodeToEnvoy(x, config) {
2108
1704
  return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset);
2109
1705
  }
2110
1706
  function decodeToEnvoy(bytes) {
2111
- const bc = new bare.ByteCursor(bytes, DEFAULT_CONFIG);
1707
+ const bc = new bare.ByteCursor(bytes, bare.DEFAULT_CONFIG);
2112
1708
  const result = readToEnvoy(bc);
2113
1709
  if (bc.offset < bc.view.byteLength) {
2114
1710
  throw new bare.BareError(bc.offset, "remaining bytes");
@@ -2176,7 +1772,7 @@ function writeToEnvoyConn(bc, x) {
2176
1772
  }
2177
1773
  }
2178
1774
  function encodeToEnvoyConn(x, config) {
2179
- const fullConfig = config != null ? bare.Config(config) : DEFAULT_CONFIG;
1775
+ const fullConfig = config != null ? bare.Config(config) : bare.DEFAULT_CONFIG;
2180
1776
  const bc = new bare.ByteCursor(
2181
1777
  new Uint8Array(fullConfig.initialBufferLength),
2182
1778
  fullConfig
@@ -2185,7 +1781,7 @@ function encodeToEnvoyConn(x, config) {
2185
1781
  return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset);
2186
1782
  }
2187
1783
  function decodeToEnvoyConn(bytes) {
2188
- const bc = new bare.ByteCursor(bytes, DEFAULT_CONFIG);
1784
+ const bc = new bare.ByteCursor(bytes, bare.DEFAULT_CONFIG);
2189
1785
  const result = readToEnvoyConn(bc);
2190
1786
  if (bc.offset < bc.view.byteLength) {
2191
1787
  throw new bare.BareError(bc.offset, "remaining bytes");
@@ -2231,7 +1827,7 @@ function writeToGateway(bc, x) {
2231
1827
  }
2232
1828
  }
2233
1829
  function encodeToGateway(x, config) {
2234
- const fullConfig = config != null ? bare.Config(config) : DEFAULT_CONFIG;
1830
+ const fullConfig = config != null ? bare.Config(config) : bare.DEFAULT_CONFIG;
2235
1831
  const bc = new bare.ByteCursor(
2236
1832
  new Uint8Array(fullConfig.initialBufferLength),
2237
1833
  fullConfig
@@ -2240,7 +1836,7 @@ function encodeToGateway(x, config) {
2240
1836
  return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset);
2241
1837
  }
2242
1838
  function decodeToGateway(bytes) {
2243
- const bc = new bare.ByteCursor(bytes, DEFAULT_CONFIG);
1839
+ const bc = new bare.ByteCursor(bytes, bare.DEFAULT_CONFIG);
2244
1840
  const result = readToGateway(bc);
2245
1841
  if (bc.offset < bc.view.byteLength) {
2246
1842
  throw new bare.BareError(bc.offset, "remaining bytes");
@@ -2283,7 +1879,7 @@ function writeToOutbound(bc, x) {
2283
1879
  }
2284
1880
  }
2285
1881
  function encodeToOutbound(x, config) {
2286
- const fullConfig = config != null ? bare.Config(config) : DEFAULT_CONFIG;
1882
+ const fullConfig = config != null ? bare.Config(config) : bare.DEFAULT_CONFIG;
2287
1883
  const bc = new bare.ByteCursor(
2288
1884
  new Uint8Array(fullConfig.initialBufferLength),
2289
1885
  fullConfig
@@ -2292,7 +1888,7 @@ function encodeToOutbound(x, config) {
2292
1888
  return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset);
2293
1889
  }
2294
1890
  function decodeToOutbound(bytes) {
2295
- const bc = new bare.ByteCursor(bytes, DEFAULT_CONFIG);
1891
+ const bc = new bare.ByteCursor(bytes, bare.DEFAULT_CONFIG);
2296
1892
  const result = readToOutbound(bc);
2297
1893
  if (bc.offset < bc.view.byteLength) {
2298
1894
  throw new bare.BareError(bc.offset, "remaining bytes");
@@ -2302,7 +1898,7 @@ function decodeToOutbound(bytes) {
2302
1898
  function assert(condition, message) {
2303
1899
  if (!condition) throw new Error(message ?? "Assertion failed");
2304
1900
  }
2305
- var VERSION = 2;
1901
+ var VERSION = 3;
2306
1902
  export {
2307
1903
  StopActorReason,
2308
1904
  StopCode,
@@ -2361,34 +1957,16 @@ export {
2361
1957
  readPreloadedKvEntry,
2362
1958
  readProtocolMetadata,
2363
1959
  readRequestId,
2364
- readSqliteCommitFinalizeOk,
2365
- readSqliteCommitFinalizeRequest,
2366
- readSqliteCommitFinalizeResponse,
2367
- readSqliteCommitOk,
2368
1960
  readSqliteCommitRequest,
2369
1961
  readSqliteCommitResponse,
2370
- readSqliteCommitStageBeginOk,
2371
- readSqliteCommitStageBeginRequest,
2372
- readSqliteCommitStageBeginResponse,
2373
- readSqliteCommitStageOk,
2374
- readSqliteCommitStageRequest,
2375
- readSqliteCommitStageResponse,
2376
- readSqliteCommitTooLarge,
2377
1962
  readSqliteDirtyPage,
2378
1963
  readSqliteErrorResponse,
2379
- readSqliteFenceMismatch,
2380
1964
  readSqliteFetchedPage,
2381
- readSqliteGeneration,
2382
1965
  readSqliteGetPagesOk,
2383
1966
  readSqliteGetPagesRequest,
2384
1967
  readSqliteGetPagesResponse,
2385
- readSqliteMeta,
2386
1968
  readSqlitePageBytes,
2387
1969
  readSqlitePgno,
2388
- readSqliteStageId,
2389
- readSqliteStageNotFound,
2390
- readSqliteStartupData,
2391
- readSqliteTxid,
2392
1970
  readStopActorReason,
2393
1971
  readStopCode,
2394
1972
  readToEnvoy,
@@ -2401,10 +1979,7 @@ export {
2401
1979
  readToEnvoyPing,
2402
1980
  readToEnvoyRequestChunk,
2403
1981
  readToEnvoyRequestStart,
2404
- readToEnvoySqliteCommitFinalizeResponse,
2405
1982
  readToEnvoySqliteCommitResponse,
2406
- readToEnvoySqliteCommitStageBeginResponse,
2407
- readToEnvoySqliteCommitStageResponse,
2408
1983
  readToEnvoySqliteGetPagesResponse,
2409
1984
  readToEnvoyTunnelMessage,
2410
1985
  readToEnvoyTunnelMessageKind,
@@ -2423,10 +1998,7 @@ export {
2423
1998
  readToRivetPong,
2424
1999
  readToRivetResponseChunk,
2425
2000
  readToRivetResponseStart,
2426
- readToRivetSqliteCommitFinalizeRequest,
2427
2001
  readToRivetSqliteCommitRequest,
2428
- readToRivetSqliteCommitStageBeginRequest,
2429
- readToRivetSqliteCommitStageRequest,
2430
2002
  readToRivetSqliteGetPagesRequest,
2431
2003
  readToRivetTunnelMessage,
2432
2004
  readToRivetTunnelMessageKind,
@@ -2476,34 +2048,16 @@ export {
2476
2048
  writePreloadedKvEntry,
2477
2049
  writeProtocolMetadata,
2478
2050
  writeRequestId,
2479
- writeSqliteCommitFinalizeOk,
2480
- writeSqliteCommitFinalizeRequest,
2481
- writeSqliteCommitFinalizeResponse,
2482
- writeSqliteCommitOk,
2483
2051
  writeSqliteCommitRequest,
2484
2052
  writeSqliteCommitResponse,
2485
- writeSqliteCommitStageBeginOk,
2486
- writeSqliteCommitStageBeginRequest,
2487
- writeSqliteCommitStageBeginResponse,
2488
- writeSqliteCommitStageOk,
2489
- writeSqliteCommitStageRequest,
2490
- writeSqliteCommitStageResponse,
2491
- writeSqliteCommitTooLarge,
2492
2053
  writeSqliteDirtyPage,
2493
2054
  writeSqliteErrorResponse,
2494
- writeSqliteFenceMismatch,
2495
2055
  writeSqliteFetchedPage,
2496
- writeSqliteGeneration,
2497
2056
  writeSqliteGetPagesOk,
2498
2057
  writeSqliteGetPagesRequest,
2499
2058
  writeSqliteGetPagesResponse,
2500
- writeSqliteMeta,
2501
2059
  writeSqlitePageBytes,
2502
2060
  writeSqlitePgno,
2503
- writeSqliteStageId,
2504
- writeSqliteStageNotFound,
2505
- writeSqliteStartupData,
2506
- writeSqliteTxid,
2507
2061
  writeStopActorReason,
2508
2062
  writeStopCode,
2509
2063
  writeToEnvoy,
@@ -2516,10 +2070,7 @@ export {
2516
2070
  writeToEnvoyPing,
2517
2071
  writeToEnvoyRequestChunk,
2518
2072
  writeToEnvoyRequestStart,
2519
- writeToEnvoySqliteCommitFinalizeResponse,
2520
2073
  writeToEnvoySqliteCommitResponse,
2521
- writeToEnvoySqliteCommitStageBeginResponse,
2522
- writeToEnvoySqliteCommitStageResponse,
2523
2074
  writeToEnvoySqliteGetPagesResponse,
2524
2075
  writeToEnvoyTunnelMessage,
2525
2076
  writeToEnvoyTunnelMessageKind,
@@ -2538,10 +2089,7 @@ export {
2538
2089
  writeToRivetPong,
2539
2090
  writeToRivetResponseChunk,
2540
2091
  writeToRivetResponseStart,
2541
- writeToRivetSqliteCommitFinalizeRequest,
2542
2092
  writeToRivetSqliteCommitRequest,
2543
- writeToRivetSqliteCommitStageBeginRequest,
2544
- writeToRivetSqliteCommitStageRequest,
2545
2093
  writeToRivetSqliteGetPagesRequest,
2546
2094
  writeToRivetTunnelMessage,
2547
2095
  writeToRivetTunnelMessageKind,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/engine-envoy-protocol",
3
- "version": "0.0.0-pr.4854.b12798b",
3
+ "version": "0.0.0-pr.4856.c68d9cb",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {