@rivetkit/engine-runner-protocol 2.0.25 → 2.0.26
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 +47 -41
- package/dist/index.js +153 -96
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -30,10 +30,7 @@ declare function readKvValue(bc: bare.ByteCursor): KvValue;
|
|
|
30
30
|
declare function writeKvValue(bc: bare.ByteCursor, x: KvValue): void;
|
|
31
31
|
type KvMetadata = {
|
|
32
32
|
readonly version: ArrayBuffer;
|
|
33
|
-
|
|
34
|
-
* TODO: Rename to update_ts
|
|
35
|
-
*/
|
|
36
|
-
readonly createTs: i64;
|
|
33
|
+
readonly updateTs: i64;
|
|
37
34
|
};
|
|
38
35
|
declare function readKvMetadata(bc: bare.ByteCursor): KvMetadata;
|
|
39
36
|
declare function writeKvMetadata(bc: bare.ByteCursor, x: KvMetadata): void;
|
|
@@ -181,6 +178,12 @@ type ActorConfig = {
|
|
|
181
178
|
};
|
|
182
179
|
declare function readActorConfig(bc: bare.ByteCursor): ActorConfig;
|
|
183
180
|
declare function writeActorConfig(bc: bare.ByteCursor, x: ActorConfig): void;
|
|
181
|
+
type ActorCheckpoint = {
|
|
182
|
+
readonly actorId: Id;
|
|
183
|
+
readonly index: i64;
|
|
184
|
+
};
|
|
185
|
+
declare function readActorCheckpoint(bc: bare.ByteCursor): ActorCheckpoint;
|
|
186
|
+
declare function writeActorCheckpoint(bc: bare.ByteCursor, x: ActorCheckpoint): void;
|
|
184
187
|
/**
|
|
185
188
|
* Intent
|
|
186
189
|
*/
|
|
@@ -251,7 +254,7 @@ type Event = {
|
|
|
251
254
|
declare function readEvent(bc: bare.ByteCursor): Event;
|
|
252
255
|
declare function writeEvent(bc: bare.ByteCursor, x: Event): void;
|
|
253
256
|
type EventWrapper = {
|
|
254
|
-
readonly
|
|
257
|
+
readonly checkpoint: ActorCheckpoint;
|
|
255
258
|
readonly inner: Event;
|
|
256
259
|
};
|
|
257
260
|
declare function readEventWrapper(bc: bare.ByteCursor): EventWrapper;
|
|
@@ -263,7 +266,6 @@ type HibernatingRequest = {
|
|
|
263
266
|
declare function readHibernatingRequest(bc: bare.ByteCursor): HibernatingRequest;
|
|
264
267
|
declare function writeHibernatingRequest(bc: bare.ByteCursor, x: HibernatingRequest): void;
|
|
265
268
|
type CommandStartActor = {
|
|
266
|
-
readonly actorId: Id;
|
|
267
269
|
readonly generation: u32;
|
|
268
270
|
readonly config: ActorConfig;
|
|
269
271
|
readonly hibernatingRequests: readonly HibernatingRequest[];
|
|
@@ -271,7 +273,6 @@ type CommandStartActor = {
|
|
|
271
273
|
declare function readCommandStartActor(bc: bare.ByteCursor): CommandStartActor;
|
|
272
274
|
declare function writeCommandStartActor(bc: bare.ByteCursor, x: CommandStartActor): void;
|
|
273
275
|
type CommandStopActor = {
|
|
274
|
-
readonly actorId: Id;
|
|
275
276
|
readonly generation: u32;
|
|
276
277
|
};
|
|
277
278
|
declare function readCommandStopActor(bc: bare.ByteCursor): CommandStopActor;
|
|
@@ -286,11 +287,25 @@ type Command = {
|
|
|
286
287
|
declare function readCommand(bc: bare.ByteCursor): Command;
|
|
287
288
|
declare function writeCommand(bc: bare.ByteCursor, x: Command): void;
|
|
288
289
|
type CommandWrapper = {
|
|
289
|
-
readonly
|
|
290
|
+
readonly checkpoint: ActorCheckpoint;
|
|
290
291
|
readonly inner: Command;
|
|
291
292
|
};
|
|
292
293
|
declare function readCommandWrapper(bc: bare.ByteCursor): CommandWrapper;
|
|
293
294
|
declare function writeCommandWrapper(bc: bare.ByteCursor, x: CommandWrapper): void;
|
|
295
|
+
/**
|
|
296
|
+
* We redeclare this so its top level
|
|
297
|
+
*/
|
|
298
|
+
type ActorCommandKeyData = {
|
|
299
|
+
readonly tag: "CommandStartActor";
|
|
300
|
+
readonly val: CommandStartActor;
|
|
301
|
+
} | {
|
|
302
|
+
readonly tag: "CommandStopActor";
|
|
303
|
+
readonly val: CommandStopActor;
|
|
304
|
+
};
|
|
305
|
+
declare function readActorCommandKeyData(bc: bare.ByteCursor): ActorCommandKeyData;
|
|
306
|
+
declare function writeActorCommandKeyData(bc: bare.ByteCursor, x: ActorCommandKeyData): void;
|
|
307
|
+
declare function encodeActorCommandKeyData(x: ActorCommandKeyData, config?: Partial<bare.Config>): Uint8Array;
|
|
308
|
+
declare function decodeActorCommandKeyData(bytes: Uint8Array): ActorCommandKeyData;
|
|
294
309
|
type MessageId = {
|
|
295
310
|
/**
|
|
296
311
|
* Globally unique ID
|
|
@@ -307,7 +322,6 @@ type MessageId = {
|
|
|
307
322
|
};
|
|
308
323
|
declare function readMessageId(bc: bare.ByteCursor): MessageId;
|
|
309
324
|
declare function writeMessageId(bc: bare.ByteCursor, x: MessageId): void;
|
|
310
|
-
type DeprecatedTunnelAck = null;
|
|
311
325
|
/**
|
|
312
326
|
* HTTP
|
|
313
327
|
*/
|
|
@@ -391,14 +405,11 @@ declare function writeToServerWebSocketClose(bc: bare.ByteCursor, x: ToServerWeb
|
|
|
391
405
|
/**
|
|
392
406
|
* To Server
|
|
393
407
|
*/
|
|
394
|
-
type ToServerTunnelMessageKind =
|
|
395
|
-
readonly tag: "DeprecatedTunnelAck";
|
|
396
|
-
readonly val: DeprecatedTunnelAck;
|
|
397
|
-
}
|
|
408
|
+
type ToServerTunnelMessageKind =
|
|
398
409
|
/**
|
|
399
410
|
* HTTP
|
|
400
411
|
*/
|
|
401
|
-
|
|
412
|
+
{
|
|
402
413
|
readonly tag: "ToServerResponseStart";
|
|
403
414
|
readonly val: ToServerResponseStart;
|
|
404
415
|
} | {
|
|
@@ -435,14 +446,11 @@ declare function writeToServerTunnelMessage(bc: bare.ByteCursor, x: ToServerTunn
|
|
|
435
446
|
/**
|
|
436
447
|
* To Client
|
|
437
448
|
*/
|
|
438
|
-
type ToClientTunnelMessageKind =
|
|
439
|
-
readonly tag: "DeprecatedTunnelAck";
|
|
440
|
-
readonly val: DeprecatedTunnelAck;
|
|
441
|
-
}
|
|
449
|
+
type ToClientTunnelMessageKind =
|
|
442
450
|
/**
|
|
443
451
|
* HTTP
|
|
444
452
|
*/
|
|
445
|
-
|
|
453
|
+
{
|
|
446
454
|
readonly tag: "ToClientRequestStart";
|
|
447
455
|
readonly val: ToClientRequestStart;
|
|
448
456
|
} | {
|
|
@@ -473,6 +481,11 @@ type ToClientTunnelMessage = {
|
|
|
473
481
|
};
|
|
474
482
|
declare function readToClientTunnelMessage(bc: bare.ByteCursor): ToClientTunnelMessage;
|
|
475
483
|
declare function writeToClientTunnelMessage(bc: bare.ByteCursor, x: ToClientTunnelMessage): void;
|
|
484
|
+
type ToClientPing = {
|
|
485
|
+
readonly ts: i64;
|
|
486
|
+
};
|
|
487
|
+
declare function readToClientPing(bc: bare.ByteCursor): ToClientPing;
|
|
488
|
+
declare function writeToClientPing(bc: bare.ByteCursor, x: ToClientPing): void;
|
|
476
489
|
/**
|
|
477
490
|
* MARK: To Server
|
|
478
491
|
*/
|
|
@@ -480,7 +493,6 @@ type ToServerInit = {
|
|
|
480
493
|
readonly name: string;
|
|
481
494
|
readonly version: u32;
|
|
482
495
|
readonly totalSlots: u32;
|
|
483
|
-
readonly lastCommandIdx: i64 | null;
|
|
484
496
|
readonly prepopulateActorNames: ReadonlyMap<string, ActorName> | null;
|
|
485
497
|
readonly metadata: Json | null;
|
|
486
498
|
};
|
|
@@ -490,16 +502,16 @@ type ToServerEvents = readonly EventWrapper[];
|
|
|
490
502
|
declare function readToServerEvents(bc: bare.ByteCursor): ToServerEvents;
|
|
491
503
|
declare function writeToServerEvents(bc: bare.ByteCursor, x: ToServerEvents): void;
|
|
492
504
|
type ToServerAckCommands = {
|
|
493
|
-
readonly
|
|
505
|
+
readonly lastCommandCheckpoints: readonly ActorCheckpoint[];
|
|
494
506
|
};
|
|
495
507
|
declare function readToServerAckCommands(bc: bare.ByteCursor): ToServerAckCommands;
|
|
496
508
|
declare function writeToServerAckCommands(bc: bare.ByteCursor, x: ToServerAckCommands): void;
|
|
497
509
|
type ToServerStopping = null;
|
|
498
|
-
type
|
|
510
|
+
type ToServerPong = {
|
|
499
511
|
readonly ts: i64;
|
|
500
512
|
};
|
|
501
|
-
declare function
|
|
502
|
-
declare function
|
|
513
|
+
declare function readToServerPong(bc: bare.ByteCursor): ToServerPong;
|
|
514
|
+
declare function writeToServerPong(bc: bare.ByteCursor, x: ToServerPong): void;
|
|
503
515
|
type ToServerKvRequest = {
|
|
504
516
|
readonly actorId: Id;
|
|
505
517
|
readonly requestId: u32;
|
|
@@ -520,8 +532,8 @@ type ToServer = {
|
|
|
520
532
|
readonly tag: "ToServerStopping";
|
|
521
533
|
readonly val: ToServerStopping;
|
|
522
534
|
} | {
|
|
523
|
-
readonly tag: "
|
|
524
|
-
readonly val:
|
|
535
|
+
readonly tag: "ToServerPong";
|
|
536
|
+
readonly val: ToServerPong;
|
|
525
537
|
} | {
|
|
526
538
|
readonly tag: "ToServerKvRequest";
|
|
527
539
|
readonly val: ToServerKvRequest;
|
|
@@ -543,7 +555,6 @@ declare function readProtocolMetadata(bc: bare.ByteCursor): ProtocolMetadata;
|
|
|
543
555
|
declare function writeProtocolMetadata(bc: bare.ByteCursor, x: ProtocolMetadata): void;
|
|
544
556
|
type ToClientInit = {
|
|
545
557
|
readonly runnerId: Id;
|
|
546
|
-
readonly lastEventIdx: i64;
|
|
547
558
|
readonly metadata: ProtocolMetadata;
|
|
548
559
|
};
|
|
549
560
|
declare function readToClientInit(bc: bare.ByteCursor): ToClientInit;
|
|
@@ -552,7 +563,7 @@ type ToClientCommands = readonly CommandWrapper[];
|
|
|
552
563
|
declare function readToClientCommands(bc: bare.ByteCursor): ToClientCommands;
|
|
553
564
|
declare function writeToClientCommands(bc: bare.ByteCursor, x: ToClientCommands): void;
|
|
554
565
|
type ToClientAckEvents = {
|
|
555
|
-
readonly
|
|
566
|
+
readonly lastEventCheckpoints: readonly ActorCheckpoint[];
|
|
556
567
|
};
|
|
557
568
|
declare function readToClientAckEvents(bc: bare.ByteCursor): ToClientAckEvents;
|
|
558
569
|
declare function writeToClientAckEvents(bc: bare.ByteCursor, x: ToClientAckEvents): void;
|
|
@@ -562,13 +573,9 @@ type ToClientKvResponse = {
|
|
|
562
573
|
};
|
|
563
574
|
declare function readToClientKvResponse(bc: bare.ByteCursor): ToClientKvResponse;
|
|
564
575
|
declare function writeToClientKvResponse(bc: bare.ByteCursor, x: ToClientKvResponse): void;
|
|
565
|
-
type ToClientClose = null;
|
|
566
576
|
type ToClient = {
|
|
567
577
|
readonly tag: "ToClientInit";
|
|
568
578
|
readonly val: ToClientInit;
|
|
569
|
-
} | {
|
|
570
|
-
readonly tag: "ToClientClose";
|
|
571
|
-
readonly val: ToClientClose;
|
|
572
579
|
} | {
|
|
573
580
|
readonly tag: "ToClientCommands";
|
|
574
581
|
readonly val: ToClientCommands;
|
|
@@ -581,6 +588,9 @@ type ToClient = {
|
|
|
581
588
|
} | {
|
|
582
589
|
readonly tag: "ToClientTunnelMessage";
|
|
583
590
|
readonly val: ToClientTunnelMessage;
|
|
591
|
+
} | {
|
|
592
|
+
readonly tag: "ToClientPing";
|
|
593
|
+
readonly val: ToClientPing;
|
|
584
594
|
};
|
|
585
595
|
declare function readToClient(bc: bare.ByteCursor): ToClient;
|
|
586
596
|
declare function writeToClient(bc: bare.ByteCursor, x: ToClient): void;
|
|
@@ -596,6 +606,7 @@ type ToRunnerPing = {
|
|
|
596
606
|
};
|
|
597
607
|
declare function readToRunnerPing(bc: bare.ByteCursor): ToRunnerPing;
|
|
598
608
|
declare function writeToRunnerPing(bc: bare.ByteCursor, x: ToRunnerPing): void;
|
|
609
|
+
type ToRunnerClose = null;
|
|
599
610
|
/**
|
|
600
611
|
* We have to re-declare the entire union since BARE will not generate the
|
|
601
612
|
* ser/de for ToClient if it's not a top-level type
|
|
@@ -604,20 +615,14 @@ type ToRunner = {
|
|
|
604
615
|
readonly tag: "ToRunnerPing";
|
|
605
616
|
readonly val: ToRunnerPing;
|
|
606
617
|
} | {
|
|
607
|
-
readonly tag: "
|
|
608
|
-
readonly val:
|
|
609
|
-
} | {
|
|
610
|
-
readonly tag: "ToClientClose";
|
|
611
|
-
readonly val: ToClientClose;
|
|
618
|
+
readonly tag: "ToRunnerClose";
|
|
619
|
+
readonly val: ToRunnerClose;
|
|
612
620
|
} | {
|
|
613
621
|
readonly tag: "ToClientCommands";
|
|
614
622
|
readonly val: ToClientCommands;
|
|
615
623
|
} | {
|
|
616
624
|
readonly tag: "ToClientAckEvents";
|
|
617
625
|
readonly val: ToClientAckEvents;
|
|
618
|
-
} | {
|
|
619
|
-
readonly tag: "ToClientKvResponse";
|
|
620
|
-
readonly val: ToClientKvResponse;
|
|
621
626
|
} | {
|
|
622
627
|
readonly tag: "ToClientTunnelMessage";
|
|
623
628
|
readonly val: ToClientTunnelMessage;
|
|
@@ -651,6 +656,7 @@ declare function decodeToGateway(bytes: Uint8Array): ToGateway;
|
|
|
651
656
|
*/
|
|
652
657
|
type ToServerlessServerInit = {
|
|
653
658
|
readonly runnerId: Id;
|
|
659
|
+
readonly runnerProtocolVersion: u16;
|
|
654
660
|
};
|
|
655
661
|
declare function readToServerlessServerInit(bc: bare.ByteCursor): ToServerlessServerInit;
|
|
656
662
|
declare function writeToServerlessServerInit(bc: bare.ByteCursor, x: ToServerlessServerInit): void;
|
|
@@ -663,4 +669,4 @@ declare function writeToServerlessServer(bc: bare.ByteCursor, x: ToServerlessSer
|
|
|
663
669
|
declare function encodeToServerlessServer(x: ToServerlessServer, config?: Partial<bare.Config>): Uint8Array;
|
|
664
670
|
declare function decodeToServerlessServer(bytes: Uint8Array): ToServerlessServer;
|
|
665
671
|
|
|
666
|
-
export { 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
|
|
672
|
+
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 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 ProtocolMetadata, type RequestId, StopCode, type ToClient, type ToClientAckEvents, type ToClientCommands, type ToClientInit, type ToClientKvResponse, type ToClientPing, type ToClientRequestAbort, type ToClientRequestChunk, type ToClientRequestStart, type ToClientTunnelMessage, type ToClientTunnelMessageKind, type ToClientWebSocketClose, type ToClientWebSocketMessage, type ToClientWebSocketOpen, type ToGateway, type ToGatewayPong, type ToRunner, type ToRunnerClose, type ToRunnerPing, type ToServer, type ToServerAckCommands, type ToServerEvents, type ToServerInit, type ToServerKvRequest, type ToServerPong, type ToServerResponseAbort, type ToServerResponseChunk, type ToServerResponseStart, type ToServerStopping, type ToServerTunnelMessage, type ToServerTunnelMessageKind, type ToServerWebSocketClose, type ToServerWebSocketMessage, type ToServerWebSocketMessageAck, type ToServerWebSocketOpen, type ToServerlessServer, type ToServerlessServerInit, decodeActorCommandKeyData, decodeToClient, decodeToGateway, decodeToRunner, decodeToServer, decodeToServerlessServer, encodeActorCommandKeyData, encodeToClient, encodeToGateway, encodeToRunner, encodeToServer, encodeToServerlessServer, type i64, readActorCheckpoint, readActorCommandKeyData, readActorConfig, readActorIntent, readActorName, readActorState, readActorStateStopped, readCommand, readCommandStartActor, readCommandStopActor, readCommandWrapper, readEvent, readEventActorIntent, readEventActorSetAlarm, readEventActorStateUpdate, readEventWrapper, readGatewayId, readHibernatingRequest, readId, readJson, readKvDeleteRequest, readKvErrorResponse, readKvGetRequest, readKvGetResponse, readKvKey, readKvListPrefixQuery, readKvListQuery, readKvListRangeQuery, readKvListRequest, readKvListResponse, readKvMetadata, readKvPutRequest, readKvRequestData, readKvResponseData, readKvValue, readMessageId, readMessageIndex, readProtocolMetadata, readRequestId, readStopCode, readToClient, readToClientAckEvents, readToClientCommands, readToClientInit, readToClientKvResponse, readToClientPing, readToClientRequestChunk, readToClientRequestStart, readToClientTunnelMessage, readToClientTunnelMessageKind, readToClientWebSocketClose, readToClientWebSocketMessage, readToClientWebSocketOpen, readToGateway, readToGatewayPong, readToRunner, readToRunnerPing, readToServer, readToServerAckCommands, readToServerEvents, readToServerInit, readToServerKvRequest, readToServerPong, readToServerResponseChunk, readToServerResponseStart, readToServerTunnelMessage, readToServerTunnelMessageKind, readToServerWebSocketClose, readToServerWebSocketMessage, readToServerWebSocketMessageAck, readToServerWebSocketOpen, readToServerlessServer, readToServerlessServerInit, 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, writeKvDeleteRequest, writeKvErrorResponse, writeKvGetRequest, writeKvGetResponse, writeKvKey, writeKvListPrefixQuery, writeKvListQuery, writeKvListRangeQuery, writeKvListRequest, writeKvListResponse, writeKvMetadata, writeKvPutRequest, writeKvRequestData, writeKvResponseData, writeKvValue, writeMessageId, writeMessageIndex, writeProtocolMetadata, writeRequestId, writeStopCode, writeToClient, writeToClientAckEvents, writeToClientCommands, writeToClientInit, writeToClientKvResponse, writeToClientPing, writeToClientRequestChunk, writeToClientRequestStart, writeToClientTunnelMessage, writeToClientTunnelMessageKind, writeToClientWebSocketClose, writeToClientWebSocketMessage, writeToClientWebSocketOpen, writeToGateway, writeToGatewayPong, writeToRunner, writeToRunnerPing, writeToServer, writeToServerAckCommands, writeToServerEvents, writeToServerInit, writeToServerKvRequest, writeToServerPong, writeToServerResponseChunk, writeToServerResponseStart, writeToServerTunnelMessage, writeToServerTunnelMessageKind, writeToServerWebSocketClose, writeToServerWebSocketMessage, writeToServerWebSocketMessageAck, writeToServerWebSocketOpen, writeToServerlessServer, writeToServerlessServerInit };
|
package/dist/index.js
CHANGED
|
@@ -49,12 +49,12 @@ function writeKvValue(bc, x) {
|
|
|
49
49
|
function readKvMetadata(bc) {
|
|
50
50
|
return {
|
|
51
51
|
version: bare.readData(bc),
|
|
52
|
-
|
|
52
|
+
updateTs: bare.readI64(bc)
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
function writeKvMetadata(bc, x) {
|
|
56
56
|
bare.writeData(bc, x.version);
|
|
57
|
-
bare.writeI64(bc, x.
|
|
57
|
+
bare.writeI64(bc, x.updateTs);
|
|
58
58
|
}
|
|
59
59
|
function readKvListRangeQuery(bc) {
|
|
60
60
|
return {
|
|
@@ -421,6 +421,16 @@ function writeActorConfig(bc, x) {
|
|
|
421
421
|
bare.writeI64(bc, x.createTs);
|
|
422
422
|
write6(bc, x.input);
|
|
423
423
|
}
|
|
424
|
+
function readActorCheckpoint(bc) {
|
|
425
|
+
return {
|
|
426
|
+
actorId: readId(bc),
|
|
427
|
+
index: bare.readI64(bc)
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
function writeActorCheckpoint(bc, x) {
|
|
431
|
+
writeId(bc, x.actorId);
|
|
432
|
+
bare.writeI64(bc, x.index);
|
|
433
|
+
}
|
|
424
434
|
function readActorIntent(bc) {
|
|
425
435
|
const offset = bc.offset;
|
|
426
436
|
const tag = bare.readU8(bc);
|
|
@@ -566,12 +576,12 @@ function writeEvent(bc, x) {
|
|
|
566
576
|
}
|
|
567
577
|
function readEventWrapper(bc) {
|
|
568
578
|
return {
|
|
569
|
-
|
|
579
|
+
checkpoint: readActorCheckpoint(bc),
|
|
570
580
|
inner: readEvent(bc)
|
|
571
581
|
};
|
|
572
582
|
}
|
|
573
583
|
function writeEventWrapper(bc, x) {
|
|
574
|
-
|
|
584
|
+
writeActorCheckpoint(bc, x.checkpoint);
|
|
575
585
|
writeEvent(bc, x.inner);
|
|
576
586
|
}
|
|
577
587
|
function readHibernatingRequest(bc) {
|
|
@@ -603,26 +613,22 @@ function write8(bc, x) {
|
|
|
603
613
|
}
|
|
604
614
|
function readCommandStartActor(bc) {
|
|
605
615
|
return {
|
|
606
|
-
actorId: readId(bc),
|
|
607
616
|
generation: bare.readU32(bc),
|
|
608
617
|
config: readActorConfig(bc),
|
|
609
618
|
hibernatingRequests: read8(bc)
|
|
610
619
|
};
|
|
611
620
|
}
|
|
612
621
|
function writeCommandStartActor(bc, x) {
|
|
613
|
-
writeId(bc, x.actorId);
|
|
614
622
|
bare.writeU32(bc, x.generation);
|
|
615
623
|
writeActorConfig(bc, x.config);
|
|
616
624
|
write8(bc, x.hibernatingRequests);
|
|
617
625
|
}
|
|
618
626
|
function readCommandStopActor(bc) {
|
|
619
627
|
return {
|
|
620
|
-
actorId: readId(bc),
|
|
621
628
|
generation: bare.readU32(bc)
|
|
622
629
|
};
|
|
623
630
|
}
|
|
624
631
|
function writeCommandStopActor(bc, x) {
|
|
625
|
-
writeId(bc, x.actorId);
|
|
626
632
|
bare.writeU32(bc, x.generation);
|
|
627
633
|
}
|
|
628
634
|
function readCommand(bc) {
|
|
@@ -655,14 +661,59 @@ function writeCommand(bc, x) {
|
|
|
655
661
|
}
|
|
656
662
|
function readCommandWrapper(bc) {
|
|
657
663
|
return {
|
|
658
|
-
|
|
664
|
+
checkpoint: readActorCheckpoint(bc),
|
|
659
665
|
inner: readCommand(bc)
|
|
660
666
|
};
|
|
661
667
|
}
|
|
662
668
|
function writeCommandWrapper(bc, x) {
|
|
663
|
-
|
|
669
|
+
writeActorCheckpoint(bc, x.checkpoint);
|
|
664
670
|
writeCommand(bc, x.inner);
|
|
665
671
|
}
|
|
672
|
+
function readActorCommandKeyData(bc) {
|
|
673
|
+
const offset = bc.offset;
|
|
674
|
+
const tag = bare.readU8(bc);
|
|
675
|
+
switch (tag) {
|
|
676
|
+
case 0:
|
|
677
|
+
return { tag: "CommandStartActor", val: readCommandStartActor(bc) };
|
|
678
|
+
case 1:
|
|
679
|
+
return { tag: "CommandStopActor", val: readCommandStopActor(bc) };
|
|
680
|
+
default: {
|
|
681
|
+
bc.offset = offset;
|
|
682
|
+
throw new bare.BareError(offset, "invalid tag");
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
function writeActorCommandKeyData(bc, x) {
|
|
687
|
+
switch (x.tag) {
|
|
688
|
+
case "CommandStartActor": {
|
|
689
|
+
bare.writeU8(bc, 0);
|
|
690
|
+
writeCommandStartActor(bc, x.val);
|
|
691
|
+
break;
|
|
692
|
+
}
|
|
693
|
+
case "CommandStopActor": {
|
|
694
|
+
bare.writeU8(bc, 1);
|
|
695
|
+
writeCommandStopActor(bc, x.val);
|
|
696
|
+
break;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
function encodeActorCommandKeyData(x, config) {
|
|
701
|
+
const fullConfig = config != null ? bare.Config(config) : DEFAULT_CONFIG;
|
|
702
|
+
const bc = new bare.ByteCursor(
|
|
703
|
+
new Uint8Array(fullConfig.initialBufferLength),
|
|
704
|
+
fullConfig
|
|
705
|
+
);
|
|
706
|
+
writeActorCommandKeyData(bc, x);
|
|
707
|
+
return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset);
|
|
708
|
+
}
|
|
709
|
+
function decodeActorCommandKeyData(bytes) {
|
|
710
|
+
const bc = new bare.ByteCursor(bytes, DEFAULT_CONFIG);
|
|
711
|
+
const result = readActorCommandKeyData(bc);
|
|
712
|
+
if (bc.offset < bc.view.byteLength) {
|
|
713
|
+
throw new bare.BareError(bc.offset, "remaining bytes");
|
|
714
|
+
}
|
|
715
|
+
return result;
|
|
716
|
+
}
|
|
666
717
|
function readMessageId(bc) {
|
|
667
718
|
return {
|
|
668
719
|
gatewayId: readGatewayId(bc),
|
|
@@ -832,20 +883,18 @@ function readToServerTunnelMessageKind(bc) {
|
|
|
832
883
|
const tag = bare.readU8(bc);
|
|
833
884
|
switch (tag) {
|
|
834
885
|
case 0:
|
|
835
|
-
return { tag: "DeprecatedTunnelAck", val: null };
|
|
836
|
-
case 1:
|
|
837
886
|
return { tag: "ToServerResponseStart", val: readToServerResponseStart(bc) };
|
|
838
|
-
case
|
|
887
|
+
case 1:
|
|
839
888
|
return { tag: "ToServerResponseChunk", val: readToServerResponseChunk(bc) };
|
|
840
|
-
case
|
|
889
|
+
case 2:
|
|
841
890
|
return { tag: "ToServerResponseAbort", val: null };
|
|
842
|
-
case
|
|
891
|
+
case 3:
|
|
843
892
|
return { tag: "ToServerWebSocketOpen", val: readToServerWebSocketOpen(bc) };
|
|
844
|
-
case
|
|
893
|
+
case 4:
|
|
845
894
|
return { tag: "ToServerWebSocketMessage", val: readToServerWebSocketMessage(bc) };
|
|
846
|
-
case
|
|
895
|
+
case 5:
|
|
847
896
|
return { tag: "ToServerWebSocketMessageAck", val: readToServerWebSocketMessageAck(bc) };
|
|
848
|
-
case
|
|
897
|
+
case 6:
|
|
849
898
|
return { tag: "ToServerWebSocketClose", val: readToServerWebSocketClose(bc) };
|
|
850
899
|
default: {
|
|
851
900
|
bc.offset = offset;
|
|
@@ -855,41 +904,37 @@ function readToServerTunnelMessageKind(bc) {
|
|
|
855
904
|
}
|
|
856
905
|
function writeToServerTunnelMessageKind(bc, x) {
|
|
857
906
|
switch (x.tag) {
|
|
858
|
-
case "DeprecatedTunnelAck": {
|
|
859
|
-
bare.writeU8(bc, 0);
|
|
860
|
-
break;
|
|
861
|
-
}
|
|
862
907
|
case "ToServerResponseStart": {
|
|
863
|
-
bare.writeU8(bc,
|
|
908
|
+
bare.writeU8(bc, 0);
|
|
864
909
|
writeToServerResponseStart(bc, x.val);
|
|
865
910
|
break;
|
|
866
911
|
}
|
|
867
912
|
case "ToServerResponseChunk": {
|
|
868
|
-
bare.writeU8(bc,
|
|
913
|
+
bare.writeU8(bc, 1);
|
|
869
914
|
writeToServerResponseChunk(bc, x.val);
|
|
870
915
|
break;
|
|
871
916
|
}
|
|
872
917
|
case "ToServerResponseAbort": {
|
|
873
|
-
bare.writeU8(bc,
|
|
918
|
+
bare.writeU8(bc, 2);
|
|
874
919
|
break;
|
|
875
920
|
}
|
|
876
921
|
case "ToServerWebSocketOpen": {
|
|
877
|
-
bare.writeU8(bc,
|
|
922
|
+
bare.writeU8(bc, 3);
|
|
878
923
|
writeToServerWebSocketOpen(bc, x.val);
|
|
879
924
|
break;
|
|
880
925
|
}
|
|
881
926
|
case "ToServerWebSocketMessage": {
|
|
882
|
-
bare.writeU8(bc,
|
|
927
|
+
bare.writeU8(bc, 4);
|
|
883
928
|
writeToServerWebSocketMessage(bc, x.val);
|
|
884
929
|
break;
|
|
885
930
|
}
|
|
886
931
|
case "ToServerWebSocketMessageAck": {
|
|
887
|
-
bare.writeU8(bc,
|
|
932
|
+
bare.writeU8(bc, 5);
|
|
888
933
|
writeToServerWebSocketMessageAck(bc, x.val);
|
|
889
934
|
break;
|
|
890
935
|
}
|
|
891
936
|
case "ToServerWebSocketClose": {
|
|
892
|
-
bare.writeU8(bc,
|
|
937
|
+
bare.writeU8(bc, 6);
|
|
893
938
|
writeToServerWebSocketClose(bc, x.val);
|
|
894
939
|
break;
|
|
895
940
|
}
|
|
@@ -910,18 +955,16 @@ function readToClientTunnelMessageKind(bc) {
|
|
|
910
955
|
const tag = bare.readU8(bc);
|
|
911
956
|
switch (tag) {
|
|
912
957
|
case 0:
|
|
913
|
-
return { tag: "DeprecatedTunnelAck", val: null };
|
|
914
|
-
case 1:
|
|
915
958
|
return { tag: "ToClientRequestStart", val: readToClientRequestStart(bc) };
|
|
916
|
-
case
|
|
959
|
+
case 1:
|
|
917
960
|
return { tag: "ToClientRequestChunk", val: readToClientRequestChunk(bc) };
|
|
918
|
-
case
|
|
961
|
+
case 2:
|
|
919
962
|
return { tag: "ToClientRequestAbort", val: null };
|
|
920
|
-
case
|
|
963
|
+
case 3:
|
|
921
964
|
return { tag: "ToClientWebSocketOpen", val: readToClientWebSocketOpen(bc) };
|
|
922
|
-
case
|
|
965
|
+
case 4:
|
|
923
966
|
return { tag: "ToClientWebSocketMessage", val: readToClientWebSocketMessage(bc) };
|
|
924
|
-
case
|
|
967
|
+
case 5:
|
|
925
968
|
return { tag: "ToClientWebSocketClose", val: readToClientWebSocketClose(bc) };
|
|
926
969
|
default: {
|
|
927
970
|
bc.offset = offset;
|
|
@@ -931,36 +974,32 @@ function readToClientTunnelMessageKind(bc) {
|
|
|
931
974
|
}
|
|
932
975
|
function writeToClientTunnelMessageKind(bc, x) {
|
|
933
976
|
switch (x.tag) {
|
|
934
|
-
case "DeprecatedTunnelAck": {
|
|
935
|
-
bare.writeU8(bc, 0);
|
|
936
|
-
break;
|
|
937
|
-
}
|
|
938
977
|
case "ToClientRequestStart": {
|
|
939
|
-
bare.writeU8(bc,
|
|
978
|
+
bare.writeU8(bc, 0);
|
|
940
979
|
writeToClientRequestStart(bc, x.val);
|
|
941
980
|
break;
|
|
942
981
|
}
|
|
943
982
|
case "ToClientRequestChunk": {
|
|
944
|
-
bare.writeU8(bc,
|
|
983
|
+
bare.writeU8(bc, 1);
|
|
945
984
|
writeToClientRequestChunk(bc, x.val);
|
|
946
985
|
break;
|
|
947
986
|
}
|
|
948
987
|
case "ToClientRequestAbort": {
|
|
949
|
-
bare.writeU8(bc,
|
|
988
|
+
bare.writeU8(bc, 2);
|
|
950
989
|
break;
|
|
951
990
|
}
|
|
952
991
|
case "ToClientWebSocketOpen": {
|
|
953
|
-
bare.writeU8(bc,
|
|
992
|
+
bare.writeU8(bc, 3);
|
|
954
993
|
writeToClientWebSocketOpen(bc, x.val);
|
|
955
994
|
break;
|
|
956
995
|
}
|
|
957
996
|
case "ToClientWebSocketMessage": {
|
|
958
|
-
bare.writeU8(bc,
|
|
997
|
+
bare.writeU8(bc, 4);
|
|
959
998
|
writeToClientWebSocketMessage(bc, x.val);
|
|
960
999
|
break;
|
|
961
1000
|
}
|
|
962
1001
|
case "ToClientWebSocketClose": {
|
|
963
|
-
bare.writeU8(bc,
|
|
1002
|
+
bare.writeU8(bc, 5);
|
|
964
1003
|
writeToClientWebSocketClose(bc, x.val);
|
|
965
1004
|
break;
|
|
966
1005
|
}
|
|
@@ -976,6 +1015,14 @@ function writeToClientTunnelMessage(bc, x) {
|
|
|
976
1015
|
writeMessageId(bc, x.messageId);
|
|
977
1016
|
writeToClientTunnelMessageKind(bc, x.messageKind);
|
|
978
1017
|
}
|
|
1018
|
+
function readToClientPing(bc) {
|
|
1019
|
+
return {
|
|
1020
|
+
ts: bare.readI64(bc)
|
|
1021
|
+
};
|
|
1022
|
+
}
|
|
1023
|
+
function writeToClientPing(bc, x) {
|
|
1024
|
+
bare.writeI64(bc, x.ts);
|
|
1025
|
+
}
|
|
979
1026
|
function read11(bc) {
|
|
980
1027
|
const len = bare.readUintSafe(bc);
|
|
981
1028
|
const result = /* @__PURE__ */ new Map();
|
|
@@ -1020,7 +1067,6 @@ function readToServerInit(bc) {
|
|
|
1020
1067
|
name: bare.readString(bc),
|
|
1021
1068
|
version: bare.readU32(bc),
|
|
1022
1069
|
totalSlots: bare.readU32(bc),
|
|
1023
|
-
lastCommandIdx: read7(bc),
|
|
1024
1070
|
prepopulateActorNames: read12(bc),
|
|
1025
1071
|
metadata: read13(bc)
|
|
1026
1072
|
};
|
|
@@ -1029,7 +1075,6 @@ function writeToServerInit(bc, x) {
|
|
|
1029
1075
|
bare.writeString(bc, x.name);
|
|
1030
1076
|
bare.writeU32(bc, x.version);
|
|
1031
1077
|
bare.writeU32(bc, x.totalSlots);
|
|
1032
|
-
write7(bc, x.lastCommandIdx);
|
|
1033
1078
|
write12(bc, x.prepopulateActorNames);
|
|
1034
1079
|
write13(bc, x.metadata);
|
|
1035
1080
|
}
|
|
@@ -1050,20 +1095,37 @@ function writeToServerEvents(bc, x) {
|
|
|
1050
1095
|
writeEventWrapper(bc, x[i]);
|
|
1051
1096
|
}
|
|
1052
1097
|
}
|
|
1098
|
+
function read14(bc) {
|
|
1099
|
+
const len = bare.readUintSafe(bc);
|
|
1100
|
+
if (len === 0) {
|
|
1101
|
+
return [];
|
|
1102
|
+
}
|
|
1103
|
+
const result = [readActorCheckpoint(bc)];
|
|
1104
|
+
for (let i = 1; i < len; i++) {
|
|
1105
|
+
result[i] = readActorCheckpoint(bc);
|
|
1106
|
+
}
|
|
1107
|
+
return result;
|
|
1108
|
+
}
|
|
1109
|
+
function write14(bc, x) {
|
|
1110
|
+
bare.writeUintSafe(bc, x.length);
|
|
1111
|
+
for (let i = 0; i < x.length; i++) {
|
|
1112
|
+
writeActorCheckpoint(bc, x[i]);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1053
1115
|
function readToServerAckCommands(bc) {
|
|
1054
1116
|
return {
|
|
1055
|
-
|
|
1117
|
+
lastCommandCheckpoints: read14(bc)
|
|
1056
1118
|
};
|
|
1057
1119
|
}
|
|
1058
1120
|
function writeToServerAckCommands(bc, x) {
|
|
1059
|
-
|
|
1121
|
+
write14(bc, x.lastCommandCheckpoints);
|
|
1060
1122
|
}
|
|
1061
|
-
function
|
|
1123
|
+
function readToServerPong(bc) {
|
|
1062
1124
|
return {
|
|
1063
1125
|
ts: bare.readI64(bc)
|
|
1064
1126
|
};
|
|
1065
1127
|
}
|
|
1066
|
-
function
|
|
1128
|
+
function writeToServerPong(bc, x) {
|
|
1067
1129
|
bare.writeI64(bc, x.ts);
|
|
1068
1130
|
}
|
|
1069
1131
|
function readToServerKvRequest(bc) {
|
|
@@ -1091,7 +1153,7 @@ function readToServer(bc) {
|
|
|
1091
1153
|
case 3:
|
|
1092
1154
|
return { tag: "ToServerStopping", val: null };
|
|
1093
1155
|
case 4:
|
|
1094
|
-
return { tag: "
|
|
1156
|
+
return { tag: "ToServerPong", val: readToServerPong(bc) };
|
|
1095
1157
|
case 5:
|
|
1096
1158
|
return { tag: "ToServerKvRequest", val: readToServerKvRequest(bc) };
|
|
1097
1159
|
case 6:
|
|
@@ -1123,9 +1185,9 @@ function writeToServer(bc, x) {
|
|
|
1123
1185
|
bare.writeU8(bc, 3);
|
|
1124
1186
|
break;
|
|
1125
1187
|
}
|
|
1126
|
-
case "
|
|
1188
|
+
case "ToServerPong": {
|
|
1127
1189
|
bare.writeU8(bc, 4);
|
|
1128
|
-
|
|
1190
|
+
writeToServerPong(bc, x.val);
|
|
1129
1191
|
break;
|
|
1130
1192
|
}
|
|
1131
1193
|
case "ToServerKvRequest": {
|
|
@@ -1168,13 +1230,11 @@ function writeProtocolMetadata(bc, x) {
|
|
|
1168
1230
|
function readToClientInit(bc) {
|
|
1169
1231
|
return {
|
|
1170
1232
|
runnerId: readId(bc),
|
|
1171
|
-
lastEventIdx: bare.readI64(bc),
|
|
1172
1233
|
metadata: readProtocolMetadata(bc)
|
|
1173
1234
|
};
|
|
1174
1235
|
}
|
|
1175
1236
|
function writeToClientInit(bc, x) {
|
|
1176
1237
|
writeId(bc, x.runnerId);
|
|
1177
|
-
bare.writeI64(bc, x.lastEventIdx);
|
|
1178
1238
|
writeProtocolMetadata(bc, x.metadata);
|
|
1179
1239
|
}
|
|
1180
1240
|
function readToClientCommands(bc) {
|
|
@@ -1196,11 +1256,11 @@ function writeToClientCommands(bc, x) {
|
|
|
1196
1256
|
}
|
|
1197
1257
|
function readToClientAckEvents(bc) {
|
|
1198
1258
|
return {
|
|
1199
|
-
|
|
1259
|
+
lastEventCheckpoints: read14(bc)
|
|
1200
1260
|
};
|
|
1201
1261
|
}
|
|
1202
1262
|
function writeToClientAckEvents(bc, x) {
|
|
1203
|
-
|
|
1263
|
+
write14(bc, x.lastEventCheckpoints);
|
|
1204
1264
|
}
|
|
1205
1265
|
function readToClientKvResponse(bc) {
|
|
1206
1266
|
return {
|
|
@@ -1219,15 +1279,15 @@ function readToClient(bc) {
|
|
|
1219
1279
|
case 0:
|
|
1220
1280
|
return { tag: "ToClientInit", val: readToClientInit(bc) };
|
|
1221
1281
|
case 1:
|
|
1222
|
-
return { tag: "ToClientClose", val: null };
|
|
1223
|
-
case 2:
|
|
1224
1282
|
return { tag: "ToClientCommands", val: readToClientCommands(bc) };
|
|
1225
|
-
case
|
|
1283
|
+
case 2:
|
|
1226
1284
|
return { tag: "ToClientAckEvents", val: readToClientAckEvents(bc) };
|
|
1227
|
-
case
|
|
1285
|
+
case 3:
|
|
1228
1286
|
return { tag: "ToClientKvResponse", val: readToClientKvResponse(bc) };
|
|
1229
|
-
case
|
|
1287
|
+
case 4:
|
|
1230
1288
|
return { tag: "ToClientTunnelMessage", val: readToClientTunnelMessage(bc) };
|
|
1289
|
+
case 5:
|
|
1290
|
+
return { tag: "ToClientPing", val: readToClientPing(bc) };
|
|
1231
1291
|
default: {
|
|
1232
1292
|
bc.offset = offset;
|
|
1233
1293
|
throw new bare.BareError(offset, "invalid tag");
|
|
@@ -1241,30 +1301,31 @@ function writeToClient(bc, x) {
|
|
|
1241
1301
|
writeToClientInit(bc, x.val);
|
|
1242
1302
|
break;
|
|
1243
1303
|
}
|
|
1244
|
-
case "ToClientClose": {
|
|
1245
|
-
bare.writeU8(bc, 1);
|
|
1246
|
-
break;
|
|
1247
|
-
}
|
|
1248
1304
|
case "ToClientCommands": {
|
|
1249
|
-
bare.writeU8(bc,
|
|
1305
|
+
bare.writeU8(bc, 1);
|
|
1250
1306
|
writeToClientCommands(bc, x.val);
|
|
1251
1307
|
break;
|
|
1252
1308
|
}
|
|
1253
1309
|
case "ToClientAckEvents": {
|
|
1254
|
-
bare.writeU8(bc,
|
|
1310
|
+
bare.writeU8(bc, 2);
|
|
1255
1311
|
writeToClientAckEvents(bc, x.val);
|
|
1256
1312
|
break;
|
|
1257
1313
|
}
|
|
1258
1314
|
case "ToClientKvResponse": {
|
|
1259
|
-
bare.writeU8(bc,
|
|
1315
|
+
bare.writeU8(bc, 3);
|
|
1260
1316
|
writeToClientKvResponse(bc, x.val);
|
|
1261
1317
|
break;
|
|
1262
1318
|
}
|
|
1263
1319
|
case "ToClientTunnelMessage": {
|
|
1264
|
-
bare.writeU8(bc,
|
|
1320
|
+
bare.writeU8(bc, 4);
|
|
1265
1321
|
writeToClientTunnelMessage(bc, x.val);
|
|
1266
1322
|
break;
|
|
1267
1323
|
}
|
|
1324
|
+
case "ToClientPing": {
|
|
1325
|
+
bare.writeU8(bc, 5);
|
|
1326
|
+
writeToClientPing(bc, x.val);
|
|
1327
|
+
break;
|
|
1328
|
+
}
|
|
1268
1329
|
}
|
|
1269
1330
|
}
|
|
1270
1331
|
function encodeToClient(x, config) {
|
|
@@ -1303,16 +1364,12 @@ function readToRunner(bc) {
|
|
|
1303
1364
|
case 0:
|
|
1304
1365
|
return { tag: "ToRunnerPing", val: readToRunnerPing(bc) };
|
|
1305
1366
|
case 1:
|
|
1306
|
-
return { tag: "
|
|
1367
|
+
return { tag: "ToRunnerClose", val: null };
|
|
1307
1368
|
case 2:
|
|
1308
|
-
return { tag: "ToClientClose", val: null };
|
|
1309
|
-
case 3:
|
|
1310
1369
|
return { tag: "ToClientCommands", val: readToClientCommands(bc) };
|
|
1311
|
-
case
|
|
1370
|
+
case 3:
|
|
1312
1371
|
return { tag: "ToClientAckEvents", val: readToClientAckEvents(bc) };
|
|
1313
|
-
case
|
|
1314
|
-
return { tag: "ToClientKvResponse", val: readToClientKvResponse(bc) };
|
|
1315
|
-
case 6:
|
|
1372
|
+
case 4:
|
|
1316
1373
|
return { tag: "ToClientTunnelMessage", val: readToClientTunnelMessage(bc) };
|
|
1317
1374
|
default: {
|
|
1318
1375
|
bc.offset = offset;
|
|
@@ -1327,32 +1384,22 @@ function writeToRunner(bc, x) {
|
|
|
1327
1384
|
writeToRunnerPing(bc, x.val);
|
|
1328
1385
|
break;
|
|
1329
1386
|
}
|
|
1330
|
-
case "
|
|
1387
|
+
case "ToRunnerClose": {
|
|
1331
1388
|
bare.writeU8(bc, 1);
|
|
1332
|
-
writeToClientInit(bc, x.val);
|
|
1333
|
-
break;
|
|
1334
|
-
}
|
|
1335
|
-
case "ToClientClose": {
|
|
1336
|
-
bare.writeU8(bc, 2);
|
|
1337
1389
|
break;
|
|
1338
1390
|
}
|
|
1339
1391
|
case "ToClientCommands": {
|
|
1340
|
-
bare.writeU8(bc,
|
|
1392
|
+
bare.writeU8(bc, 2);
|
|
1341
1393
|
writeToClientCommands(bc, x.val);
|
|
1342
1394
|
break;
|
|
1343
1395
|
}
|
|
1344
1396
|
case "ToClientAckEvents": {
|
|
1345
|
-
bare.writeU8(bc,
|
|
1397
|
+
bare.writeU8(bc, 3);
|
|
1346
1398
|
writeToClientAckEvents(bc, x.val);
|
|
1347
1399
|
break;
|
|
1348
1400
|
}
|
|
1349
|
-
case "ToClientKvResponse": {
|
|
1350
|
-
bare.writeU8(bc, 5);
|
|
1351
|
-
writeToClientKvResponse(bc, x.val);
|
|
1352
|
-
break;
|
|
1353
|
-
}
|
|
1354
1401
|
case "ToClientTunnelMessage": {
|
|
1355
|
-
bare.writeU8(bc,
|
|
1402
|
+
bare.writeU8(bc, 4);
|
|
1356
1403
|
writeToClientTunnelMessage(bc, x.val);
|
|
1357
1404
|
break;
|
|
1358
1405
|
}
|
|
@@ -1432,11 +1479,13 @@ function decodeToGateway(bytes) {
|
|
|
1432
1479
|
}
|
|
1433
1480
|
function readToServerlessServerInit(bc) {
|
|
1434
1481
|
return {
|
|
1435
|
-
runnerId: readId(bc)
|
|
1482
|
+
runnerId: readId(bc),
|
|
1483
|
+
runnerProtocolVersion: bare.readU16(bc)
|
|
1436
1484
|
};
|
|
1437
1485
|
}
|
|
1438
1486
|
function writeToServerlessServerInit(bc, x) {
|
|
1439
1487
|
writeId(bc, x.runnerId);
|
|
1488
|
+
bare.writeU16(bc, x.runnerProtocolVersion);
|
|
1440
1489
|
}
|
|
1441
1490
|
function readToServerlessServer(bc) {
|
|
1442
1491
|
const offset = bc.offset;
|
|
@@ -1478,16 +1527,20 @@ function decodeToServerlessServer(bytes) {
|
|
|
1478
1527
|
}
|
|
1479
1528
|
export {
|
|
1480
1529
|
StopCode,
|
|
1530
|
+
decodeActorCommandKeyData,
|
|
1481
1531
|
decodeToClient,
|
|
1482
1532
|
decodeToGateway,
|
|
1483
1533
|
decodeToRunner,
|
|
1484
1534
|
decodeToServer,
|
|
1485
1535
|
decodeToServerlessServer,
|
|
1536
|
+
encodeActorCommandKeyData,
|
|
1486
1537
|
encodeToClient,
|
|
1487
1538
|
encodeToGateway,
|
|
1488
1539
|
encodeToRunner,
|
|
1489
1540
|
encodeToServer,
|
|
1490
1541
|
encodeToServerlessServer,
|
|
1542
|
+
readActorCheckpoint,
|
|
1543
|
+
readActorCommandKeyData,
|
|
1491
1544
|
readActorConfig,
|
|
1492
1545
|
readActorIntent,
|
|
1493
1546
|
readActorName,
|
|
@@ -1531,6 +1584,7 @@ export {
|
|
|
1531
1584
|
readToClientCommands,
|
|
1532
1585
|
readToClientInit,
|
|
1533
1586
|
readToClientKvResponse,
|
|
1587
|
+
readToClientPing,
|
|
1534
1588
|
readToClientRequestChunk,
|
|
1535
1589
|
readToClientRequestStart,
|
|
1536
1590
|
readToClientTunnelMessage,
|
|
@@ -1547,7 +1601,7 @@ export {
|
|
|
1547
1601
|
readToServerEvents,
|
|
1548
1602
|
readToServerInit,
|
|
1549
1603
|
readToServerKvRequest,
|
|
1550
|
-
|
|
1604
|
+
readToServerPong,
|
|
1551
1605
|
readToServerResponseChunk,
|
|
1552
1606
|
readToServerResponseStart,
|
|
1553
1607
|
readToServerTunnelMessage,
|
|
@@ -1558,6 +1612,8 @@ export {
|
|
|
1558
1612
|
readToServerWebSocketOpen,
|
|
1559
1613
|
readToServerlessServer,
|
|
1560
1614
|
readToServerlessServerInit,
|
|
1615
|
+
writeActorCheckpoint,
|
|
1616
|
+
writeActorCommandKeyData,
|
|
1561
1617
|
writeActorConfig,
|
|
1562
1618
|
writeActorIntent,
|
|
1563
1619
|
writeActorName,
|
|
@@ -1601,6 +1657,7 @@ export {
|
|
|
1601
1657
|
writeToClientCommands,
|
|
1602
1658
|
writeToClientInit,
|
|
1603
1659
|
writeToClientKvResponse,
|
|
1660
|
+
writeToClientPing,
|
|
1604
1661
|
writeToClientRequestChunk,
|
|
1605
1662
|
writeToClientRequestStart,
|
|
1606
1663
|
writeToClientTunnelMessage,
|
|
@@ -1617,7 +1674,7 @@ export {
|
|
|
1617
1674
|
writeToServerEvents,
|
|
1618
1675
|
writeToServerInit,
|
|
1619
1676
|
writeToServerKvRequest,
|
|
1620
|
-
|
|
1677
|
+
writeToServerPong,
|
|
1621
1678
|
writeToServerResponseChunk,
|
|
1622
1679
|
writeToServerResponseStart,
|
|
1623
1680
|
writeToServerTunnelMessage,
|