rivetkit 2.1.4 → 2.1.6

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.
Files changed (72) hide show
  1. package/dist/browser/client.js +1 -1
  2. package/dist/browser/client.js.map +1 -1
  3. package/dist/browser/inspector/client.js +1 -1
  4. package/dist/browser/inspector/client.js.map +1 -1
  5. package/dist/inspector.tar.gz +0 -0
  6. package/dist/tsup/{chunk-4KSHPFXF.cjs → chunk-2Q5WS6QH.cjs} +3 -4
  7. package/dist/tsup/chunk-2Q5WS6QH.cjs.map +1 -0
  8. package/dist/tsup/{chunk-H5TSEPN4.cjs → chunk-4YFX2SP2.cjs} +30 -30
  9. package/dist/tsup/{chunk-H5TSEPN4.cjs.map → chunk-4YFX2SP2.cjs.map} +1 -1
  10. package/dist/tsup/{chunk-GXRVSSVD.cjs → chunk-7ANRFQJK.cjs} +20 -20
  11. package/dist/tsup/{chunk-GXRVSSVD.cjs.map → chunk-7ANRFQJK.cjs.map} +1 -1
  12. package/dist/tsup/{chunk-I6PL6QIY.js → chunk-DOEWKM5V.js} +5 -5
  13. package/dist/tsup/{chunk-QPADHLDU.cjs → chunk-DSXC3S7Q.cjs} +3 -3
  14. package/dist/tsup/{chunk-QPADHLDU.cjs.map → chunk-DSXC3S7Q.cjs.map} +1 -1
  15. package/dist/tsup/{chunk-5UEFNG7P.js → chunk-ELCI2QTU.js} +2 -2
  16. package/dist/tsup/{chunk-TEUL4UYN.cjs → chunk-GRHLSP4A.cjs} +152 -152
  17. package/dist/tsup/{chunk-TEUL4UYN.cjs.map → chunk-GRHLSP4A.cjs.map} +1 -1
  18. package/dist/tsup/{chunk-LK36OGGO.cjs → chunk-GVBTEL2D.cjs} +3 -3
  19. package/dist/tsup/{chunk-LK36OGGO.cjs.map → chunk-GVBTEL2D.cjs.map} +1 -1
  20. package/dist/tsup/{chunk-DZXDUGLL.js → chunk-ITLKCAXM.js} +2 -3
  21. package/dist/tsup/{chunk-DZXDUGLL.js.map → chunk-ITLKCAXM.js.map} +1 -1
  22. package/dist/tsup/{chunk-AQD4CBZ2.cjs → chunk-J45S63Q5.cjs} +4 -4
  23. package/dist/tsup/{chunk-AQD4CBZ2.cjs.map → chunk-J45S63Q5.cjs.map} +1 -1
  24. package/dist/tsup/{chunk-TEFYRRAK.js → chunk-K7JTZNLG.js} +4 -4
  25. package/dist/tsup/{chunk-3GTO6H3E.js → chunk-KARQFHQH.js} +4 -4
  26. package/dist/tsup/{chunk-KTWY3K6Z.js → chunk-KJXZTBFN.js} +5 -5
  27. package/dist/tsup/{chunk-M6H4XIF4.js → chunk-KTQKZOGC.js} +110 -110
  28. package/dist/tsup/chunk-KTQKZOGC.js.map +1 -0
  29. package/dist/tsup/{chunk-HBYEYBIC.js → chunk-PB5QRAQX.js} +2 -2
  30. package/dist/tsup/{chunk-ANKZ2FS6.js → chunk-SFC4YXTL.js} +2 -2
  31. package/dist/tsup/{chunk-3B6PCYJB.cjs → chunk-TTVNEKBE.cjs} +81 -81
  32. package/dist/tsup/{chunk-3B6PCYJB.cjs.map → chunk-TTVNEKBE.cjs.map} +1 -1
  33. package/dist/tsup/{chunk-HKOSZKKZ.cjs → chunk-VQHUWB37.cjs} +192 -192
  34. package/dist/tsup/chunk-VQHUWB37.cjs.map +1 -0
  35. package/dist/tsup/{chunk-UDMRZR6A.js → chunk-W735O34B.js} +3 -3
  36. package/dist/tsup/{chunk-UWAGLDT6.cjs → chunk-Z2X3VVCS.cjs} +235 -235
  37. package/dist/tsup/{chunk-UWAGLDT6.cjs.map → chunk-Z2X3VVCS.cjs.map} +1 -1
  38. package/dist/tsup/client/mod.cjs +6 -6
  39. package/dist/tsup/client/mod.js +5 -5
  40. package/dist/tsup/common/log.cjs +2 -2
  41. package/dist/tsup/common/log.js +1 -1
  42. package/dist/tsup/common/websocket.cjs +3 -3
  43. package/dist/tsup/common/websocket.js +2 -2
  44. package/dist/tsup/driver-helpers/mod.cjs +4 -4
  45. package/dist/tsup/driver-helpers/mod.js +3 -3
  46. package/dist/tsup/driver-test-suite/mod.cjs +60 -60
  47. package/dist/tsup/driver-test-suite/mod.js +10 -10
  48. package/dist/tsup/inspector/mod.cjs +3 -3
  49. package/dist/tsup/inspector/mod.js +2 -2
  50. package/dist/tsup/mod.cjs +8 -8
  51. package/dist/tsup/mod.js +7 -7
  52. package/dist/tsup/serve-test-suite/mod.cjs +102 -102
  53. package/dist/tsup/serve-test-suite/mod.js +10 -10
  54. package/dist/tsup/test/mod.cjs +10 -10
  55. package/dist/tsup/test/mod.js +6 -6
  56. package/dist/tsup/utils.cjs +2 -2
  57. package/dist/tsup/utils.js +1 -1
  58. package/dist/tsup/workflow/mod.cjs +5 -5
  59. package/dist/tsup/workflow/mod.js +4 -4
  60. package/package.json +5 -5
  61. package/src/registry/index.ts +4 -4
  62. package/dist/tsup/chunk-4KSHPFXF.cjs.map +0 -1
  63. package/dist/tsup/chunk-HKOSZKKZ.cjs.map +0 -1
  64. package/dist/tsup/chunk-M6H4XIF4.js.map +0 -1
  65. /package/dist/tsup/{chunk-I6PL6QIY.js.map → chunk-DOEWKM5V.js.map} +0 -0
  66. /package/dist/tsup/{chunk-5UEFNG7P.js.map → chunk-ELCI2QTU.js.map} +0 -0
  67. /package/dist/tsup/{chunk-TEFYRRAK.js.map → chunk-K7JTZNLG.js.map} +0 -0
  68. /package/dist/tsup/{chunk-3GTO6H3E.js.map → chunk-KARQFHQH.js.map} +0 -0
  69. /package/dist/tsup/{chunk-KTWY3K6Z.js.map → chunk-KJXZTBFN.js.map} +0 -0
  70. /package/dist/tsup/{chunk-HBYEYBIC.js.map → chunk-PB5QRAQX.js.map} +0 -0
  71. /package/dist/tsup/{chunk-ANKZ2FS6.js.map → chunk-SFC4YXTL.js.map} +0 -0
  72. /package/dist/tsup/{chunk-UDMRZR6A.js.map → chunk-W735O34B.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class; var _class2;
2
2
 
3
- var _chunkTEUL4UYNcjs = require('./chunk-TEUL4UYN.cjs');
3
+ var _chunkGRHLSP4Acjs = require('./chunk-GRHLSP4A.cjs');
4
4
 
5
5
 
6
6
 
@@ -48,7 +48,7 @@ var _chunkTEUL4UYNcjs = require('./chunk-TEUL4UYN.cjs');
48
48
 
49
49
 
50
50
 
51
- var _chunk3B6PCYJBcjs = require('./chunk-3B6PCYJB.cjs');
51
+ var _chunkTTVNEKBEcjs = require('./chunk-TTVNEKBE.cjs');
52
52
 
53
53
 
54
54
 
@@ -69,7 +69,7 @@ var _chunk3B6PCYJBcjs = require('./chunk-3B6PCYJB.cjs');
69
69
 
70
70
 
71
71
 
72
- var _chunkLK36OGGOcjs = require('./chunk-LK36OGGO.cjs');
72
+ var _chunkGVBTEL2Dcjs = require('./chunk-GVBTEL2D.cjs');
73
73
 
74
74
 
75
75
 
@@ -86,7 +86,7 @@ var _chunkLK36OGGOcjs = require('./chunk-LK36OGGO.cjs');
86
86
 
87
87
 
88
88
 
89
- var _chunk4KSHPFXFcjs = require('./chunk-4KSHPFXF.cjs');
89
+ var _chunk2Q5WS6QHcjs = require('./chunk-2Q5WS6QH.cjs');
90
90
 
91
91
 
92
92
 
@@ -124,7 +124,7 @@ var ActorInspector = (_class = class {
124
124
  this.actor = actor;
125
125
  var _a, _b;
126
126
  this.#lastQueueSize = _nullishCoalesce(((_a = actor.queueManager) == null ? void 0 : _a.size), () => ( 0));
127
- const runInspector = _chunkLK36OGGOcjs.getRunInspectorConfig.call(void 0, actor.config.run);
127
+ const runInspector = _chunkGVBTEL2Dcjs.getRunInspectorConfig.call(void 0, actor.config.run);
128
128
  this.#workflowInspector = runInspector == null ? void 0 : runInspector.workflow;
129
129
  if ((_b = this.#workflowInspector) == null ? void 0 : _b.onHistoryUpdated) {
130
130
  this.#workflowInspector.onHistoryUpdated((history) => {
@@ -218,7 +218,7 @@ var ActorInspector = (_class = class {
218
218
  records: _nullishCoalesce(((_a = countResult == null ? void 0 : countResult[0]) == null ? void 0 : _a.count), () => ( 0))
219
219
  });
220
220
  }
221
- return _chunk4KSHPFXFcjs.bufferToArrayBuffer.call(void 0, cbor.encode({ tables: tableInfos }));
221
+ return _chunk2Q5WS6QHcjs.bufferToArrayBuffer.call(void 0, cbor.encode({ tables: tableInfos }));
222
222
  }
223
223
  async getDatabaseTableRows(table, limit, offset) {
224
224
  if (!this.isDatabaseEnabled()) {
@@ -233,7 +233,7 @@ var ActorInspector = (_class = class {
233
233
  safeLimit,
234
234
  safeOffset
235
235
  );
236
- return _chunk4KSHPFXFcjs.bufferToArrayBuffer.call(void 0, cbor.encode(result));
236
+ return _chunk2Q5WS6QHcjs.bufferToArrayBuffer.call(void 0, cbor.encode(result));
237
237
  }
238
238
  isStateEnabled() {
239
239
  return this.actor.stateEnabled;
@@ -242,7 +242,7 @@ var ActorInspector = (_class = class {
242
242
  if (!this.actor.stateEnabled) {
243
243
  throw new (0, _chunkL47L3ZWJcjs.StateNotEnabled)();
244
244
  }
245
- return _chunk4KSHPFXFcjs.bufferToArrayBuffer.call(void 0,
245
+ return _chunk2Q5WS6QHcjs.bufferToArrayBuffer.call(void 0,
246
246
  cbor.encode(this.actor.stateManager.persistRaw.state)
247
247
  );
248
248
  }
@@ -254,13 +254,13 @@ var ActorInspector = (_class = class {
254
254
  this.actor.connectionManager.connections.entries()
255
255
  ).map(([id, conn]) => {
256
256
  var _a, _b;
257
- const connStateManager = conn[_chunk3B6PCYJBcjs.CONN_STATE_MANAGER_SYMBOL];
257
+ const connStateManager = conn[_chunkTTVNEKBEcjs.CONN_STATE_MANAGER_SYMBOL];
258
258
  return {
259
- type: (_a = conn[_chunk3B6PCYJBcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _a.type,
259
+ type: (_a = conn[_chunkTTVNEKBEcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _a.type,
260
260
  id,
261
- details: _chunk4KSHPFXFcjs.bufferToArrayBuffer.call(void 0,
261
+ details: _chunk2Q5WS6QHcjs.bufferToArrayBuffer.call(void 0,
262
262
  cbor.encode({
263
- type: (_b = conn[_chunk3B6PCYJBcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _b.type,
263
+ type: (_b = conn[_chunkTTVNEKBEcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _b.type,
264
264
  params: conn.params,
265
265
  stateEnabled: connStateManager.stateEnabled,
266
266
  state: connStateManager.stateEnabled ? connStateManager.state : void 0,
@@ -282,7 +282,7 @@ var ActorInspector = (_class = class {
282
282
  }
283
283
  async executeAction(name, params) {
284
284
  const conn = await this.actor.connectionManager.prepareAndConnectConn(
285
- _chunk3B6PCYJBcjs.createHttpDriver.call(void 0, ),
285
+ _chunkTTVNEKBEcjs.createHttpDriver.call(void 0, ),
286
286
  // TODO: This may cause issues
287
287
  void 0,
288
288
  void 0,
@@ -290,10 +290,10 @@ var ActorInspector = (_class = class {
290
290
  void 0
291
291
  );
292
292
  try {
293
- return _chunk4KSHPFXFcjs.bufferToArrayBuffer.call(void 0,
293
+ return _chunk2Q5WS6QHcjs.bufferToArrayBuffer.call(void 0,
294
294
  cbor.encode(
295
295
  await this.actor.executeAction(
296
- new (0, _chunk3B6PCYJBcjs.ActionContext)(this.actor, conn),
296
+ new (0, _chunkTTVNEKBEcjs.ActionContext)(this.actor, conn),
297
297
  name,
298
298
  cbor.decode(Buffer.from(params))
299
299
  )
@@ -323,12 +323,12 @@ var ActorInspector = (_class = class {
323
323
  this.actor.connectionManager.connections.entries()
324
324
  ).map(([id, conn]) => {
325
325
  var _a, _b;
326
- const connStateManager = conn[_chunk3B6PCYJBcjs.CONN_STATE_MANAGER_SYMBOL];
326
+ const connStateManager = conn[_chunkTTVNEKBEcjs.CONN_STATE_MANAGER_SYMBOL];
327
327
  return {
328
- type: (_a = conn[_chunk3B6PCYJBcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _a.type,
328
+ type: (_a = conn[_chunkTTVNEKBEcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _a.type,
329
329
  id,
330
330
  details: {
331
- type: (_b = conn[_chunk3B6PCYJBcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _b.type,
331
+ type: (_b = conn[_chunkTTVNEKBEcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _b.type,
332
332
  params: conn.params,
333
333
  stateEnabled: connStateManager.stateEnabled,
334
334
  state: connStateManager.stateEnabled ? connStateManager.state : void 0,
@@ -340,7 +340,7 @@ var ActorInspector = (_class = class {
340
340
  }
341
341
  async executeActionJson(name, args) {
342
342
  const conn = await this.actor.connectionManager.prepareAndConnectConn(
343
- _chunk3B6PCYJBcjs.createHttpDriver.call(void 0, ),
343
+ _chunkTTVNEKBEcjs.createHttpDriver.call(void 0, ),
344
344
  void 0,
345
345
  void 0,
346
346
  void 0,
@@ -348,7 +348,7 @@ var ActorInspector = (_class = class {
348
348
  );
349
349
  try {
350
350
  return await this.actor.executeAction(
351
- new (0, _chunk3B6PCYJBcjs.ActionContext)(this.actor, conn),
351
+ new (0, _chunkTTVNEKBEcjs.ActionContext)(this.actor, conn),
352
352
  name,
353
353
  args
354
354
  );
@@ -391,8 +391,8 @@ function escapeDoubleQuotes(value) {
391
391
  function convertConnToBarePersistedConn(persist) {
392
392
  return {
393
393
  id: persist.id,
394
- parameters: _chunk4KSHPFXFcjs.bufferToArrayBuffer.call(void 0, cbor2.encode(persist.parameters)),
395
- state: _chunk4KSHPFXFcjs.bufferToArrayBuffer.call(void 0, cbor2.encode(persist.state)),
394
+ parameters: _chunk2Q5WS6QHcjs.bufferToArrayBuffer.call(void 0, cbor2.encode(persist.parameters)),
395
+ state: _chunk2Q5WS6QHcjs.bufferToArrayBuffer.call(void 0, cbor2.encode(persist.state)),
396
396
  subscriptions: persist.subscriptions.map((sub) => ({
397
397
  eventName: sub.eventName
398
398
  })),
@@ -484,7 +484,7 @@ var ConnectionManager = class {
484
484
  return this.#reconnectHibernatableConn(driver);
485
485
  }
486
486
  if (this.#actor.config.onBeforeConnect) {
487
- const ctx = new (0, _chunk3B6PCYJBcjs.BeforeConnectContext)(this.#actor, request);
487
+ const ctx = new (0, _chunkTTVNEKBEcjs.BeforeConnectContext)(this.#actor, request);
488
488
  await this.#actor.runInTraceSpan(
489
489
  "actor.onBeforeConnect",
490
490
  {
@@ -530,8 +530,8 @@ var ConnectionManager = class {
530
530
  }
531
531
  };
532
532
  }
533
- const conn = new (0, _chunk3B6PCYJBcjs.Conn)(this.#actor, connData);
534
- conn[_chunk3B6PCYJBcjs.CONN_DRIVER_SYMBOL] = driver;
533
+ const conn = new (0, _chunkTTVNEKBEcjs.Conn)(this.#actor, connData);
534
+ conn[_chunkTTVNEKBEcjs.CONN_DRIVER_SYMBOL] = driver;
535
535
  return conn;
536
536
  }
537
537
  /**
@@ -554,15 +554,15 @@ var ConnectionManager = class {
554
554
  this.#callOnConnect(conn);
555
555
  this.#actor.inspector.emitter.emit("connectionsUpdated");
556
556
  this.#actor.resetSleepTimer();
557
- conn[_chunk3B6PCYJBcjs.CONN_CONNECTED_SYMBOL] = true;
558
- if (conn[_chunk3B6PCYJBcjs.CONN_SPEAKS_RIVETKIT_SYMBOL]) {
557
+ conn[_chunkTTVNEKBEcjs.CONN_CONNECTED_SYMBOL] = true;
558
+ if (conn[_chunkTTVNEKBEcjs.CONN_SPEAKS_RIVETKIT_SYMBOL]) {
559
559
  const initData = { actorId: this.#actor.id, connectionId: conn.id };
560
- conn[_chunk3B6PCYJBcjs.CONN_SEND_MESSAGE_SYMBOL](
561
- new (0, _chunk3B6PCYJBcjs.CachedSerializer)(
560
+ conn[_chunkTTVNEKBEcjs.CONN_SEND_MESSAGE_SYMBOL](
561
+ new (0, _chunkTTVNEKBEcjs.CachedSerializer)(
562
562
  initData,
563
- _chunk3B6PCYJBcjs.TO_CLIENT_VERSIONED,
564
- _chunk3B6PCYJBcjs.CURRENT_VERSION,
565
- _chunk3B6PCYJBcjs.ToClientSchema,
563
+ _chunkTTVNEKBEcjs.TO_CLIENT_VERSIONED,
564
+ _chunkTTVNEKBEcjs.CURRENT_VERSION,
565
+ _chunkTTVNEKBEcjs.ToClientSchema,
566
566
  // JSON: identity conversion (no nested data to encode)
567
567
  (value) => ({
568
568
  body: {
@@ -595,17 +595,17 @@ var ConnectionManager = class {
595
595
  msg: "reconnecting hibernatable websocket connection",
596
596
  connectionId: existingConn.id
597
597
  });
598
- if (existingConn[_chunk3B6PCYJBcjs.CONN_DRIVER_SYMBOL]) {
598
+ if (existingConn[_chunkTTVNEKBEcjs.CONN_DRIVER_SYMBOL]) {
599
599
  this.#disconnectExistingDriver(existingConn);
600
600
  }
601
- existingConn[_chunk3B6PCYJBcjs.CONN_DRIVER_SYMBOL] = driver;
601
+ existingConn[_chunkTTVNEKBEcjs.CONN_DRIVER_SYMBOL] = driver;
602
602
  this.#actor.resetSleepTimer();
603
- existingConn[_chunk3B6PCYJBcjs.CONN_CONNECTED_SYMBOL] = true;
603
+ existingConn[_chunkTTVNEKBEcjs.CONN_CONNECTED_SYMBOL] = true;
604
604
  this.#actor.inspector.emitter.emit("connectionsUpdated");
605
605
  return existingConn;
606
606
  }
607
607
  #disconnectExistingDriver(conn) {
608
- const driver = conn[_chunk3B6PCYJBcjs.CONN_DRIVER_SYMBOL];
608
+ const driver = conn[_chunkTTVNEKBEcjs.CONN_DRIVER_SYMBOL];
609
609
  if (driver == null ? void 0 : driver.disconnect) {
610
610
  driver.disconnect(
611
611
  this.#actor,
@@ -633,7 +633,7 @@ var ConnectionManager = class {
633
633
  this.#pendingDisconnectCount += 1;
634
634
  const attributes = {
635
635
  "rivet.conn.id": conn.id,
636
- "rivet.conn.type": (_a = conn[_chunk3B6PCYJBcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _a.type,
636
+ "rivet.conn.type": (_a = conn[_chunkTTVNEKBEcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _a.type,
637
637
  "rivet.conn.hibernatable": conn.isHibernatable
638
638
  };
639
639
  const span = this.#actor.startTraceSpan(
@@ -669,16 +669,16 @@ var ConnectionManager = class {
669
669
  } catch (error) {
670
670
  this.#actor.endTraceSpan(span, {
671
671
  code: "ERROR",
672
- message: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
672
+ message: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
673
673
  });
674
674
  this.#actor.rLog.error({
675
675
  msg: "error in `onDisconnect`",
676
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
676
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
677
677
  });
678
678
  } finally {
679
679
  this.#connsWithPersistChanged.delete(conn.id);
680
680
  if (conn.isHibernatable) {
681
- const key = _chunkLK36OGGOcjs.makeConnKey.call(void 0, conn.id);
681
+ const key = _chunkGVBTEL2Dcjs.makeConnKey.call(void 0, conn.id);
682
682
  try {
683
683
  await this.#actor.driver.kvBatchDelete(this.#actor.id, [key]);
684
684
  this.#actor.rLog.debug({
@@ -688,7 +688,7 @@ var ConnectionManager = class {
688
688
  } catch (err) {
689
689
  this.#actor.rLog.error({
690
690
  msg: "kvBatchDelete failed for conn",
691
- err: _chunk4KSHPFXFcjs.stringifyError.call(void 0, err)
691
+ err: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, err)
692
692
  });
693
693
  }
694
694
  }
@@ -701,7 +701,7 @@ var ConnectionManager = class {
701
701
  }
702
702
  async cleanupPersistedHibernatableConnections(reason) {
703
703
  const staleConnections = Array.from(this.#connections.values()).filter(
704
- (conn) => conn.isHibernatable && conn[_chunk3B6PCYJBcjs.CONN_DRIVER_SYMBOL] === void 0
704
+ (conn) => conn.isHibernatable && conn[_chunkTTVNEKBEcjs.CONN_DRIVER_SYMBOL] === void 0
705
705
  );
706
706
  if (staleConnections.length === 0) {
707
707
  return 0;
@@ -738,7 +738,7 @@ var ConnectionManager = class {
738
738
  */
739
739
  restoreConnections(connections) {
740
740
  for (const connPersist of connections) {
741
- const conn = new (0, _chunk3B6PCYJBcjs.Conn)(this.#actor, {
741
+ const conn = new (0, _chunkTTVNEKBEcjs.Conn)(this.#actor, {
742
742
  hibernatable: connPersist
743
743
  });
744
744
  this.#connections.set(conn.id, conn);
@@ -757,22 +757,22 @@ var ConnectionManager = class {
757
757
  // MARK: - Private Helpers
758
758
  findHibernatableConn(gatewayIdBuf, requestIdBuf) {
759
759
  return Array.from(this.#connections.values()).find((conn) => {
760
- const connStateManager = conn[_chunk3B6PCYJBcjs.CONN_STATE_MANAGER_SYMBOL];
760
+ const connStateManager = conn[_chunkTTVNEKBEcjs.CONN_STATE_MANAGER_SYMBOL];
761
761
  const h = connStateManager.hibernatableDataRaw;
762
- return h && _chunk4KSHPFXFcjs.arrayBuffersEqual.call(void 0, h.gatewayId, gatewayIdBuf) && _chunk4KSHPFXFcjs.arrayBuffersEqual.call(void 0, h.requestId, requestIdBuf);
762
+ return h && _chunk2Q5WS6QHcjs.arrayBuffersEqual.call(void 0, h.gatewayId, gatewayIdBuf) && _chunk2Q5WS6QHcjs.arrayBuffersEqual.call(void 0, h.requestId, requestIdBuf);
763
763
  });
764
764
  }
765
765
  async #createConnState(params, request) {
766
766
  if ("createConnState" in this.#actor.config) {
767
767
  const createConnState = this.#actor.config.createConnState;
768
- const ctx = new (0, _chunk3B6PCYJBcjs.CreateConnStateContext)(this.#actor, request);
768
+ const ctx = new (0, _chunkTTVNEKBEcjs.CreateConnStateContext)(this.#actor, request);
769
769
  return await this.#actor.runInTraceSpan(
770
770
  "actor.createConnState",
771
771
  void 0,
772
772
  () => {
773
773
  const dataOrPromise = createConnState(ctx, params);
774
774
  if (dataOrPromise instanceof Promise) {
775
- return _chunkLK36OGGOcjs.deadline.call(void 0,
775
+ return _chunkGVBTEL2Dcjs.deadline.call(void 0,
776
776
  dataOrPromise,
777
777
  this.#actor.config.options.createConnStateTimeout
778
778
  );
@@ -791,13 +791,13 @@ var ConnectionManager = class {
791
791
  var _a;
792
792
  const attributes = {
793
793
  "rivet.conn.id": conn.id,
794
- "rivet.conn.type": (_a = conn[_chunk3B6PCYJBcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _a.type,
794
+ "rivet.conn.type": (_a = conn[_chunkTTVNEKBEcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _a.type,
795
795
  "rivet.conn.hibernatable": conn.isHibernatable
796
796
  };
797
797
  const span = this.#actor.startTraceSpan("actor.onConnect", attributes);
798
798
  try {
799
799
  if (this.#actor.config.onConnect) {
800
- const ctx = new (0, _chunk3B6PCYJBcjs.ConnectContext)(this.#actor, conn);
800
+ const ctx = new (0, _chunkTTVNEKBEcjs.ConnectContext)(this.#actor, conn);
801
801
  const result = this.#actor.traces.withSpan(
802
802
  span,
803
803
  () => this.#actor.config.onConnect(ctx, conn)
@@ -808,7 +808,7 @@ var ConnectionManager = class {
808
808
  span
809
809
  );
810
810
  if (result instanceof Promise) {
811
- _chunkLK36OGGOcjs.deadline.call(void 0,
811
+ _chunkGVBTEL2Dcjs.deadline.call(void 0,
812
812
  result,
813
813
  this.#actor.config.options.onConnectTimeout
814
814
  ).then(() => {
@@ -816,7 +816,7 @@ var ConnectionManager = class {
816
816
  }).catch((error) => {
817
817
  this.#actor.endTraceSpan(span, {
818
818
  code: "ERROR",
819
- message: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
819
+ message: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
820
820
  });
821
821
  this.#actor.rLog.error({
822
822
  msg: "error in `onConnect`, closing socket",
@@ -832,11 +832,11 @@ var ConnectionManager = class {
832
832
  } catch (error) {
833
833
  this.#actor.endTraceSpan(span, {
834
834
  code: "ERROR",
835
- message: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
835
+ message: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
836
836
  });
837
837
  this.#actor.rLog.error({
838
838
  msg: "error in `onConnect`",
839
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
839
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
840
840
  });
841
841
  conn == null ? void 0 : conn.disconnect("`onConnect` failed");
842
842
  }
@@ -876,7 +876,7 @@ var EventManager = class {
876
876
  }
877
877
  subscribers.add(connection);
878
878
  if (!fromPersist) {
879
- connection[_chunk3B6PCYJBcjs.CONN_STATE_MANAGER_SYMBOL].addSubscription({
879
+ connection[_chunkTTVNEKBEcjs.CONN_STATE_MANAGER_SYMBOL].addSubscription({
880
880
  eventName
881
881
  });
882
882
  this.#actor.stateManager.saveState({ immediate: true });
@@ -913,7 +913,7 @@ var EventManager = class {
913
913
  }
914
914
  }
915
915
  if (!fromRemoveConn) {
916
- const removed = connection[_chunk3B6PCYJBcjs.CONN_STATE_MANAGER_SYMBOL].removeSubscription({ eventName });
916
+ const removed = connection[_chunkTTVNEKBEcjs.CONN_STATE_MANAGER_SYMBOL].removeSubscription({ eventName });
917
917
  if (!removed) {
918
918
  this.#actor.rLog.warn({
919
919
  msg: "subscription does not exist in persist",
@@ -951,11 +951,11 @@ var EventManager = class {
951
951
  "rivet.broadcast.subscribers": subscribers.size
952
952
  });
953
953
  const eventData = { name, args };
954
- const toClientSerializer = new (0, _chunk3B6PCYJBcjs.CachedSerializer)(
954
+ const toClientSerializer = new (0, _chunkTTVNEKBEcjs.CachedSerializer)(
955
955
  eventData,
956
- _chunk3B6PCYJBcjs.TO_CLIENT_VERSIONED,
957
- _chunk3B6PCYJBcjs.CURRENT_VERSION,
958
- _chunk3B6PCYJBcjs.ToClientSchema,
956
+ _chunkTTVNEKBEcjs.TO_CLIENT_VERSIONED,
957
+ _chunkTTVNEKBEcjs.CURRENT_VERSION,
958
+ _chunkTTVNEKBEcjs.ToClientSchema,
959
959
  // JSON: args is the raw value (array of arguments)
960
960
  (value) => ({
961
961
  body: {
@@ -972,16 +972,16 @@ var EventManager = class {
972
972
  tag: "Event",
973
973
  val: {
974
974
  name: value.name,
975
- args: _chunk4KSHPFXFcjs.bufferToArrayBuffer.call(void 0, cbor3.encode(value.args))
975
+ args: _chunk2Q5WS6QHcjs.bufferToArrayBuffer.call(void 0, cbor3.encode(value.args))
976
976
  }
977
977
  }
978
978
  })
979
979
  );
980
980
  let sentCount = 0;
981
981
  for (const connection of subscribers) {
982
- if (connection[_chunk3B6PCYJBcjs.CONN_SPEAKS_RIVETKIT_SYMBOL]) {
982
+ if (connection[_chunkTTVNEKBEcjs.CONN_SPEAKS_RIVETKIT_SYMBOL]) {
983
983
  try {
984
- connection[_chunk3B6PCYJBcjs.CONN_SEND_MESSAGE_SYMBOL](toClientSerializer);
984
+ connection[_chunkTTVNEKBEcjs.CONN_SEND_MESSAGE_SYMBOL](toClientSerializer);
985
985
  sentCount++;
986
986
  } catch (error) {
987
987
  if (error instanceof _chunkL47L3ZWJcjs.OutgoingMessageTooLong) {
@@ -1067,9 +1067,9 @@ var EventManager = class {
1067
1067
 
1068
1068
  function convertActorToBarePersisted(persist) {
1069
1069
  return {
1070
- input: persist.input !== void 0 ? _chunk4KSHPFXFcjs.bufferToArrayBuffer.call(void 0, cbor4.encode(persist.input)) : null,
1070
+ input: persist.input !== void 0 ? _chunk2Q5WS6QHcjs.bufferToArrayBuffer.call(void 0, cbor4.encode(persist.input)) : null,
1071
1071
  hasInitialized: persist.hasInitialized,
1072
- state: _chunk4KSHPFXFcjs.bufferToArrayBuffer.call(void 0, cbor4.encode(persist.state)),
1072
+ state: _chunk2Q5WS6QHcjs.bufferToArrayBuffer.call(void 0, cbor4.encode(persist.state)),
1073
1073
  scheduledEvents: persist.scheduledEvents.map((event) => ({
1074
1074
  eventId: event.eventId,
1075
1075
  timestamp: BigInt(event.timestamp),
@@ -1098,8 +1098,8 @@ var DEFAULT_METADATA = {
1098
1098
  nextId: 1n,
1099
1099
  size: 0
1100
1100
  };
1101
- var QUEUE_METADATA_KEY = _chunkLK36OGGOcjs.queueMetadataKey.call(void 0, );
1102
- var QUEUE_MESSAGES_PREFIX = _chunkLK36OGGOcjs.queueMessagesPrefix.call(void 0, );
1101
+ var QUEUE_METADATA_KEY = _chunkGVBTEL2Dcjs.queueMetadataKey.call(void 0, );
1102
+ var QUEUE_MESSAGES_PREFIX = _chunkGVBTEL2Dcjs.queueMessagesPrefix.call(void 0, );
1103
1103
  var QueueManager = class {
1104
1104
  #actor;
1105
1105
  #driver;
@@ -1128,7 +1128,7 @@ var QueueManager = class {
1128
1128
  return;
1129
1129
  }
1130
1130
  try {
1131
- const decoded = _chunk3B6PCYJBcjs.QUEUE_METADATA_VERSIONED.deserializeWithEmbeddedVersion(
1131
+ const decoded = _chunkTTVNEKBEcjs.QUEUE_METADATA_VERSIONED.deserializeWithEmbeddedVersion(
1132
1132
  metadataBuffer
1133
1133
  );
1134
1134
  this.#metadata.nextId = decoded.nextId;
@@ -1150,14 +1150,14 @@ var QueueManager = class {
1150
1150
  throw new (0, _chunkL47L3ZWJcjs.QueueFull)(sizeLimit);
1151
1151
  }
1152
1152
  let invalidPath = "";
1153
- if (!_chunk4KSHPFXFcjs.isCborSerializable.call(void 0, body, (path) => {
1153
+ if (!_chunk2Q5WS6QHcjs.isCborSerializable.call(void 0, body, (path) => {
1154
1154
  invalidPath = path;
1155
1155
  })) {
1156
1156
  throw new (0, _chunkL47L3ZWJcjs.QueueMessageInvalid)(invalidPath);
1157
1157
  }
1158
1158
  const createdAt = Date.now();
1159
1159
  const bodyCborBuffer = cbor5.encode(body);
1160
- const encodedMessage = _chunk3B6PCYJBcjs.QUEUE_MESSAGE_VERSIONED.serializeWithEmbeddedVersion(
1160
+ const encodedMessage = _chunkTTVNEKBEcjs.QUEUE_MESSAGE_VERSIONED.serializeWithEmbeddedVersion(
1161
1161
  {
1162
1162
  name,
1163
1163
  body: new Uint8Array(bodyCborBuffer).buffer,
@@ -1167,7 +1167,7 @@ var QueueManager = class {
1167
1167
  inFlight: null,
1168
1168
  inFlightAt: null
1169
1169
  },
1170
- _chunk3B6PCYJBcjs.CURRENT_VERSION2
1170
+ _chunkTTVNEKBEcjs.CURRENT_VERSION2
1171
1171
  );
1172
1172
  const encodedSize = encodedMessage.byteLength;
1173
1173
  if (encodedSize > this.#actor.config.options.maxQueueMessageSize) {
@@ -1177,7 +1177,7 @@ var QueueManager = class {
1177
1177
  );
1178
1178
  }
1179
1179
  const id = this.#metadata.nextId;
1180
- const messageKey = _chunkLK36OGGOcjs.makeQueueMessageKey.call(void 0, id);
1180
+ const messageKey = _chunkGVBTEL2Dcjs.makeQueueMessageKey.call(void 0, id);
1181
1181
  this.#metadata.nextId = id + 1n;
1182
1182
  this.#metadata.size += 1;
1183
1183
  const encodedMetadata = this.#serializeMetadata();
@@ -1206,7 +1206,7 @@ var QueueManager = class {
1206
1206
  }
1207
1207
  const message = await this.enqueue(name, body);
1208
1208
  const messageId = message.id.toString();
1209
- const { promise, resolve } = _chunk4KSHPFXFcjs.promiseWithResolvers.call(void 0, () => {
1209
+ const { promise, resolve } = _chunk2Q5WS6QHcjs.promiseWithResolvers.call(void 0, () => {
1210
1210
  });
1211
1211
  const pending = { resolve };
1212
1212
  if (timeout !== void 0) {
@@ -1249,7 +1249,7 @@ var QueueManager = class {
1249
1249
  if (timeout === 0) {
1250
1250
  return [];
1251
1251
  }
1252
- const { promise, resolve, reject } = _chunk4KSHPFXFcjs.promiseWithResolvers.call(void 0, () => {
1252
+ const { promise, resolve, reject } = _chunk2Q5WS6QHcjs.promiseWithResolvers.call(void 0, () => {
1253
1253
  });
1254
1254
  const waiterId = crypto.randomUUID();
1255
1255
  let timeoutHandle;
@@ -1415,8 +1415,8 @@ var QueueManager = class {
1415
1415
  const decoded = [];
1416
1416
  for (const [key, value] of entries) {
1417
1417
  try {
1418
- const messageId = _chunkLK36OGGOcjs.decodeQueueMessageKey.call(void 0, key);
1419
- const decodedPayload = _chunk3B6PCYJBcjs.QUEUE_MESSAGE_VERSIONED.deserializeWithEmbeddedVersion(
1418
+ const messageId = _chunkGVBTEL2Dcjs.decodeQueueMessageKey.call(void 0, key);
1419
+ const decodedPayload = _chunkTTVNEKBEcjs.QUEUE_MESSAGE_VERSIONED.deserializeWithEmbeddedVersion(
1420
1420
  value
1421
1421
  );
1422
1422
  const body = cbor5.decode(new Uint8Array(decodedPayload.body));
@@ -1463,7 +1463,7 @@ var QueueManager = class {
1463
1463
  if (messages.length === 0) {
1464
1464
  return;
1465
1465
  }
1466
- const keys = messages.map((message) => _chunkLK36OGGOcjs.makeQueueMessageKey.call(void 0, message.id));
1466
+ const keys = messages.map((message) => _chunkGVBTEL2Dcjs.makeQueueMessageKey.call(void 0, message.id));
1467
1467
  this.#metadata.size = Math.max(
1468
1468
  0,
1469
1469
  this.#metadata.size - messages.length
@@ -1501,7 +1501,7 @@ var QueueManager = class {
1501
1501
  let maxId = 0n;
1502
1502
  for (const [key] of entries) {
1503
1503
  try {
1504
- const messageId = _chunkLK36OGGOcjs.decodeQueueMessageKey.call(void 0, key);
1504
+ const messageId = _chunkGVBTEL2Dcjs.decodeQueueMessageKey.call(void 0, key);
1505
1505
  if (messageId > maxId) {
1506
1506
  maxId = messageId;
1507
1507
  }
@@ -1516,12 +1516,12 @@ var QueueManager = class {
1516
1516
  this.#actor.inspector.updateQueueSize(this.#metadata.size);
1517
1517
  }
1518
1518
  #serializeMetadata() {
1519
- return _chunk3B6PCYJBcjs.QUEUE_METADATA_VERSIONED.serializeWithEmbeddedVersion(
1519
+ return _chunkTTVNEKBEcjs.QUEUE_METADATA_VERSIONED.serializeWithEmbeddedVersion(
1520
1520
  {
1521
1521
  nextId: this.#metadata.nextId,
1522
1522
  size: this.#metadata.size
1523
1523
  },
1524
- _chunk3B6PCYJBcjs.CURRENT_VERSION2
1524
+ _chunkTTVNEKBEcjs.CURRENT_VERSION2
1525
1525
  );
1526
1526
  }
1527
1527
  };
@@ -1531,7 +1531,7 @@ var QueueManager = class {
1531
1531
  var ScheduleManager = class {
1532
1532
  #actor;
1533
1533
  #actorDriver;
1534
- #alarmWriteQueue = new (0, _chunk4KSHPFXFcjs.SinglePromiseQueue)();
1534
+ #alarmWriteQueue = new (0, _chunk2Q5WS6QHcjs.SinglePromiseQueue)();
1535
1535
  #config;
1536
1536
  // ActorConfig type
1537
1537
  #persist;
@@ -1561,7 +1561,7 @@ var ScheduleManager = class {
1561
1561
  eventId: crypto.randomUUID(),
1562
1562
  timestamp,
1563
1563
  action,
1564
- args: _chunk4KSHPFXFcjs.bufferToArrayBuffer.call(void 0, cbor6.encode(args))
1564
+ args: _chunk2Q5WS6QHcjs.bufferToArrayBuffer.call(void 0, cbor6.encode(args))
1565
1565
  };
1566
1566
  this.#actor.emitTraceEvent("schedule.created", {
1567
1567
  "rivet.schedule.event_id": newEvent.eventId,
@@ -1776,16 +1776,16 @@ var ScheduleManager = class {
1776
1776
  });
1777
1777
  } catch (error) {
1778
1778
  this.#actor.traces.setAttributes(span, {
1779
- "error.message": _chunk4KSHPFXFcjs.stringifyError.call(void 0, error),
1779
+ "error.message": _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error),
1780
1780
  "error.type": error instanceof Error ? error.name : typeof error
1781
1781
  });
1782
1782
  this.#actor.endTraceSpan(span, {
1783
1783
  code: "ERROR",
1784
- message: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
1784
+ message: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
1785
1785
  });
1786
1786
  this.#actor.log.error({
1787
1787
  msg: "error executing scheduled event",
1788
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error),
1788
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error),
1789
1789
  eventId: event.eventId,
1790
1790
  timestamp: event.timestamp,
1791
1791
  action: event.action
@@ -1840,7 +1840,7 @@ var StateManager = class {
1840
1840
  #persistChanged = false;
1841
1841
  #isInOnStateChange = false;
1842
1842
  // Save management
1843
- #persistWriteQueue = new (0, _chunk4KSHPFXFcjs.SinglePromiseQueue)();
1843
+ #persistWriteQueue = new (0, _chunk2Q5WS6QHcjs.SinglePromiseQueue)();
1844
1844
  #lastSaveTime = 0;
1845
1845
  #pendingSaveTimeout;
1846
1846
  #pendingSaveScheduledTimestamp;
@@ -1909,10 +1909,10 @@ var StateManager = class {
1909
1909
  const bareData = convertActorToBarePersisted(persistData);
1910
1910
  await this.#actorDriver.kvBatchPut(this.#actor.id, [
1911
1911
  [
1912
- _chunkLK36OGGOcjs.KEYS.PERSIST_DATA,
1913
- _chunk3B6PCYJBcjs.ACTOR_VERSIONED.serializeWithEmbeddedVersion(
1912
+ _chunkGVBTEL2Dcjs.KEYS.PERSIST_DATA,
1913
+ _chunkTTVNEKBEcjs.ACTOR_VERSIONED.serializeWithEmbeddedVersion(
1914
1914
  bareData,
1915
- _chunk3B6PCYJBcjs.CURRENT_VERSION2
1915
+ _chunkTTVNEKBEcjs.CURRENT_VERSION2
1916
1916
  )
1917
1917
  ]
1918
1918
  ]);
@@ -1926,7 +1926,7 @@ var StateManager = class {
1926
1926
  this.#persistRaw = target;
1927
1927
  if (target === null || typeof target !== "object") {
1928
1928
  let invalidPath = "";
1929
- if (!_chunk4KSHPFXFcjs.isCborSerializable.call(void 0,
1929
+ if (!_chunk2Q5WS6QHcjs.isCborSerializable.call(void 0,
1930
1930
  target,
1931
1931
  (path) => {
1932
1932
  invalidPath = path;
@@ -1960,7 +1960,7 @@ var StateManager = class {
1960
1960
  await this.#savePersistInner();
1961
1961
  } else {
1962
1962
  if (!this.#onPersistSavedPromise) {
1963
- this.#onPersistSavedPromise = _chunk4KSHPFXFcjs.promiseWithResolvers.call(void 0, (reason) => _chunkLK36OGGOcjs.loggerWithoutContext.call(void 0, ).warn({ msg: "unhandled persist saved promise rejection", reason }));
1963
+ this.#onPersistSavedPromise = _chunk2Q5WS6QHcjs.promiseWithResolvers.call(void 0, (reason) => _chunkGVBTEL2Dcjs.loggerWithoutContext.call(void 0, ).warn({ msg: "unhandled persist saved promise rejection", reason }));
1964
1964
  }
1965
1965
  this.savePersistThrottled(opts.maxWait);
1966
1966
  await ((_a = this.#onPersistSavedPromise) == null ? void 0 : _a.promise);
@@ -2001,7 +2001,7 @@ var StateManager = class {
2001
2001
  this.#savePersistInner().catch((error) => {
2002
2002
  this.#actor.rLog.error({
2003
2003
  msg: "error saving persist data in scheduled save",
2004
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
2004
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
2005
2005
  });
2006
2006
  });
2007
2007
  }, saveDelay);
@@ -2009,7 +2009,7 @@ var StateManager = class {
2009
2009
  this.#savePersistInner().catch((error) => {
2010
2010
  this.#actor.rLog.error({
2011
2011
  msg: "error saving persist data immediately",
2012
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
2012
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
2013
2013
  });
2014
2014
  });
2015
2015
  }
@@ -2039,11 +2039,11 @@ var StateManager = class {
2039
2039
  }
2040
2040
  }
2041
2041
  #handleStateChange(path, value) {
2042
- const actorStatePath = _chunkLK36OGGOcjs.isStatePath.call(void 0, path);
2043
- const connStatePath = _chunkLK36OGGOcjs.isConnStatePath.call(void 0, path);
2042
+ const actorStatePath = _chunkGVBTEL2Dcjs.isStatePath.call(void 0, path);
2043
+ const connStatePath = _chunkGVBTEL2Dcjs.isConnStatePath.call(void 0, path);
2044
2044
  if (actorStatePath || connStatePath) {
2045
2045
  let invalidPath = "";
2046
- if (!_chunk4KSHPFXFcjs.isCborSerializable.call(void 0,
2046
+ if (!_chunk2Q5WS6QHcjs.isCborSerializable.call(void 0,
2047
2047
  value,
2048
2048
  (invalidPathPart) => {
2049
2049
  invalidPath = invalidPathPart;
@@ -2083,11 +2083,11 @@ var StateManager = class {
2083
2083
  } catch (error) {
2084
2084
  this.#actor.endTraceSpan(span, {
2085
2085
  code: "ERROR",
2086
- message: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
2086
+ message: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
2087
2087
  });
2088
2088
  this.#actor.rLog.error({
2089
2089
  msg: "error in `_onStateChange`",
2090
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
2090
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
2091
2091
  });
2092
2092
  } finally {
2093
2093
  this.#isInOnStateChange = false;
@@ -2121,10 +2121,10 @@ var StateManager = class {
2121
2121
  this.#persistRaw
2122
2122
  );
2123
2123
  entries.push([
2124
- _chunkLK36OGGOcjs.KEYS.PERSIST_DATA,
2125
- _chunk3B6PCYJBcjs.ACTOR_VERSIONED.serializeWithEmbeddedVersion(
2124
+ _chunkGVBTEL2Dcjs.KEYS.PERSIST_DATA,
2125
+ _chunkTTVNEKBEcjs.ACTOR_VERSIONED.serializeWithEmbeddedVersion(
2126
2126
  bareData,
2127
- _chunk3B6PCYJBcjs.CURRENT_VERSION2
2127
+ _chunkTTVNEKBEcjs.CURRENT_VERSION2
2128
2128
  )
2129
2129
  ]);
2130
2130
  }
@@ -2138,7 +2138,7 @@ var StateManager = class {
2138
2138
  });
2139
2139
  continue;
2140
2140
  }
2141
- const connStateManager = conn[_chunk3B6PCYJBcjs.CONN_STATE_MANAGER_SYMBOL];
2141
+ const connStateManager = conn[_chunkTTVNEKBEcjs.CONN_STATE_MANAGER_SYMBOL];
2142
2142
  const hibernatableDataRaw = connStateManager.hibernatableDataRaw;
2143
2143
  if (!hibernatableDataRaw) {
2144
2144
  this.#actor.log.warn({
@@ -2159,11 +2159,11 @@ var StateManager = class {
2159
2159
  const bareData = convertConnToBarePersistedConn(
2160
2160
  hibernatableDataRaw
2161
2161
  );
2162
- const connData = _chunk3B6PCYJBcjs.CONN_VERSIONED.serializeWithEmbeddedVersion(
2162
+ const connData = _chunkTTVNEKBEcjs.CONN_VERSIONED.serializeWithEmbeddedVersion(
2163
2163
  bareData,
2164
- _chunk3B6PCYJBcjs.CURRENT_VERSION2
2164
+ _chunkTTVNEKBEcjs.CURRENT_VERSION2
2165
2165
  );
2166
- entries.push([_chunkLK36OGGOcjs.makeConnKey.call(void 0, connId), connData]);
2166
+ entries.push([_chunkGVBTEL2Dcjs.makeConnKey.call(void 0, connId), connData]);
2167
2167
  connections.push(conn);
2168
2168
  }
2169
2169
  this.#actor.rLog.info({
@@ -2203,7 +2203,7 @@ var StateManager = class {
2203
2203
  } catch (error) {
2204
2204
  this.#actor.rLog.error({
2205
2205
  msg: "error saving persist",
2206
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
2206
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
2207
2207
  });
2208
2208
  (_b = this.#onPersistSavedPromise) == null ? void 0 : _b.reject(error);
2209
2209
  throw error;
@@ -2237,7 +2237,7 @@ var ActorTracesDriver = class {
2237
2237
  constructor(driver, actorId) {
2238
2238
  this.#driver = driver;
2239
2239
  this.#actorId = actorId;
2240
- this.#prefix = _chunkLK36OGGOcjs.tracesStoragePrefix.call(void 0, );
2240
+ this.#prefix = _chunkGVBTEL2Dcjs.tracesStoragePrefix.call(void 0, );
2241
2241
  }
2242
2242
  async get(key) {
2243
2243
  const [value] = await this.#driver.kvBatchGet(this.#actorId, [
@@ -2392,7 +2392,7 @@ var ActorInstance = (_class2 = class {
2392
2392
  // MARK: - Constructor
2393
2393
  constructor(config4) {;_class2.prototype.__init2.call(this);
2394
2394
  this.#config = config4;
2395
- this.actorContext = new (0, _chunkLK36OGGOcjs.ActorContext)(this);
2395
+ this.actorContext = new (0, _chunkGVBTEL2Dcjs.ActorContext)(this);
2396
2396
  this.#inspector = new ActorInspector(this);
2397
2397
  }
2398
2398
  // MARK: - Public Getters
@@ -2457,7 +2457,7 @@ var ActorInstance = (_class2 = class {
2457
2457
  this.#traces.endSpan(span, {
2458
2458
  status: {
2459
2459
  code: "ERROR",
2460
- message: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
2460
+ message: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
2461
2461
  }
2462
2462
  });
2463
2463
  throw error;
@@ -2524,7 +2524,7 @@ var ActorInstance = (_class2 = class {
2524
2524
  this.#actorId = actorId;
2525
2525
  this.#name = name;
2526
2526
  this.#key = key;
2527
- this.#actorKeyString = _chunk3B6PCYJBcjs.serializeActorKey.call(void 0, this.#key);
2527
+ this.#actorKeyString = _chunkTTVNEKBEcjs.serializeActorKey.call(void 0, this.#key);
2528
2528
  this.#region = region;
2529
2529
  this.#initializeTraces();
2530
2530
  this.#initializeLogging();
@@ -2596,7 +2596,7 @@ var ActorInstance = (_class2 = class {
2596
2596
  } else if (mode === "destroy") {
2597
2597
  await this.#callOnDestroy();
2598
2598
  } else {
2599
- _chunkLK36OGGOcjs.assertUnreachable.call(void 0, mode);
2599
+ _chunkGVBTEL2Dcjs.assertUnreachable.call(void 0, mode);
2600
2600
  }
2601
2601
  await this.#disconnectConnections();
2602
2602
  await this.#waitBackgroundPromises(
@@ -2678,14 +2678,14 @@ var ActorInstance = (_class2 = class {
2678
2678
  this.#activeHonoHttpRequests = 0;
2679
2679
  this.#rLog.warn({
2680
2680
  msg: "active hono requests went below 0, this is a RivetKit bug",
2681
- ..._chunk4KSHPFXFcjs.EXTRA_ERROR_LOG
2681
+ ..._chunk2Q5WS6QHcjs.EXTRA_ERROR_LOG
2682
2682
  });
2683
2683
  }
2684
2684
  this.resetSleepTimer();
2685
2685
  }
2686
2686
  // MARK: - Message Processing
2687
2687
  async processMessage(message, conn) {
2688
- await _chunk3B6PCYJBcjs.processMessage.call(void 0, message, this, conn, {
2688
+ await _chunkTTVNEKBEcjs.processMessage.call(void 0, message, this, conn, {
2689
2689
  onExecuteAction: async (ctx, name, args) => {
2690
2690
  return await this.executeAction(ctx, name, args);
2691
2691
  },
@@ -2698,7 +2698,7 @@ var ActorInstance = (_class2 = class {
2698
2698
  });
2699
2699
  }
2700
2700
  async assertCanSubscribe(ctx, eventName) {
2701
- const canSubscribe = _chunkLK36OGGOcjs.getEventCanSubscribe.call(void 0, this.#config.events, eventName);
2701
+ const canSubscribe = _chunkGVBTEL2Dcjs.getEventCanSubscribe.call(void 0, this.#config.events, eventName);
2702
2702
  if (!canSubscribe) {
2703
2703
  return;
2704
2704
  }
@@ -2711,7 +2711,7 @@ var ActorInstance = (_class2 = class {
2711
2711
  }
2712
2712
  }
2713
2713
  async assertCanPublish(ctx, queueName) {
2714
- const canPublish = _chunkLK36OGGOcjs.getQueueCanPublish.call(void 0, this.#config.queues, queueName);
2714
+ const canPublish = _chunkGVBTEL2Dcjs.getQueueCanPublish.call(void 0, this.#config.queues, queueName);
2715
2715
  if (!canPublish) {
2716
2716
  return;
2717
2717
  }
@@ -2761,7 +2761,7 @@ var ActorInstance = (_class2 = class {
2761
2761
  let output;
2762
2762
  const maybeThenable = outputOrPromise;
2763
2763
  if (maybeThenable && typeof maybeThenable.then === "function") {
2764
- output = await _chunkLK36OGGOcjs.deadline.call(void 0,
2764
+ output = await _chunkGVBTEL2Dcjs.deadline.call(void 0,
2765
2765
  Promise.resolve(outputOrPromise),
2766
2766
  this.#config.options.actionTimeout
2767
2767
  );
@@ -2783,15 +2783,15 @@ var ActorInstance = (_class2 = class {
2783
2783
  } catch (error) {
2784
2784
  this.#rLog.error({
2785
2785
  msg: "error in `onBeforeActionResponse`",
2786
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
2786
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
2787
2787
  });
2788
2788
  }
2789
2789
  }
2790
2790
  return output;
2791
2791
  });
2792
2792
  } catch (error) {
2793
- const isTimeout = error instanceof _chunkLK36OGGOcjs.DeadlineError;
2794
- const message = isTimeout ? "ActionTimedOut" : _chunk4KSHPFXFcjs.stringifyError.call(void 0, error);
2793
+ const isTimeout = error instanceof _chunkGVBTEL2Dcjs.DeadlineError;
2794
+ const message = isTimeout ? "ActionTimedOut" : _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error);
2795
2795
  this.#traces.setAttributes(actionSpan, {
2796
2796
  "error.message": message,
2797
2797
  "error.type": error instanceof Error ? error.name : typeof error
@@ -2806,7 +2806,7 @@ var ActorInstance = (_class2 = class {
2806
2806
  this.#rLog.error({
2807
2807
  msg: "action error",
2808
2808
  actionName,
2809
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
2809
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
2810
2810
  });
2811
2811
  throw error;
2812
2812
  } finally {
@@ -2820,7 +2820,7 @@ var ActorInstance = (_class2 = class {
2820
2820
  this.#activeKeepAwakeCount = 0;
2821
2821
  this.#rLog.warn({
2822
2822
  msg: "active keep awake count went below 0, this is a RivetKit bug",
2823
- ..._chunk4KSHPFXFcjs.EXTRA_ERROR_LOG
2823
+ ..._chunk2Q5WS6QHcjs.EXTRA_ERROR_LOG
2824
2824
  });
2825
2825
  }
2826
2826
  this.resetSleepTimer();
@@ -2842,7 +2842,7 @@ var ActorInstance = (_class2 = class {
2842
2842
  "rivet.conn.id": conn.id
2843
2843
  },
2844
2844
  async () => {
2845
- const ctx = new (0, _chunk3B6PCYJBcjs.RequestContext)(this, conn, request);
2845
+ const ctx = new (0, _chunkTTVNEKBEcjs.RequestContext)(this, conn, request);
2846
2846
  try {
2847
2847
  const response = await onRequest(ctx, request);
2848
2848
  if (!response) {
@@ -2852,7 +2852,7 @@ var ActorInstance = (_class2 = class {
2852
2852
  } catch (error) {
2853
2853
  this.#rLog.error({
2854
2854
  msg: "onRequest error",
2855
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
2855
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
2856
2856
  });
2857
2857
  throw error;
2858
2858
  } finally {
@@ -2873,7 +2873,7 @@ var ActorInstance = (_class2 = class {
2873
2873
  let spanEnded = false;
2874
2874
  try {
2875
2875
  this.resetSleepTimer();
2876
- const ctx = new (0, _chunk3B6PCYJBcjs.WebSocketContext)(this, conn, request);
2876
+ const ctx = new (0, _chunkTTVNEKBEcjs.WebSocketContext)(this, conn, request);
2877
2877
  const voidOrPromise = this.#traces.withSpan(
2878
2878
  span,
2879
2879
  () => this.#config.onWebSocket(ctx, websocket)
@@ -2888,13 +2888,13 @@ var ActorInstance = (_class2 = class {
2888
2888
  if (!spanEnded) {
2889
2889
  this.endTraceSpan(span, {
2890
2890
  code: "ERROR",
2891
- message: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
2891
+ message: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
2892
2892
  });
2893
2893
  spanEnded = true;
2894
2894
  }
2895
2895
  this.#rLog.error({
2896
2896
  msg: "onWebSocket error",
2897
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
2897
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
2898
2898
  });
2899
2899
  }).finally(() => {
2900
2900
  this.stateManager.savePersistThrottled();
@@ -2910,13 +2910,13 @@ var ActorInstance = (_class2 = class {
2910
2910
  if (!spanEnded) {
2911
2911
  this.endTraceSpan(span, {
2912
2912
  code: "ERROR",
2913
- message: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
2913
+ message: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
2914
2914
  });
2915
2915
  spanEnded = true;
2916
2916
  }
2917
2917
  this.#rLog.error({
2918
2918
  msg: "onWebSocket error",
2919
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
2919
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
2920
2920
  });
2921
2921
  throw error;
2922
2922
  }
@@ -2937,7 +2937,7 @@ var ActorInstance = (_class2 = class {
2937
2937
  }).catch((error) => {
2938
2938
  this.#rLog.error({
2939
2939
  msg: "wait until promise failed",
2940
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
2940
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
2941
2941
  });
2942
2942
  });
2943
2943
  this.#backgroundPromises.push(nonfailablePromise);
@@ -2963,7 +2963,7 @@ var ActorInstance = (_class2 = class {
2963
2963
  this.#activeKeepAwakeCount = 0;
2964
2964
  this.#rLog.warn({
2965
2965
  msg: "active keep awake count went below 0, this is a RivetKit bug",
2966
- ..._chunk4KSHPFXFcjs.EXTRA_ERROR_LOG
2966
+ ..._chunk2Q5WS6QHcjs.EXTRA_ERROR_LOG
2967
2967
  });
2968
2968
  }
2969
2969
  this.resetSleepTimer();
@@ -2980,14 +2980,14 @@ var ActorInstance = (_class2 = class {
2980
2980
  this.#activeQueueWaitCount = 0;
2981
2981
  this.#rLog.warn({
2982
2982
  msg: "active queue wait count went below 0, this is a RivetKit bug",
2983
- ..._chunk4KSHPFXFcjs.EXTRA_ERROR_LOG
2983
+ ..._chunk2Q5WS6QHcjs.EXTRA_ERROR_LOG
2984
2984
  });
2985
2985
  }
2986
2986
  this.resetSleepTimer();
2987
2987
  }
2988
2988
  // MARK: - Private Helper Methods
2989
2989
  #initializeTraces() {
2990
- if (_chunk4KSHPFXFcjs.getRivetExperimentalOtel.call(void 0, )) {
2990
+ if (_chunk2Q5WS6QHcjs.getRivetExperimentalOtel.call(void 0, )) {
2991
2991
  this.#traces = _traces.createTraces.call(void 0, {
2992
2992
  driver: new ActorTracesDriver(this.driver, this.#actorId)
2993
2993
  });
@@ -3052,15 +3052,15 @@ var ActorInstance = (_class2 = class {
3052
3052
  };
3053
3053
  const extraLogParams = (_b = (_a = this.driver).getExtraActorLogParams) == null ? void 0 : _b.call(_a);
3054
3054
  if (extraLogParams) Object.assign(logParams, extraLogParams);
3055
- this.#log = _chunk4KSHPFXFcjs.getBaseLogger.call(void 0, ).child(
3055
+ this.#log = _chunk2Q5WS6QHcjs.getBaseLogger.call(void 0, ).child(
3056
3056
  Object.assign(
3057
- _chunk4KSHPFXFcjs.getIncludeTarget.call(void 0, ) ? { target: "actor" } : {},
3057
+ _chunk2Q5WS6QHcjs.getIncludeTarget.call(void 0, ) ? { target: "actor" } : {},
3058
3058
  logParams
3059
3059
  )
3060
3060
  );
3061
- this.#rLog = _chunk4KSHPFXFcjs.getBaseLogger.call(void 0, ).child(
3061
+ this.#rLog = _chunk2Q5WS6QHcjs.getBaseLogger.call(void 0, ).child(
3062
3062
  Object.assign(
3063
- _chunk4KSHPFXFcjs.getIncludeTarget.call(void 0, ) ? { target: "actor-runtime" } : {},
3063
+ _chunk2Q5WS6QHcjs.getIncludeTarget.call(void 0, ) ? { target: "actor-runtime" } : {},
3064
3064
  logParams
3065
3065
  )
3066
3066
  );
@@ -3070,13 +3070,13 @@ var ActorInstance = (_class2 = class {
3070
3070
  async #loadState() {
3071
3071
  const [persistDataBuffer] = await this.driver.kvBatchGet(
3072
3072
  this.#actorId,
3073
- [_chunkLK36OGGOcjs.KEYS.PERSIST_DATA]
3073
+ [_chunkGVBTEL2Dcjs.KEYS.PERSIST_DATA]
3074
3074
  );
3075
3075
  _invariant2.default.call(void 0,
3076
3076
  persistDataBuffer !== null,
3077
3077
  "persist data has not been set, it should be set when initialized"
3078
3078
  );
3079
- const bareData = _chunk3B6PCYJBcjs.ACTOR_VERSIONED.deserializeWithEmbeddedVersion(persistDataBuffer);
3079
+ const bareData = _chunkTTVNEKBEcjs.ACTOR_VERSIONED.deserializeWithEmbeddedVersion(persistDataBuffer);
3080
3080
  const persistData = convertActorFromBarePersisted(bareData);
3081
3081
  if (persistData.hasInitialized) {
3082
3082
  await this.#restoreExistingActor(persistData);
@@ -3100,12 +3100,12 @@ var ActorInstance = (_class2 = class {
3100
3100
  async #restoreExistingActor(persistData) {
3101
3101
  const connEntries = await this.driver.kvListPrefix(
3102
3102
  this.#actorId,
3103
- _chunkLK36OGGOcjs.KEYS.CONN_PREFIX
3103
+ _chunkGVBTEL2Dcjs.KEYS.CONN_PREFIX
3104
3104
  );
3105
3105
  const connections = [];
3106
3106
  for (const [_key, value] of connEntries) {
3107
3107
  try {
3108
- const bareData = _chunk3B6PCYJBcjs.CONN_VERSIONED.deserializeWithEmbeddedVersion(
3108
+ const bareData = _chunkTTVNEKBEcjs.CONN_VERSIONED.deserializeWithEmbeddedVersion(
3109
3109
  new Uint8Array(value)
3110
3110
  );
3111
3111
  const conn = convertConnFromBarePersistedConn(bareData);
@@ -3113,7 +3113,7 @@ var ActorInstance = (_class2 = class {
3113
3113
  } catch (error) {
3114
3114
  this.#rLog.error({
3115
3115
  msg: "failed to decode connection",
3116
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
3116
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
3117
3117
  });
3118
3118
  }
3119
3119
  }
@@ -3126,17 +3126,17 @@ var ActorInstance = (_class2 = class {
3126
3126
  }
3127
3127
  async #initializeInspectorToken() {
3128
3128
  const [tokenBuffer] = await this.driver.kvBatchGet(this.#actorId, [
3129
- _chunkLK36OGGOcjs.KEYS.INSPECTOR_TOKEN
3129
+ _chunkGVBTEL2Dcjs.KEYS.INSPECTOR_TOKEN
3130
3130
  ]);
3131
3131
  if (tokenBuffer !== null) {
3132
3132
  const decoder = new TextDecoder();
3133
3133
  this.#inspectorToken = decoder.decode(tokenBuffer);
3134
3134
  this.#rLog.debug({ msg: "loaded existing inspector token" });
3135
3135
  } else {
3136
- this.#inspectorToken = _chunkLK36OGGOcjs.generateSecureToken.call(void 0, );
3136
+ this.#inspectorToken = _chunkGVBTEL2Dcjs.generateSecureToken.call(void 0, );
3137
3137
  const tokenBytes = new TextEncoder().encode(this.#inspectorToken);
3138
3138
  await this.driver.kvBatchPut(this.#actorId, [
3139
- [_chunkLK36OGGOcjs.KEYS.INSPECTOR_TOKEN, tokenBytes]
3139
+ [_chunkGVBTEL2Dcjs.KEYS.INSPECTOR_TOKEN, tokenBytes]
3140
3140
  ]);
3141
3141
  this.#rLog.debug({ msg: "generated new inspector token" });
3142
3142
  }
@@ -3154,7 +3154,7 @@ var ActorInstance = (_class2 = class {
3154
3154
  this.driver.getContext(this.#actorId)
3155
3155
  );
3156
3156
  if (dataOrPromise instanceof Promise) {
3157
- return _chunkLK36OGGOcjs.deadline.call(void 0,
3157
+ return _chunkGVBTEL2Dcjs.deadline.call(void 0,
3158
3158
  dataOrPromise,
3159
3159
  this.#config.options.createVarsTimeout
3160
3160
  );
@@ -3193,7 +3193,7 @@ var ActorInstance = (_class2 = class {
3193
3193
  async () => {
3194
3194
  const result = onSleep(this.actorContext);
3195
3195
  if (result instanceof Promise) {
3196
- await _chunkLK36OGGOcjs.deadline.call(void 0,
3196
+ await _chunkGVBTEL2Dcjs.deadline.call(void 0,
3197
3197
  result,
3198
3198
  this.overrides.onSleepTimeout !== void 0 ? Math.min(this.#config.options.onSleepTimeout, this.overrides.onSleepTimeout) : this.#config.options.onSleepTimeout
3199
3199
  );
@@ -3202,12 +3202,12 @@ var ActorInstance = (_class2 = class {
3202
3202
  );
3203
3203
  this.#rLog.debug({ msg: "onSleep completed" });
3204
3204
  } catch (error) {
3205
- if (error instanceof _chunkLK36OGGOcjs.DeadlineError) {
3205
+ if (error instanceof _chunkGVBTEL2Dcjs.DeadlineError) {
3206
3206
  this.#rLog.error({ msg: "onSleep timed out" });
3207
3207
  } else {
3208
3208
  this.#rLog.error({
3209
3209
  msg: "error in onSleep",
3210
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
3210
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
3211
3211
  });
3212
3212
  }
3213
3213
  }
@@ -3224,7 +3224,7 @@ var ActorInstance = (_class2 = class {
3224
3224
  async () => {
3225
3225
  const result = onDestroy(this.actorContext);
3226
3226
  if (result instanceof Promise) {
3227
- await _chunkLK36OGGOcjs.deadline.call(void 0,
3227
+ await _chunkGVBTEL2Dcjs.deadline.call(void 0,
3228
3228
  result,
3229
3229
  this.overrides.onDestroyTimeout !== void 0 ? Math.min(this.#config.options.onDestroyTimeout, this.overrides.onDestroyTimeout) : this.#config.options.onDestroyTimeout
3230
3230
  );
@@ -3233,19 +3233,19 @@ var ActorInstance = (_class2 = class {
3233
3233
  );
3234
3234
  this.#rLog.debug({ msg: "onDestroy completed" });
3235
3235
  } catch (error) {
3236
- if (error instanceof _chunkLK36OGGOcjs.DeadlineError) {
3236
+ if (error instanceof _chunkGVBTEL2Dcjs.DeadlineError) {
3237
3237
  this.#rLog.error({ msg: "onDestroy timed out" });
3238
3238
  } else {
3239
3239
  this.#rLog.error({
3240
3240
  msg: "error in onDestroy",
3241
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
3241
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
3242
3242
  });
3243
3243
  }
3244
3244
  }
3245
3245
  }
3246
3246
  }
3247
3247
  #startRunHandler() {
3248
- const runFn = _chunkLK36OGGOcjs.getRunFunction.call(void 0, this.#config.run);
3248
+ const runFn = _chunkGVBTEL2Dcjs.getRunFunction.call(void 0, this.#config.run);
3249
3249
  if (!runFn) return;
3250
3250
  this.#rLog.debug({ msg: "starting run handler" });
3251
3251
  this.#runHandlerActive = true;
@@ -3286,7 +3286,7 @@ var ActorInstance = (_class2 = class {
3286
3286
  }
3287
3287
  this.#rLog.debug({
3288
3288
  msg: "run handler threw during actor stop",
3289
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
3289
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
3290
3290
  });
3291
3291
  return;
3292
3292
  }
@@ -3294,17 +3294,17 @@ var ActorInstance = (_class2 = class {
3294
3294
  "actor.crash",
3295
3295
  {
3296
3296
  "rivet.actor.reason": "run_error",
3297
- "error.message": _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
3297
+ "error.message": _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
3298
3298
  },
3299
3299
  runSpan
3300
3300
  );
3301
3301
  this.endTraceSpan(runSpan, {
3302
3302
  code: "ERROR",
3303
- message: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
3303
+ message: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
3304
3304
  });
3305
3305
  this.#rLog.error({
3306
3306
  msg: "run handler threw error, crashing actor to reschedule",
3307
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
3307
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
3308
3308
  });
3309
3309
  this.startDestroy();
3310
3310
  }).finally(() => {
@@ -3369,7 +3369,7 @@ var ActorInstance = (_class2 = class {
3369
3369
  } catch (cleanupError) {
3370
3370
  this.#rLog.error({
3371
3371
  msg: "database setup cleanup failed",
3372
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, cleanupError)
3372
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, cleanupError)
3373
3373
  });
3374
3374
  }
3375
3375
  }
@@ -3379,7 +3379,7 @@ var ActorInstance = (_class2 = class {
3379
3379
  } catch (cleanupError) {
3380
3380
  this.#rLog.error({
3381
3381
  msg: "sqlite vfs teardown after setup failure failed",
3382
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, cleanupError)
3382
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, cleanupError)
3383
3383
  });
3384
3384
  }
3385
3385
  }
@@ -3387,7 +3387,7 @@ var ActorInstance = (_class2 = class {
3387
3387
  if (error instanceof Error) {
3388
3388
  this.#rLog.error({
3389
3389
  msg: "database setup failed",
3390
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
3390
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
3391
3391
  });
3392
3392
  throw error;
3393
3393
  }
@@ -3413,7 +3413,7 @@ var ActorInstance = (_class2 = class {
3413
3413
  } catch (error) {
3414
3414
  this.#rLog.error({
3415
3415
  msg: "database cleanup failed",
3416
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
3416
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
3417
3417
  });
3418
3418
  }
3419
3419
  }
@@ -3423,7 +3423,7 @@ var ActorInstance = (_class2 = class {
3423
3423
  } catch (error) {
3424
3424
  this.#rLog.error({
3425
3425
  msg: "sqlite vfs cleanup failed",
3426
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, error)
3426
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, error)
3427
3427
  });
3428
3428
  }
3429
3429
  }
@@ -3563,7 +3563,7 @@ function createActorRouter(config4, actorDriver, getUpgradeWebSocket, isTest) {
3563
3563
  const router = new (0, _hono.Hono)({
3564
3564
  strict: false
3565
3565
  });
3566
- router.use("*", _chunk3B6PCYJBcjs.loggerMiddleware.call(void 0, _chunkLK36OGGOcjs.loggerWithoutContext.call(void 0, )));
3566
+ router.use("*", _chunkTTVNEKBEcjs.loggerMiddleware.call(void 0, _chunkGVBTEL2Dcjs.loggerWithoutContext.call(void 0, )));
3567
3567
  router.use("*", async (c, next) => {
3568
3568
  const actor = await actorDriver.loadActor(c.env.actorId);
3569
3569
  actor.beginHonoHttpRequest();
@@ -3584,7 +3584,7 @@ function createActorRouter(config4, actorDriver, getUpgradeWebSocket, isTest) {
3584
3584
  router.get("/metadata", async (c) => {
3585
3585
  return c.json({
3586
3586
  runtime: "rivetkit",
3587
- version: _chunk4KSHPFXFcjs.VERSION
3587
+ version: _chunk2Q5WS6QHcjs.VERSION
3588
3588
  });
3589
3589
  });
3590
3590
  if (isTest) {
@@ -3599,8 +3599,8 @@ function createActorRouter(config4, actorDriver, getUpgradeWebSocket, isTest) {
3599
3599
  if (!conn) {
3600
3600
  return c.text(`Connection not found: ${connId}`, 404);
3601
3601
  }
3602
- if ((_a = conn[_chunk3B6PCYJBcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _a.terminate) {
3603
- conn[_chunk3B6PCYJBcjs.CONN_DRIVER_SYMBOL].terminate(actor, conn);
3602
+ if ((_a = conn[_chunkTTVNEKBEcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _a.terminate) {
3603
+ conn[_chunkTTVNEKBEcjs.CONN_DRIVER_SYMBOL].terminate(actor, conn);
3604
3604
  }
3605
3605
  return c.json({ success: true });
3606
3606
  });
@@ -3608,7 +3608,7 @@ function createActorRouter(config4, actorDriver, getUpgradeWebSocket, isTest) {
3608
3608
  if (getUpgradeWebSocket) {
3609
3609
  router.on(
3610
3610
  "GET",
3611
- [_chunk3B6PCYJBcjs.PATH_CONNECT, `${_chunk3B6PCYJBcjs.PATH_WEBSOCKET_PREFIX}*`, _chunk3B6PCYJBcjs.PATH_INSPECTOR_CONNECT],
3611
+ [_chunkTTVNEKBEcjs.PATH_CONNECT, `${_chunkTTVNEKBEcjs.PATH_WEBSOCKET_PREFIX}*`, _chunkTTVNEKBEcjs.PATH_INSPECTOR_CONNECT],
3612
3612
  async (c) => {
3613
3613
  const upgradeWebSocket = getUpgradeWebSocket();
3614
3614
  if (upgradeWebSocket) {
@@ -3616,8 +3616,8 @@ function createActorRouter(config4, actorDriver, getUpgradeWebSocket, isTest) {
3616
3616
  const protocols = c2.req.header(
3617
3617
  "sec-websocket-protocol"
3618
3618
  );
3619
- const { encoding, connParams } = _chunk3B6PCYJBcjs.parseWebSocketProtocols.call(void 0, protocols);
3620
- return await _chunk3B6PCYJBcjs.routeWebSocket.call(void 0,
3619
+ const { encoding, connParams } = _chunkTTVNEKBEcjs.parseWebSocketProtocols.call(void 0, protocols);
3620
+ return await _chunkTTVNEKBEcjs.routeWebSocket.call(void 0,
3621
3621
  c2.req.raw,
3622
3622
  c2.req.path,
3623
3623
  c2.req.header(),
@@ -3631,7 +3631,7 @@ function createActorRouter(config4, actorDriver, getUpgradeWebSocket, isTest) {
3631
3631
  false,
3632
3632
  false
3633
3633
  );
3634
- })(c, _chunk4KSHPFXFcjs.noopNext.call(void 0, ));
3634
+ })(c, _chunk2Q5WS6QHcjs.noopNext.call(void 0, ));
3635
3635
  } else {
3636
3636
  return c.text(
3637
3637
  "WebSockets are not enabled for this driver.",
@@ -3644,8 +3644,8 @@ function createActorRouter(config4, actorDriver, getUpgradeWebSocket, isTest) {
3644
3644
  if (config4.inspector.enabled) {
3645
3645
  const inspectorAuth = async (c) => {
3646
3646
  var _a;
3647
- if (_chunk4KSHPFXFcjs.isDev.call(void 0, ) && !config4.inspector.token()) {
3648
- _chunk3B6PCYJBcjs.inspectorLogger.call(void 0, ).warn({
3647
+ if (_chunk2Q5WS6QHcjs.isDev.call(void 0, ) && !config4.inspector.token()) {
3648
+ _chunkTTVNEKBEcjs.inspectorLogger.call(void 0, ).warn({
3649
3649
  msg: "RIVET_INSPECTOR_TOKEN is not set, skipping inspector auth in development mode"
3650
3650
  });
3651
3651
  return void 0;
@@ -3658,7 +3658,7 @@ function createActorRouter(config4, actorDriver, getUpgradeWebSocket, isTest) {
3658
3658
  if (!inspectorToken) {
3659
3659
  return c.text("Unauthorized", 401);
3660
3660
  }
3661
- if (!_chunk3B6PCYJBcjs.timingSafeEqual.call(void 0, userToken, inspectorToken)) {
3661
+ if (!_chunkTTVNEKBEcjs.timingSafeEqual.call(void 0, userToken, inspectorToken)) {
3662
3662
  return c.text("Unauthorized", 401);
3663
3663
  }
3664
3664
  return void 0;
@@ -3766,13 +3766,13 @@ function createActorRouter(config4, actorDriver, getUpgradeWebSocket, isTest) {
3766
3766
  }
3767
3767
  router.post("/action/:action", async (c) => {
3768
3768
  const actionName = c.req.param("action");
3769
- return _chunk3B6PCYJBcjs.handleAction.call(void 0, c, config4, actorDriver, actionName, c.env.actorId);
3769
+ return _chunkTTVNEKBEcjs.handleAction.call(void 0, c, config4, actorDriver, actionName, c.env.actorId);
3770
3770
  });
3771
3771
  router.post("/queue", async (c) => {
3772
- return _chunk3B6PCYJBcjs.handleQueueSend.call(void 0, c, config4, actorDriver, c.env.actorId);
3772
+ return _chunkTTVNEKBEcjs.handleQueueSend.call(void 0, c, config4, actorDriver, c.env.actorId);
3773
3773
  });
3774
3774
  router.post("/queue/:name", async (c) => {
3775
- return _chunk3B6PCYJBcjs.handleQueueSend.call(void 0,
3775
+ return _chunkTTVNEKBEcjs.handleQueueSend.call(void 0,
3776
3776
  c,
3777
3777
  config4,
3778
3778
  actorDriver,
@@ -3790,20 +3790,20 @@ function createActorRouter(config4, actorDriver, getUpgradeWebSocket, isTest) {
3790
3790
  body: c.req.raw.body,
3791
3791
  duplex: "half"
3792
3792
  });
3793
- _chunkLK36OGGOcjs.loggerWithoutContext.call(void 0, ).debug({
3793
+ _chunkGVBTEL2Dcjs.loggerWithoutContext.call(void 0, ).debug({
3794
3794
  msg: "rewriting http url",
3795
3795
  from: c.req.url,
3796
3796
  to: correctedRequest.url
3797
3797
  });
3798
- return await _chunk3B6PCYJBcjs.handleRawRequest.call(void 0,
3798
+ return await _chunkTTVNEKBEcjs.handleRawRequest.call(void 0,
3799
3799
  c,
3800
3800
  correctedRequest,
3801
3801
  actorDriver,
3802
3802
  c.env.actorId
3803
3803
  );
3804
3804
  });
3805
- router.notFound(_chunk3B6PCYJBcjs.handleRouteNotFound);
3806
- router.onError(_chunk3B6PCYJBcjs.handleRouteError);
3805
+ router.notFound(_chunkTTVNEKBEcjs.handleRouteNotFound);
3806
+ router.onError(_chunkTTVNEKBEcjs.handleRouteError);
3807
3807
  return router;
3808
3808
  }
3809
3809
 
@@ -3811,7 +3811,7 @@ function createActorRouter(config4, actorDriver, getUpgradeWebSocket, isTest) {
3811
3811
  var _ws = require('hono/ws');
3812
3812
  var _virtualwebsocket = require('@rivetkit/virtual-websocket');
3813
3813
  function logger() {
3814
- return _chunk4KSHPFXFcjs.getLogger.call(void 0, "inline-websocket-adapter");
3814
+ return _chunk2Q5WS6QHcjs.getLogger.call(void 0, "inline-websocket-adapter");
3815
3815
  }
3816
3816
  var InlineWebSocketAdapter = class {
3817
3817
  #handler;
@@ -3962,7 +3962,7 @@ var FileSystemActorDriver = class {
3962
3962
  }
3963
3963
  /** Creates a SQLite VFS instance for creating KV-backed databases */
3964
3964
  async createSqliteVfs() {
3965
- return await _chunk3B6PCYJBcjs.importSqliteVfs.call(void 0, );
3965
+ return await _chunkTTVNEKBEcjs.importSqliteVfs.call(void 0, );
3966
3966
  }
3967
3967
  startSleep(actorId) {
3968
3968
  this.#state.sleepActor(actorId);
@@ -4296,7 +4296,7 @@ var v1ToV2 = (v1State) => {
4296
4296
  if (v1State.persistedData) {
4297
4297
  const key = new Uint8Array([1]);
4298
4298
  kvStorage.push({
4299
- key: _chunk4KSHPFXFcjs.bufferToArrayBuffer.call(void 0, key),
4299
+ key: _chunk2Q5WS6QHcjs.bufferToArrayBuffer.call(void 0, key),
4300
4300
  value: v1State.persistedData
4301
4301
  });
4302
4302
  }
@@ -4402,33 +4402,33 @@ var ACTOR_ALARM_VERSIONED = _vbare.createVersionedDataHandler.call(void 0, {
4402
4402
 
4403
4403
  // src/drivers/file-system/log.ts
4404
4404
  function logger2() {
4405
- return _chunk4KSHPFXFcjs.getLogger.call(void 0, "driver-fs");
4405
+ return _chunk2Q5WS6QHcjs.getLogger.call(void 0, "driver-fs");
4406
4406
  }
4407
4407
 
4408
4408
  // src/drivers/file-system/utils.ts
4409
4409
  function generateActorId(name, key) {
4410
4410
  const jsonString = JSON.stringify([name, key]);
4411
- const crypto2 = _chunk3B6PCYJBcjs.getNodeCrypto.call(void 0, );
4411
+ const crypto2 = _chunkTTVNEKBEcjs.getNodeCrypto.call(void 0, );
4412
4412
  const hash = crypto2.createHash("sha256").update(jsonString).digest("hex").substring(0, 16);
4413
4413
  return hash;
4414
4414
  }
4415
4415
  function createHashForPath(dirPath) {
4416
- const path = _chunk3B6PCYJBcjs.getNodePath.call(void 0, );
4416
+ const path = _chunkTTVNEKBEcjs.getNodePath.call(void 0, );
4417
4417
  const normalizedPath = path.normalize(dirPath);
4418
4418
  const lastComponent = path.basename(normalizedPath);
4419
- const crypto2 = _chunk3B6PCYJBcjs.getNodeCrypto.call(void 0, );
4419
+ const crypto2 = _chunkTTVNEKBEcjs.getNodeCrypto.call(void 0, );
4420
4420
  const hash = crypto2.createHash("sha256").update(normalizedPath).digest("hex").substring(0, 8);
4421
4421
  return `${lastComponent}-${hash}`;
4422
4422
  }
4423
4423
  function getStoragePath() {
4424
4424
  const dataPath = getDataPath("rivetkit");
4425
4425
  const dirHash = createHashForPath(process.cwd());
4426
- const path = _chunk3B6PCYJBcjs.getNodePath.call(void 0, );
4426
+ const path = _chunkTTVNEKBEcjs.getNodePath.call(void 0, );
4427
4427
  return path.join(dataPath, dirHash);
4428
4428
  }
4429
4429
  async function pathExists(path) {
4430
4430
  try {
4431
- const fs = _chunk3B6PCYJBcjs.getNodeFs.call(void 0, );
4431
+ const fs = _chunkTTVNEKBEcjs.getNodeFs.call(void 0, );
4432
4432
  await fs.access(path);
4433
4433
  return true;
4434
4434
  } catch (e6) {
@@ -4437,21 +4437,21 @@ async function pathExists(path) {
4437
4437
  }
4438
4438
  async function ensureDirectoryExists(directoryPath) {
4439
4439
  if (!await pathExists(directoryPath)) {
4440
- const fs = _chunk3B6PCYJBcjs.getNodeFs.call(void 0, );
4440
+ const fs = _chunkTTVNEKBEcjs.getNodeFs.call(void 0, );
4441
4441
  await fs.mkdir(directoryPath, { recursive: true });
4442
4442
  }
4443
4443
  }
4444
4444
  function ensureDirectoryExistsSync(directoryPath) {
4445
- const fsSync = _chunk3B6PCYJBcjs.getNodeFsSync.call(void 0, );
4445
+ const fsSync = _chunkTTVNEKBEcjs.getNodeFsSync.call(void 0, );
4446
4446
  if (!fsSync.existsSync(directoryPath)) {
4447
4447
  fsSync.mkdirSync(directoryPath, { recursive: true });
4448
4448
  }
4449
4449
  }
4450
4450
  function getDataPath(appName) {
4451
4451
  const platform = process.platform;
4452
- const os = _chunk3B6PCYJBcjs.getNodeOs.call(void 0, );
4452
+ const os = _chunkTTVNEKBEcjs.getNodeOs.call(void 0, );
4453
4453
  const homeDir = os.homedir();
4454
- const path = _chunk3B6PCYJBcjs.getNodePath.call(void 0, );
4454
+ const path = _chunkTTVNEKBEcjs.getNodePath.call(void 0, );
4455
4455
  switch (platform) {
4456
4456
  case "win32":
4457
4457
  return path.join(
@@ -4514,7 +4514,7 @@ function configureSqliteRuntimeDatabase(rawDb, path) {
4514
4514
  }
4515
4515
  }
4516
4516
  function loadSqliteRuntime() {
4517
- const requireFn = _chunk3B6PCYJBcjs.getRequireFn.call(void 0, );
4517
+ const requireFn = _chunkTTVNEKBEcjs.getRequireFn.call(void 0, );
4518
4518
  const loadErrors = [];
4519
4519
  try {
4520
4520
  const bunSqlite = requireFn(
@@ -4708,7 +4708,7 @@ var FileSystemGlobalState = class {
4708
4708
  this.#persist = persist;
4709
4709
  this.#sqliteRuntime = loadSqliteRuntime();
4710
4710
  this.#storagePath = persist ? _nullishCoalesce(customPath, () => ( getStoragePath())) : "/tmp";
4711
- const path = _chunk3B6PCYJBcjs.getNodePath.call(void 0, );
4711
+ const path = _chunkTTVNEKBEcjs.getNodePath.call(void 0, );
4712
4712
  this.#stateDir = path.join(this.#storagePath, "state");
4713
4713
  this.#dbsDir = path.join(this.#storagePath, "databases");
4714
4714
  this.#alarmsDir = path.join(this.#storagePath, "alarms");
@@ -4717,7 +4717,7 @@ var FileSystemGlobalState = class {
4717
4717
  ensureDirectoryExistsSync(this.#dbsDir);
4718
4718
  ensureDirectoryExistsSync(this.#alarmsDir);
4719
4719
  try {
4720
- const fsSync = _chunk3B6PCYJBcjs.getNodeFsSync.call(void 0, );
4720
+ const fsSync = _chunkTTVNEKBEcjs.getNodeFsSync.call(void 0, );
4721
4721
  const actorIds = fsSync.readdirSync(this.#stateDir);
4722
4722
  this.#actorCountOnStartup = actorIds.length;
4723
4723
  } catch (error) {
@@ -4754,13 +4754,13 @@ var FileSystemGlobalState = class {
4754
4754
  }
4755
4755
  }
4756
4756
  getActorStatePath(actorId) {
4757
- return _chunk3B6PCYJBcjs.getNodePath.call(void 0, ).join(this.#stateDir, actorId);
4757
+ return _chunkTTVNEKBEcjs.getNodePath.call(void 0, ).join(this.#stateDir, actorId);
4758
4758
  }
4759
4759
  getActorDbPath(actorId) {
4760
- return _chunk3B6PCYJBcjs.getNodePath.call(void 0, ).join(this.#dbsDir, `${actorId}.db`);
4760
+ return _chunkTTVNEKBEcjs.getNodePath.call(void 0, ).join(this.#dbsDir, `${actorId}.db`);
4761
4761
  }
4762
4762
  getActorAlarmPath(actorId) {
4763
- return _chunk3B6PCYJBcjs.getNodePath.call(void 0, ).join(this.#alarmsDir, actorId);
4763
+ return _chunkTTVNEKBEcjs.getNodePath.call(void 0, ).join(this.#alarmsDir, actorId);
4764
4764
  }
4765
4765
  #getActorKvDatabasePath(actorId) {
4766
4766
  if (this.#persist) {
@@ -4783,7 +4783,7 @@ var FileSystemGlobalState = class {
4783
4783
  }
4784
4784
  const dbPath = this.#getActorKvDatabasePath(actorId);
4785
4785
  if (this.#persist) {
4786
- const path = _chunk3B6PCYJBcjs.getNodePath.call(void 0, );
4786
+ const path = _chunkTTVNEKBEcjs.getNodePath.call(void 0, );
4787
4787
  ensureDirectoryExistsSync(path.dirname(dbPath));
4788
4788
  }
4789
4789
  let db;
@@ -4838,7 +4838,7 @@ var FileSystemGlobalState = class {
4838
4838
  return count > 0;
4839
4839
  }
4840
4840
  #migrateLegacyKvToSqliteOnStartupSync() {
4841
- const fsSync = _chunk3B6PCYJBcjs.getNodeFsSync.call(void 0, );
4841
+ const fsSync = _chunkTTVNEKBEcjs.getNodeFsSync.call(void 0, );
4842
4842
  if (!fsSync.existsSync(this.#stateDir)) {
4843
4843
  return;
4844
4844
  }
@@ -4863,7 +4863,7 @@ var FileSystemGlobalState = class {
4863
4863
  continue;
4864
4864
  }
4865
4865
  const dbPath = this.getActorDbPath(actorId);
4866
- const path = _chunk3B6PCYJBcjs.getNodePath.call(void 0, );
4866
+ const path = _chunkTTVNEKBEcjs.getNodePath.call(void 0, );
4867
4867
  ensureDirectoryExistsSync(path.dirname(dbPath));
4868
4868
  const db = this.#sqliteRuntime.open(dbPath);
4869
4869
  try {
@@ -4888,7 +4888,7 @@ var FileSystemGlobalState = class {
4888
4888
  }
4889
4889
  async *getActorsIterator(params) {
4890
4890
  let actorIds = Array.from(this.#actors.keys()).sort();
4891
- const fsSync = _chunk3B6PCYJBcjs.getNodeFsSync.call(void 0, );
4891
+ const fsSync = _chunkTTVNEKBEcjs.getNodeFsSync.call(void 0, );
4892
4892
  if (fsSync.existsSync(this.#stateDir)) {
4893
4893
  actorIds = fsSync.readdirSync(this.#stateDir).filter((id) => !id.includes(".tmp")).sort();
4894
4894
  }
@@ -4945,7 +4945,7 @@ var FileSystemGlobalState = class {
4945
4945
  entry.lifecycleState = 0 /* NONEXISTENT */;
4946
4946
  entry.generation = crypto.randomUUID();
4947
4947
  }
4948
- const initialKvState = _chunk3B6PCYJBcjs.getInitialActorKvState.call(void 0, input);
4948
+ const initialKvState = _chunkTTVNEKBEcjs.getInitialActorKvState.call(void 0, input);
4949
4949
  await this.#withActorWrite(actorId, async (lockedEntry) => {
4950
4950
  lockedEntry.state = {
4951
4951
  actorId,
@@ -4997,7 +4997,7 @@ var FileSystemGlobalState = class {
4997
4997
  async loadActorState(entry) {
4998
4998
  const stateFilePath = this.getActorStatePath(entry.id);
4999
4999
  try {
5000
- const fs = _chunk3B6PCYJBcjs.getNodeFs.call(void 0, );
5000
+ const fs = _chunkTTVNEKBEcjs.getNodeFs.call(void 0, );
5001
5001
  const stateData = await fs.readFile(stateFilePath);
5002
5002
  const loadedState = ACTOR_STATE_VERSIONED.deserializeWithEmbeddedVersion(
5003
5003
  new Uint8Array(stateData)
@@ -5030,7 +5030,7 @@ var FileSystemGlobalState = class {
5030
5030
  entry.lifecycleState = 0 /* NONEXISTENT */;
5031
5031
  entry.generation = crypto.randomUUID();
5032
5032
  }
5033
- const initialKvState = _chunk3B6PCYJBcjs.getInitialActorKvState.call(void 0, input);
5033
+ const initialKvState = _chunkTTVNEKBEcjs.getInitialActorKvState.call(void 0, input);
5034
5034
  await this.#withActorWrite(actorId, async (lockedEntry) => {
5035
5035
  lockedEntry.state = {
5036
5036
  actorId,
@@ -5070,7 +5070,7 @@ var FileSystemGlobalState = class {
5070
5070
  return;
5071
5071
  }
5072
5072
  actor.lifecycleState = 2 /* STARTING_SLEEP */;
5073
- actor.stopPromise = _chunk4KSHPFXFcjs.promiseWithResolvers.call(void 0, (reason) => logger2().warn({ msg: "unhandled actor sleep stop promise rejection", reason }));
5073
+ actor.stopPromise = _chunk2Q5WS6QHcjs.promiseWithResolvers.call(void 0, (reason) => logger2().warn({ msg: "unhandled actor sleep stop promise rejection", reason }));
5074
5074
  if (actor.loadPromise) await actor.loadPromise.catch();
5075
5075
  if ((_a = actor.startPromise) == null ? void 0 : _a.promise)
5076
5076
  await actor.startPromise.promise.catch();
@@ -5111,7 +5111,7 @@ var FileSystemGlobalState = class {
5111
5111
  return;
5112
5112
  }
5113
5113
  actor.lifecycleState = 3 /* STARTING_DESTROY */;
5114
- actor.stopPromise = _chunk4KSHPFXFcjs.promiseWithResolvers.call(void 0, (reason) => logger2().warn({ msg: "unhandled actor destroy stop promise rejection", reason }));
5114
+ actor.stopPromise = _chunk2Q5WS6QHcjs.promiseWithResolvers.call(void 0, (reason) => logger2().warn({ msg: "unhandled actor destroy stop promise rejection", reason }));
5115
5115
  if (actor.loadPromise) await actor.loadPromise.catch();
5116
5116
  if ((_a = actor.startPromise) == null ? void 0 : _a.promise)
5117
5117
  await actor.startPromise.promise.catch();
@@ -5144,7 +5144,7 @@ var FileSystemGlobalState = class {
5144
5144
  actor.alarmTimeout.abort();
5145
5145
  }
5146
5146
  if (this.#persist) {
5147
- const fs = _chunk3B6PCYJBcjs.getNodeFs.call(void 0, );
5147
+ const fs = _chunkTTVNEKBEcjs.getNodeFs.call(void 0, );
5148
5148
  await Promise.all([
5149
5149
  // Delete actor state file
5150
5150
  (async () => {
@@ -5155,7 +5155,7 @@ var FileSystemGlobalState = class {
5155
5155
  logger2().error({
5156
5156
  msg: "failed to delete actor state file",
5157
5157
  actorId,
5158
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, err)
5158
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, err)
5159
5159
  });
5160
5160
  }
5161
5161
  }
@@ -5169,7 +5169,7 @@ var FileSystemGlobalState = class {
5169
5169
  logger2().error({
5170
5170
  msg: "failed to delete actor database file",
5171
5171
  actorId,
5172
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, err)
5172
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, err)
5173
5173
  });
5174
5174
  }
5175
5175
  }
@@ -5183,7 +5183,7 @@ var FileSystemGlobalState = class {
5183
5183
  logger2().error({
5184
5184
  msg: "failed to delete actor alarm file",
5185
5185
  actorId,
5186
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, err)
5186
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, err)
5187
5187
  });
5188
5188
  }
5189
5189
  }
@@ -5243,7 +5243,7 @@ var FileSystemGlobalState = class {
5243
5243
  const entry = this.#actors.get(actorId);
5244
5244
  _invariant2.default.call(void 0, entry, "actor entry does not exist");
5245
5245
  const previousWrite = entry.pendingWriteResolver;
5246
- const currentWrite = _chunk4KSHPFXFcjs.promiseWithResolvers.call(void 0, (reason) => logger2().warn({ msg: "unhandled kv write promise rejection", reason }));
5246
+ const currentWrite = _chunk2Q5WS6QHcjs.promiseWithResolvers.call(void 0, (reason) => logger2().warn({ msg: "unhandled kv write promise rejection", reason }));
5247
5247
  entry.pendingWriteResolver = currentWrite;
5248
5248
  if (previousWrite) {
5249
5249
  try {
@@ -5283,10 +5283,10 @@ var FileSystemGlobalState = class {
5283
5283
  }
5284
5284
  if (this.#persist) {
5285
5285
  const alarmPath = this.getActorAlarmPath(actorId);
5286
- const crypto2 = _chunk3B6PCYJBcjs.getNodeCrypto.call(void 0, );
5286
+ const crypto2 = _chunkTTVNEKBEcjs.getNodeCrypto.call(void 0, );
5287
5287
  const tempPath = `${alarmPath}.tmp.${crypto2.randomUUID()}`;
5288
5288
  try {
5289
- const path = _chunk3B6PCYJBcjs.getNodePath.call(void 0, );
5289
+ const path = _chunkTTVNEKBEcjs.getNodePath.call(void 0, );
5290
5290
  await ensureDirectoryExists(path.dirname(alarmPath));
5291
5291
  const alarmData = {
5292
5292
  actorId,
@@ -5296,7 +5296,7 @@ var FileSystemGlobalState = class {
5296
5296
  alarmData,
5297
5297
  CURRENT_VERSION3
5298
5298
  );
5299
- const fs = _chunk3B6PCYJBcjs.getNodeFs.call(void 0, );
5299
+ const fs = _chunkTTVNEKBEcjs.getNodeFs.call(void 0, );
5300
5300
  await fs.writeFile(tempPath, data);
5301
5301
  if (!this.isGenerationCurrentAndNotDestroyed(
5302
5302
  actorId,
@@ -5310,7 +5310,7 @@ var FileSystemGlobalState = class {
5310
5310
  await fs.rename(tempPath, alarmPath);
5311
5311
  } catch (error) {
5312
5312
  try {
5313
- const fs = _chunk3B6PCYJBcjs.getNodeFs.call(void 0, );
5313
+ const fs = _chunkTTVNEKBEcjs.getNodeFs.call(void 0, );
5314
5314
  await fs.unlink(tempPath);
5315
5315
  } catch (e11) {
5316
5316
  }
@@ -5329,10 +5329,10 @@ var FileSystemGlobalState = class {
5329
5329
  */
5330
5330
  async #performWrite(actorId, generation, state) {
5331
5331
  const dataPath = this.getActorStatePath(actorId);
5332
- const crypto2 = _chunk3B6PCYJBcjs.getNodeCrypto.call(void 0, );
5332
+ const crypto2 = _chunkTTVNEKBEcjs.getNodeCrypto.call(void 0, );
5333
5333
  const tempPath = `${dataPath}.tmp.${crypto2.randomUUID()}`;
5334
5334
  try {
5335
- const path = _chunk3B6PCYJBcjs.getNodePath.call(void 0, );
5335
+ const path = _chunkTTVNEKBEcjs.getNodePath.call(void 0, );
5336
5336
  await ensureDirectoryExists(path.dirname(dataPath));
5337
5337
  const bareState = {
5338
5338
  actorId: state.actorId,
@@ -5349,7 +5349,7 @@ var FileSystemGlobalState = class {
5349
5349
  bareState,
5350
5350
  CURRENT_VERSION3
5351
5351
  );
5352
- const fs = _chunk3B6PCYJBcjs.getNodeFs.call(void 0, );
5352
+ const fs = _chunkTTVNEKBEcjs.getNodeFs.call(void 0, );
5353
5353
  await fs.writeFile(tempPath, serializedState);
5354
5354
  if (!this.isGenerationCurrentAndNotDestroyed(actorId, generation)) {
5355
5355
  logger2().debug(
@@ -5360,7 +5360,7 @@ var FileSystemGlobalState = class {
5360
5360
  await fs.rename(tempPath, dataPath);
5361
5361
  } catch (error) {
5362
5362
  try {
5363
- const fs = _chunk3B6PCYJBcjs.getNodeFs.call(void 0, );
5363
+ const fs = _chunkTTVNEKBEcjs.getNodeFs.call(void 0, );
5364
5364
  await fs.unlink(tempPath);
5365
5365
  } catch (e12) {
5366
5366
  }
@@ -5424,7 +5424,7 @@ var FileSystemGlobalState = class {
5424
5424
  return entry.actor;
5425
5425
  }
5426
5426
  }
5427
- entry.startPromise = _chunk4KSHPFXFcjs.promiseWithResolvers.call(void 0, (reason) => logger2().warn({ msg: "unhandled actor start promise rejection", reason }));
5427
+ entry.startPromise = _chunk2Q5WS6QHcjs.promiseWithResolvers.call(void 0, (reason) => logger2().warn({ msg: "unhandled actor start promise rejection", reason }));
5428
5428
  try {
5429
5429
  const definition = lookupInRegistry(config4, entry.state.name);
5430
5430
  entry.actor = await definition.instantiate();
@@ -5490,11 +5490,11 @@ var FileSystemGlobalState = class {
5490
5490
  */
5491
5491
  #loadAlarmsSync() {
5492
5492
  try {
5493
- const fsSync = _chunk3B6PCYJBcjs.getNodeFsSync.call(void 0, );
5493
+ const fsSync = _chunkTTVNEKBEcjs.getNodeFsSync.call(void 0, );
5494
5494
  const files = fsSync.existsSync(this.#alarmsDir) ? fsSync.readdirSync(this.#alarmsDir) : [];
5495
5495
  for (const file of files) {
5496
5496
  if (file.includes(".tmp.")) continue;
5497
- const path = _chunk3B6PCYJBcjs.getNodePath.call(void 0, );
5497
+ const path = _chunkTTVNEKBEcjs.getNodePath.call(void 0, );
5498
5498
  const fullPath = path.join(this.#alarmsDir, file);
5499
5499
  try {
5500
5500
  const buf = fsSync.readFileSync(fullPath);
@@ -5517,7 +5517,7 @@ var FileSystemGlobalState = class {
5517
5517
  logger2().error({
5518
5518
  msg: "failed to read alarm file",
5519
5519
  file,
5520
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, err)
5520
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, err)
5521
5521
  });
5522
5522
  }
5523
5523
  }
@@ -5547,18 +5547,18 @@ var FileSystemGlobalState = class {
5547
5547
  (_a = entry.alarmTimeout) == null ? void 0 : _a.abort();
5548
5548
  entry.alarmTimestamp = timestamp;
5549
5549
  const delay = Math.max(0, timestamp - Date.now());
5550
- entry.alarmTimeout = _chunk4KSHPFXFcjs.setLongTimeout.call(void 0, async () => {
5550
+ entry.alarmTimeout = _chunk2Q5WS6QHcjs.setLongTimeout.call(void 0, async () => {
5551
5551
  entry.alarmTimestamp = void 0;
5552
5552
  if (this.#persist) {
5553
5553
  try {
5554
- const fs = _chunk3B6PCYJBcjs.getNodeFs.call(void 0, );
5554
+ const fs = _chunkTTVNEKBEcjs.getNodeFs.call(void 0, );
5555
5555
  await fs.unlink(this.getActorAlarmPath(actorId));
5556
5556
  } catch (err) {
5557
5557
  if ((err == null ? void 0 : err.code) !== "ENOENT") {
5558
5558
  logger2().debug({
5559
5559
  msg: "failed to remove alarm file",
5560
5560
  actorId,
5561
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, err)
5561
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, err)
5562
5562
  });
5563
5563
  }
5564
5564
  }
@@ -5584,7 +5584,7 @@ var FileSystemGlobalState = class {
5584
5584
  logger2().error({
5585
5585
  msg: "failed to handle alarm",
5586
5586
  actorId,
5587
- error: _chunk4KSHPFXFcjs.stringifyError.call(void 0, err)
5587
+ error: _chunk2Q5WS6QHcjs.stringifyError.call(void 0, err)
5588
5588
  });
5589
5589
  }
5590
5590
  }, delay);
@@ -5594,13 +5594,13 @@ var FileSystemGlobalState = class {
5594
5594
  */
5595
5595
  #cleanupTempFilesSync() {
5596
5596
  try {
5597
- const fsSync = _chunk3B6PCYJBcjs.getNodeFsSync.call(void 0, );
5597
+ const fsSync = _chunkTTVNEKBEcjs.getNodeFsSync.call(void 0, );
5598
5598
  const files = fsSync.readdirSync(this.#stateDir);
5599
5599
  const tempFiles = files.filter((f) => f.includes(".tmp."));
5600
5600
  const oneHourAgo = Date.now() - 36e5;
5601
5601
  for (const tempFile of tempFiles) {
5602
5602
  try {
5603
- const path = _chunk3B6PCYJBcjs.getNodePath.call(void 0, );
5603
+ const path = _chunkTTVNEKBEcjs.getNodePath.call(void 0, );
5604
5604
  const fullPath = path.join(this.#stateDir, tempFile);
5605
5605
  const stat = fsSync.statSync(fullPath);
5606
5606
  if (stat.mtimeMs < oneHourAgo) {
@@ -5747,7 +5747,7 @@ var FileSystemManagerDriver = class {
5747
5747
  this.#config = config4;
5748
5748
  this.#state = state;
5749
5749
  this.#driverConfig = driverConfig;
5750
- const inlineClient = _chunkTEUL4UYNcjs.createClientWithDriver.call(void 0, this);
5750
+ const inlineClient = _chunkGRHLSP4Acjs.createClientWithDriver.call(void 0, this);
5751
5751
  this.#actorDriver = this.#driverConfig.actor(
5752
5752
  config4,
5753
5753
  this,
@@ -5773,7 +5773,7 @@ var FileSystemManagerDriver = class {
5773
5773
  });
5774
5774
  const pathOnly = normalizedPath.split("?")[0];
5775
5775
  const { gatewayId, requestId } = createHibernatableRequestMetadata();
5776
- const wsHandler = await _chunk3B6PCYJBcjs.routeWebSocket.call(void 0,
5776
+ const wsHandler = await _chunkTTVNEKBEcjs.routeWebSocket.call(void 0,
5777
5777
  fakeRequest,
5778
5778
  pathOnly,
5779
5779
  {},
@@ -5801,7 +5801,7 @@ var FileSystemManagerDriver = class {
5801
5801
  const pathOnly = path.split("?")[0];
5802
5802
  const normalizedPath = pathOnly.startsWith("/") ? pathOnly : `/${pathOnly}`;
5803
5803
  const { gatewayId, requestId } = createHibernatableRequestMetadata();
5804
- const wsHandler = await _chunk3B6PCYJBcjs.routeWebSocket.call(void 0,
5804
+ const wsHandler = await _chunkTTVNEKBEcjs.routeWebSocket.call(void 0,
5805
5805
  // TODO: Create new request with new path
5806
5806
  c.req.raw,
5807
5807
  normalizedPath,
@@ -5816,7 +5816,7 @@ var FileSystemManagerDriver = class {
5816
5816
  true,
5817
5817
  false
5818
5818
  );
5819
- return upgradeWebSocket(() => wsHandler)(c, _chunk4KSHPFXFcjs.noopNext.call(void 0, ));
5819
+ return upgradeWebSocket(() => wsHandler)(c, _chunk2Q5WS6QHcjs.noopNext.call(void 0, ));
5820
5820
  }
5821
5821
  async buildGatewayUrl(actorId) {
5822
5822
  const port = _nullishCoalesce(this.#config.managerPort, () => ( 6420));
@@ -5932,7 +5932,7 @@ var CreateFileSystemDriverOptionsSchema = _zod.z.object({
5932
5932
  useNativeSqlite: _zod.z.boolean().optional()
5933
5933
  });
5934
5934
  function createFileSystemOrMemoryDriver(persist = true, options) {
5935
- _chunk3B6PCYJBcjs.importNodeDependencies.call(void 0, );
5935
+ _chunkTTVNEKBEcjs.importNodeDependencies.call(void 0, );
5936
5936
  if ((options == null ? void 0 : options.useNativeSqlite) === false) {
5937
5937
  throw new Error(
5938
5938
  "File-system driver no longer supports non-SQLite KV storage. Remove useNativeSqlite: false."
@@ -5981,4 +5981,4 @@ function createMemoryDriver() {
5981
5981
 
5982
5982
 
5983
5983
  exports.ActorDefinition = ActorDefinition; exports.lookupInRegistry = lookupInRegistry; exports.createActorRouter = createActorRouter; exports.InlineWebSocketAdapter = InlineWebSocketAdapter; exports.getStoragePath = getStoragePath; exports.ensureDirectoryExists = ensureDirectoryExists; exports.createFileSystemOrMemoryDriver = createFileSystemOrMemoryDriver; exports.createFileSystemDriver = createFileSystemDriver; exports.createMemoryDriver = createMemoryDriver;
5984
- //# sourceMappingURL=chunk-UWAGLDT6.cjs.map
5984
+ //# sourceMappingURL=chunk-Z2X3VVCS.cjs.map