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