@rivetkit/engine-envoy-protocol 0.0.0-pr.4671.0ad3a43 → 0.0.0-pr.4672.159c9b3

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
@@ -1,6 +1,7 @@
1
1
  import * as bare from '@rivetkit/bare-ts';
2
2
 
3
3
  type i64 = bigint;
4
+ type u8 = number;
4
5
  type u16 = number;
5
6
  type u32 = number;
6
7
  type u64 = bigint;
@@ -94,6 +95,35 @@ type KvDeleteRangeRequest = {
94
95
  };
95
96
  declare function readKvDeleteRangeRequest(bc: bare.ByteCursor): KvDeleteRangeRequest;
96
97
  declare function writeKvDeleteRangeRequest(bc: bare.ByteCursor, x: KvDeleteRangeRequest): void;
98
+ type SqliteFastPathFence = {
99
+ readonly expectedFence: u64 | null;
100
+ readonly requestFence: u64;
101
+ };
102
+ declare function readSqliteFastPathFence(bc: bare.ByteCursor): SqliteFastPathFence;
103
+ declare function writeSqliteFastPathFence(bc: bare.ByteCursor, x: SqliteFastPathFence): void;
104
+ type SqlitePageUpdate = {
105
+ readonly chunkIndex: u32;
106
+ readonly data: KvValue;
107
+ };
108
+ declare function readSqlitePageUpdate(bc: bare.ByteCursor): SqlitePageUpdate;
109
+ declare function writeSqlitePageUpdate(bc: bare.ByteCursor, x: SqlitePageUpdate): void;
110
+ type KvSqliteWriteBatchRequest = {
111
+ readonly fileTag: u8;
112
+ readonly metaValue: KvValue;
113
+ readonly pageUpdates: readonly SqlitePageUpdate[];
114
+ readonly fence: SqliteFastPathFence;
115
+ };
116
+ declare function readKvSqliteWriteBatchRequest(bc: bare.ByteCursor): KvSqliteWriteBatchRequest;
117
+ declare function writeKvSqliteWriteBatchRequest(bc: bare.ByteCursor, x: KvSqliteWriteBatchRequest): void;
118
+ type KvSqliteTruncateRequest = {
119
+ readonly fileTag: u8;
120
+ readonly metaValue: KvValue;
121
+ readonly deleteChunksFrom: u32;
122
+ readonly tailChunk: SqlitePageUpdate | null;
123
+ readonly fence: SqliteFastPathFence;
124
+ };
125
+ declare function readKvSqliteTruncateRequest(bc: bare.ByteCursor): KvSqliteTruncateRequest;
126
+ declare function writeKvSqliteTruncateRequest(bc: bare.ByteCursor, x: KvSqliteTruncateRequest): void;
97
127
  type KvDropRequest = null;
98
128
  /**
99
129
  * Response types
@@ -138,6 +168,12 @@ type KvRequestData = {
138
168
  } | {
139
169
  readonly tag: "KvDeleteRangeRequest";
140
170
  readonly val: KvDeleteRangeRequest;
171
+ } | {
172
+ readonly tag: "KvSqliteWriteBatchRequest";
173
+ readonly val: KvSqliteWriteBatchRequest;
174
+ } | {
175
+ readonly tag: "KvSqliteTruncateRequest";
176
+ readonly val: KvSqliteTruncateRequest;
141
177
  } | {
142
178
  readonly tag: "KvDropRequest";
143
179
  readonly val: KvDropRequest;
@@ -572,10 +608,18 @@ declare function decodeToRivet(bytes: Uint8Array): ToRivet;
572
608
  /**
573
609
  * MARK: To Envoy
574
610
  */
611
+ type SqliteFastPathCapability = {
612
+ readonly protocolVersion: u16;
613
+ readonly supportsWriteBatch: boolean;
614
+ readonly supportsTruncate: boolean;
615
+ };
616
+ declare function readSqliteFastPathCapability(bc: bare.ByteCursor): SqliteFastPathCapability;
617
+ declare function writeSqliteFastPathCapability(bc: bare.ByteCursor, x: SqliteFastPathCapability): void;
575
618
  type ProtocolMetadata = {
576
619
  readonly envoyLostThreshold: i64;
577
620
  readonly actorStopThreshold: i64;
578
621
  readonly maxResponsePayloadSize: u64;
622
+ readonly sqliteFastPath: SqliteFastPathCapability | null;
579
623
  };
580
624
  declare function readProtocolMetadata(bc: bare.ByteCursor): ProtocolMetadata;
581
625
  declare function writeProtocolMetadata(bc: bare.ByteCursor, x: ProtocolMetadata): void;
@@ -691,6 +735,6 @@ declare function readToOutbound(bc: bare.ByteCursor): ToOutbound;
691
735
  declare function writeToOutbound(bc: bare.ByteCursor, x: ToOutbound): void;
692
736
  declare function encodeToOutbound(x: ToOutbound, config?: Partial<bare.Config>): Uint8Array;
693
737
  declare function decodeToOutbound(bytes: Uint8Array): ToOutbound;
694
- declare const VERSION = 1;
738
+ declare const VERSION = 2;
695
739
 
696
- 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, 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 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 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, readStopActorReason, readStopCode, readToEnvoy, readToEnvoyAckEvents, readToEnvoyCommands, readToEnvoyConn, readToEnvoyConnPing, readToEnvoyInit, readToEnvoyKvResponse, readToEnvoyPing, readToEnvoyRequestChunk, readToEnvoyRequestStart, readToEnvoyTunnelMessage, readToEnvoyTunnelMessageKind, readToEnvoyWebSocketClose, readToEnvoyWebSocketMessage, readToEnvoyWebSocketOpen, readToGateway, readToGatewayPong, readToOutbound, readToOutboundActorStart, readToRivet, readToRivetAckCommands, readToRivetEvents, readToRivetKvRequest, readToRivetMetadata, readToRivetPong, readToRivetResponseChunk, readToRivetResponseStart, 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, writeStopActorReason, writeStopCode, writeToEnvoy, writeToEnvoyAckEvents, writeToEnvoyCommands, writeToEnvoyConn, writeToEnvoyConnPing, writeToEnvoyInit, writeToEnvoyKvResponse, writeToEnvoyPing, writeToEnvoyRequestChunk, writeToEnvoyRequestStart, writeToEnvoyTunnelMessage, writeToEnvoyTunnelMessageKind, writeToEnvoyWebSocketClose, writeToEnvoyWebSocketMessage, writeToEnvoyWebSocketOpen, writeToGateway, writeToGatewayPong, writeToOutbound, writeToOutboundActorStart, writeToRivet, writeToRivetAckCommands, writeToRivetEvents, writeToRivetKvRequest, writeToRivetMetadata, writeToRivetPong, writeToRivetResponseChunk, writeToRivetResponseStart, writeToRivetTunnelMessage, writeToRivetTunnelMessageKind, writeToRivetWebSocketClose, writeToRivetWebSocketMessage, writeToRivetWebSocketMessageAck, writeToRivetWebSocketOpen };
740
+ 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 KvSqliteTruncateRequest, type KvSqliteWriteBatchRequest, type KvValue, type MessageId, type MessageIndex, type PreloadedKv, type PreloadedKvEntry, type ProtocolMetadata, type RequestId, type SqliteFastPathCapability, type SqliteFastPathFence, type SqlitePageUpdate, 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 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 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, readKvSqliteTruncateRequest, readKvSqliteWriteBatchRequest, readKvValue, readMessageId, readMessageIndex, readPreloadedKv, readPreloadedKvEntry, readProtocolMetadata, readRequestId, readSqliteFastPathCapability, readSqliteFastPathFence, readSqlitePageUpdate, readStopActorReason, readStopCode, readToEnvoy, readToEnvoyAckEvents, readToEnvoyCommands, readToEnvoyConn, readToEnvoyConnPing, readToEnvoyInit, readToEnvoyKvResponse, readToEnvoyPing, readToEnvoyRequestChunk, readToEnvoyRequestStart, readToEnvoyTunnelMessage, readToEnvoyTunnelMessageKind, readToEnvoyWebSocketClose, readToEnvoyWebSocketMessage, readToEnvoyWebSocketOpen, readToGateway, readToGatewayPong, readToOutbound, readToOutboundActorStart, readToRivet, readToRivetAckCommands, readToRivetEvents, readToRivetKvRequest, readToRivetMetadata, readToRivetPong, readToRivetResponseChunk, readToRivetResponseStart, readToRivetTunnelMessage, readToRivetTunnelMessageKind, readToRivetWebSocketClose, readToRivetWebSocketMessage, readToRivetWebSocketMessageAck, readToRivetWebSocketOpen, type u16, type u32, type u64, type u8, 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, writeKvSqliteTruncateRequest, writeKvSqliteWriteBatchRequest, writeKvValue, writeMessageId, writeMessageIndex, writePreloadedKv, writePreloadedKvEntry, writeProtocolMetadata, writeRequestId, writeSqliteFastPathCapability, writeSqliteFastPathFence, writeSqlitePageUpdate, writeStopActorReason, writeStopCode, writeToEnvoy, writeToEnvoyAckEvents, writeToEnvoyCommands, writeToEnvoyConn, writeToEnvoyConnPing, writeToEnvoyInit, writeToEnvoyKvResponse, writeToEnvoyPing, writeToEnvoyRequestChunk, writeToEnvoyRequestStart, writeToEnvoyTunnelMessage, writeToEnvoyTunnelMessageKind, writeToEnvoyWebSocketClose, writeToEnvoyWebSocketMessage, writeToEnvoyWebSocketOpen, writeToGateway, writeToGatewayPong, writeToOutbound, writeToOutboundActorStart, writeToRivet, writeToRivetAckCommands, writeToRivetEvents, writeToRivetKvRequest, writeToRivetMetadata, writeToRivetPong, writeToRivetResponseChunk, writeToRivetResponseStart, writeToRivetTunnelMessage, writeToRivetTunnelMessageKind, writeToRivetWebSocketClose, writeToRivetWebSocketMessage, writeToRivetWebSocketMessageAck, writeToRivetWebSocketOpen };
package/dist/index.js CHANGED
@@ -209,6 +209,82 @@ function writeKvDeleteRangeRequest(bc, x) {
209
209
  writeKvKey(bc, x.start);
210
210
  writeKvKey(bc, x.end);
211
211
  }
212
+ function readSqliteFastPathFence(bc) {
213
+ return {
214
+ expectedFence: read2(bc),
215
+ requestFence: bare.readU64(bc)
216
+ };
217
+ }
218
+ function writeSqliteFastPathFence(bc, x) {
219
+ write2(bc, x.expectedFence);
220
+ bare.writeU64(bc, x.requestFence);
221
+ }
222
+ function readSqlitePageUpdate(bc) {
223
+ return {
224
+ chunkIndex: bare.readU32(bc),
225
+ data: readKvValue(bc)
226
+ };
227
+ }
228
+ function writeSqlitePageUpdate(bc, x) {
229
+ bare.writeU32(bc, x.chunkIndex);
230
+ writeKvValue(bc, x.data);
231
+ }
232
+ function read4(bc) {
233
+ const len = bare.readUintSafe(bc);
234
+ if (len === 0) {
235
+ return [];
236
+ }
237
+ const result = [readSqlitePageUpdate(bc)];
238
+ for (let i = 1; i < len; i++) {
239
+ result[i] = readSqlitePageUpdate(bc);
240
+ }
241
+ return result;
242
+ }
243
+ function write4(bc, x) {
244
+ bare.writeUintSafe(bc, x.length);
245
+ for (let i = 0; i < x.length; i++) {
246
+ writeSqlitePageUpdate(bc, x[i]);
247
+ }
248
+ }
249
+ function readKvSqliteWriteBatchRequest(bc) {
250
+ return {
251
+ fileTag: bare.readU8(bc),
252
+ metaValue: readKvValue(bc),
253
+ pageUpdates: read4(bc),
254
+ fence: readSqliteFastPathFence(bc)
255
+ };
256
+ }
257
+ function writeKvSqliteWriteBatchRequest(bc, x) {
258
+ bare.writeU8(bc, x.fileTag);
259
+ writeKvValue(bc, x.metaValue);
260
+ write4(bc, x.pageUpdates);
261
+ writeSqliteFastPathFence(bc, x.fence);
262
+ }
263
+ function read5(bc) {
264
+ return bare.readBool(bc) ? readSqlitePageUpdate(bc) : null;
265
+ }
266
+ function write5(bc, x) {
267
+ bare.writeBool(bc, x != null);
268
+ if (x != null) {
269
+ writeSqlitePageUpdate(bc, x);
270
+ }
271
+ }
272
+ function readKvSqliteTruncateRequest(bc) {
273
+ return {
274
+ fileTag: bare.readU8(bc),
275
+ metaValue: readKvValue(bc),
276
+ deleteChunksFrom: bare.readU32(bc),
277
+ tailChunk: read5(bc),
278
+ fence: readSqliteFastPathFence(bc)
279
+ };
280
+ }
281
+ function writeKvSqliteTruncateRequest(bc, x) {
282
+ bare.writeU8(bc, x.fileTag);
283
+ writeKvValue(bc, x.metaValue);
284
+ bare.writeU32(bc, x.deleteChunksFrom);
285
+ write5(bc, x.tailChunk);
286
+ writeSqliteFastPathFence(bc, x.fence);
287
+ }
212
288
  function readKvErrorResponse(bc) {
213
289
  return {
214
290
  message: bare.readString(bc)
@@ -217,7 +293,7 @@ function readKvErrorResponse(bc) {
217
293
  function writeKvErrorResponse(bc, x) {
218
294
  bare.writeString(bc, x.message);
219
295
  }
220
- function read4(bc) {
296
+ function read6(bc) {
221
297
  const len = bare.readUintSafe(bc);
222
298
  if (len === 0) {
223
299
  return [];
@@ -228,7 +304,7 @@ function read4(bc) {
228
304
  }
229
305
  return result;
230
306
  }
231
- function write4(bc, x) {
307
+ function write6(bc, x) {
232
308
  bare.writeUintSafe(bc, x.length);
233
309
  for (let i = 0; i < x.length; i++) {
234
310
  writeKvMetadata(bc, x[i]);
@@ -238,25 +314,25 @@ function readKvGetResponse(bc) {
238
314
  return {
239
315
  keys: read0(bc),
240
316
  values: read3(bc),
241
- metadata: read4(bc)
317
+ metadata: read6(bc)
242
318
  };
243
319
  }
244
320
  function writeKvGetResponse(bc, x) {
245
321
  write0(bc, x.keys);
246
322
  write3(bc, x.values);
247
- write4(bc, x.metadata);
323
+ write6(bc, x.metadata);
248
324
  }
249
325
  function readKvListResponse(bc) {
250
326
  return {
251
327
  keys: read0(bc),
252
328
  values: read3(bc),
253
- metadata: read4(bc)
329
+ metadata: read6(bc)
254
330
  };
255
331
  }
256
332
  function writeKvListResponse(bc, x) {
257
333
  write0(bc, x.keys);
258
334
  write3(bc, x.values);
259
- write4(bc, x.metadata);
335
+ write6(bc, x.metadata);
260
336
  }
261
337
  function readKvRequestData(bc) {
262
338
  const offset = bc.offset;
@@ -273,6 +349,10 @@ function readKvRequestData(bc) {
273
349
  case 4:
274
350
  return { tag: "KvDeleteRangeRequest", val: readKvDeleteRangeRequest(bc) };
275
351
  case 5:
352
+ return { tag: "KvSqliteWriteBatchRequest", val: readKvSqliteWriteBatchRequest(bc) };
353
+ case 6:
354
+ return { tag: "KvSqliteTruncateRequest", val: readKvSqliteTruncateRequest(bc) };
355
+ case 7:
276
356
  return { tag: "KvDropRequest", val: null };
277
357
  default: {
278
358
  bc.offset = offset;
@@ -307,8 +387,18 @@ function writeKvRequestData(bc, x) {
307
387
  writeKvDeleteRangeRequest(bc, x.val);
308
388
  break;
309
389
  }
310
- case "KvDropRequest": {
390
+ case "KvSqliteWriteBatchRequest": {
311
391
  bare.writeU8(bc, 5);
392
+ writeKvSqliteWriteBatchRequest(bc, x.val);
393
+ break;
394
+ }
395
+ case "KvSqliteTruncateRequest": {
396
+ bare.writeU8(bc, 6);
397
+ writeKvSqliteTruncateRequest(bc, x.val);
398
+ break;
399
+ }
400
+ case "KvDropRequest": {
401
+ bare.writeU8(bc, 7);
312
402
  break;
313
403
  }
314
404
  }
@@ -405,19 +495,19 @@ function readActorName(bc) {
405
495
  function writeActorName(bc, x) {
406
496
  writeJson(bc, x.metadata);
407
497
  }
408
- function read5(bc) {
498
+ function read7(bc) {
409
499
  return bare.readBool(bc) ? bare.readString(bc) : null;
410
500
  }
411
- function write5(bc, x) {
501
+ function write7(bc, x) {
412
502
  bare.writeBool(bc, x != null);
413
503
  if (x != null) {
414
504
  bare.writeString(bc, x);
415
505
  }
416
506
  }
417
- function read6(bc) {
507
+ function read8(bc) {
418
508
  return bare.readBool(bc) ? bare.readData(bc) : null;
419
509
  }
420
- function write6(bc, x) {
510
+ function write8(bc, x) {
421
511
  bare.writeBool(bc, x != null);
422
512
  if (x != null) {
423
513
  bare.writeData(bc, x);
@@ -426,16 +516,16 @@ function write6(bc, x) {
426
516
  function readActorConfig(bc) {
427
517
  return {
428
518
  name: bare.readString(bc),
429
- key: read5(bc),
519
+ key: read7(bc),
430
520
  createTs: bare.readI64(bc),
431
- input: read6(bc)
521
+ input: read8(bc)
432
522
  };
433
523
  }
434
524
  function writeActorConfig(bc, x) {
435
525
  bare.writeString(bc, x.name);
436
- write5(bc, x.key);
526
+ write7(bc, x.key);
437
527
  bare.writeI64(bc, x.createTs);
438
- write6(bc, x.input);
528
+ write8(bc, x.input);
439
529
  }
440
530
  function readActorCheckpoint(bc) {
441
531
  return {
@@ -478,12 +568,12 @@ function writeActorIntent(bc, x) {
478
568
  function readActorStateStopped(bc) {
479
569
  return {
480
570
  code: readStopCode(bc),
481
- message: read5(bc)
571
+ message: read7(bc)
482
572
  };
483
573
  }
484
574
  function writeActorStateStopped(bc, x) {
485
575
  writeStopCode(bc, x.code);
486
- write5(bc, x.message);
576
+ write7(bc, x.message);
487
577
  }
488
578
  function readActorState(bc) {
489
579
  const offset = bc.offset;
@@ -528,10 +618,10 @@ function readEventActorStateUpdate(bc) {
528
618
  function writeEventActorStateUpdate(bc, x) {
529
619
  writeActorState(bc, x.state);
530
620
  }
531
- function read7(bc) {
621
+ function read9(bc) {
532
622
  return bare.readBool(bc) ? bare.readI64(bc) : null;
533
623
  }
534
- function write7(bc, x) {
624
+ function write9(bc, x) {
535
625
  bare.writeBool(bc, x != null);
536
626
  if (x != null) {
537
627
  bare.writeI64(bc, x);
@@ -539,11 +629,11 @@ function write7(bc, x) {
539
629
  }
540
630
  function readEventActorSetAlarm(bc) {
541
631
  return {
542
- alarmTs: read7(bc)
632
+ alarmTs: read9(bc)
543
633
  };
544
634
  }
545
635
  function writeEventActorSetAlarm(bc, x) {
546
- write7(bc, x.alarmTs);
636
+ write9(bc, x.alarmTs);
547
637
  }
548
638
  function readEvent(bc) {
549
639
  const offset = bc.offset;
@@ -602,7 +692,7 @@ function writePreloadedKvEntry(bc, x) {
602
692
  writeKvValue(bc, x.value);
603
693
  writeKvMetadata(bc, x.metadata);
604
694
  }
605
- function read8(bc) {
695
+ function read10(bc) {
606
696
  const len = bare.readUintSafe(bc);
607
697
  if (len === 0) {
608
698
  return [];
@@ -613,7 +703,7 @@ function read8(bc) {
613
703
  }
614
704
  return result;
615
705
  }
616
- function write8(bc, x) {
706
+ function write10(bc, x) {
617
707
  bare.writeUintSafe(bc, x.length);
618
708
  for (let i = 0; i < x.length; i++) {
619
709
  writePreloadedKvEntry(bc, x[i]);
@@ -621,13 +711,13 @@ function write8(bc, x) {
621
711
  }
622
712
  function readPreloadedKv(bc) {
623
713
  return {
624
- entries: read8(bc),
714
+ entries: read10(bc),
625
715
  requestedGetKeys: read0(bc),
626
716
  requestedPrefixes: read0(bc)
627
717
  };
628
718
  }
629
719
  function writePreloadedKv(bc, x) {
630
- write8(bc, x.entries);
720
+ write10(bc, x.entries);
631
721
  write0(bc, x.requestedGetKeys);
632
722
  write0(bc, x.requestedPrefixes);
633
723
  }
@@ -641,7 +731,7 @@ function writeHibernatingRequest(bc, x) {
641
731
  writeGatewayId(bc, x.gatewayId);
642
732
  writeRequestId(bc, x.requestId);
643
733
  }
644
- function read9(bc) {
734
+ function read11(bc) {
645
735
  const len = bare.readUintSafe(bc);
646
736
  if (len === 0) {
647
737
  return [];
@@ -652,16 +742,16 @@ function read9(bc) {
652
742
  }
653
743
  return result;
654
744
  }
655
- function write9(bc, x) {
745
+ function write11(bc, x) {
656
746
  bare.writeUintSafe(bc, x.length);
657
747
  for (let i = 0; i < x.length; i++) {
658
748
  writeHibernatingRequest(bc, x[i]);
659
749
  }
660
750
  }
661
- function read10(bc) {
751
+ function read12(bc) {
662
752
  return bare.readBool(bc) ? readPreloadedKv(bc) : null;
663
753
  }
664
- function write10(bc, x) {
754
+ function write12(bc, x) {
665
755
  bare.writeBool(bc, x != null);
666
756
  if (x != null) {
667
757
  writePreloadedKv(bc, x);
@@ -670,14 +760,14 @@ function write10(bc, x) {
670
760
  function readCommandStartActor(bc) {
671
761
  return {
672
762
  config: readActorConfig(bc),
673
- hibernatingRequests: read9(bc),
674
- preloadedKv: read10(bc)
763
+ hibernatingRequests: read11(bc),
764
+ preloadedKv: read12(bc)
675
765
  };
676
766
  }
677
767
  function writeCommandStartActor(bc, x) {
678
768
  writeActorConfig(bc, x.config);
679
- write9(bc, x.hibernatingRequests);
680
- write10(bc, x.preloadedKv);
769
+ write11(bc, x.hibernatingRequests);
770
+ write12(bc, x.preloadedKv);
681
771
  }
682
772
  var StopActorReason = /* @__PURE__ */ ((StopActorReason2) => {
683
773
  StopActorReason2["SleepIntent"] = "SleepIntent";
@@ -834,7 +924,7 @@ function writeMessageId(bc, x) {
834
924
  writeRequestId(bc, x.requestId);
835
925
  writeMessageIndex(bc, x.messageIndex);
836
926
  }
837
- function read11(bc) {
927
+ function read13(bc) {
838
928
  const len = bare.readUintSafe(bc);
839
929
  const result = /* @__PURE__ */ new Map();
840
930
  for (let i = 0; i < len; i++) {
@@ -848,7 +938,7 @@ function read11(bc) {
848
938
  }
849
939
  return result;
850
940
  }
851
- function write11(bc, x) {
941
+ function write13(bc, x) {
852
942
  bare.writeUintSafe(bc, x.size);
853
943
  for (const kv of x) {
854
944
  bare.writeString(bc, kv[0]);
@@ -860,8 +950,8 @@ function readToEnvoyRequestStart(bc) {
860
950
  actorId: readId(bc),
861
951
  method: bare.readString(bc),
862
952
  path: bare.readString(bc),
863
- headers: read11(bc),
864
- body: read6(bc),
953
+ headers: read13(bc),
954
+ body: read8(bc),
865
955
  stream: bare.readBool(bc)
866
956
  };
867
957
  }
@@ -869,8 +959,8 @@ function writeToEnvoyRequestStart(bc, x) {
869
959
  writeId(bc, x.actorId);
870
960
  bare.writeString(bc, x.method);
871
961
  bare.writeString(bc, x.path);
872
- write11(bc, x.headers);
873
- write6(bc, x.body);
962
+ write13(bc, x.headers);
963
+ write8(bc, x.body);
874
964
  bare.writeBool(bc, x.stream);
875
965
  }
876
966
  function readToEnvoyRequestChunk(bc) {
@@ -886,15 +976,15 @@ function writeToEnvoyRequestChunk(bc, x) {
886
976
  function readToRivetResponseStart(bc) {
887
977
  return {
888
978
  status: bare.readU16(bc),
889
- headers: read11(bc),
890
- body: read6(bc),
979
+ headers: read13(bc),
980
+ body: read8(bc),
891
981
  stream: bare.readBool(bc)
892
982
  };
893
983
  }
894
984
  function writeToRivetResponseStart(bc, x) {
895
985
  bare.writeU16(bc, x.status);
896
- write11(bc, x.headers);
897
- write6(bc, x.body);
986
+ write13(bc, x.headers);
987
+ write8(bc, x.body);
898
988
  bare.writeBool(bc, x.stream);
899
989
  }
900
990
  function readToRivetResponseChunk(bc) {
@@ -911,13 +1001,13 @@ function readToEnvoyWebSocketOpen(bc) {
911
1001
  return {
912
1002
  actorId: readId(bc),
913
1003
  path: bare.readString(bc),
914
- headers: read11(bc)
1004
+ headers: read13(bc)
915
1005
  };
916
1006
  }
917
1007
  function writeToEnvoyWebSocketOpen(bc, x) {
918
1008
  writeId(bc, x.actorId);
919
1009
  bare.writeString(bc, x.path);
920
- write11(bc, x.headers);
1010
+ write13(bc, x.headers);
921
1011
  }
922
1012
  function readToEnvoyWebSocketMessage(bc) {
923
1013
  return {
@@ -929,10 +1019,10 @@ function writeToEnvoyWebSocketMessage(bc, x) {
929
1019
  bare.writeData(bc, x.data);
930
1020
  bare.writeBool(bc, x.binary);
931
1021
  }
932
- function read12(bc) {
1022
+ function read14(bc) {
933
1023
  return bare.readBool(bc) ? bare.readU16(bc) : null;
934
1024
  }
935
- function write12(bc, x) {
1025
+ function write14(bc, x) {
936
1026
  bare.writeBool(bc, x != null);
937
1027
  if (x != null) {
938
1028
  bare.writeU16(bc, x);
@@ -940,13 +1030,13 @@ function write12(bc, x) {
940
1030
  }
941
1031
  function readToEnvoyWebSocketClose(bc) {
942
1032
  return {
943
- code: read12(bc),
944
- reason: read5(bc)
1033
+ code: read14(bc),
1034
+ reason: read7(bc)
945
1035
  };
946
1036
  }
947
1037
  function writeToEnvoyWebSocketClose(bc, x) {
948
- write12(bc, x.code);
949
- write5(bc, x.reason);
1038
+ write14(bc, x.code);
1039
+ write7(bc, x.reason);
950
1040
  }
951
1041
  function readToRivetWebSocketOpen(bc) {
952
1042
  return {
@@ -976,14 +1066,14 @@ function writeToRivetWebSocketMessageAck(bc, x) {
976
1066
  }
977
1067
  function readToRivetWebSocketClose(bc) {
978
1068
  return {
979
- code: read12(bc),
980
- reason: read5(bc),
1069
+ code: read14(bc),
1070
+ reason: read7(bc),
981
1071
  hibernate: bare.readBool(bc)
982
1072
  };
983
1073
  }
984
1074
  function writeToRivetWebSocketClose(bc, x) {
985
- write12(bc, x.code);
986
- write5(bc, x.reason);
1075
+ write14(bc, x.code);
1076
+ write7(bc, x.reason);
987
1077
  bare.writeBool(bc, x.hibernate);
988
1078
  }
989
1079
  function readToRivetTunnelMessageKind(bc) {
@@ -1131,7 +1221,7 @@ function readToEnvoyPing(bc) {
1131
1221
  function writeToEnvoyPing(bc, x) {
1132
1222
  bare.writeI64(bc, x.ts);
1133
1223
  }
1134
- function read13(bc) {
1224
+ function read15(bc) {
1135
1225
  const len = bare.readUintSafe(bc);
1136
1226
  const result = /* @__PURE__ */ new Map();
1137
1227
  for (let i = 0; i < len; i++) {
@@ -1145,26 +1235,26 @@ function read13(bc) {
1145
1235
  }
1146
1236
  return result;
1147
1237
  }
1148
- function write13(bc, x) {
1238
+ function write15(bc, x) {
1149
1239
  bare.writeUintSafe(bc, x.size);
1150
1240
  for (const kv of x) {
1151
1241
  bare.writeString(bc, kv[0]);
1152
1242
  writeActorName(bc, kv[1]);
1153
1243
  }
1154
1244
  }
1155
- function read14(bc) {
1156
- return bare.readBool(bc) ? read13(bc) : null;
1245
+ function read16(bc) {
1246
+ return bare.readBool(bc) ? read15(bc) : null;
1157
1247
  }
1158
- function write14(bc, x) {
1248
+ function write16(bc, x) {
1159
1249
  bare.writeBool(bc, x != null);
1160
1250
  if (x != null) {
1161
- write13(bc, x);
1251
+ write15(bc, x);
1162
1252
  }
1163
1253
  }
1164
- function read15(bc) {
1254
+ function read17(bc) {
1165
1255
  return bare.readBool(bc) ? readJson(bc) : null;
1166
1256
  }
1167
- function write15(bc, x) {
1257
+ function write17(bc, x) {
1168
1258
  bare.writeBool(bc, x != null);
1169
1259
  if (x != null) {
1170
1260
  writeJson(bc, x);
@@ -1172,13 +1262,13 @@ function write15(bc, x) {
1172
1262
  }
1173
1263
  function readToRivetMetadata(bc) {
1174
1264
  return {
1175
- prepopulateActorNames: read14(bc),
1176
- metadata: read15(bc)
1265
+ prepopulateActorNames: read16(bc),
1266
+ metadata: read17(bc)
1177
1267
  };
1178
1268
  }
1179
1269
  function writeToRivetMetadata(bc, x) {
1180
- write14(bc, x.prepopulateActorNames);
1181
- write15(bc, x.metadata);
1270
+ write16(bc, x.prepopulateActorNames);
1271
+ write17(bc, x.metadata);
1182
1272
  }
1183
1273
  function readToRivetEvents(bc) {
1184
1274
  const len = bare.readUintSafe(bc);
@@ -1197,7 +1287,7 @@ function writeToRivetEvents(bc, x) {
1197
1287
  writeEventWrapper(bc, x[i]);
1198
1288
  }
1199
1289
  }
1200
- function read16(bc) {
1290
+ function read18(bc) {
1201
1291
  const len = bare.readUintSafe(bc);
1202
1292
  if (len === 0) {
1203
1293
  return [];
@@ -1208,7 +1298,7 @@ function read16(bc) {
1208
1298
  }
1209
1299
  return result;
1210
1300
  }
1211
- function write16(bc, x) {
1301
+ function write18(bc, x) {
1212
1302
  bare.writeUintSafe(bc, x.length);
1213
1303
  for (let i = 0; i < x.length; i++) {
1214
1304
  writeActorCheckpoint(bc, x[i]);
@@ -1216,11 +1306,11 @@ function write16(bc, x) {
1216
1306
  }
1217
1307
  function readToRivetAckCommands(bc) {
1218
1308
  return {
1219
- lastCommandCheckpoints: read16(bc)
1309
+ lastCommandCheckpoints: read18(bc)
1220
1310
  };
1221
1311
  }
1222
1312
  function writeToRivetAckCommands(bc, x) {
1223
- write16(bc, x.lastCommandCheckpoints);
1313
+ write18(bc, x.lastCommandCheckpoints);
1224
1314
  }
1225
1315
  function readToRivetPong(bc) {
1226
1316
  return {
@@ -1321,17 +1411,40 @@ function decodeToRivet(bytes) {
1321
1411
  }
1322
1412
  return result;
1323
1413
  }
1414
+ function readSqliteFastPathCapability(bc) {
1415
+ return {
1416
+ protocolVersion: bare.readU16(bc),
1417
+ supportsWriteBatch: bare.readBool(bc),
1418
+ supportsTruncate: bare.readBool(bc)
1419
+ };
1420
+ }
1421
+ function writeSqliteFastPathCapability(bc, x) {
1422
+ bare.writeU16(bc, x.protocolVersion);
1423
+ bare.writeBool(bc, x.supportsWriteBatch);
1424
+ bare.writeBool(bc, x.supportsTruncate);
1425
+ }
1426
+ function read19(bc) {
1427
+ return bare.readBool(bc) ? readSqliteFastPathCapability(bc) : null;
1428
+ }
1429
+ function write19(bc, x) {
1430
+ bare.writeBool(bc, x != null);
1431
+ if (x != null) {
1432
+ writeSqliteFastPathCapability(bc, x);
1433
+ }
1434
+ }
1324
1435
  function readProtocolMetadata(bc) {
1325
1436
  return {
1326
1437
  envoyLostThreshold: bare.readI64(bc),
1327
1438
  actorStopThreshold: bare.readI64(bc),
1328
- maxResponsePayloadSize: bare.readU64(bc)
1439
+ maxResponsePayloadSize: bare.readU64(bc),
1440
+ sqliteFastPath: read19(bc)
1329
1441
  };
1330
1442
  }
1331
1443
  function writeProtocolMetadata(bc, x) {
1332
1444
  bare.writeI64(bc, x.envoyLostThreshold);
1333
1445
  bare.writeI64(bc, x.actorStopThreshold);
1334
1446
  bare.writeU64(bc, x.maxResponsePayloadSize);
1447
+ write19(bc, x.sqliteFastPath);
1335
1448
  }
1336
1449
  function readToEnvoyInit(bc) {
1337
1450
  return {
@@ -1360,11 +1473,11 @@ function writeToEnvoyCommands(bc, x) {
1360
1473
  }
1361
1474
  function readToEnvoyAckEvents(bc) {
1362
1475
  return {
1363
- lastEventCheckpoints: read16(bc)
1476
+ lastEventCheckpoints: read18(bc)
1364
1477
  };
1365
1478
  }
1366
1479
  function writeToEnvoyAckEvents(bc, x) {
1367
- write16(bc, x.lastEventCheckpoints);
1480
+ write18(bc, x.lastEventCheckpoints);
1368
1481
  }
1369
1482
  function readToEnvoyKvResponse(bc) {
1370
1483
  return {
@@ -1636,7 +1749,7 @@ function decodeToOutbound(bytes) {
1636
1749
  function assert(condition, message) {
1637
1750
  if (!condition) throw new Error(message ?? "Assertion failed");
1638
1751
  }
1639
- var VERSION = 1;
1752
+ var VERSION = 2;
1640
1753
  export {
1641
1754
  StopActorReason,
1642
1755
  StopCode,
@@ -1688,6 +1801,8 @@ export {
1688
1801
  readKvPutRequest,
1689
1802
  readKvRequestData,
1690
1803
  readKvResponseData,
1804
+ readKvSqliteTruncateRequest,
1805
+ readKvSqliteWriteBatchRequest,
1691
1806
  readKvValue,
1692
1807
  readMessageId,
1693
1808
  readMessageIndex,
@@ -1695,6 +1810,9 @@ export {
1695
1810
  readPreloadedKvEntry,
1696
1811
  readProtocolMetadata,
1697
1812
  readRequestId,
1813
+ readSqliteFastPathCapability,
1814
+ readSqliteFastPathFence,
1815
+ readSqlitePageUpdate,
1698
1816
  readStopActorReason,
1699
1817
  readStopCode,
1700
1818
  readToEnvoy,
@@ -1765,6 +1883,8 @@ export {
1765
1883
  writeKvPutRequest,
1766
1884
  writeKvRequestData,
1767
1885
  writeKvResponseData,
1886
+ writeKvSqliteTruncateRequest,
1887
+ writeKvSqliteWriteBatchRequest,
1768
1888
  writeKvValue,
1769
1889
  writeMessageId,
1770
1890
  writeMessageIndex,
@@ -1772,6 +1892,9 @@ export {
1772
1892
  writePreloadedKvEntry,
1773
1893
  writeProtocolMetadata,
1774
1894
  writeRequestId,
1895
+ writeSqliteFastPathCapability,
1896
+ writeSqliteFastPathFence,
1897
+ writeSqlitePageUpdate,
1775
1898
  writeStopActorReason,
1776
1899
  writeStopCode,
1777
1900
  writeToEnvoy,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/engine-envoy-protocol",
3
- "version": "0.0.0-pr.4671.0ad3a43",
3
+ "version": "0.0.0-pr.4672.159c9b3",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {