@rivetkit/engine-runner-protocol 2.0.26 → 2.0.28

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
@@ -180,6 +180,7 @@ declare function readActorConfig(bc: bare.ByteCursor): ActorConfig;
180
180
  declare function writeActorConfig(bc: bare.ByteCursor, x: ActorConfig): void;
181
181
  type ActorCheckpoint = {
182
182
  readonly actorId: Id;
183
+ readonly generation: u32;
183
184
  readonly index: i64;
184
185
  };
185
186
  declare function readActorCheckpoint(bc: bare.ByteCursor): ActorCheckpoint;
@@ -221,22 +222,16 @@ declare function writeActorState(bc: bare.ByteCursor, x: ActorState): void;
221
222
  * MARK: Events
222
223
  */
223
224
  type EventActorIntent = {
224
- readonly actorId: Id;
225
- readonly generation: u32;
226
225
  readonly intent: ActorIntent;
227
226
  };
228
227
  declare function readEventActorIntent(bc: bare.ByteCursor): EventActorIntent;
229
228
  declare function writeEventActorIntent(bc: bare.ByteCursor, x: EventActorIntent): void;
230
229
  type EventActorStateUpdate = {
231
- readonly actorId: Id;
232
- readonly generation: u32;
233
230
  readonly state: ActorState;
234
231
  };
235
232
  declare function readEventActorStateUpdate(bc: bare.ByteCursor): EventActorStateUpdate;
236
233
  declare function writeEventActorStateUpdate(bc: bare.ByteCursor, x: EventActorStateUpdate): void;
237
234
  type EventActorSetAlarm = {
238
- readonly actorId: Id;
239
- readonly generation: u32;
240
235
  readonly alarmTs: i64 | null;
241
236
  };
242
237
  declare function readEventActorSetAlarm(bc: bare.ByteCursor): EventActorSetAlarm;
@@ -266,17 +261,12 @@ type HibernatingRequest = {
266
261
  declare function readHibernatingRequest(bc: bare.ByteCursor): HibernatingRequest;
267
262
  declare function writeHibernatingRequest(bc: bare.ByteCursor, x: HibernatingRequest): void;
268
263
  type CommandStartActor = {
269
- readonly generation: u32;
270
264
  readonly config: ActorConfig;
271
265
  readonly hibernatingRequests: readonly HibernatingRequest[];
272
266
  };
273
267
  declare function readCommandStartActor(bc: bare.ByteCursor): CommandStartActor;
274
268
  declare function writeCommandStartActor(bc: bare.ByteCursor, x: CommandStartActor): void;
275
- type CommandStopActor = {
276
- readonly generation: u32;
277
- };
278
- declare function readCommandStopActor(bc: bare.ByteCursor): CommandStopActor;
279
- declare function writeCommandStopActor(bc: bare.ByteCursor, x: CommandStopActor): void;
269
+ type CommandStopActor = null;
280
270
  type Command = {
281
271
  readonly tag: "CommandStartActor";
282
272
  readonly val: CommandStartActor;
@@ -669,4 +659,4 @@ declare function writeToServerlessServer(bc: bare.ByteCursor, x: ToServerlessSer
669
659
  declare function encodeToServerlessServer(x: ToServerlessServer, config?: Partial<bare.Config>): Uint8Array;
670
660
  declare function decodeToServerlessServer(bytes: Uint8Array): ToServerlessServer;
671
661
 
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 };
662
+ 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, 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, 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
@@ -424,11 +424,13 @@ function writeActorConfig(bc, x) {
424
424
  function readActorCheckpoint(bc) {
425
425
  return {
426
426
  actorId: readId(bc),
427
+ generation: bare.readU32(bc),
427
428
  index: bare.readI64(bc)
428
429
  };
429
430
  }
430
431
  function writeActorCheckpoint(bc, x) {
431
432
  writeId(bc, x.actorId);
433
+ bare.writeU32(bc, x.generation);
432
434
  bare.writeI64(bc, x.index);
433
435
  }
434
436
  function readActorIntent(bc) {
@@ -496,26 +498,18 @@ function writeActorState(bc, x) {
496
498
  }
497
499
  function readEventActorIntent(bc) {
498
500
  return {
499
- actorId: readId(bc),
500
- generation: bare.readU32(bc),
501
501
  intent: readActorIntent(bc)
502
502
  };
503
503
  }
504
504
  function writeEventActorIntent(bc, x) {
505
- writeId(bc, x.actorId);
506
- bare.writeU32(bc, x.generation);
507
505
  writeActorIntent(bc, x.intent);
508
506
  }
509
507
  function readEventActorStateUpdate(bc) {
510
508
  return {
511
- actorId: readId(bc),
512
- generation: bare.readU32(bc),
513
509
  state: readActorState(bc)
514
510
  };
515
511
  }
516
512
  function writeEventActorStateUpdate(bc, x) {
517
- writeId(bc, x.actorId);
518
- bare.writeU32(bc, x.generation);
519
513
  writeActorState(bc, x.state);
520
514
  }
521
515
  function read7(bc) {
@@ -529,14 +523,10 @@ function write7(bc, x) {
529
523
  }
530
524
  function readEventActorSetAlarm(bc) {
531
525
  return {
532
- actorId: readId(bc),
533
- generation: bare.readU32(bc),
534
526
  alarmTs: read7(bc)
535
527
  };
536
528
  }
537
529
  function writeEventActorSetAlarm(bc, x) {
538
- writeId(bc, x.actorId);
539
- bare.writeU32(bc, x.generation);
540
530
  write7(bc, x.alarmTs);
541
531
  }
542
532
  function readEvent(bc) {
@@ -613,24 +603,14 @@ function write8(bc, x) {
613
603
  }
614
604
  function readCommandStartActor(bc) {
615
605
  return {
616
- generation: bare.readU32(bc),
617
606
  config: readActorConfig(bc),
618
607
  hibernatingRequests: read8(bc)
619
608
  };
620
609
  }
621
610
  function writeCommandStartActor(bc, x) {
622
- bare.writeU32(bc, x.generation);
623
611
  writeActorConfig(bc, x.config);
624
612
  write8(bc, x.hibernatingRequests);
625
613
  }
626
- function readCommandStopActor(bc) {
627
- return {
628
- generation: bare.readU32(bc)
629
- };
630
- }
631
- function writeCommandStopActor(bc, x) {
632
- bare.writeU32(bc, x.generation);
633
- }
634
614
  function readCommand(bc) {
635
615
  const offset = bc.offset;
636
616
  const tag = bare.readU8(bc);
@@ -638,7 +618,7 @@ function readCommand(bc) {
638
618
  case 0:
639
619
  return { tag: "CommandStartActor", val: readCommandStartActor(bc) };
640
620
  case 1:
641
- return { tag: "CommandStopActor", val: readCommandStopActor(bc) };
621
+ return { tag: "CommandStopActor", val: null };
642
622
  default: {
643
623
  bc.offset = offset;
644
624
  throw new bare.BareError(offset, "invalid tag");
@@ -654,7 +634,6 @@ function writeCommand(bc, x) {
654
634
  }
655
635
  case "CommandStopActor": {
656
636
  bare.writeU8(bc, 1);
657
- writeCommandStopActor(bc, x.val);
658
637
  break;
659
638
  }
660
639
  }
@@ -676,7 +655,7 @@ function readActorCommandKeyData(bc) {
676
655
  case 0:
677
656
  return { tag: "CommandStartActor", val: readCommandStartActor(bc) };
678
657
  case 1:
679
- return { tag: "CommandStopActor", val: readCommandStopActor(bc) };
658
+ return { tag: "CommandStopActor", val: null };
680
659
  default: {
681
660
  bc.offset = offset;
682
661
  throw new bare.BareError(offset, "invalid tag");
@@ -692,7 +671,6 @@ function writeActorCommandKeyData(bc, x) {
692
671
  }
693
672
  case "CommandStopActor": {
694
673
  bare.writeU8(bc, 1);
695
- writeCommandStopActor(bc, x.val);
696
674
  break;
697
675
  }
698
676
  }
@@ -1548,7 +1526,6 @@ export {
1548
1526
  readActorStateStopped,
1549
1527
  readCommand,
1550
1528
  readCommandStartActor,
1551
- readCommandStopActor,
1552
1529
  readCommandWrapper,
1553
1530
  readEvent,
1554
1531
  readEventActorIntent,
@@ -1621,7 +1598,6 @@ export {
1621
1598
  writeActorStateStopped,
1622
1599
  writeCommand,
1623
1600
  writeCommandStartActor,
1624
- writeCommandStopActor,
1625
1601
  writeCommandWrapper,
1626
1602
  writeEvent,
1627
1603
  writeEventActorIntent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/engine-runner-protocol",
3
- "version": "2.0.26",
3
+ "version": "2.0.28",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {