rivetkit 2.0.35 → 2.0.37

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 (95) hide show
  1. package/dist/tsup/actor/errors.cjs +6 -2
  2. package/dist/tsup/actor/errors.cjs.map +1 -1
  3. package/dist/tsup/actor/errors.d.cts +7 -1
  4. package/dist/tsup/actor/errors.d.ts +7 -1
  5. package/dist/tsup/actor/errors.js +5 -1
  6. package/dist/tsup/{chunk-OAGIXNOC.cjs → chunk-22NKW7F5.cjs} +9 -9
  7. package/dist/tsup/{chunk-OAGIXNOC.cjs.map → chunk-22NKW7F5.cjs.map} +1 -1
  8. package/dist/tsup/{chunk-6KPMUCTX.js → chunk-2YHR67M4.js} +26 -2
  9. package/dist/tsup/{chunk-6KPMUCTX.js.map → chunk-2YHR67M4.js.map} +1 -1
  10. package/dist/tsup/{chunk-RLJYDDGJ.cjs → chunk-4V7MS7SO.cjs} +3 -3
  11. package/dist/tsup/{chunk-RLJYDDGJ.cjs.map → chunk-4V7MS7SO.cjs.map} +1 -1
  12. package/dist/tsup/{chunk-QY2XOK33.cjs → chunk-5VVIFC6M.cjs} +355 -265
  13. package/dist/tsup/chunk-5VVIFC6M.cjs.map +1 -0
  14. package/dist/tsup/{chunk-ESNM74WZ.js → chunk-5XGZXH74.js} +274 -320
  15. package/dist/tsup/chunk-5XGZXH74.js.map +1 -0
  16. package/dist/tsup/{chunk-SKOXACQD.cjs → chunk-B6BP74X3.cjs} +224 -270
  17. package/dist/tsup/chunk-B6BP74X3.cjs.map +1 -0
  18. package/dist/tsup/{chunk-W3X2CC5D.js → chunk-FIUSIG6J.js} +5 -5
  19. package/dist/tsup/{chunk-3BUVMAPG.cjs → chunk-G4N7FZMM.cjs} +151 -121
  20. package/dist/tsup/chunk-G4N7FZMM.cjs.map +1 -0
  21. package/dist/tsup/{chunk-UQPTBQYY.js → chunk-J6TX5EFW.js} +67 -37
  22. package/dist/tsup/chunk-J6TX5EFW.js.map +1 -0
  23. package/dist/tsup/{chunk-6N4L6DVT.cjs → chunk-LYYTV7DN.cjs} +49 -49
  24. package/dist/tsup/{chunk-6N4L6DVT.cjs.map → chunk-LYYTV7DN.cjs.map} +1 -1
  25. package/dist/tsup/{chunk-S4TG6JFA.js → chunk-RBA5AQTB.js} +5 -5
  26. package/dist/tsup/{chunk-2PH6FNGI.js → chunk-RXA3ZMCL.js} +2 -2
  27. package/dist/tsup/{chunk-FWT2BTVT.cjs → chunk-SNAUKDDK.cjs} +26 -2
  28. package/dist/tsup/chunk-SNAUKDDK.cjs.map +1 -0
  29. package/dist/tsup/{chunk-6KXKY3IE.cjs → chunk-X5IX3YPO.cjs} +13 -9
  30. package/dist/tsup/chunk-X5IX3YPO.cjs.map +1 -0
  31. package/dist/tsup/{chunk-UCUYH474.js → chunk-XI335ZED.js} +7 -3
  32. package/dist/tsup/chunk-XI335ZED.js.map +1 -0
  33. package/dist/tsup/{chunk-PSMT24GX.js → chunk-ZQBSQ6H3.js} +96 -6
  34. package/dist/tsup/chunk-ZQBSQ6H3.js.map +1 -0
  35. package/dist/tsup/client/mod.cjs +6 -6
  36. package/dist/tsup/client/mod.d.cts +8 -8
  37. package/dist/tsup/client/mod.d.ts +8 -8
  38. package/dist/tsup/client/mod.js +5 -5
  39. package/dist/tsup/common/log.cjs +3 -3
  40. package/dist/tsup/common/log.js +2 -2
  41. package/dist/tsup/common/websocket.cjs +4 -4
  42. package/dist/tsup/common/websocket.js +3 -3
  43. package/dist/tsup/{config-Qr8_jvK3.d.cts → config--NjwiYlS.d.cts} +24 -25
  44. package/dist/tsup/{config-DRt_4bDk.d.ts → config-CRuzI6n4.d.ts} +24 -25
  45. package/dist/tsup/{driver-zNEhBkiK.d.ts → driver-BcmckRaF.d.ts} +1 -1
  46. package/dist/tsup/driver-helpers/mod.cjs +4 -4
  47. package/dist/tsup/driver-helpers/mod.d.cts +2 -2
  48. package/dist/tsup/driver-helpers/mod.d.ts +2 -2
  49. package/dist/tsup/driver-helpers/mod.js +3 -3
  50. package/dist/tsup/driver-test-suite/mod.cjs +37 -37
  51. package/dist/tsup/driver-test-suite/mod.cjs.map +1 -1
  52. package/dist/tsup/driver-test-suite/mod.d.cts +2 -2
  53. package/dist/tsup/driver-test-suite/mod.d.ts +2 -2
  54. package/dist/tsup/driver-test-suite/mod.js +9 -9
  55. package/dist/tsup/{driver-D6heoKxK.d.cts → driver-yKjYx9Yy.d.cts} +1 -1
  56. package/dist/tsup/mod.cjs +8 -8
  57. package/dist/tsup/mod.d.cts +4 -4
  58. package/dist/tsup/mod.d.ts +4 -4
  59. package/dist/tsup/mod.js +7 -7
  60. package/dist/tsup/test/mod.cjs +8 -8
  61. package/dist/tsup/test/mod.d.cts +1 -1
  62. package/dist/tsup/test/mod.d.ts +1 -1
  63. package/dist/tsup/test/mod.js +7 -7
  64. package/dist/tsup/utils.cjs +3 -3
  65. package/dist/tsup/utils.js +2 -2
  66. package/package.json +2 -2
  67. package/src/actor/errors.ts +24 -0
  68. package/src/client/config.ts +58 -50
  69. package/src/common/router.ts +12 -0
  70. package/src/drivers/engine/config.ts +6 -3
  71. package/src/engine-process/constants.ts +1 -1
  72. package/src/engine-process/mod.ts +1 -1
  73. package/src/globals.d.ts +1 -0
  74. package/src/inspector/utils.ts +1 -1
  75. package/src/manager/router.ts +8 -1
  76. package/src/registry/config/index.ts +98 -90
  77. package/src/registry/config/serverless.ts +34 -3
  78. package/src/remote-manager-driver/api-utils.ts +3 -0
  79. package/src/serverless/router.test.ts +133 -0
  80. package/src/serverless/router.ts +63 -2
  81. package/src/utils/endpoint-parser.test.ts +184 -171
  82. package/src/utils/endpoint-parser.ts +70 -65
  83. package/src/utils/env-vars.ts +6 -0
  84. package/dist/tsup/chunk-3BUVMAPG.cjs.map +0 -1
  85. package/dist/tsup/chunk-6KXKY3IE.cjs.map +0 -1
  86. package/dist/tsup/chunk-ESNM74WZ.js.map +0 -1
  87. package/dist/tsup/chunk-FWT2BTVT.cjs.map +0 -1
  88. package/dist/tsup/chunk-PSMT24GX.js.map +0 -1
  89. package/dist/tsup/chunk-QY2XOK33.cjs.map +0 -1
  90. package/dist/tsup/chunk-SKOXACQD.cjs.map +0 -1
  91. package/dist/tsup/chunk-UCUYH474.js.map +0 -1
  92. package/dist/tsup/chunk-UQPTBQYY.js.map +0 -1
  93. /package/dist/tsup/{chunk-W3X2CC5D.js.map → chunk-FIUSIG6J.js.map} +0 -0
  94. /package/dist/tsup/{chunk-S4TG6JFA.js.map → chunk-RBA5AQTB.js.map} +0 -0
  95. /package/dist/tsup/{chunk-2PH6FNGI.js.map → chunk-RXA3ZMCL.js.map} +0 -0
@@ -1,7 +1,7 @@
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; var _class3;
2
2
 
3
3
 
4
- var _chunkRLJYDDGJcjs = require('./chunk-RLJYDDGJ.cjs');
4
+ var _chunk4V7MS7SOcjs = require('./chunk-4V7MS7SO.cjs');
5
5
 
6
6
 
7
7
 
@@ -58,8 +58,8 @@ var _chunkRLJYDDGJcjs = require('./chunk-RLJYDDGJ.cjs');
58
58
 
59
59
 
60
60
 
61
- var _chunkSKOXACQDcjs = require('./chunk-SKOXACQD.cjs');
62
61
 
62
+ var _chunkB6BP74X3cjs = require('./chunk-B6BP74X3.cjs');
63
63
 
64
64
 
65
65
 
@@ -78,13 +78,13 @@ var _chunkSKOXACQDcjs = require('./chunk-SKOXACQD.cjs');
78
78
 
79
79
 
80
80
 
81
- var _chunk6KXKY3IEcjs = require('./chunk-6KXKY3IE.cjs');
82
81
 
83
82
 
84
83
 
85
84
 
86
85
 
87
86
 
87
+ var _chunkX5IX3YPOcjs = require('./chunk-X5IX3YPO.cjs');
88
88
 
89
89
 
90
90
 
@@ -92,15 +92,21 @@ var _chunk6KXKY3IEcjs = require('./chunk-6KXKY3IE.cjs');
92
92
 
93
93
 
94
94
 
95
- var _chunkFWT2BTVTcjs = require('./chunk-FWT2BTVT.cjs');
95
+
96
+
97
+
98
+
99
+
100
+
101
+ var _chunkSNAUKDDKcjs = require('./chunk-SNAUKDDK.cjs');
96
102
 
97
103
  // src/devtools-loader/log.ts
98
104
  function logger2() {
99
- return _chunk6KXKY3IEcjs.getLogger.call(void 0, "devtools");
105
+ return _chunkX5IX3YPOcjs.getLogger.call(void 0, "devtools");
100
106
  }
101
107
 
102
108
  // src/devtools-loader/index.ts
103
- var DEFAULT_DEVTOOLS_URL = (version = _chunk6KXKY3IEcjs.VERSION) => `https://releases.rivet.dev/rivet/latest/devtools/mod.js?v=${version}`;
109
+ var DEFAULT_DEVTOOLS_URL = (version = _chunkX5IX3YPOcjs.VERSION) => `https://releases.rivet.dev/rivet/latest/devtools/mod.js?v=${version}`;
104
110
  var scriptId = "rivetkit-devtools-script";
105
111
  function injectDevtools(config) {
106
112
  if (!window) {
@@ -123,7 +129,7 @@ var _cborx = require('cbor-x'); var cbor2 = _interopRequireWildcard(_cborx); var
123
129
  var _invariant = require('invariant'); var _invariant2 = _interopRequireDefault(_invariant);
124
130
 
125
131
  // src/remote-manager-driver/api-utils.ts
126
- var _zod = require('zod');
132
+ var _zod = require('zod'); var _zod2 = _interopRequireDefault(_zod);
127
133
 
128
134
  // src/client/utils.ts
129
135
 
@@ -216,10 +222,10 @@ function messageLength(message) {
216
222
  if (typeof message === "string") {
217
223
  return message.length;
218
224
  }
219
- _chunk6KXKY3IEcjs.assertUnreachable.call(void 0, message);
225
+ _chunkX5IX3YPOcjs.assertUnreachable.call(void 0, message);
220
226
  }
221
227
  async function sendHttpRequest(opts) {
222
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
228
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
223
229
  msg: "sending http request",
224
230
  url: opts.url,
225
231
  encoding: opts.encoding
@@ -228,8 +234,8 @@ async function sendHttpRequest(opts) {
228
234
  let bodyData;
229
235
  if (opts.method === "POST" || opts.method === "PUT") {
230
236
  _invariant2.default.call(void 0, opts.body !== void 0, "missing body");
231
- contentType = _chunkSKOXACQDcjs.contentTypeForEncoding.call(void 0, opts.encoding);
232
- bodyData = _chunkSKOXACQDcjs.serializeWithEncoding.call(void 0,
237
+ contentType = _chunkB6BP74X3cjs.contentTypeForEncoding.call(void 0, opts.encoding);
238
+ bodyData = _chunkB6BP74X3cjs.serializeWithEncoding.call(void 0,
233
239
  opts.encoding,
234
240
  opts.body,
235
241
  opts.requestVersionedDataHandler,
@@ -249,7 +255,7 @@ async function sendHttpRequest(opts) {
249
255
  ...contentType ? {
250
256
  "Content-Type": contentType
251
257
  } : {},
252
- "User-Agent": _chunk6KXKY3IEcjs.httpUserAgent.call(void 0, )
258
+ "User-Agent": _chunkX5IX3YPOcjs.httpUserAgent.call(void 0, )
253
259
  },
254
260
  body: bodyData,
255
261
  credentials: "include",
@@ -267,11 +273,11 @@ async function sendHttpRequest(opts) {
267
273
  const rayId = response.headers.get("x-rivet-ray-id");
268
274
  const encoding = (contentType2 == null ? void 0 : contentType2.includes("application/json")) ? "json" : opts.encoding;
269
275
  try {
270
- const responseData = _chunkSKOXACQDcjs.deserializeWithEncoding.call(void 0,
276
+ const responseData = _chunkB6BP74X3cjs.deserializeWithEncoding.call(void 0,
271
277
  encoding,
272
278
  new Uint8Array(bufferResponse),
273
- _chunkSKOXACQDcjs.HTTP_RESPONSE_ERROR_VERSIONED,
274
- _chunkSKOXACQDcjs.HttpResponseErrorSchema,
279
+ _chunkB6BP74X3cjs.HTTP_RESPONSE_ERROR_VERSIONED,
280
+ _chunkB6BP74X3cjs.HttpResponseErrorSchema,
275
281
  // JSON: metadata is already unknown
276
282
  (json) => json,
277
283
  // BARE: decode ArrayBuffer metadata to unknown
@@ -313,7 +319,7 @@ ${textResponse}`
313
319
  }
314
320
  try {
315
321
  const buffer = new Uint8Array(await response.arrayBuffer());
316
- return _chunkSKOXACQDcjs.deserializeWithEncoding.call(void 0,
322
+ return _chunkB6BP74X3cjs.deserializeWithEncoding.call(void 0,
317
323
  opts.encoding,
318
324
  buffer,
319
325
  opts.responseVersionedDataHandler,
@@ -330,7 +336,7 @@ ${textResponse}`
330
336
 
331
337
  // src/remote-manager-driver/log.ts
332
338
  function logger3() {
333
- return _chunk6KXKY3IEcjs.getLogger.call(void 0, "remote-manager-driver");
339
+ return _chunkX5IX3YPOcjs.getLogger.call(void 0, "remote-manager-driver");
334
340
  }
335
341
 
336
342
  // src/remote-manager-driver/api-utils.ts
@@ -347,7 +353,7 @@ function getEndpoint(config) {
347
353
  }
348
354
  async function apiCall(config, method, path, body) {
349
355
  const endpoint = getEndpoint(config);
350
- const url = _chunk6KXKY3IEcjs.combineUrlPath.call(void 0, endpoint, path, {
356
+ const url = _chunkX5IX3YPOcjs.combineUrlPath.call(void 0, endpoint, path, {
351
357
  namespace: config.namespace
352
358
  });
353
359
  logger3().debug({ msg: "making api call", method, url });
@@ -382,7 +388,7 @@ async function apiCall(config, method, path, body) {
382
388
  async function sendHttpRequestToActor(runConfig, actorId, actorRequest) {
383
389
  const url = new URL(actorRequest.url);
384
390
  const endpoint = getEndpoint(runConfig);
385
- const guardUrl = _chunk6KXKY3IEcjs.combineUrlPath.call(void 0,
391
+ const guardUrl = _chunkX5IX3YPOcjs.combineUrlPath.call(void 0,
386
392
  endpoint,
387
393
  `/gateway/${actorId}${url.pathname}${url.search}`
388
394
  );
@@ -423,14 +429,14 @@ function buildGuardHeadersForHttp(runConfig, actorRequest, actorId) {
423
429
  headers.set(key, value);
424
430
  }
425
431
  if (runConfig.token) {
426
- headers.set(_chunkSKOXACQDcjs.HEADER_RIVET_TOKEN, runConfig.token);
432
+ headers.set(_chunkB6BP74X3cjs.HEADER_RIVET_TOKEN, runConfig.token);
427
433
  }
428
434
  return headers;
429
435
  }
430
436
 
431
437
  // src/remote-manager-driver/actor-websocket-client.ts
432
438
  async function openWebSocketToActor(runConfig, path, actorId, encoding, params) {
433
- const WebSocket2 = await _chunkRLJYDDGJcjs.importWebSocket.call(void 0, );
439
+ const WebSocket2 = await _chunk4V7MS7SOcjs.importWebSocket.call(void 0, );
434
440
  const endpoint = getEndpoint(runConfig);
435
441
  let gatewayPath;
436
442
  if (runConfig.token !== void 0) {
@@ -438,7 +444,7 @@ async function openWebSocketToActor(runConfig, path, actorId, encoding, params)
438
444
  } else {
439
445
  gatewayPath = `/gateway/${encodeURIComponent(actorId)}${path}`;
440
446
  }
441
- const guardUrl = _chunk6KXKY3IEcjs.combineUrlPath.call(void 0, endpoint, gatewayPath);
447
+ const guardUrl = _chunkX5IX3YPOcjs.combineUrlPath.call(void 0, endpoint, gatewayPath);
442
448
  logger3().debug({
443
449
  msg: "opening websocket to actor via guard",
444
450
  actorId,
@@ -455,11 +461,11 @@ async function openWebSocketToActor(runConfig, path, actorId, encoding, params)
455
461
  }
456
462
  function buildWebSocketProtocols(runConfig, encoding, params) {
457
463
  const protocols = [];
458
- protocols.push(_chunkSKOXACQDcjs.WS_PROTOCOL_STANDARD);
459
- protocols.push(`${_chunkSKOXACQDcjs.WS_PROTOCOL_ENCODING}${encoding}`);
464
+ protocols.push(_chunkB6BP74X3cjs.WS_PROTOCOL_STANDARD);
465
+ protocols.push(`${_chunkB6BP74X3cjs.WS_PROTOCOL_ENCODING}${encoding}`);
460
466
  if (params) {
461
467
  protocols.push(
462
- `${_chunkSKOXACQDcjs.WS_PROTOCOL_CONN_PARAMS}${encodeURIComponent(JSON.stringify(params))}`
468
+ `${_chunkB6BP74X3cjs.WS_PROTOCOL_CONN_PARAMS}${encodeURIComponent(JSON.stringify(params))}`
463
469
  );
464
470
  }
465
471
  return protocols;
@@ -474,7 +480,7 @@ async function getActor(config, _, actorId) {
474
480
  );
475
481
  }
476
482
  async function getActorByKey(config, name, key) {
477
- const serializedKey = _chunkSKOXACQDcjs.serializeActorKey.call(void 0, key);
483
+ const serializedKey = _chunkB6BP74X3cjs.serializeActorKey.call(void 0, key);
478
484
  return apiCall(
479
485
  config,
480
486
  "GET",
@@ -566,7 +572,7 @@ async function lookupMetadataCached(config) {
566
572
  msg: "failed to fetch metadata, retrying",
567
573
  endpoint,
568
574
  attempt: error.attemptNumber,
569
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
575
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
570
576
  });
571
577
  }
572
578
  }
@@ -578,7 +584,7 @@ async function lookupMetadataCached(config) {
578
584
 
579
585
  // src/remote-manager-driver/ws-proxy.ts
580
586
  async function createWebSocketProxy(c, targetUrl, protocols) {
581
- const WebSocket2 = await _chunkRLJYDDGJcjs.importWebSocket.call(void 0, );
587
+ const WebSocket2 = await _chunk4V7MS7SOcjs.importWebSocket.call(void 0, );
582
588
  const state = {};
583
589
  return {
584
590
  onOpen: async (event, clientWs) => {
@@ -641,7 +647,7 @@ async function createWebSocketProxy(c, targetUrl, protocols) {
641
647
  logger3().error({
642
648
  msg: "target websocket error",
643
649
  targetUrl,
644
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
650
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
645
651
  });
646
652
  closeWebSocketIfOpen(clientWs, 1011, "Target WebSocket error");
647
653
  });
@@ -720,7 +726,7 @@ var RemoteManagerDriver = class {
720
726
  #config;
721
727
  #metadataPromise;
722
728
  constructor(runConfig) {
723
- if (_chunk6KXKY3IEcjs.getNextPhase.call(void 0, ) === "phase-production-build") {
729
+ if (_chunkX5IX3YPOcjs.getNextPhase.call(void 0, ) === "phase-production-build") {
724
730
  logger3().info(
725
731
  "detected next.js build phase, disabling health check"
726
732
  );
@@ -809,9 +815,9 @@ var RemoteManagerDriver = class {
809
815
  const { actor, created } = await getOrCreateActor(this.#config, {
810
816
  datacenter: region,
811
817
  name,
812
- key: _chunkSKOXACQDcjs.serializeActorKey.call(void 0, key),
818
+ key: _chunkB6BP74X3cjs.serializeActorKey.call(void 0, key),
813
819
  runner_name_selector: this.#config.runnerName,
814
- input: actorInput ? _chunkSKOXACQDcjs.uint8ArrayToBase64.call(void 0, cbor2.encode(actorInput)) : void 0,
820
+ input: actorInput ? _chunkB6BP74X3cjs.uint8ArrayToBase64.call(void 0, cbor2.encode(actorInput)) : void 0,
815
821
  crash_policy: "sleep"
816
822
  });
817
823
  logger3().info({
@@ -838,8 +844,8 @@ var RemoteManagerDriver = class {
838
844
  datacenter: region,
839
845
  name,
840
846
  runner_name_selector: this.#config.runnerName,
841
- key: _chunkSKOXACQDcjs.serializeActorKey.call(void 0, key),
842
- input: input ? _chunkSKOXACQDcjs.uint8ArrayToBase64.call(void 0, cbor2.encode(input)) : void 0,
847
+ key: _chunkB6BP74X3cjs.serializeActorKey.call(void 0, key),
848
+ input: input ? _chunkB6BP74X3cjs.uint8ArrayToBase64.call(void 0, cbor2.encode(input)) : void 0,
843
849
  crash_policy: "sleep"
844
850
  });
845
851
  logger3().info({
@@ -906,7 +912,7 @@ var RemoteManagerDriver = class {
906
912
  const upgradeWebSocket = (_b = (_a = this.#config).getUpgradeWebSocket) == null ? void 0 : _b.call(_a);
907
913
  _invariant2.default.call(void 0, upgradeWebSocket, "missing getUpgradeWebSocket");
908
914
  const endpoint = getEndpoint(this.#config);
909
- const guardUrl = _chunk6KXKY3IEcjs.combineUrlPath.call(void 0, endpoint, path);
915
+ const guardUrl = _chunkX5IX3YPOcjs.combineUrlPath.call(void 0, endpoint, path);
910
916
  const wsGuardUrl = guardUrl.replace("http://", "ws://");
911
917
  logger3().debug({
912
918
  msg: "forwarding websocket to actor via guard",
@@ -920,7 +926,7 @@ var RemoteManagerDriver = class {
920
926
  params
921
927
  );
922
928
  const args = await createWebSocketProxy(c, wsGuardUrl, protocols);
923
- return await upgradeWebSocket(() => args)(c, _chunk6KXKY3IEcjs.noopNext.call(void 0, ));
929
+ return await upgradeWebSocket(() => args)(c, _chunkX5IX3YPOcjs.noopNext.call(void 0, ));
924
930
  }
925
931
  async kvGet(actorId, key) {
926
932
  if (this.#metadataPromise) {
@@ -945,7 +951,7 @@ function apiActorToOutput(actor) {
945
951
  return {
946
952
  actorId: actor.actor_id,
947
953
  name: actor.name,
948
- key: _chunkSKOXACQDcjs.deserializeActorKey.call(void 0, actor.key),
954
+ key: _chunkB6BP74X3cjs.deserializeActorKey.call(void 0, actor.key),
949
955
  createTs: actor.create_ts,
950
956
  startTs: _nullishCoalesce(actor.start_ts, () => ( null)),
951
957
  connectableTs: _nullishCoalesce(actor.connectable_ts, () => ( null)),
@@ -962,7 +968,7 @@ function apiActorToOutput(actor) {
962
968
 
963
969
  // src/client/actor-query.ts
964
970
  async function queryActor(c, query, managerDriver) {
965
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({ msg: "querying actor", query: JSON.stringify(query) });
971
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({ msg: "querying actor", query: JSON.stringify(query) });
966
972
  let actorOutput;
967
973
  if ("getForId" in query) {
968
974
  const output = await managerDriver.getForId({
@@ -970,7 +976,7 @@ async function queryActor(c, query, managerDriver) {
970
976
  name: query.getForId.name,
971
977
  actorId: query.getForId.actorId
972
978
  });
973
- if (!output) throw new (0, _chunkFWT2BTVTcjs.ActorNotFound)(query.getForId.actorId);
979
+ if (!output) throw new (0, _chunkSNAUKDDKcjs.ActorNotFound)(query.getForId.actorId);
974
980
  actorOutput = output;
975
981
  } else if ("getForKey" in query) {
976
982
  const existingActor = await managerDriver.getWithKey({
@@ -979,7 +985,7 @@ async function queryActor(c, query, managerDriver) {
979
985
  key: query.getForKey.key
980
986
  });
981
987
  if (!existingActor) {
982
- throw new (0, _chunkFWT2BTVTcjs.ActorNotFound)(
988
+ throw new (0, _chunkSNAUKDDKcjs.ActorNotFound)(
983
989
  `${query.getForKey.name}:${JSON.stringify(query.getForKey.key)}`
984
990
  );
985
991
  }
@@ -1007,9 +1013,9 @@ async function queryActor(c, query, managerDriver) {
1007
1013
  actorId: createOutput.actorId
1008
1014
  };
1009
1015
  } else {
1010
- throw new (0, _chunkFWT2BTVTcjs.InvalidRequest)("Invalid query format");
1016
+ throw new (0, _chunkSNAUKDDKcjs.InvalidRequest)("Invalid query format");
1011
1017
  }
1012
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({ msg: "actor query result", actorId: actorOutput.actorId });
1018
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({ msg: "actor query result", actorId: actorOutput.actorId });
1013
1019
  return { actorId: actorOutput.actorId };
1014
1020
  }
1015
1021
 
@@ -1072,16 +1078,16 @@ var ActorConnRaw = class {
1072
1078
  * @returns {Promise<Response>} - A promise that resolves to the response of the action function.
1073
1079
  */
1074
1080
  async action(opts) {
1075
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({ msg: "action", name: opts.name, args: opts.args });
1081
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({ msg: "action", name: opts.name, args: opts.args });
1076
1082
  const actionId = this.#actionIdCounter;
1077
1083
  this.#actionIdCounter += 1;
1078
- const { promise, resolve, reject } = _chunk6KXKY3IEcjs.promiseWithResolvers.call(void 0, );
1084
+ const { promise, resolve, reject } = _chunkX5IX3YPOcjs.promiseWithResolvers.call(void 0, );
1079
1085
  this.#actionsInFlight.set(actionId, {
1080
1086
  name: opts.name,
1081
1087
  resolve,
1082
1088
  reject
1083
1089
  });
1084
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
1090
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
1085
1091
  msg: "added action to in-flight map",
1086
1092
  actionId,
1087
1093
  actionName: opts.name,
@@ -1122,9 +1128,9 @@ var ActorConnRaw = class {
1122
1128
  try {
1123
1129
  handler(status);
1124
1130
  } catch (err) {
1125
- _chunkRLJYDDGJcjs.logger.call(void 0, ).error({
1131
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).error({
1126
1132
  msg: "error in status change handler",
1127
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, err)
1133
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, err)
1128
1134
  });
1129
1135
  }
1130
1136
  }
@@ -1133,9 +1139,9 @@ var ActorConnRaw = class {
1133
1139
  try {
1134
1140
  handler();
1135
1141
  } catch (err) {
1136
- _chunkRLJYDDGJcjs.logger.call(void 0, ).error({
1142
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).error({
1137
1143
  msg: "error in open handler",
1138
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, err)
1144
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, err)
1139
1145
  });
1140
1146
  }
1141
1147
  }
@@ -1145,9 +1151,9 @@ var ActorConnRaw = class {
1145
1151
  try {
1146
1152
  handler();
1147
1153
  } catch (err) {
1148
- _chunkRLJYDDGJcjs.logger.call(void 0, ).error({
1154
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).error({
1149
1155
  msg: "error in close handler",
1150
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, err)
1156
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, err)
1151
1157
  });
1152
1158
  }
1153
1159
  }
@@ -1160,21 +1166,21 @@ var ActorConnRaw = class {
1160
1166
  minTimeout: 250,
1161
1167
  maxTimeout: 3e4,
1162
1168
  onFailedAttempt: (error) => {
1163
- _chunkRLJYDDGJcjs.logger.call(void 0, ).warn({
1169
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).warn({
1164
1170
  msg: "failed to reconnect",
1165
1171
  attempt: error.attemptNumber,
1166
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
1172
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
1167
1173
  });
1168
1174
  },
1169
1175
  // Cancel retry if aborted
1170
1176
  signal: this.#abortController.signal
1171
1177
  }).catch((err) => {
1172
1178
  if (err.name === "AbortError") {
1173
- _chunkRLJYDDGJcjs.logger.call(void 0, ).info({ msg: "connection retry aborted" });
1179
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).info({ msg: "connection retry aborted" });
1174
1180
  } else {
1175
- _chunkRLJYDDGJcjs.logger.call(void 0, ).error({
1181
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).error({
1176
1182
  msg: "unexpected error in connection retry",
1177
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, err)
1183
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, err)
1178
1184
  });
1179
1185
  }
1180
1186
  });
@@ -1183,7 +1189,7 @@ var ActorConnRaw = class {
1183
1189
  try {
1184
1190
  if (this.#onOpenPromise)
1185
1191
  throw new Error("#onOpenPromise already defined");
1186
- this.#onOpenPromise = _chunk6KXKY3IEcjs.promiseWithResolvers.call(void 0, );
1192
+ this.#onOpenPromise = _chunkX5IX3YPOcjs.promiseWithResolvers.call(void 0, );
1187
1193
  await this.#connectWebSocket();
1188
1194
  await this.#onOpenPromise.promise;
1189
1195
  } finally {
@@ -1198,12 +1204,12 @@ var ActorConnRaw = class {
1198
1204
  );
1199
1205
  this.#actorId = actorId;
1200
1206
  const ws = await this.#driver.openWebSocket(
1201
- _chunkSKOXACQDcjs.PATH_CONNECT,
1207
+ _chunkB6BP74X3cjs.PATH_CONNECT,
1202
1208
  actorId,
1203
1209
  this.#encoding,
1204
1210
  this.#params
1205
1211
  );
1206
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
1212
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
1207
1213
  msg: "opened websocket",
1208
1214
  connId: this.#connId,
1209
1215
  readyState: ws.readyState,
@@ -1211,7 +1217,7 @@ var ActorConnRaw = class {
1211
1217
  });
1212
1218
  this.#websocket = ws;
1213
1219
  ws.addEventListener("open", () => {
1214
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
1220
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
1215
1221
  msg: "client websocket open",
1216
1222
  connId: this.#connId
1217
1223
  });
@@ -1220,9 +1226,9 @@ var ActorConnRaw = class {
1220
1226
  try {
1221
1227
  await this.#handleOnMessage(ev.data);
1222
1228
  } catch (err) {
1223
- _chunkRLJYDDGJcjs.logger.call(void 0, ).error({
1229
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).error({
1224
1230
  msg: "error in websocket message handler",
1225
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, err)
1231
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, err)
1226
1232
  });
1227
1233
  }
1228
1234
  });
@@ -1230,9 +1236,9 @@ var ActorConnRaw = class {
1230
1236
  try {
1231
1237
  this.#handleOnClose(ev);
1232
1238
  } catch (err) {
1233
- _chunkRLJYDDGJcjs.logger.call(void 0, ).error({
1239
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).error({
1234
1240
  msg: "error in websocket close handler",
1235
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, err)
1241
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, err)
1236
1242
  });
1237
1243
  }
1238
1244
  });
@@ -1240,9 +1246,9 @@ var ActorConnRaw = class {
1240
1246
  try {
1241
1247
  this.#handleOnError();
1242
1248
  } catch (err) {
1243
- _chunkRLJYDDGJcjs.logger.call(void 0, ).error({
1249
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).error({
1244
1250
  msg: "error in websocket error handler",
1245
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, err)
1251
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, err)
1246
1252
  });
1247
1253
  }
1248
1254
  });
@@ -1250,7 +1256,7 @@ var ActorConnRaw = class {
1250
1256
  /** Called by the onopen event from drivers. */
1251
1257
  #handleOnOpen() {
1252
1258
  if (this.#disposed) {
1253
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
1259
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
1254
1260
  msg: "handleOnOpen called after dispose, closing websocket"
1255
1261
  });
1256
1262
  if (this.#websocket) {
@@ -1259,7 +1265,7 @@ var ActorConnRaw = class {
1259
1265
  }
1260
1266
  return;
1261
1267
  }
1262
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
1268
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
1263
1269
  msg: "socket open",
1264
1270
  messageQueueLength: this.#messageQueue.length,
1265
1271
  connId: this.#connId
@@ -1268,14 +1274,14 @@ var ActorConnRaw = class {
1268
1274
  if (this.#onOpenPromise) {
1269
1275
  this.#onOpenPromise.resolve(void 0);
1270
1276
  } else {
1271
- _chunkRLJYDDGJcjs.logger.call(void 0, ).warn({ msg: "#onOpenPromise is undefined" });
1277
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).warn({ msg: "#onOpenPromise is undefined" });
1272
1278
  }
1273
1279
  for (const eventName of this.#eventSubscriptions.keys()) {
1274
1280
  this.#sendSubscription(eventName, true);
1275
1281
  }
1276
1282
  const queue = this.#messageQueue;
1277
1283
  this.#messageQueue = [];
1278
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
1284
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
1279
1285
  msg: "flushing message queue",
1280
1286
  queueLength: queue.length
1281
1287
  });
@@ -1285,23 +1291,23 @@ var ActorConnRaw = class {
1285
1291
  }
1286
1292
  /** Called by the onmessage event from drivers. */
1287
1293
  async #handleOnMessage(data) {
1288
- _chunkRLJYDDGJcjs.logger.call(void 0, ).trace({
1294
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).trace({
1289
1295
  msg: "received message",
1290
1296
  dataType: typeof data,
1291
1297
  isBlob: data instanceof Blob,
1292
1298
  isArrayBuffer: data instanceof ArrayBuffer
1293
1299
  });
1294
1300
  const response = await this.#parseMessage(data);
1295
- _chunkRLJYDDGJcjs.logger.call(void 0, ).trace(
1296
- _chunk6KXKY3IEcjs.getLogMessage.call(void 0, ) ? {
1301
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).trace(
1302
+ _chunkX5IX3YPOcjs.getLogMessage.call(void 0, ) ? {
1297
1303
  msg: "parsed message",
1298
- message: _chunkSKOXACQDcjs.jsonStringifyCompat.call(void 0, response).substring(0, 100) + "..."
1304
+ message: _chunkB6BP74X3cjs.jsonStringifyCompat.call(void 0, response).substring(0, 100) + "..."
1299
1305
  } : { msg: "parsed message" }
1300
1306
  );
1301
1307
  if (response.body.tag === "Init") {
1302
1308
  this.#actorId = response.body.val.actorId;
1303
1309
  this.#connId = response.body.val.connectionId;
1304
- _chunkRLJYDDGJcjs.logger.call(void 0, ).trace({
1310
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).trace({
1305
1311
  msg: "received init message",
1306
1312
  actorId: this.#actorId,
1307
1313
  connId: this.#connId
@@ -1311,7 +1317,7 @@ var ActorConnRaw = class {
1311
1317
  const { group, code, message, metadata, actionId } = response.body.val;
1312
1318
  if (actionId) {
1313
1319
  const inFlight = this.#takeActionInFlight(Number(actionId));
1314
- _chunkRLJYDDGJcjs.logger.call(void 0, ).warn({
1320
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).warn({
1315
1321
  msg: "action error",
1316
1322
  actionId,
1317
1323
  actionName: inFlight == null ? void 0 : inFlight.name,
@@ -1324,7 +1330,7 @@ var ActorConnRaw = class {
1324
1330
  new ActorError(group, code, message, metadata)
1325
1331
  );
1326
1332
  } else {
1327
- _chunkRLJYDDGJcjs.logger.call(void 0, ).warn({
1333
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).warn({
1328
1334
  msg: "connection error",
1329
1335
  group,
1330
1336
  code,
@@ -1356,27 +1362,27 @@ var ActorConnRaw = class {
1356
1362
  }
1357
1363
  } else if (response.body.tag === "ActionResponse") {
1358
1364
  const { id: actionId } = response.body.val;
1359
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
1365
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
1360
1366
  msg: "received action response",
1361
1367
  actionId: Number(actionId),
1362
1368
  inFlightCount: this.#actionsInFlight.size,
1363
1369
  inFlightIds: Array.from(this.#actionsInFlight.keys())
1364
1370
  });
1365
1371
  const inFlight = this.#takeActionInFlight(Number(actionId));
1366
- _chunkRLJYDDGJcjs.logger.call(void 0, ).trace({
1372
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).trace({
1367
1373
  msg: "resolving action promise",
1368
1374
  actionId,
1369
1375
  actionName: inFlight == null ? void 0 : inFlight.name
1370
1376
  });
1371
1377
  inFlight.resolve(response.body.val);
1372
1378
  } else if (response.body.tag === "Event") {
1373
- _chunkRLJYDDGJcjs.logger.call(void 0, ).trace({
1379
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).trace({
1374
1380
  msg: "received event",
1375
1381
  name: response.body.val.name
1376
1382
  });
1377
1383
  this.#dispatchEvent(response.body.val);
1378
1384
  } else {
1379
- _chunk6KXKY3IEcjs.assertUnreachable.call(void 0, response.body);
1385
+ _chunkX5IX3YPOcjs.assertUnreachable.call(void 0, response.body);
1380
1386
  }
1381
1387
  }
1382
1388
  /** Called by the onclose event from drivers. */
@@ -1384,7 +1390,7 @@ var ActorConnRaw = class {
1384
1390
  const closeEvent = event;
1385
1391
  const wasClean = closeEvent.wasClean;
1386
1392
  const wasConnected = this.#connStatus === "connected";
1387
- _chunkRLJYDDGJcjs.logger.call(void 0, ).info({
1393
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).info({
1388
1394
  msg: "socket closed",
1389
1395
  code: closeEvent.code,
1390
1396
  reason: closeEvent.reason,
@@ -1404,7 +1410,7 @@ var ActorConnRaw = class {
1404
1410
  false
1405
1411
  );
1406
1412
  if (wasConnected) {
1407
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
1413
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
1408
1414
  msg: "triggering reconnect",
1409
1415
  connId: this.#connId
1410
1416
  });
@@ -1428,12 +1434,12 @@ var ActorConnRaw = class {
1428
1434
  /** Called by the onerror event from drivers. */
1429
1435
  #handleOnError() {
1430
1436
  if (this.#disposed) return;
1431
- _chunkRLJYDDGJcjs.logger.call(void 0, ).warn("socket error");
1437
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).warn("socket error");
1432
1438
  }
1433
1439
  #takeActionInFlight(id) {
1434
1440
  const inFlight = this.#actionsInFlight.get(id);
1435
1441
  if (!inFlight) {
1436
- _chunkRLJYDDGJcjs.logger.call(void 0, ).error({
1442
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).error({
1437
1443
  msg: "action not found in in-flight map",
1438
1444
  lookupId: id,
1439
1445
  inFlightCount: this.#actionsInFlight.size,
@@ -1448,7 +1454,7 @@ var ActorConnRaw = class {
1448
1454
  throw new InternalError2(`No in flight response for ${id}`);
1449
1455
  }
1450
1456
  this.#actionsInFlight.delete(id);
1451
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
1457
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
1452
1458
  msg: "removed action from in-flight map",
1453
1459
  actionId: id,
1454
1460
  actionName: inFlight.name,
@@ -1475,9 +1481,9 @@ var ActorConnRaw = class {
1475
1481
  try {
1476
1482
  handler(error);
1477
1483
  } catch (err) {
1478
- _chunkRLJYDDGJcjs.logger.call(void 0, ).error({
1484
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).error({
1479
1485
  msg: "error in connection error handler",
1480
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, err)
1486
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, err)
1481
1487
  });
1482
1488
  }
1483
1489
  }
@@ -1493,7 +1499,7 @@ var ActorConnRaw = class {
1493
1499
  actorId: this.#actorId
1494
1500
  });
1495
1501
  if (actor == null ? void 0 : actor.error) {
1496
- _chunkRLJYDDGJcjs.logger.call(void 0, ).info({
1502
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).info({
1497
1503
  msg: "found actor scheduling error",
1498
1504
  actorId: this.#actorId,
1499
1505
  error: actor.error
@@ -1504,10 +1510,10 @@ var ActorConnRaw = class {
1504
1510
  );
1505
1511
  }
1506
1512
  } catch (err) {
1507
- _chunkRLJYDDGJcjs.logger.call(void 0, ).warn({
1513
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).warn({
1508
1514
  msg: "failed to fetch actor details for scheduling error check",
1509
1515
  actorId: this.#actorId,
1510
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, err)
1516
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, err)
1511
1517
  });
1512
1518
  }
1513
1519
  return null;
@@ -1643,7 +1649,7 @@ var ActorConnRaw = class {
1643
1649
  let queueMessage = false;
1644
1650
  if (this.#websocket) {
1645
1651
  const readyState = this.#websocket.readyState;
1646
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
1652
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
1647
1653
  msg: "websocket send attempt",
1648
1654
  readyState,
1649
1655
  readyStateString: readyState === 0 ? "CONNECTING" : readyState === 1 ? "OPEN" : readyState === 2 ? "CLOSING" : "CLOSED",
@@ -1653,12 +1659,12 @@ var ActorConnRaw = class {
1653
1659
  });
1654
1660
  if (readyState === 1) {
1655
1661
  try {
1656
- const messageSerialized = _chunkSKOXACQDcjs.serializeWithEncoding.call(void 0,
1662
+ const messageSerialized = _chunkB6BP74X3cjs.serializeWithEncoding.call(void 0,
1657
1663
  this.#encoding,
1658
1664
  message,
1659
- _chunkSKOXACQDcjs.TO_SERVER_VERSIONED,
1660
- _chunkSKOXACQDcjs.CURRENT_VERSION,
1661
- _chunkSKOXACQDcjs.ToServerSchema,
1665
+ _chunkB6BP74X3cjs.TO_SERVER_VERSIONED,
1666
+ _chunkB6BP74X3cjs.CURRENT_VERSION,
1667
+ _chunkB6BP74X3cjs.ToServerSchema,
1662
1668
  // JSON: args is the raw value
1663
1669
  (msg) => msg,
1664
1670
  // BARE: args needs to be CBOR-encoded to ArrayBuffer
@@ -1670,7 +1676,7 @@ var ActorConnRaw = class {
1670
1676
  val: {
1671
1677
  id: msg.body.val.id,
1672
1678
  name: msg.body.val.name,
1673
- args: _chunk6KXKY3IEcjs.bufferToArrayBuffer.call(void 0,
1679
+ args: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0,
1674
1680
  cbor3.encode(msg.body.val.args)
1675
1681
  )
1676
1682
  }
@@ -1682,12 +1688,12 @@ var ActorConnRaw = class {
1682
1688
  }
1683
1689
  );
1684
1690
  this.#websocket.send(messageSerialized);
1685
- _chunkRLJYDDGJcjs.logger.call(void 0, ).trace({
1691
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).trace({
1686
1692
  msg: "sent websocket message",
1687
1693
  len: messageLength(messageSerialized)
1688
1694
  });
1689
1695
  } catch (error) {
1690
- _chunkRLJYDDGJcjs.logger.call(void 0, ).warn({
1696
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).warn({
1691
1697
  msg: "failed to send message, added to queue",
1692
1698
  error,
1693
1699
  connId: this.#connId
@@ -1695,19 +1701,19 @@ var ActorConnRaw = class {
1695
1701
  queueMessage = true;
1696
1702
  }
1697
1703
  } else {
1698
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
1704
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
1699
1705
  msg: "websocket not open, queueing message",
1700
1706
  readyState
1701
1707
  });
1702
1708
  queueMessage = true;
1703
1709
  }
1704
1710
  } else {
1705
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({ msg: "no websocket, queueing message" });
1711
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({ msg: "no websocket, queueing message" });
1706
1712
  queueMessage = true;
1707
1713
  }
1708
1714
  if (!(opts == null ? void 0 : opts.ephemeral) && queueMessage) {
1709
1715
  this.#messageQueue.push(message);
1710
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
1716
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
1711
1717
  msg: "queued connection message",
1712
1718
  queueLength: this.#messageQueue.length,
1713
1719
  connId: this.#connId,
@@ -1718,12 +1724,12 @@ var ActorConnRaw = class {
1718
1724
  }
1719
1725
  async #parseMessage(data) {
1720
1726
  _invariant2.default.call(void 0, this.#websocket, "websocket must be defined");
1721
- const buffer = await _chunkSKOXACQDcjs.inputDataToBuffer.call(void 0, data);
1722
- return _chunkSKOXACQDcjs.deserializeWithEncoding.call(void 0,
1727
+ const buffer = await _chunkB6BP74X3cjs.inputDataToBuffer.call(void 0, data);
1728
+ return _chunkB6BP74X3cjs.deserializeWithEncoding.call(void 0,
1723
1729
  this.#encoding,
1724
1730
  buffer,
1725
- _chunkSKOXACQDcjs.TO_CLIENT_VERSIONED,
1726
- _chunkSKOXACQDcjs.ToClientSchema,
1731
+ _chunkB6BP74X3cjs.TO_CLIENT_VERSIONED,
1732
+ _chunkB6BP74X3cjs.ToClientSchema,
1727
1733
  // JSON: values are already the correct type
1728
1734
  (msg) => msg,
1729
1735
  // BARE: need to decode ArrayBuffer fields back to unknown
@@ -1804,11 +1810,11 @@ var ActorConnRaw = class {
1804
1810
  */
1805
1811
  async dispose() {
1806
1812
  if (this.#disposed) {
1807
- _chunkRLJYDDGJcjs.logger.call(void 0, ).warn({ msg: "connection already disconnected" });
1813
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).warn({ msg: "connection already disconnected" });
1808
1814
  return;
1809
1815
  }
1810
1816
  this.#disposed = true;
1811
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({ msg: "disposing actor conn" });
1817
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({ msg: "disposing actor conn" });
1812
1818
  this.#setConnStatus("idle");
1813
1819
  clearInterval(this.#keepNodeAliveInterval);
1814
1820
  this.#abortController.abort();
@@ -1816,7 +1822,7 @@ var ActorConnRaw = class {
1816
1822
  if (this.#websocket) {
1817
1823
  const ws = this.#websocket;
1818
1824
  if (ws.readyState !== 2 && ws.readyState !== 3) {
1819
- const { promise, resolve } = _chunk6KXKY3IEcjs.promiseWithResolvers.call(void 0, );
1825
+ const { promise, resolve } = _chunkX5IX3YPOcjs.promiseWithResolvers.call(void 0, );
1820
1826
  ws.addEventListener("close", () => resolve(void 0));
1821
1827
  ws.close(1e3, "Disposed");
1822
1828
  await promise;
@@ -1888,13 +1894,13 @@ async function rawHttpFetch(driver, actorQuery, params, input, init) {
1888
1894
  }
1889
1895
  try {
1890
1896
  const { actorId } = await queryActor(void 0, actorQuery, driver);
1891
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({ msg: "found actor for raw http", actorId });
1897
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({ msg: "found actor for raw http", actorId });
1892
1898
  _invariant2.default.call(void 0, actorId, "Missing actor ID");
1893
1899
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
1894
1900
  const url = new URL(`http://actor/request/${normalizedPath}`);
1895
1901
  const proxyRequestHeaders = new Headers(mergedInit.headers);
1896
1902
  if (params) {
1897
- proxyRequestHeaders.set(_chunkSKOXACQDcjs.HEADER_CONN_PARAMS, JSON.stringify(params));
1903
+ proxyRequestHeaders.set(_chunkB6BP74X3cjs.HEADER_CONN_PARAMS, JSON.stringify(params));
1898
1904
  }
1899
1905
  const proxyRequest = new Request(url, {
1900
1906
  ...mergedInit,
@@ -1902,9 +1908,9 @@ async function rawHttpFetch(driver, actorQuery, params, input, init) {
1902
1908
  });
1903
1909
  return driver.sendRequest(actorId, proxyRequest);
1904
1910
  } catch (err) {
1905
- const { group, code, message, metadata } = _chunk6KXKY3IEcjs.deconstructError.call(void 0,
1911
+ const { group, code, message, metadata } = _chunkX5IX3YPOcjs.deconstructError.call(void 0,
1906
1912
  err,
1907
- _chunkRLJYDDGJcjs.logger.call(void 0, ),
1913
+ _chunk4V7MS7SOcjs.logger.call(void 0, ),
1908
1914
  {},
1909
1915
  true
1910
1916
  );
@@ -1914,7 +1920,7 @@ async function rawHttpFetch(driver, actorQuery, params, input, init) {
1914
1920
  async function rawWebSocket(driver, actorQuery, params, path, protocols) {
1915
1921
  const encoding = "bare";
1916
1922
  const { actorId } = await queryActor(void 0, actorQuery, driver);
1917
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({ msg: "found actor for action", actorId });
1923
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({ msg: "found actor for action", actorId });
1918
1924
  _invariant2.default.call(void 0, actorId, "Missing actor ID");
1919
1925
  let pathPortion = "";
1920
1926
  let queryPortion = "";
@@ -1930,8 +1936,8 @@ async function rawWebSocket(driver, actorQuery, params, path, protocols) {
1930
1936
  pathPortion = pathPortion.slice(1);
1931
1937
  }
1932
1938
  }
1933
- const fullPath = `${_chunkSKOXACQDcjs.PATH_WEBSOCKET_PREFIX}${pathPortion}${queryPortion}`;
1934
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
1939
+ const fullPath = `${_chunkB6BP74X3cjs.PATH_WEBSOCKET_PREFIX}${pathPortion}${queryPortion}`;
1940
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
1935
1941
  msg: "opening websocket",
1936
1942
  actorId,
1937
1943
  encoding,
@@ -1976,9 +1982,9 @@ var ActorHandleRaw = class {
1976
1982
  this.#actorQuery,
1977
1983
  this.#driver
1978
1984
  );
1979
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({ msg: "found actor for action", actorId });
1985
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({ msg: "found actor for action", actorId });
1980
1986
  _invariant2.default.call(void 0, actorId, "Missing actor ID");
1981
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
1987
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
1982
1988
  msg: "handling action",
1983
1989
  name: opts.name,
1984
1990
  encoding: this.#encoding
@@ -1987,8 +1993,8 @@ var ActorHandleRaw = class {
1987
1993
  url: `http://actor/action/${encodeURIComponent(opts.name)}`,
1988
1994
  method: "POST",
1989
1995
  headers: {
1990
- [_chunkSKOXACQDcjs.HEADER_ENCODING]: this.#encoding,
1991
- ...this.#params !== void 0 ? { [_chunkSKOXACQDcjs.HEADER_CONN_PARAMS]: JSON.stringify(this.#params) } : {}
1996
+ [_chunkB6BP74X3cjs.HEADER_ENCODING]: this.#encoding,
1997
+ ...this.#params !== void 0 ? { [_chunkB6BP74X3cjs.HEADER_CONN_PARAMS]: JSON.stringify(this.#params) } : {}
1992
1998
  },
1993
1999
  body: opts.args,
1994
2000
  encoding: this.#encoding,
@@ -1997,19 +2003,19 @@ var ActorHandleRaw = class {
1997
2003
  actorId
1998
2004
  ),
1999
2005
  signal: opts == null ? void 0 : opts.signal,
2000
- requestVersion: _chunkSKOXACQDcjs.CURRENT_VERSION,
2001
- requestVersionedDataHandler: _chunkSKOXACQDcjs.HTTP_ACTION_REQUEST_VERSIONED,
2002
- responseVersion: _chunkSKOXACQDcjs.CURRENT_VERSION,
2003
- responseVersionedDataHandler: _chunkSKOXACQDcjs.HTTP_ACTION_RESPONSE_VERSIONED,
2004
- requestZodSchema: _chunkSKOXACQDcjs.HttpActionRequestSchema,
2005
- responseZodSchema: _chunkSKOXACQDcjs.HttpActionResponseSchema,
2006
+ requestVersion: _chunkB6BP74X3cjs.CURRENT_VERSION,
2007
+ requestVersionedDataHandler: _chunkB6BP74X3cjs.HTTP_ACTION_REQUEST_VERSIONED,
2008
+ responseVersion: _chunkB6BP74X3cjs.CURRENT_VERSION,
2009
+ responseVersionedDataHandler: _chunkB6BP74X3cjs.HTTP_ACTION_RESPONSE_VERSIONED,
2010
+ requestZodSchema: _chunkB6BP74X3cjs.HttpActionRequestSchema,
2011
+ responseZodSchema: _chunkB6BP74X3cjs.HttpActionResponseSchema,
2006
2012
  // JSON Request: args is the raw value
2007
2013
  requestToJson: (args) => ({
2008
2014
  args
2009
2015
  }),
2010
2016
  // BARE Request: args needs to be CBOR-encoded
2011
2017
  requestToBare: (args) => ({
2012
- args: _chunk6KXKY3IEcjs.bufferToArrayBuffer.call(void 0, cbor4.encode(args))
2018
+ args: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor4.encode(args))
2013
2019
  }),
2014
2020
  // JSON Response: output is the raw value
2015
2021
  responseFromJson: (json) => json.output,
@@ -2018,9 +2024,9 @@ var ActorHandleRaw = class {
2018
2024
  });
2019
2025
  return responseData;
2020
2026
  } catch (err) {
2021
- const { group, code, message, metadata } = _chunk6KXKY3IEcjs.deconstructError.call(void 0,
2027
+ const { group, code, message, metadata } = _chunkX5IX3YPOcjs.deconstructError.call(void 0,
2022
2028
  err,
2023
- _chunkRLJYDDGJcjs.logger.call(void 0, ),
2029
+ _chunk4V7MS7SOcjs.logger.call(void 0, ),
2024
2030
  {},
2025
2031
  true
2026
2032
  );
@@ -2034,7 +2040,7 @@ var ActorHandleRaw = class {
2034
2040
  * @returns {ActorConn<AD>} A connection to the actor.
2035
2041
  */
2036
2042
  connect() {
2037
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
2043
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
2038
2044
  msg: "establishing connection from handle",
2039
2045
  query: this.#actorQuery
2040
2046
  });
@@ -2094,7 +2100,7 @@ var ActorHandleRaw = class {
2094
2100
  } else if ("getOrCreateForKey" in this.#actorQuery) {
2095
2101
  name = this.#actorQuery.getOrCreateForKey.name;
2096
2102
  } else {
2097
- _chunkSKOXACQDcjs.assertUnreachable.call(void 0, this.#actorQuery);
2103
+ _chunkB6BP74X3cjs.assertUnreachable.call(void 0, this.#actorQuery);
2098
2104
  }
2099
2105
  const { actorId } = await queryActor(
2100
2106
  void 0,
@@ -2108,7 +2114,7 @@ var ActorHandleRaw = class {
2108
2114
  } else if ("create" in this.#actorQuery) {
2109
2115
  _invariant2.default.call(void 0, false, "actorQuery cannot be create");
2110
2116
  } else {
2111
- _chunkSKOXACQDcjs.assertUnreachable.call(void 0, this.#actorQuery);
2117
+ _chunkB6BP74X3cjs.assertUnreachable.call(void 0, this.#actorQuery);
2112
2118
  }
2113
2119
  }
2114
2120
  };
@@ -2138,7 +2144,7 @@ var ClientRaw = (_class2 = class {
2138
2144
  * @returns {ActorHandle<AD>} - A handle to the actor.
2139
2145
  */
2140
2146
  getForId(name, actorId, opts) {
2141
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
2147
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
2142
2148
  msg: "get handle to actor with id",
2143
2149
  name,
2144
2150
  actorId,
@@ -2164,7 +2170,7 @@ var ClientRaw = (_class2 = class {
2164
2170
  */
2165
2171
  get(name, key, opts) {
2166
2172
  const keyArray = typeof key === "string" ? [key] : key || [];
2167
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
2173
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
2168
2174
  msg: "get handle to actor",
2169
2175
  name,
2170
2176
  key: keyArray,
@@ -2190,7 +2196,7 @@ var ClientRaw = (_class2 = class {
2190
2196
  */
2191
2197
  getOrCreate(name, key, opts) {
2192
2198
  const keyArray = typeof key === "string" ? [key] : key || [];
2193
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
2199
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
2194
2200
  msg: "get or create handle to actor",
2195
2201
  name,
2196
2202
  key: keyArray,
@@ -2228,7 +2234,7 @@ var ClientRaw = (_class2 = class {
2228
2234
  key: keyArray
2229
2235
  }
2230
2236
  };
2231
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
2237
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
2232
2238
  msg: "create actor handle",
2233
2239
  name,
2234
2240
  key: keyArray,
@@ -2240,7 +2246,7 @@ var ClientRaw = (_class2 = class {
2240
2246
  createQuery,
2241
2247
  this.#driver
2242
2248
  );
2243
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({
2249
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({
2244
2250
  msg: "created actor with ID",
2245
2251
  name,
2246
2252
  key: keyArray,
@@ -2277,11 +2283,11 @@ var ClientRaw = (_class2 = class {
2277
2283
  */
2278
2284
  async dispose() {
2279
2285
  if (this.#disposed) {
2280
- _chunkRLJYDDGJcjs.logger.call(void 0, ).warn({ msg: "client already disconnected" });
2286
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).warn({ msg: "client already disconnected" });
2281
2287
  return;
2282
2288
  }
2283
2289
  this.#disposed = true;
2284
- _chunkRLJYDDGJcjs.logger.call(void 0, ).debug({ msg: "disposing client" });
2290
+ _chunk4V7MS7SOcjs.logger.call(void 0, ).debug({ msg: "disposing client" });
2285
2291
  const disposePromises = [];
2286
2292
  for (const conn of this[ACTOR_CONNS_SYMBOL].values()) {
2287
2293
  disposePromises.push(conn.dispose());
@@ -2382,6 +2388,86 @@ function createActorProxy(handle) {
2382
2388
  });
2383
2389
  }
2384
2390
 
2391
+ // src/client/config.ts
2392
+
2393
+ function getDefaultEndpoint() {
2394
+ var _a;
2395
+ if (typeof window !== "undefined" && ((_a = window.location) == null ? void 0 : _a.origin)) {
2396
+ return `${window.location.origin}/api/rivet`;
2397
+ }
2398
+ return "http://127.0.0.1:6420";
2399
+ }
2400
+ var ClientConfigSchemaBase = _zod2.default.object({
2401
+ /**
2402
+ * Endpoint to connect to for Rivet Engine or RivetKit manager API.
2403
+ *
2404
+ * Supports URL auth syntax for namespace and token:
2405
+ * - `https://namespace:token@api.rivet.dev`
2406
+ * - `https://namespace@api.rivet.dev`
2407
+ *
2408
+ * Can also be set via RIVET_ENDPOINT environment variables.
2409
+ *
2410
+ * Defaults to current origin + /api/rivet in browser, or 127.0.0.1:6420 server-side.
2411
+ */
2412
+ endpoint: _zod2.default.string().optional().transform(
2413
+ (val) => _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(val, () => ( _chunkX5IX3YPOcjs.getRivetEngine.call(void 0, ))), () => ( _chunkX5IX3YPOcjs.getRivetEndpoint.call(void 0, ))), () => ( getDefaultEndpoint()))
2414
+ ),
2415
+ /** Token to use to authenticate with the API. */
2416
+ token: _zod2.default.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkX5IX3YPOcjs.getRivetToken.call(void 0, )))),
2417
+ /** Namespace to connect to. */
2418
+ namespace: _zod2.default.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkX5IX3YPOcjs.getRivetNamespace.call(void 0, )))),
2419
+ /** Name of the runner. This is used to group together runners in to different pools. */
2420
+ runnerName: _zod2.default.string().default(() => _nullishCoalesce(_chunkX5IX3YPOcjs.getRivetRunner.call(void 0, ), () => ( "default"))),
2421
+ encoding: _chunkB6BP74X3cjs.EncodingSchema.default("bare"),
2422
+ headers: _zod2.default.record(_zod2.default.string(), _zod2.default.string()).optional().default(() => ({})),
2423
+ // See RunConfig.getUpgradeWebSocket
2424
+ //
2425
+ // This is required in the client config in order to support
2426
+ // `proxyWebSocket`
2427
+ getUpgradeWebSocket: _zod2.default.custom().optional(),
2428
+ /** Whether to automatically perform health checks when the client is created. */
2429
+ disableMetadataLookup: _zod2.default.boolean().optional().default(false),
2430
+ /** Whether to enable RivetKit Devtools integration. */
2431
+ devtools: _zod2.default.boolean().default(
2432
+ () => {
2433
+ var _a, _b;
2434
+ return typeof window !== "undefined" && (((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.hostname) === "127.0.0.1" || ((_b = window.location) == null ? void 0 : _b.hostname) === "localhost");
2435
+ }
2436
+ )
2437
+ });
2438
+ var ClientConfigSchema = ClientConfigSchemaBase.transform(
2439
+ (config, ctx) => transformClientConfig(config, ctx)
2440
+ );
2441
+ function transformClientConfig(config, ctx) {
2442
+ const parsedEndpoint = _chunkB6BP74X3cjs.tryParseEndpoint.call(void 0, ctx, {
2443
+ endpoint: config.endpoint,
2444
+ path: ["endpoint"],
2445
+ namespace: config.namespace,
2446
+ token: config.token
2447
+ });
2448
+ return {
2449
+ ...config,
2450
+ endpoint: parsedEndpoint == null ? void 0 : parsedEndpoint.endpoint,
2451
+ namespace: _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.namespace), () => ( config.namespace)), () => ( "default")),
2452
+ token: _nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token))
2453
+ };
2454
+ }
2455
+ function convertRegistryConfigToClientConfig(config) {
2456
+ var _a, _b;
2457
+ return {
2458
+ endpoint: config.endpoint,
2459
+ token: config.token,
2460
+ namespace: config.namespace,
2461
+ runnerName: config.runner.runnerName,
2462
+ headers: config.headers,
2463
+ encoding: "bare",
2464
+ getUpgradeWebSocket: void 0,
2465
+ // We don't need health checks for internal clients
2466
+ disableMetadataLookup: true,
2467
+ devtools: typeof window !== "undefined" && (((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.hostname) === "127.0.0.1" || ((_b = window == null ? void 0 : window.location) == null ? void 0 : _b.hostname) === "localhost")
2468
+ };
2469
+ }
2470
+
2385
2471
  // src/actor/instance/mod.ts
2386
2472
 
2387
2473
 
@@ -2427,9 +2513,9 @@ var ActorInspector = (_class3 = class {
2427
2513
  }
2428
2514
  getState() {
2429
2515
  if (!this.actor.stateEnabled) {
2430
- throw new (0, _chunkFWT2BTVTcjs.StateNotEnabled)();
2516
+ throw new (0, _chunkSNAUKDDKcjs.StateNotEnabled)();
2431
2517
  }
2432
- return _chunk6KXKY3IEcjs.bufferToArrayBuffer.call(void 0,
2518
+ return _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0,
2433
2519
  cbor5.encode(this.actor.stateManager.persistRaw.state)
2434
2520
  );
2435
2521
  }
@@ -2441,13 +2527,13 @@ var ActorInspector = (_class3 = class {
2441
2527
  this.actor.connectionManager.connections.entries()
2442
2528
  ).map(([id, conn]) => {
2443
2529
  var _a, _b;
2444
- const connStateManager = conn[_chunkSKOXACQDcjs.CONN_STATE_MANAGER_SYMBOL];
2530
+ const connStateManager = conn[_chunkB6BP74X3cjs.CONN_STATE_MANAGER_SYMBOL];
2445
2531
  return {
2446
- type: (_a = conn[_chunkSKOXACQDcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _a.type,
2532
+ type: (_a = conn[_chunkB6BP74X3cjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _a.type,
2447
2533
  id,
2448
- details: _chunk6KXKY3IEcjs.bufferToArrayBuffer.call(void 0,
2534
+ details: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0,
2449
2535
  cbor5.encode({
2450
- type: (_b = conn[_chunkSKOXACQDcjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _b.type,
2536
+ type: (_b = conn[_chunkB6BP74X3cjs.CONN_DRIVER_SYMBOL]) == null ? void 0 : _b.type,
2451
2537
  params: conn.params,
2452
2538
  stateEnabled: connStateManager.stateEnabled,
2453
2539
  state: connStateManager.stateEnabled ? connStateManager.state : void 0,
@@ -2462,14 +2548,14 @@ var ActorInspector = (_class3 = class {
2462
2548
  }
2463
2549
  async setState(state) {
2464
2550
  if (!this.actor.stateEnabled) {
2465
- throw new (0, _chunkFWT2BTVTcjs.StateNotEnabled)();
2551
+ throw new (0, _chunkSNAUKDDKcjs.StateNotEnabled)();
2466
2552
  }
2467
2553
  this.actor.stateManager.state = cbor5.decode(Buffer.from(state));
2468
2554
  await this.actor.stateManager.saveState({ immediate: true });
2469
2555
  }
2470
2556
  async executeAction(name, params) {
2471
2557
  const conn = await this.actor.connectionManager.prepareAndConnectConn(
2472
- _chunkSKOXACQDcjs.createHttpDriver.call(void 0, ),
2558
+ _chunkB6BP74X3cjs.createHttpDriver.call(void 0, ),
2473
2559
  // TODO: This may cause issues
2474
2560
  void 0,
2475
2561
  void 0,
@@ -2477,10 +2563,10 @@ var ActorInspector = (_class3 = class {
2477
2563
  void 0
2478
2564
  );
2479
2565
  try {
2480
- return _chunk6KXKY3IEcjs.bufferToArrayBuffer.call(void 0,
2566
+ return _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0,
2481
2567
  cbor5.encode(
2482
2568
  await this.actor.executeAction(
2483
- new (0, _chunkSKOXACQDcjs.ActionContext)(this.actor, conn),
2569
+ new (0, _chunkB6BP74X3cjs.ActionContext)(this.actor, conn),
2484
2570
  name,
2485
2571
  cbor5.decode(Buffer.from(params))
2486
2572
  )
@@ -2498,7 +2584,7 @@ function transformEvent(event) {
2498
2584
  tag: "ActionEvent",
2499
2585
  val: {
2500
2586
  name: event.name,
2501
- args: _chunk6KXKY3IEcjs.bufferToArrayBuffer.call(void 0, cbor5.encode(event.args)),
2587
+ args: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor5.encode(event.args)),
2502
2588
  connId: event.connId
2503
2589
  }
2504
2590
  }
@@ -2529,7 +2615,7 @@ function transformEvent(event) {
2529
2615
  tag: "FiredEvent",
2530
2616
  val: {
2531
2617
  eventName: event.eventName,
2532
- args: _chunk6KXKY3IEcjs.bufferToArrayBuffer.call(void 0, cbor5.encode(event.args)),
2618
+ args: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor5.encode(event.args)),
2533
2619
  connId: event.connId
2534
2620
  }
2535
2621
  }
@@ -2540,12 +2626,12 @@ function transformEvent(event) {
2540
2626
  tag: "BroadcastEvent",
2541
2627
  val: {
2542
2628
  eventName: event.eventName,
2543
- args: _chunk6KXKY3IEcjs.bufferToArrayBuffer.call(void 0, cbor5.encode(event.args))
2629
+ args: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor5.encode(event.args))
2544
2630
  }
2545
2631
  }
2546
2632
  };
2547
2633
  } else {
2548
- _chunk6KXKY3IEcjs.assertUnreachable.call(void 0, event);
2634
+ _chunkX5IX3YPOcjs.assertUnreachable.call(void 0, event);
2549
2635
  }
2550
2636
  }
2551
2637
 
@@ -2554,8 +2640,8 @@ function transformEvent(event) {
2554
2640
  function convertConnToBarePersistedConn(persist) {
2555
2641
  return {
2556
2642
  id: persist.id,
2557
- parameters: _chunk6KXKY3IEcjs.bufferToArrayBuffer.call(void 0, cbor6.encode(persist.parameters)),
2558
- state: _chunk6KXKY3IEcjs.bufferToArrayBuffer.call(void 0, cbor6.encode(persist.state)),
2643
+ parameters: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor6.encode(persist.parameters)),
2644
+ state: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor6.encode(persist.state)),
2559
2645
  subscriptions: persist.subscriptions.map((sub) => ({
2560
2646
  eventName: sub.eventName
2561
2647
  })),
@@ -2643,7 +2729,7 @@ var ConnectionManager = class {
2643
2729
  return this.#reconnectHibernatableConn(driver);
2644
2730
  }
2645
2731
  if (this.#actor.config.onBeforeConnect) {
2646
- const ctx = new (0, _chunkSKOXACQDcjs.BeforeConnectContext)(this.#actor, request);
2732
+ const ctx = new (0, _chunkB6BP74X3cjs.BeforeConnectContext)(this.#actor, request);
2647
2733
  await this.#actor.config.onBeforeConnect(ctx, params);
2648
2734
  }
2649
2735
  let connState;
@@ -2683,8 +2769,8 @@ var ConnectionManager = class {
2683
2769
  }
2684
2770
  };
2685
2771
  }
2686
- const conn = new (0, _chunkSKOXACQDcjs.Conn)(this.#actor, connData);
2687
- conn[_chunkSKOXACQDcjs.CONN_DRIVER_SYMBOL] = driver;
2772
+ const conn = new (0, _chunkB6BP74X3cjs.Conn)(this.#actor, connData);
2773
+ conn[_chunkB6BP74X3cjs.CONN_DRIVER_SYMBOL] = driver;
2688
2774
  return conn;
2689
2775
  }
2690
2776
  /**
@@ -2707,15 +2793,15 @@ var ConnectionManager = class {
2707
2793
  this.#callOnConnect(conn);
2708
2794
  this.#actor.inspector.emitter.emit("connectionsUpdated");
2709
2795
  this.#actor.resetSleepTimer();
2710
- conn[_chunkSKOXACQDcjs.CONN_CONNECTED_SYMBOL] = true;
2711
- if (conn[_chunkSKOXACQDcjs.CONN_SPEAKS_RIVETKIT_SYMBOL]) {
2796
+ conn[_chunkB6BP74X3cjs.CONN_CONNECTED_SYMBOL] = true;
2797
+ if (conn[_chunkB6BP74X3cjs.CONN_SPEAKS_RIVETKIT_SYMBOL]) {
2712
2798
  const initData = { actorId: this.#actor.id, connectionId: conn.id };
2713
- conn[_chunkSKOXACQDcjs.CONN_SEND_MESSAGE_SYMBOL](
2714
- new (0, _chunkSKOXACQDcjs.CachedSerializer)(
2799
+ conn[_chunkB6BP74X3cjs.CONN_SEND_MESSAGE_SYMBOL](
2800
+ new (0, _chunkB6BP74X3cjs.CachedSerializer)(
2715
2801
  initData,
2716
- _chunkSKOXACQDcjs.TO_CLIENT_VERSIONED,
2717
- _chunkSKOXACQDcjs.CURRENT_VERSION,
2718
- _chunkSKOXACQDcjs.ToClientSchema,
2802
+ _chunkB6BP74X3cjs.TO_CLIENT_VERSIONED,
2803
+ _chunkB6BP74X3cjs.CURRENT_VERSION,
2804
+ _chunkB6BP74X3cjs.ToClientSchema,
2719
2805
  // JSON: identity conversion (no nested data to encode)
2720
2806
  (value) => ({
2721
2807
  body: {
@@ -2748,17 +2834,17 @@ var ConnectionManager = class {
2748
2834
  msg: "reconnecting hibernatable websocket connection",
2749
2835
  connectionId: existingConn.id
2750
2836
  });
2751
- if (existingConn[_chunkSKOXACQDcjs.CONN_DRIVER_SYMBOL]) {
2837
+ if (existingConn[_chunkB6BP74X3cjs.CONN_DRIVER_SYMBOL]) {
2752
2838
  this.#disconnectExistingDriver(existingConn);
2753
2839
  }
2754
- existingConn[_chunkSKOXACQDcjs.CONN_DRIVER_SYMBOL] = driver;
2840
+ existingConn[_chunkB6BP74X3cjs.CONN_DRIVER_SYMBOL] = driver;
2755
2841
  this.#actor.resetSleepTimer();
2756
- existingConn[_chunkSKOXACQDcjs.CONN_CONNECTED_SYMBOL] = true;
2842
+ existingConn[_chunkB6BP74X3cjs.CONN_CONNECTED_SYMBOL] = true;
2757
2843
  this.#actor.inspector.emitter.emit("connectionsUpdated");
2758
2844
  return existingConn;
2759
2845
  }
2760
2846
  #disconnectExistingDriver(conn) {
2761
- const driver = conn[_chunkSKOXACQDcjs.CONN_DRIVER_SYMBOL];
2847
+ const driver = conn[_chunkB6BP74X3cjs.CONN_DRIVER_SYMBOL];
2762
2848
  if (driver == null ? void 0 : driver.disconnect) {
2763
2849
  driver.disconnect(
2764
2850
  this.#actor,
@@ -2793,20 +2879,20 @@ var ConnectionManager = class {
2793
2879
  result.catch((error) => {
2794
2880
  this.#actor.rLog.error({
2795
2881
  msg: "error in `onDisconnect`",
2796
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
2882
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
2797
2883
  });
2798
2884
  });
2799
2885
  }
2800
2886
  } catch (error) {
2801
2887
  this.#actor.rLog.error({
2802
2888
  msg: "error in `onDisconnect`",
2803
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
2889
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
2804
2890
  });
2805
2891
  }
2806
2892
  }
2807
2893
  this.#connsWithPersistChanged.delete(conn.id);
2808
2894
  if (conn.isHibernatable) {
2809
- const key = _chunkSKOXACQDcjs.makeConnKey.call(void 0, conn.id);
2895
+ const key = _chunkB6BP74X3cjs.makeConnKey.call(void 0, conn.id);
2810
2896
  try {
2811
2897
  await this.#actor.driver.kvBatchDelete(this.#actor.id, [key]);
2812
2898
  this.#actor.rLog.debug({
@@ -2816,7 +2902,7 @@ var ConnectionManager = class {
2816
2902
  } catch (err) {
2817
2903
  this.#actor.rLog.error({
2818
2904
  msg: "kvBatchDelete failed for conn",
2819
- err: _chunk6KXKY3IEcjs.stringifyError.call(void 0, err)
2905
+ err: _chunkX5IX3YPOcjs.stringifyError.call(void 0, err)
2820
2906
  });
2821
2907
  }
2822
2908
  }
@@ -2843,7 +2929,7 @@ var ConnectionManager = class {
2843
2929
  */
2844
2930
  restoreConnections(connections) {
2845
2931
  for (const connPersist of connections) {
2846
- const conn = new (0, _chunkSKOXACQDcjs.Conn)(this.#actor, {
2932
+ const conn = new (0, _chunkB6BP74X3cjs.Conn)(this.#actor, {
2847
2933
  hibernatable: connPersist
2848
2934
  });
2849
2935
  this.#connections.set(conn.id, conn);
@@ -2862,20 +2948,20 @@ var ConnectionManager = class {
2862
2948
  // MARK: - Private Helpers
2863
2949
  findHibernatableConn(gatewayIdBuf, requestIdBuf) {
2864
2950
  return Array.from(this.#connections.values()).find((conn) => {
2865
- const connStateManager = conn[_chunkSKOXACQDcjs.CONN_STATE_MANAGER_SYMBOL];
2951
+ const connStateManager = conn[_chunkB6BP74X3cjs.CONN_STATE_MANAGER_SYMBOL];
2866
2952
  const h = connStateManager.hibernatableDataRaw;
2867
- return h && _chunk6KXKY3IEcjs.arrayBuffersEqual.call(void 0, h.gatewayId, gatewayIdBuf) && _chunk6KXKY3IEcjs.arrayBuffersEqual.call(void 0, h.requestId, requestIdBuf);
2953
+ return h && _chunkX5IX3YPOcjs.arrayBuffersEqual.call(void 0, h.gatewayId, gatewayIdBuf) && _chunkX5IX3YPOcjs.arrayBuffersEqual.call(void 0, h.requestId, requestIdBuf);
2868
2954
  });
2869
2955
  }
2870
2956
  async #createConnState(params, request) {
2871
2957
  if ("createConnState" in this.#actor.config) {
2872
- const ctx = new (0, _chunkSKOXACQDcjs.CreateConnStateContext)(this.#actor, request);
2958
+ const ctx = new (0, _chunkB6BP74X3cjs.CreateConnStateContext)(this.#actor, request);
2873
2959
  const dataOrPromise = this.#actor.config.createConnState(
2874
2960
  ctx,
2875
2961
  params
2876
2962
  );
2877
2963
  if (dataOrPromise instanceof Promise) {
2878
- return await _chunkSKOXACQDcjs.deadline.call(void 0,
2964
+ return await _chunkB6BP74X3cjs.deadline.call(void 0,
2879
2965
  dataOrPromise,
2880
2966
  this.#actor.config.options.createConnStateTimeout
2881
2967
  );
@@ -2891,10 +2977,10 @@ var ConnectionManager = class {
2891
2977
  #callOnConnect(conn) {
2892
2978
  if (this.#actor.config.onConnect) {
2893
2979
  try {
2894
- const ctx = new (0, _chunkSKOXACQDcjs.ConnectContext)(this.#actor, conn);
2980
+ const ctx = new (0, _chunkB6BP74X3cjs.ConnectContext)(this.#actor, conn);
2895
2981
  const result = this.#actor.config.onConnect(ctx, conn);
2896
2982
  if (result instanceof Promise) {
2897
- _chunkSKOXACQDcjs.deadline.call(void 0,
2983
+ _chunkB6BP74X3cjs.deadline.call(void 0,
2898
2984
  result,
2899
2985
  this.#actor.config.options.onConnectTimeout
2900
2986
  ).catch((error) => {
@@ -2908,7 +2994,7 @@ var ConnectionManager = class {
2908
2994
  } catch (error) {
2909
2995
  this.#actor.rLog.error({
2910
2996
  msg: "error in `onConnect`",
2911
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
2997
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
2912
2998
  });
2913
2999
  conn == null ? void 0 : conn.disconnect("`onConnect` failed");
2914
3000
  }
@@ -2949,7 +3035,7 @@ var EventManager = class {
2949
3035
  }
2950
3036
  subscribers.add(connection);
2951
3037
  if (!fromPersist) {
2952
- connection[_chunkSKOXACQDcjs.CONN_STATE_MANAGER_SYMBOL].addSubscription({
3038
+ connection[_chunkB6BP74X3cjs.CONN_STATE_MANAGER_SYMBOL].addSubscription({
2953
3039
  eventName
2954
3040
  });
2955
3041
  this.#actor.stateManager.saveState({ immediate: true });
@@ -2986,7 +3072,7 @@ var EventManager = class {
2986
3072
  }
2987
3073
  }
2988
3074
  if (!fromRemoveConn) {
2989
- const removed = connection[_chunkSKOXACQDcjs.CONN_STATE_MANAGER_SYMBOL].removeSubscription({ eventName });
3075
+ const removed = connection[_chunkB6BP74X3cjs.CONN_STATE_MANAGER_SYMBOL].removeSubscription({ eventName });
2990
3076
  if (!removed) {
2991
3077
  this.#actor.rLog.warn({
2992
3078
  msg: "subscription does not exist in persist",
@@ -3025,11 +3111,11 @@ var EventManager = class {
3025
3111
  return;
3026
3112
  }
3027
3113
  const eventData = { name, args };
3028
- const toClientSerializer = new (0, _chunkSKOXACQDcjs.CachedSerializer)(
3114
+ const toClientSerializer = new (0, _chunkB6BP74X3cjs.CachedSerializer)(
3029
3115
  eventData,
3030
- _chunkSKOXACQDcjs.TO_CLIENT_VERSIONED,
3031
- _chunkSKOXACQDcjs.CURRENT_VERSION,
3032
- _chunkSKOXACQDcjs.ToClientSchema,
3116
+ _chunkB6BP74X3cjs.TO_CLIENT_VERSIONED,
3117
+ _chunkB6BP74X3cjs.CURRENT_VERSION,
3118
+ _chunkB6BP74X3cjs.ToClientSchema,
3033
3119
  // JSON: args is the raw value (array of arguments)
3034
3120
  (value) => ({
3035
3121
  body: {
@@ -3046,19 +3132,19 @@ var EventManager = class {
3046
3132
  tag: "Event",
3047
3133
  val: {
3048
3134
  name: value.name,
3049
- args: _chunk6KXKY3IEcjs.bufferToArrayBuffer.call(void 0, cbor7.encode(value.args))
3135
+ args: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor7.encode(value.args))
3050
3136
  }
3051
3137
  }
3052
3138
  })
3053
3139
  );
3054
3140
  let sentCount = 0;
3055
3141
  for (const connection of subscribers) {
3056
- if (connection[_chunkSKOXACQDcjs.CONN_SPEAKS_RIVETKIT_SYMBOL]) {
3142
+ if (connection[_chunkB6BP74X3cjs.CONN_SPEAKS_RIVETKIT_SYMBOL]) {
3057
3143
  try {
3058
- connection[_chunkSKOXACQDcjs.CONN_SEND_MESSAGE_SYMBOL](toClientSerializer);
3144
+ connection[_chunkB6BP74X3cjs.CONN_SEND_MESSAGE_SYMBOL](toClientSerializer);
3059
3145
  sentCount++;
3060
3146
  } catch (error) {
3061
- if (error instanceof _chunkFWT2BTVTcjs.OutgoingMessageTooLong) {
3147
+ if (error instanceof _chunkSNAUKDDKcjs.OutgoingMessageTooLong) {
3062
3148
  throw error;
3063
3149
  }
3064
3150
  this.#actor.rLog.error({
@@ -3141,9 +3227,9 @@ var EventManager = class {
3141
3227
 
3142
3228
  function convertActorToBarePersisted(persist) {
3143
3229
  return {
3144
- input: persist.input !== void 0 ? _chunk6KXKY3IEcjs.bufferToArrayBuffer.call(void 0, cbor8.encode(persist.input)) : null,
3230
+ input: persist.input !== void 0 ? _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor8.encode(persist.input)) : null,
3145
3231
  hasInitialized: persist.hasInitialized,
3146
- state: _chunk6KXKY3IEcjs.bufferToArrayBuffer.call(void 0, cbor8.encode(persist.state)),
3232
+ state: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor8.encode(persist.state)),
3147
3233
  scheduledEvents: persist.scheduledEvents.map((event) => ({
3148
3234
  eventId: event.eventId,
3149
3235
  timestamp: BigInt(event.timestamp),
@@ -3171,7 +3257,7 @@ function convertActorFromBarePersisted(bareData) {
3171
3257
  var ScheduleManager = class {
3172
3258
  #actor;
3173
3259
  #actorDriver;
3174
- #alarmWriteQueue = new (0, _chunk6KXKY3IEcjs.SinglePromiseQueue)();
3260
+ #alarmWriteQueue = new (0, _chunkX5IX3YPOcjs.SinglePromiseQueue)();
3175
3261
  #config;
3176
3262
  // ActorConfig type
3177
3263
  #persist;
@@ -3201,7 +3287,7 @@ var ScheduleManager = class {
3201
3287
  eventId: crypto.randomUUID(),
3202
3288
  timestamp,
3203
3289
  action,
3204
- args: _chunk6KXKY3IEcjs.bufferToArrayBuffer.call(void 0, cbor9.encode(args))
3290
+ args: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor9.encode(args))
3205
3291
  };
3206
3292
  await this.#scheduleEventInner(newEvent);
3207
3293
  }
@@ -3393,7 +3479,7 @@ var ScheduleManager = class {
3393
3479
  } catch (error) {
3394
3480
  this.#actor.log.error({
3395
3481
  msg: "error executing scheduled event",
3396
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error),
3482
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error),
3397
3483
  eventId: event.eventId,
3398
3484
  timestamp: event.timestamp,
3399
3485
  action: event.action
@@ -3448,7 +3534,7 @@ var StateManager = class {
3448
3534
  #persistChanged = false;
3449
3535
  #isInOnStateChange = false;
3450
3536
  // Save management
3451
- #persistWriteQueue = new (0, _chunk6KXKY3IEcjs.SinglePromiseQueue)();
3537
+ #persistWriteQueue = new (0, _chunkX5IX3YPOcjs.SinglePromiseQueue)();
3452
3538
  #lastSaveTime = 0;
3453
3539
  #pendingSaveTimeout;
3454
3540
  #pendingSaveScheduledTimestamp;
@@ -3513,10 +3599,10 @@ var StateManager = class {
3513
3599
  const bareData = convertActorToBarePersisted(persistData);
3514
3600
  await this.#actorDriver.kvBatchPut(this.#actor.id, [
3515
3601
  [
3516
- _chunkSKOXACQDcjs.KEYS.PERSIST_DATA,
3517
- _chunkSKOXACQDcjs.ACTOR_VERSIONED.serializeWithEmbeddedVersion(
3602
+ _chunkB6BP74X3cjs.KEYS.PERSIST_DATA,
3603
+ _chunkB6BP74X3cjs.ACTOR_VERSIONED.serializeWithEmbeddedVersion(
3518
3604
  bareData,
3519
- _chunkSKOXACQDcjs.CURRENT_VERSION2
3605
+ _chunkB6BP74X3cjs.CURRENT_VERSION2
3520
3606
  )
3521
3607
  ]
3522
3608
  ]);
@@ -3530,14 +3616,14 @@ var StateManager = class {
3530
3616
  this.#persistRaw = target;
3531
3617
  if (target === null || typeof target !== "object") {
3532
3618
  let invalidPath = "";
3533
- if (!_chunk6KXKY3IEcjs.isCborSerializable.call(void 0,
3619
+ if (!_chunkX5IX3YPOcjs.isCborSerializable.call(void 0,
3534
3620
  target,
3535
3621
  (path) => {
3536
3622
  invalidPath = path;
3537
3623
  },
3538
3624
  ""
3539
3625
  )) {
3540
- throw new (0, _chunkFWT2BTVTcjs.InvalidStateType)({ path: invalidPath });
3626
+ throw new (0, _chunkSNAUKDDKcjs.InvalidStateType)({ path: invalidPath });
3541
3627
  }
3542
3628
  return target;
3543
3629
  }
@@ -3564,7 +3650,7 @@ var StateManager = class {
3564
3650
  await this.#savePersistInner();
3565
3651
  } else {
3566
3652
  if (!this.#onPersistSavedPromise) {
3567
- this.#onPersistSavedPromise = _chunk6KXKY3IEcjs.promiseWithResolvers.call(void 0, );
3653
+ this.#onPersistSavedPromise = _chunkX5IX3YPOcjs.promiseWithResolvers.call(void 0, );
3568
3654
  }
3569
3655
  this.savePersistThrottled(opts.maxWait);
3570
3656
  await ((_a = this.#onPersistSavedPromise) == null ? void 0 : _a.promise);
@@ -3605,7 +3691,7 @@ var StateManager = class {
3605
3691
  this.#savePersistInner().catch((error) => {
3606
3692
  this.#actor.rLog.error({
3607
3693
  msg: "error saving persist data in scheduled save",
3608
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
3694
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
3609
3695
  });
3610
3696
  });
3611
3697
  }, saveDelay);
@@ -3613,7 +3699,7 @@ var StateManager = class {
3613
3699
  this.#savePersistInner().catch((error) => {
3614
3700
  this.#actor.rLog.error({
3615
3701
  msg: "error saving persist data immediately",
3616
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
3702
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
3617
3703
  });
3618
3704
  });
3619
3705
  }
@@ -3639,22 +3725,22 @@ var StateManager = class {
3639
3725
  // MARK: - Private Helpers
3640
3726
  #validateStateEnabled() {
3641
3727
  if (!this.stateEnabled) {
3642
- throw new (0, _chunkFWT2BTVTcjs.StateNotEnabled)();
3728
+ throw new (0, _chunkSNAUKDDKcjs.StateNotEnabled)();
3643
3729
  }
3644
3730
  }
3645
3731
  #handleStateChange(path, value) {
3646
- const actorStatePath = _chunkSKOXACQDcjs.isStatePath.call(void 0, path);
3647
- const connStatePath = _chunkSKOXACQDcjs.isConnStatePath.call(void 0, path);
3732
+ const actorStatePath = _chunkB6BP74X3cjs.isStatePath.call(void 0, path);
3733
+ const connStatePath = _chunkB6BP74X3cjs.isConnStatePath.call(void 0, path);
3648
3734
  if (actorStatePath || connStatePath) {
3649
3735
  let invalidPath = "";
3650
- if (!_chunk6KXKY3IEcjs.isCborSerializable.call(void 0,
3736
+ if (!_chunkX5IX3YPOcjs.isCborSerializable.call(void 0,
3651
3737
  value,
3652
3738
  (invalidPathPart) => {
3653
3739
  invalidPath = invalidPathPart;
3654
3740
  },
3655
3741
  ""
3656
3742
  )) {
3657
- throw new (0, _chunkFWT2BTVTcjs.InvalidStateType)({
3743
+ throw new (0, _chunkSNAUKDDKcjs.InvalidStateType)({
3658
3744
  path: path + (invalidPath ? `.${invalidPath}` : "")
3659
3745
  });
3660
3746
  }
@@ -3680,7 +3766,7 @@ var StateManager = class {
3680
3766
  } catch (error) {
3681
3767
  this.#actor.rLog.error({
3682
3768
  msg: "error in `_onStateChange`",
3683
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
3769
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
3684
3770
  });
3685
3771
  } finally {
3686
3772
  this.#isInOnStateChange = false;
@@ -3714,10 +3800,10 @@ var StateManager = class {
3714
3800
  this.#persistRaw
3715
3801
  );
3716
3802
  entries.push([
3717
- _chunkSKOXACQDcjs.KEYS.PERSIST_DATA,
3718
- _chunkSKOXACQDcjs.ACTOR_VERSIONED.serializeWithEmbeddedVersion(
3803
+ _chunkB6BP74X3cjs.KEYS.PERSIST_DATA,
3804
+ _chunkB6BP74X3cjs.ACTOR_VERSIONED.serializeWithEmbeddedVersion(
3719
3805
  bareData,
3720
- _chunkSKOXACQDcjs.CURRENT_VERSION2
3806
+ _chunkB6BP74X3cjs.CURRENT_VERSION2
3721
3807
  )
3722
3808
  ]);
3723
3809
  }
@@ -3731,7 +3817,7 @@ var StateManager = class {
3731
3817
  });
3732
3818
  continue;
3733
3819
  }
3734
- const connStateManager = conn[_chunkSKOXACQDcjs.CONN_STATE_MANAGER_SYMBOL];
3820
+ const connStateManager = conn[_chunkB6BP74X3cjs.CONN_STATE_MANAGER_SYMBOL];
3735
3821
  const hibernatableDataRaw = connStateManager.hibernatableDataRaw;
3736
3822
  if (!hibernatableDataRaw) {
3737
3823
  this.#actor.log.warn({
@@ -3752,11 +3838,11 @@ var StateManager = class {
3752
3838
  const bareData = convertConnToBarePersistedConn(
3753
3839
  hibernatableDataRaw
3754
3840
  );
3755
- const connData = _chunkSKOXACQDcjs.CONN_VERSIONED.serializeWithEmbeddedVersion(
3841
+ const connData = _chunkB6BP74X3cjs.CONN_VERSIONED.serializeWithEmbeddedVersion(
3756
3842
  bareData,
3757
- _chunkSKOXACQDcjs.CURRENT_VERSION2
3843
+ _chunkB6BP74X3cjs.CURRENT_VERSION2
3758
3844
  );
3759
- entries.push([_chunkSKOXACQDcjs.makeConnKey.call(void 0, connId), connData]);
3845
+ entries.push([_chunkB6BP74X3cjs.makeConnKey.call(void 0, connId), connData]);
3760
3846
  connections.push(conn);
3761
3847
  }
3762
3848
  this.#actor.rLog.info({
@@ -3796,7 +3882,7 @@ var StateManager = class {
3796
3882
  } catch (error) {
3797
3883
  this.#actor.rLog.error({
3798
3884
  msg: "error saving persist",
3799
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
3885
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
3800
3886
  });
3801
3887
  (_b = this.#onPersistSavedPromise) == null ? void 0 : _b.reject(error);
3802
3888
  throw error;
@@ -3864,7 +3950,7 @@ var ActorInstance = class {
3864
3950
  // MARK: - Constructor
3865
3951
  constructor(config) {
3866
3952
  this.#config = config;
3867
- this.actorContext = new (0, _chunkSKOXACQDcjs.ActorContext)(this);
3953
+ this.actorContext = new (0, _chunkB6BP74X3cjs.ActorContext)(this);
3868
3954
  }
3869
3955
  // MARK: - Public Getters
3870
3956
  get log() {
@@ -3938,7 +4024,7 @@ var ActorInstance = class {
3938
4024
  }
3939
4025
  get db() {
3940
4026
  if (!this.#db) {
3941
- throw new (0, _chunkFWT2BTVTcjs.DatabaseNotEnabled)();
4027
+ throw new (0, _chunkSNAUKDDKcjs.DatabaseNotEnabled)();
3942
4028
  }
3943
4029
  return this.#db;
3944
4030
  }
@@ -3981,9 +4067,9 @@ var ActorInstance = class {
3981
4067
  return this.#ready;
3982
4068
  }
3983
4069
  assertReady(allowStoppingState = false) {
3984
- if (!this.#ready) throw new (0, _chunkFWT2BTVTcjs.InternalError)("Actor not ready");
4070
+ if (!this.#ready) throw new (0, _chunkSNAUKDDKcjs.InternalError)("Actor not ready");
3985
4071
  if (!allowStoppingState && this.#stopCalled)
3986
- throw new (0, _chunkFWT2BTVTcjs.InternalError)("Actor is stopping");
4072
+ throw new (0, _chunkSNAUKDDKcjs.InternalError)("Actor is stopping");
3987
4073
  }
3988
4074
  // MARK: - Stop
3989
4075
  async onStop(mode) {
@@ -4009,7 +4095,7 @@ var ActorInstance = class {
4009
4095
  } else if (mode === "destroy") {
4010
4096
  await this.#callOnDestroy();
4011
4097
  } else {
4012
- _chunkSKOXACQDcjs.assertUnreachable.call(void 0, mode);
4098
+ _chunkB6BP74X3cjs.assertUnreachable.call(void 0, mode);
4013
4099
  }
4014
4100
  await this.#disconnectConnections();
4015
4101
  await this.#waitBackgroundPromises(
@@ -4084,14 +4170,14 @@ var ActorInstance = class {
4084
4170
  this.#activeHonoHttpRequests = 0;
4085
4171
  this.#rLog.warn({
4086
4172
  msg: "active hono requests went below 0, this is a RivetKit bug",
4087
- ..._chunk6KXKY3IEcjs.EXTRA_ERROR_LOG
4173
+ ..._chunkX5IX3YPOcjs.EXTRA_ERROR_LOG
4088
4174
  });
4089
4175
  }
4090
4176
  this.resetSleepTimer();
4091
4177
  }
4092
4178
  // MARK: - Message Processing
4093
4179
  async processMessage(message, conn) {
4094
- await _chunkSKOXACQDcjs.processMessage.call(void 0, message, this, conn, {
4180
+ await _chunkB6BP74X3cjs.processMessage.call(void 0, message, this, conn, {
4095
4181
  onExecuteAction: async (ctx, name, args) => {
4096
4182
  this.inspector.emitter.emit("eventFired", {
4097
4183
  type: "action",
@@ -4124,7 +4210,7 @@ var ActorInstance = class {
4124
4210
  this.assertReady();
4125
4211
  if (!(actionName in this.#config.actions)) {
4126
4212
  this.#rLog.warn({ msg: "action does not exist", actionName });
4127
- throw new (0, _chunkFWT2BTVTcjs.ActionNotFound)(actionName);
4213
+ throw new (0, _chunkSNAUKDDKcjs.ActionNotFound)(actionName);
4128
4214
  }
4129
4215
  const actionFunction = this.#config.actions[actionName];
4130
4216
  if (typeof actionFunction !== "function") {
@@ -4133,7 +4219,7 @@ var ActorInstance = class {
4133
4219
  actionName,
4134
4220
  type: typeof actionFunction
4135
4221
  });
4136
- throw new (0, _chunkFWT2BTVTcjs.ActionNotFound)(actionName);
4222
+ throw new (0, _chunkSNAUKDDKcjs.ActionNotFound)(actionName);
4137
4223
  }
4138
4224
  try {
4139
4225
  this.#rLog.debug({
@@ -4148,7 +4234,7 @@ var ActorInstance = class {
4148
4234
  );
4149
4235
  let output;
4150
4236
  if (outputOrPromise instanceof Promise) {
4151
- output = await _chunkSKOXACQDcjs.deadline.call(void 0,
4237
+ output = await _chunkB6BP74X3cjs.deadline.call(void 0,
4152
4238
  outputOrPromise,
4153
4239
  this.#config.options.actionTimeout
4154
4240
  );
@@ -4171,19 +4257,19 @@ var ActorInstance = class {
4171
4257
  } catch (error) {
4172
4258
  this.#rLog.error({
4173
4259
  msg: "error in `onBeforeActionResponse`",
4174
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
4260
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
4175
4261
  });
4176
4262
  }
4177
4263
  }
4178
4264
  return output;
4179
4265
  } catch (error) {
4180
- if (error instanceof _chunkSKOXACQDcjs.DeadlineError) {
4181
- throw new (0, _chunkFWT2BTVTcjs.ActionTimedOut)();
4266
+ if (error instanceof _chunkB6BP74X3cjs.DeadlineError) {
4267
+ throw new (0, _chunkSNAUKDDKcjs.ActionTimedOut)();
4182
4268
  }
4183
4269
  this.#rLog.error({
4184
4270
  msg: "action error",
4185
4271
  actionName,
4186
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
4272
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
4187
4273
  });
4188
4274
  throw error;
4189
4275
  } finally {
@@ -4194,19 +4280,19 @@ var ActorInstance = class {
4194
4280
  async handleRawRequest(conn, request) {
4195
4281
  this.assertReady();
4196
4282
  if (!this.#config.onRequest) {
4197
- throw new (0, _chunkFWT2BTVTcjs.RequestHandlerNotDefined)();
4283
+ throw new (0, _chunkSNAUKDDKcjs.RequestHandlerNotDefined)();
4198
4284
  }
4199
4285
  try {
4200
- const ctx = new (0, _chunkSKOXACQDcjs.RequestContext)(this, conn, request);
4286
+ const ctx = new (0, _chunkB6BP74X3cjs.RequestContext)(this, conn, request);
4201
4287
  const response = await this.#config.onRequest(ctx, request);
4202
4288
  if (!response) {
4203
- throw new (0, _chunkFWT2BTVTcjs.InvalidRequestHandlerResponse)();
4289
+ throw new (0, _chunkSNAUKDDKcjs.InvalidRequestHandlerResponse)();
4204
4290
  }
4205
4291
  return response;
4206
4292
  } catch (error) {
4207
4293
  this.#rLog.error({
4208
4294
  msg: "onRequest error",
4209
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
4295
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
4210
4296
  });
4211
4297
  throw error;
4212
4298
  } finally {
@@ -4216,11 +4302,11 @@ var ActorInstance = class {
4216
4302
  handleRawWebSocket(conn, websocket, request) {
4217
4303
  this.assertReady();
4218
4304
  if (!this.#config.onWebSocket) {
4219
- throw new (0, _chunkFWT2BTVTcjs.InternalError)("onWebSocket handler not defined");
4305
+ throw new (0, _chunkSNAUKDDKcjs.InternalError)("onWebSocket handler not defined");
4220
4306
  }
4221
4307
  try {
4222
4308
  this.resetSleepTimer();
4223
- const ctx = new (0, _chunkSKOXACQDcjs.WebSocketContext)(this, conn, request);
4309
+ const ctx = new (0, _chunkB6BP74X3cjs.WebSocketContext)(this, conn, request);
4224
4310
  const voidOrPromise = this.#config.onWebSocket(ctx, websocket);
4225
4311
  if (voidOrPromise instanceof Promise) {
4226
4312
  voidOrPromise.then(() => {
@@ -4232,7 +4318,7 @@ var ActorInstance = class {
4232
4318
  } catch (error) {
4233
4319
  this.#rLog.error({
4234
4320
  msg: "onWebSocket error",
4235
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
4321
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
4236
4322
  });
4237
4323
  throw error;
4238
4324
  }
@@ -4253,7 +4339,7 @@ var ActorInstance = class {
4253
4339
  }).catch((error) => {
4254
4340
  this.#rLog.error({
4255
4341
  msg: "wait until promise failed",
4256
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
4342
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
4257
4343
  });
4258
4344
  });
4259
4345
  this.#backgroundPromises.push(nonfailablePromise);
@@ -4263,20 +4349,20 @@ var ActorInstance = class {
4263
4349
  var _a, _b;
4264
4350
  const logParams = {
4265
4351
  actor: this.#name,
4266
- key: _chunkSKOXACQDcjs.serializeActorKey.call(void 0, this.#key),
4352
+ key: _chunkB6BP74X3cjs.serializeActorKey.call(void 0, this.#key),
4267
4353
  actorId: this.#actorId
4268
4354
  };
4269
4355
  const extraLogParams = (_b = (_a = this.driver).getExtraActorLogParams) == null ? void 0 : _b.call(_a);
4270
4356
  if (extraLogParams) Object.assign(logParams, extraLogParams);
4271
- this.#log = _chunk6KXKY3IEcjs.getBaseLogger.call(void 0, ).child(
4357
+ this.#log = _chunkX5IX3YPOcjs.getBaseLogger.call(void 0, ).child(
4272
4358
  Object.assign(
4273
- _chunk6KXKY3IEcjs.getIncludeTarget.call(void 0, ) ? { target: "actor" } : {},
4359
+ _chunkX5IX3YPOcjs.getIncludeTarget.call(void 0, ) ? { target: "actor" } : {},
4274
4360
  logParams
4275
4361
  )
4276
4362
  );
4277
- this.#rLog = _chunk6KXKY3IEcjs.getBaseLogger.call(void 0, ).child(
4363
+ this.#rLog = _chunkX5IX3YPOcjs.getBaseLogger.call(void 0, ).child(
4278
4364
  Object.assign(
4279
- _chunk6KXKY3IEcjs.getIncludeTarget.call(void 0, ) ? { target: "actor-runtime" } : {},
4365
+ _chunkX5IX3YPOcjs.getIncludeTarget.call(void 0, ) ? { target: "actor-runtime" } : {},
4280
4366
  logParams
4281
4367
  )
4282
4368
  );
@@ -4284,13 +4370,13 @@ var ActorInstance = class {
4284
4370
  async #loadState() {
4285
4371
  const [persistDataBuffer] = await this.driver.kvBatchGet(
4286
4372
  this.#actorId,
4287
- [_chunkSKOXACQDcjs.KEYS.PERSIST_DATA]
4373
+ [_chunkB6BP74X3cjs.KEYS.PERSIST_DATA]
4288
4374
  );
4289
4375
  _invariant2.default.call(void 0,
4290
4376
  persistDataBuffer !== null,
4291
4377
  "persist data has not been set, it should be set when initialized"
4292
4378
  );
4293
- const bareData = _chunkSKOXACQDcjs.ACTOR_VERSIONED.deserializeWithEmbeddedVersion(persistDataBuffer);
4379
+ const bareData = _chunkB6BP74X3cjs.ACTOR_VERSIONED.deserializeWithEmbeddedVersion(persistDataBuffer);
4294
4380
  const persistData = convertActorFromBarePersisted(bareData);
4295
4381
  if (persistData.hasInitialized) {
4296
4382
  await this.#restoreExistingActor(persistData);
@@ -4312,12 +4398,12 @@ var ActorInstance = class {
4312
4398
  async #restoreExistingActor(persistData) {
4313
4399
  const connEntries = await this.driver.kvListPrefix(
4314
4400
  this.#actorId,
4315
- _chunkSKOXACQDcjs.KEYS.CONN_PREFIX
4401
+ _chunkB6BP74X3cjs.KEYS.CONN_PREFIX
4316
4402
  );
4317
4403
  const connections = [];
4318
4404
  for (const [_key, value] of connEntries) {
4319
4405
  try {
4320
- const bareData = _chunkSKOXACQDcjs.CONN_VERSIONED.deserializeWithEmbeddedVersion(
4406
+ const bareData = _chunkB6BP74X3cjs.CONN_VERSIONED.deserializeWithEmbeddedVersion(
4321
4407
  new Uint8Array(value)
4322
4408
  );
4323
4409
  const conn = convertConnFromBarePersistedConn(bareData);
@@ -4325,7 +4411,7 @@ var ActorInstance = class {
4325
4411
  } catch (error) {
4326
4412
  this.#rLog.error({
4327
4413
  msg: "failed to decode connection",
4328
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
4414
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
4329
4415
  });
4330
4416
  }
4331
4417
  }
@@ -4338,17 +4424,17 @@ var ActorInstance = class {
4338
4424
  }
4339
4425
  async #initializeInspectorToken() {
4340
4426
  const [tokenBuffer] = await this.driver.kvBatchGet(this.#actorId, [
4341
- _chunkSKOXACQDcjs.KEYS.INSPECTOR_TOKEN
4427
+ _chunkB6BP74X3cjs.KEYS.INSPECTOR_TOKEN
4342
4428
  ]);
4343
4429
  if (tokenBuffer !== null) {
4344
4430
  const decoder = new TextDecoder();
4345
4431
  this.#inspectorToken = decoder.decode(tokenBuffer);
4346
4432
  this.#rLog.debug({ msg: "loaded existing inspector token" });
4347
4433
  } else {
4348
- this.#inspectorToken = _chunkSKOXACQDcjs.generateSecureToken.call(void 0, );
4434
+ this.#inspectorToken = _chunkB6BP74X3cjs.generateSecureToken.call(void 0, );
4349
4435
  const tokenBytes = new TextEncoder().encode(this.#inspectorToken);
4350
4436
  await this.driver.kvBatchPut(this.#actorId, [
4351
- [_chunkSKOXACQDcjs.KEYS.INSPECTOR_TOKEN, tokenBytes]
4437
+ [_chunkB6BP74X3cjs.KEYS.INSPECTOR_TOKEN, tokenBytes]
4352
4438
  ]);
4353
4439
  this.#rLog.debug({ msg: "generated new inspector token" });
4354
4440
  }
@@ -4361,7 +4447,7 @@ var ActorInstance = class {
4361
4447
  this.driver.getContext(this.#actorId)
4362
4448
  );
4363
4449
  if (dataOrPromise instanceof Promise) {
4364
- vars = await _chunkSKOXACQDcjs.deadline.call(void 0,
4450
+ vars = await _chunkB6BP74X3cjs.deadline.call(void 0,
4365
4451
  dataOrPromise,
4366
4452
  this.#config.options.createVarsTimeout
4367
4453
  );
@@ -4392,16 +4478,16 @@ var ActorInstance = class {
4392
4478
  this.#rLog.debug({ msg: "calling onSleep" });
4393
4479
  const result = this.#config.onSleep(this.actorContext);
4394
4480
  if (result instanceof Promise) {
4395
- await _chunkSKOXACQDcjs.deadline.call(void 0, result, this.#config.options.onSleepTimeout);
4481
+ await _chunkB6BP74X3cjs.deadline.call(void 0, result, this.#config.options.onSleepTimeout);
4396
4482
  }
4397
4483
  this.#rLog.debug({ msg: "onSleep completed" });
4398
4484
  } catch (error) {
4399
- if (error instanceof _chunkSKOXACQDcjs.DeadlineError) {
4485
+ if (error instanceof _chunkB6BP74X3cjs.DeadlineError) {
4400
4486
  this.#rLog.error({ msg: "onSleep timed out" });
4401
4487
  } else {
4402
4488
  this.#rLog.error({
4403
4489
  msg: "error in onSleep",
4404
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
4490
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
4405
4491
  });
4406
4492
  }
4407
4493
  }
@@ -4413,19 +4499,19 @@ var ActorInstance = class {
4413
4499
  this.#rLog.debug({ msg: "calling onDestroy" });
4414
4500
  const result = this.#config.onDestroy(this.actorContext);
4415
4501
  if (result instanceof Promise) {
4416
- await _chunkSKOXACQDcjs.deadline.call(void 0,
4502
+ await _chunkB6BP74X3cjs.deadline.call(void 0,
4417
4503
  result,
4418
4504
  this.#config.options.onDestroyTimeout
4419
4505
  );
4420
4506
  }
4421
4507
  this.#rLog.debug({ msg: "onDestroy completed" });
4422
4508
  } catch (error) {
4423
- if (error instanceof _chunkSKOXACQDcjs.DeadlineError) {
4509
+ if (error instanceof _chunkB6BP74X3cjs.DeadlineError) {
4424
4510
  this.#rLog.error({ msg: "onDestroy timed out" });
4425
4511
  } else {
4426
4512
  this.#rLog.error({
4427
4513
  msg: "error in onDestroy",
4428
- error: _chunk6KXKY3IEcjs.stringifyError.call(void 0, error)
4514
+ error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
4429
4515
  });
4430
4516
  }
4431
4517
  }
@@ -4541,7 +4627,7 @@ var ActorInstance = class {
4541
4627
  }
4542
4628
  #validateVarsEnabled() {
4543
4629
  if (!this.#varsEnabled) {
4544
- throw new (0, _chunkFWT2BTVTcjs.VarsNotEnabled)();
4630
+ throw new (0, _chunkSNAUKDDKcjs.VarsNotEnabled)();
4545
4631
  }
4546
4632
  }
4547
4633
  };
@@ -4568,7 +4654,7 @@ function lookupInRegistry(config, name) {
4568
4654
  // src/client/mod.ts
4569
4655
  function createClient(endpointOrConfig) {
4570
4656
  const configInput = endpointOrConfig === void 0 ? {} : typeof endpointOrConfig === "string" ? { endpoint: endpointOrConfig } : endpointOrConfig;
4571
- const config = _chunkSKOXACQDcjs.ClientConfigSchema.parse(configInput);
4657
+ const config = ClientConfigSchema.parse(configInput);
4572
4658
  const driver = new RemoteManagerDriver(config);
4573
4659
  if (config.devtools) {
4574
4660
  injectDevtools(config);
@@ -4593,5 +4679,9 @@ function createClient(endpointOrConfig) {
4593
4679
 
4594
4680
 
4595
4681
 
4596
- exports.ActorDefinition = ActorDefinition; exports.lookupInRegistry = lookupInRegistry; exports.ActorClientError = ActorClientError; exports.InternalError = InternalError2; exports.ManagerError = ManagerError; exports.MalformedResponseMessage = MalformedResponseMessage; exports.ActorError = ActorError; exports.ActorConnDisposed = ActorConnDisposed; exports.ActorConnRaw = ActorConnRaw; exports.ActorHandleRaw = ActorHandleRaw; exports.createClientWithDriver = createClientWithDriver; exports.getEndpoint = getEndpoint; exports.getDatacenters = getDatacenters; exports.updateRunnerConfig = updateRunnerConfig; exports.RemoteManagerDriver = RemoteManagerDriver; exports.createClient = createClient;
4597
- //# sourceMappingURL=chunk-QY2XOK33.cjs.map
4682
+
4683
+
4684
+
4685
+
4686
+ exports.ActorDefinition = ActorDefinition; exports.lookupInRegistry = lookupInRegistry; exports.ActorClientError = ActorClientError; exports.InternalError = InternalError2; exports.ManagerError = ManagerError; exports.MalformedResponseMessage = MalformedResponseMessage; exports.ActorError = ActorError; exports.ActorConnDisposed = ActorConnDisposed; exports.ActorConnRaw = ActorConnRaw; exports.ActorHandleRaw = ActorHandleRaw; exports.createClientWithDriver = createClientWithDriver; exports.ClientConfigSchemaBase = ClientConfigSchemaBase; exports.ClientConfigSchema = ClientConfigSchema; exports.transformClientConfig = transformClientConfig; exports.convertRegistryConfigToClientConfig = convertRegistryConfigToClientConfig; exports.getEndpoint = getEndpoint; exports.getDatacenters = getDatacenters; exports.updateRunnerConfig = updateRunnerConfig; exports.RemoteManagerDriver = RemoteManagerDriver; exports.createClient = createClient;
4687
+ //# sourceMappingURL=chunk-5VVIFC6M.cjs.map