rivetkit 0.0.0-sqlite-sync-3x-release.a00b07f → 0.0.0-sqlite-sync-3-0-0-release.14341d0

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 (71) hide show
  1. package/dist/browser/client.js +49 -28
  2. package/dist/browser/client.js.map +1 -1
  3. package/dist/browser/inspector/client.js +1 -1
  4. package/dist/browser/inspector/client.js.map +1 -1
  5. package/dist/tsup/{chunk-TRUHDXOU.js → chunk-2EQ2WCO7.js} +51 -30
  6. package/dist/tsup/chunk-2EQ2WCO7.js.map +1 -0
  7. package/dist/tsup/{chunk-2MOLY6AM.cjs → chunk-4H2LT2WB.cjs} +2 -2
  8. package/dist/tsup/chunk-4H2LT2WB.cjs.map +1 -0
  9. package/dist/tsup/{chunk-TM76Z7XT.cjs → chunk-6WYQ3NJI.cjs} +7 -7
  10. package/dist/tsup/{chunk-TM76Z7XT.cjs.map → chunk-6WYQ3NJI.cjs.map} +1 -1
  11. package/dist/tsup/{chunk-BRH4PQS5.js → chunk-6ZJX3KXW.js} +2 -2
  12. package/dist/tsup/chunk-6ZJX3KXW.js.map +1 -0
  13. package/dist/tsup/{chunk-D5WUPE47.js → chunk-AIGW2SKA.js} +2 -2
  14. package/dist/tsup/{chunk-Z7E2G3JZ.cjs → chunk-HU4F7H3F.cjs} +4 -4
  15. package/dist/tsup/{chunk-Z7E2G3JZ.cjs.map → chunk-HU4F7H3F.cjs.map} +1 -1
  16. package/dist/tsup/{chunk-DJUBJQEQ.js → chunk-JNJEWQZL.js} +3 -3
  17. package/dist/tsup/{chunk-OTVJYZ2L.cjs → chunk-NE5CUQRN.cjs} +190 -169
  18. package/dist/tsup/chunk-NE5CUQRN.cjs.map +1 -0
  19. package/dist/tsup/{chunk-3DONDAMG.js → chunk-OX5MX7TO.js} +2 -2
  20. package/dist/tsup/{chunk-JUHXV3HF.cjs → chunk-PSIBTOAR.cjs} +3 -3
  21. package/dist/tsup/{chunk-JUHXV3HF.cjs.map → chunk-PSIBTOAR.cjs.map} +1 -1
  22. package/dist/tsup/{chunk-6KXVLIXL.cjs → chunk-PW6FYEIV.cjs} +3 -3
  23. package/dist/tsup/{chunk-6KXVLIXL.cjs.map → chunk-PW6FYEIV.cjs.map} +1 -1
  24. package/dist/tsup/{chunk-JUWMP5O3.js → chunk-SLICBKAU.js} +2 -2
  25. package/dist/tsup/{chunk-TSQTI6H6.js → chunk-WCVYMFWJ.js} +4 -4
  26. package/dist/tsup/{chunk-73RNTXHB.cjs → chunk-WX3JS4XU.cjs} +3 -3
  27. package/dist/tsup/{chunk-73RNTXHB.cjs.map → chunk-WX3JS4XU.cjs.map} +1 -1
  28. package/dist/tsup/{chunk-ZYK4B5WV.js → chunk-X32L7FDD.js} +2 -2
  29. package/dist/tsup/{chunk-BTSDFFDC.cjs → chunk-XAY2HIZN.cjs} +10 -10
  30. package/dist/tsup/{chunk-BTSDFFDC.cjs.map → chunk-XAY2HIZN.cjs.map} +1 -1
  31. package/dist/tsup/client/mod.cjs +5 -5
  32. package/dist/tsup/client/mod.js +4 -4
  33. package/dist/tsup/common/log.cjs +2 -2
  34. package/dist/tsup/common/log.js +1 -1
  35. package/dist/tsup/common/websocket.cjs +3 -3
  36. package/dist/tsup/common/websocket.js +2 -2
  37. package/dist/tsup/db/drizzle.cjs +2 -2
  38. package/dist/tsup/db/drizzle.js +1 -1
  39. package/dist/tsup/db/mod.cjs +3 -3
  40. package/dist/tsup/db/mod.js +2 -2
  41. package/dist/tsup/inspector/mod.cjs +5 -5
  42. package/dist/tsup/inspector/mod.js +4 -4
  43. package/dist/tsup/inspector/workflow.cjs +4 -4
  44. package/dist/tsup/inspector/workflow.js +3 -3
  45. package/dist/tsup/mod.cjs +93 -89
  46. package/dist/tsup/mod.cjs.map +1 -1
  47. package/dist/tsup/mod.js +13 -9
  48. package/dist/tsup/mod.js.map +1 -1
  49. package/dist/tsup/test/mod.cjs +6 -6
  50. package/dist/tsup/test/mod.js +4 -4
  51. package/dist/tsup/utils.cjs +2 -2
  52. package/dist/tsup/utils.js +1 -1
  53. package/dist/tsup/workflow/mod.cjs +7 -7
  54. package/dist/tsup/workflow/mod.js +4 -4
  55. package/package.json +9 -9
  56. package/src/client/actor-conn.ts +59 -33
  57. package/src/client/lifecycle-errors.ts +13 -0
  58. package/src/registry/config/index.ts +2 -1
  59. package/src/registry/index.ts +16 -3
  60. package/src/registry/napi-runtime.ts +1 -1
  61. package/src/registry/native.ts +1 -1
  62. package/dist/tsup/chunk-2MOLY6AM.cjs.map +0 -1
  63. package/dist/tsup/chunk-BRH4PQS5.js.map +0 -1
  64. package/dist/tsup/chunk-OTVJYZ2L.cjs.map +0 -1
  65. package/dist/tsup/chunk-TRUHDXOU.js.map +0 -1
  66. /package/dist/tsup/{chunk-D5WUPE47.js.map → chunk-AIGW2SKA.js.map} +0 -0
  67. /package/dist/tsup/{chunk-DJUBJQEQ.js.map → chunk-JNJEWQZL.js.map} +0 -0
  68. /package/dist/tsup/{chunk-3DONDAMG.js.map → chunk-OX5MX7TO.js.map} +0 -0
  69. /package/dist/tsup/{chunk-JUWMP5O3.js.map → chunk-SLICBKAU.js.map} +0 -0
  70. /package/dist/tsup/{chunk-TSQTI6H6.js.map → chunk-WCVYMFWJ.js.map} +0 -0
  71. /package/dist/tsup/{chunk-ZYK4B5WV.js.map → chunk-X32L7FDD.js.map} +0 -0
package/dist/tsup/mod.cjs CHANGED
@@ -17,7 +17,7 @@
17
17
  var _chunkHDVZ6YZGcjs = require('./chunk-HDVZ6YZG.cjs');
18
18
 
19
19
 
20
- var _chunkZ7E2G3JZcjs = require('./chunk-Z7E2G3JZ.cjs');
20
+ var _chunkHU4F7H3Fcjs = require('./chunk-HU4F7H3F.cjs');
21
21
 
22
22
 
23
23
 
@@ -35,17 +35,17 @@ var _chunkZ7E2G3JZcjs = require('./chunk-Z7E2G3JZ.cjs');
35
35
 
36
36
 
37
37
 
38
- var _chunkOTVJYZ2Lcjs = require('./chunk-OTVJYZ2L.cjs');
38
+ var _chunkNE5CUQRNcjs = require('./chunk-NE5CUQRN.cjs');
39
39
 
40
40
 
41
41
 
42
42
  var _chunkRTWH3AX3cjs = require('./chunk-RTWH3AX3.cjs');
43
- require('./chunk-JUHXV3HF.cjs');
43
+ require('./chunk-PSIBTOAR.cjs');
44
44
 
45
45
 
46
46
 
47
47
 
48
- var _chunk73RNTXHBcjs = require('./chunk-73RNTXHB.cjs');
48
+ var _chunkWX3JS4XUcjs = require('./chunk-WX3JS4XU.cjs');
49
49
  require('./chunk-KVFIONKQ.cjs');
50
50
 
51
51
 
@@ -80,7 +80,7 @@ require('./chunk-KVFIONKQ.cjs');
80
80
 
81
81
 
82
82
 
83
- var _chunk2MOLY6AMcjs = require('./chunk-2MOLY6AM.cjs');
83
+ var _chunk4H2LT2WBcjs = require('./chunk-4H2LT2WB.cjs');
84
84
 
85
85
 
86
86
 
@@ -98,7 +98,7 @@ var _chunkMGI2VVF6cjs = require('./chunk-MGI2VVF6.cjs');
98
98
 
99
99
  // src/actor/log.ts
100
100
  function loggerWithoutContext() {
101
- return _chunk2MOLY6AMcjs.getLogger.call(void 0, "actor-runtime");
101
+ return _chunk4H2LT2WBcjs.getLogger.call(void 0, "actor-runtime");
102
102
  }
103
103
 
104
104
  // src/actor/definition.ts
@@ -240,7 +240,7 @@ function validateSchemaSync(schemas, key, data) {
240
240
  var _virtualwebsocket = require('@rivetkit/virtual-websocket');
241
241
  var _ws = require('hono/ws');
242
242
  function logger() {
243
- return _chunk2MOLY6AMcjs.getLogger.call(void 0, "inline-websocket-adapter");
243
+ return _chunk4H2LT2WBcjs.getLogger.call(void 0, "inline-websocket-adapter");
244
244
  }
245
245
  var InlineWebSocketAdapter = class {
246
246
  #handler;
@@ -392,7 +392,7 @@ var InlineWebSocketAdapter = class {
392
392
 
393
393
  // src/registry/log.ts
394
394
  function logger2() {
395
- return _chunk2MOLY6AMcjs.getLogger.call(void 0, "registry");
395
+ return _chunk4H2LT2WBcjs.getLogger.call(void 0, "registry");
396
396
  }
397
397
 
398
398
  // src/serverless/configure.ts
@@ -438,8 +438,8 @@ async function configureServerlessPool(config) {
438
438
  );
439
439
  }
440
440
  const customConfig = config.configurePool;
441
- const clientConfig = _chunkOTVJYZ2Lcjs.convertRegistryConfigToClientConfig.call(void 0, config);
442
- const dcsRes = await _chunkOTVJYZ2Lcjs.getDatacenters.call(void 0, clientConfig);
441
+ const clientConfig = _chunkNE5CUQRNcjs.convertRegistryConfigToClientConfig.call(void 0, config);
442
+ const dcsRes = await _chunkNE5CUQRNcjs.getDatacenters.call(void 0, clientConfig);
443
443
  const poolName = _nullishCoalesce(customConfig.name, () => ( "default"));
444
444
  const serverlessToken = _nullishCoalesce(config.token, () => ( config.publicToken));
445
445
  const headers = {
@@ -461,7 +461,7 @@ async function configureServerlessPool(config) {
461
461
  metadata: _nullishCoalesce(customConfig.metadata, () => ( {})),
462
462
  drain_on_version_upgrade: _nullishCoalesce(customConfig.drainOnVersionUpgrade, () => ( true))
463
463
  };
464
- await _chunkOTVJYZ2Lcjs.updateRunnerConfig.call(void 0, clientConfig, poolName, {
464
+ await _chunkNE5CUQRNcjs.updateRunnerConfig.call(void 0, clientConfig, poolName, {
465
465
  datacenters: Object.fromEntries(
466
466
  dcsRes.datacenters.map((dc) => [dc.name, serverlessConfig])
467
467
  )
@@ -478,7 +478,7 @@ async function configureServerlessPool(config) {
478
478
  logger2().warn({
479
479
  msg: "serverless pool configuration attempt failed",
480
480
  attempts,
481
- error: _chunk2MOLY6AMcjs.stringifyError.call(void 0, error)
481
+ error: _chunk4H2LT2WBcjs.stringifyError.call(void 0, error)
482
482
  });
483
483
  await sleep(CONFIGURE_RETRY_DELAY_MS);
484
484
  }
@@ -486,7 +486,7 @@ async function configureServerlessPool(config) {
486
486
  logger2().error({
487
487
  msg: "failed to configure serverless pool, validate endpoint is configured correctly then restart this process",
488
488
  attempts,
489
- error: _chunk2MOLY6AMcjs.stringifyError.call(void 0, lastError)
489
+ error: _chunk4H2LT2WBcjs.stringifyError.call(void 0, lastError)
490
490
  });
491
491
  throw lastError;
492
492
  }
@@ -497,10 +497,10 @@ var _zod = require('zod');
497
497
  // src/registry/config/envoy.ts
498
498
  var _v4 = require('zod/v4');
499
499
  var EnvoyConfigSchema = _v4.z.object({
500
- poolName: _v4.z.string().default(() => _nullishCoalesce(_chunk2MOLY6AMcjs.getRivetPool.call(void 0, ), () => ( "default"))),
501
- version: _v4.z.number().default(() => _nullishCoalesce(_chunk2MOLY6AMcjs.getRivetEnvoyVersion.call(void 0, ), () => ( 1))),
500
+ poolName: _v4.z.string().default(() => _nullishCoalesce(_chunk4H2LT2WBcjs.getRivetPool.call(void 0, ), () => ( "default"))),
501
+ version: _v4.z.number().default(() => _nullishCoalesce(_chunk4H2LT2WBcjs.getRivetEnvoyVersion.call(void 0, ), () => ( 1))),
502
502
  // Deprecated.
503
- totalSlots: _v4.z.number().default(() => _nullishCoalesce(_chunk2MOLY6AMcjs.getRivetTotalSlots.call(void 0, ), () => ( 1e5))),
503
+ totalSlots: _v4.z.number().default(() => _nullishCoalesce(_chunk4H2LT2WBcjs.getRivetTotalSlots.call(void 0, ), () => ( 1e5))),
504
504
  nodeKey: _v4.z.string().optional()
505
505
  });
506
506
 
@@ -538,7 +538,7 @@ var ServerlessConfigSchema = _v4.z.object({
538
538
  *
539
539
  * Can also be set via RIVET_PUBLIC_ENDPOINT environment variable.
540
540
  */
541
- publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk2MOLY6AMcjs.getRivetPublicEndpoint.call(void 0, )))),
541
+ publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk4H2LT2WBcjs.getRivetPublicEndpoint.call(void 0, )))),
542
542
  /**
543
543
  * Token that clients should use when connecting via the public endpoint.
544
544
  *
@@ -546,7 +546,7 @@ var ServerlessConfigSchema = _v4.z.object({
546
546
  *
547
547
  * Can also be specified in the publicEndpoint URL as `https://namespace:token@host`.
548
548
  */
549
- publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk2MOLY6AMcjs.getRivetPublicToken.call(void 0, ))))
549
+ publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk4H2LT2WBcjs.getRivetPublicToken.call(void 0, ))))
550
550
  // There is no publicNamespace config option because the frontend and backend
551
551
  // cannot use different namespaces. The namespace is extracted from the
552
552
  // publicEndpoint URL auth syntax if provided.
@@ -600,7 +600,7 @@ var RegistryConfigSchema = _zod.z.object({
600
600
  * Runtime binding to use for RivetKit core.
601
601
  * */
602
602
  runtime: RuntimeKindSchema.optional().transform((val, ctx) => {
603
- const rawRuntime = _nullishCoalesce(val, () => ( _chunk2MOLY6AMcjs.getRivetkitRuntime.call(void 0, )));
603
+ const rawRuntime = _nullishCoalesce(val, () => ( _chunk4H2LT2WBcjs.getRivetkitRuntime.call(void 0, )));
604
604
  if (rawRuntime === void 0) {
605
605
  return "auto";
606
606
  }
@@ -637,7 +637,7 @@ var RegistryConfigSchema = _zod.z.object({
637
637
  * */
638
638
  logging: _zod.z.object({
639
639
  baseLogger: _zod.z.custom().optional(),
640
- level: _chunk2MOLY6AMcjs.LogLevelSchema.optional()
640
+ level: _chunk4H2LT2WBcjs.LogLevelSchema.optional()
641
641
  }).optional().default(() => ({})),
642
642
  // MARK: Routing
643
643
  // // This is a function to allow for lazy configuration of upgradeWebSocket on the
@@ -655,9 +655,9 @@ var RegistryConfigSchema = _zod.z.object({
655
655
  *
656
656
  * Can also be set via RIVET_ENDPOINT environment variables.
657
657
  */
658
- endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => ( _chunk2MOLY6AMcjs.getRivetEngine.call(void 0, ))), () => ( _chunk2MOLY6AMcjs.getRivetEndpoint.call(void 0, )))),
659
- token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk2MOLY6AMcjs.getRivetToken.call(void 0, )))),
660
- namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk2MOLY6AMcjs.getRivetNamespace.call(void 0, )))),
658
+ endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => ( _chunk4H2LT2WBcjs.getRivetEngine.call(void 0, ))), () => ( _chunk4H2LT2WBcjs.getRivetEndpoint.call(void 0, )))),
659
+ token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk4H2LT2WBcjs.getRivetToken.call(void 0, )))),
660
+ namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk4H2LT2WBcjs.getRivetNamespace.call(void 0, )))),
661
661
  headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional().default({}),
662
662
  // MARK: Client
663
663
  // TODO:
@@ -697,21 +697,21 @@ var RegistryConfigSchema = _zod.z.object({
697
697
  *
698
698
  * Starts the full Rust engine process locally.
699
699
  */
700
- startEngine: _zod.z.boolean().default(() => _chunk2MOLY6AMcjs.getRivetRunEngine.call(void 0, )),
700
+ startEngine: _zod.z.boolean().default(() => _chunk4H2LT2WBcjs.getRivetRunEngine.call(void 0, )),
701
701
  /**
702
702
  * @experimental
703
703
  *
704
704
  * Host to bind the spawned local engine process to.
705
705
  */
706
- engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(_chunk2MOLY6AMcjs.getRivetRunEngineHost.call(void 0, ), () => ( _chunkOTVJYZ2Lcjs.ENGINE_HOST))),
706
+ engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(_chunk4H2LT2WBcjs.getRivetRunEngineHost.call(void 0, ), () => ( _chunkNE5CUQRNcjs.ENGINE_HOST))),
707
707
  /**
708
708
  * @experimental
709
709
  *
710
710
  * Port to bind the spawned local engine process to.
711
711
  */
712
- enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(_chunk2MOLY6AMcjs.getRivetRunEnginePort.call(void 0, ), () => ( _chunkOTVJYZ2Lcjs.ENGINE_PORT))),
712
+ enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(_chunk4H2LT2WBcjs.getRivetRunEnginePort.call(void 0, ), () => ( _chunkNE5CUQRNcjs.ENGINE_PORT))),
713
713
  /** @experimental */
714
- engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunk2MOLY6AMcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunk2MOLY6AMcjs.VERSION))),
714
+ engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunk4H2LT2WBcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunk4H2LT2WBcjs.VERSION))),
715
715
  /**
716
716
  * Starts the first-party Services actor host when RivetKit manages
717
717
  * a local engine. Disabled by default. Set RIVET_RUN_SERVICES=1
@@ -751,7 +751,8 @@ var RegistryConfigSchema = _zod.z.object({
751
751
  * after calling `CoreRegistry::shutdown()`. Defaults to the
752
752
  * engine-provided actor stop threshold once the node connects. A
753
753
  * signal-driven shutdown of a managed local development engine waits
754
- * one second by default so a file watcher can restart promptly.
754
+ * four seconds by default so actors can acknowledge stopping before
755
+ * a file watcher restarts the process.
755
756
  *
756
757
  * Set a longer period when a complete graceful node drain is required.
757
758
  */
@@ -767,7 +768,7 @@ var RegistryConfigSchema = _zod.z.object({
767
768
  }))
768
769
  }).transform((config, ctx) => {
769
770
  var _a, _b, _c;
770
- const isDevEnv = _chunk2MOLY6AMcjs.isDev.call(void 0, );
771
+ const isDevEnv = _chunk4H2LT2WBcjs.isDev.call(void 0, );
771
772
  const sqliteBackend = _nullishCoalesce(((_a = config.sqlite) == null ? void 0 : _a.backend), () => ( ((_b = config.test) == null ? void 0 : _b.sqliteBackend)));
772
773
  if (config.runtime === "wasm" && sqliteBackend === "local") {
773
774
  ctx.addIssue({
@@ -777,7 +778,7 @@ var RegistryConfigSchema = _zod.z.object({
777
778
  });
778
779
  }
779
780
  const sqlite = config.runtime === "wasm" && config.sqlite === void 0 ? { backend: "remote" } : config.sqlite;
780
- const parsedEndpoint = config.endpoint ? _chunkOTVJYZ2Lcjs.tryParseEndpoint.call(void 0, ctx, {
781
+ const parsedEndpoint = config.endpoint ? _chunkNE5CUQRNcjs.tryParseEndpoint.call(void 0, ctx, {
781
782
  endpoint: config.endpoint,
782
783
  path: ["endpoint"],
783
784
  namespace: config.namespace,
@@ -796,18 +797,18 @@ var RegistryConfigSchema = _zod.z.object({
796
797
  path: ["configurePool"]
797
798
  });
798
799
  }
799
- const localEngineEndpoint = _chunkOTVJYZ2Lcjs.buildEngineEndpoint.call(void 0,
800
+ const localEngineEndpoint = _chunkNE5CUQRNcjs.buildEngineEndpoint.call(void 0,
800
801
  config.engineHost,
801
802
  config.enginePort
802
803
  );
803
804
  const endpoint = config.startEngine ? localEngineEndpoint : _nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.endpoint), () => ( (isDevEnv ? localEngineEndpoint : void 0)));
804
- const startServices = _nullishCoalesce(config.startServices, () => ( _chunk2MOLY6AMcjs.getRivetRunServices.call(void 0, )));
805
+ const startServices = _nullishCoalesce(config.startServices, () => ( _chunk4H2LT2WBcjs.getRivetRunServices.call(void 0, )));
805
806
  const validateServerlessEndpoint = Boolean(
806
807
  config.startEngine || parsedEndpoint
807
808
  );
808
809
  const namespace = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.namespace), () => ( config.namespace)), () => ( "default"));
809
- const token = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token)), () => ( (endpoint && _chunkOTVJYZ2Lcjs.isLocalEngineEndpoint.call(void 0, endpoint) ? "default" : void 0)));
810
- const parsedPublicEndpoint = config.serverless.publicEndpoint ? _chunkOTVJYZ2Lcjs.tryParseEndpoint.call(void 0, ctx, {
810
+ const token = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token)), () => ( (endpoint && _chunkNE5CUQRNcjs.isLocalEngineEndpoint.call(void 0, endpoint) ? "default" : void 0)));
811
+ const parsedPublicEndpoint = config.serverless.publicEndpoint ? _chunkNE5CUQRNcjs.tryParseEndpoint.call(void 0, ctx, {
811
812
  endpoint: config.serverless.publicEndpoint,
812
813
  path: ["serverless", "publicEndpoint"]
813
814
  }) : void 0;
@@ -912,7 +913,7 @@ var DocRegistryConfigSchema = _zod.z.object({
912
913
  noWelcome: _zod.z.boolean().optional().describe("Disable the welcome message on startup. Default: false"),
913
914
  sqlite: DocSqliteConfigSchema,
914
915
  logging: _zod.z.object({
915
- level: _chunk2MOLY6AMcjs.LogLevelSchema.optional().describe(
916
+ level: _chunk4H2LT2WBcjs.LogLevelSchema.optional().describe(
916
917
  "Log level for RivetKit. Default: 'warn'"
917
918
  )
918
919
  }).optional().describe("Logging configuration."),
@@ -1693,7 +1694,7 @@ var NapiCoreRuntime = (_class = class {
1693
1694
  if (!(active == null ? void 0 : active.sameActorInstance(ownerCtx))) {
1694
1695
  return ownerCtx;
1695
1696
  }
1696
- const applicationSpan = _chunkOTVJYZ2Lcjs.readActiveTraceHeaders.call(void 0, );
1697
+ const applicationSpan = _chunkNE5CUQRNcjs.readActiveTraceHeaders.call(void 0, );
1697
1698
  if (!applicationSpan) {
1698
1699
  return active;
1699
1700
  }
@@ -1897,7 +1898,7 @@ var NapiCoreRuntime = (_class = class {
1897
1898
  const span = (_a = nativeCtx.invocationTraceContext()) == null ? void 0 : _a.span;
1898
1899
  return this.#invocationContext.run(
1899
1900
  nativeCtx,
1900
- () => _chunkOTVJYZ2Lcjs.runWithActorInvocationSpan.call(void 0, span, run)
1901
+ () => _chunkNE5CUQRNcjs.runWithActorInvocationSpan.call(void 0, span, run)
1901
1902
  );
1902
1903
  }
1903
1904
  actorInvocationTraceContext(ctx) {
@@ -2316,8 +2317,8 @@ function runtimeBytesToArrayBuffer(value) {
2316
2317
  function buildNativeHttpRequest(init) {
2317
2318
  var _a;
2318
2319
  const headers = new Headers(init.headers);
2319
- const originalUrl = headers.get(_chunkOTVJYZ2Lcjs.HEADER_ORIGINAL_REQUEST_URL);
2320
- headers.delete(_chunkOTVJYZ2Lcjs.HEADER_ORIGINAL_REQUEST_URL);
2320
+ const originalUrl = headers.get(_chunkNE5CUQRNcjs.HEADER_ORIGINAL_REQUEST_URL);
2321
+ headers.delete(_chunkNE5CUQRNcjs.HEADER_ORIGINAL_REQUEST_URL);
2321
2322
  const url = _nullishCoalesce(originalUrl, () => ( (init.uri.startsWith("http") ? init.uri : new URL(init.uri, "http://127.0.0.1").toString())));
2322
2323
  const method2 = init.method.toUpperCase();
2323
2324
  const bodyForbidden = method2 === "GET" || method2 === "HEAD";
@@ -2396,7 +2397,7 @@ async function pumpResponseBody(reader, stream) {
2396
2397
  }
2397
2398
  } catch (error) {
2398
2399
  try {
2399
- await stream.error(_chunk2MOLY6AMcjs.stringifyError.call(void 0, error));
2400
+ await stream.error(_chunk4H2LT2WBcjs.stringifyError.call(void 0, error));
2400
2401
  } catch (streamError) {
2401
2402
  logger2().debug({
2402
2403
  msg: "failed to report native http response stream error",
@@ -3686,7 +3687,7 @@ async function loadAutoRuntime(config, loaders = defaultRuntimeLoaders) {
3686
3687
  nativeError = error;
3687
3688
  logger2().warn({
3688
3689
  msg: "native runtime failed to load; falling back to wasm",
3689
- error: _chunk2MOLY6AMcjs.stringifyError.call(void 0, error)
3690
+ error: _chunk4H2LT2WBcjs.stringifyError.call(void 0, error)
3690
3691
  });
3691
3692
  }
3692
3693
  try {
@@ -3695,7 +3696,7 @@ async function loadAutoRuntime(config, loaders = defaultRuntimeLoaders) {
3695
3696
  throw new (0, _chunkMGI2VVF6cjs.RivetError)(
3696
3697
  "config",
3697
3698
  "runtime_unavailable",
3698
- `RivetKit could not load a core runtime. Native runtime: ${_chunk2MOLY6AMcjs.stringifyError.call(void 0, nativeError)} Wasm runtime: ${_chunk2MOLY6AMcjs.stringifyError.call(void 0, wasmError)}`,
3699
+ `RivetKit could not load a core runtime. Native runtime: ${_chunk4H2LT2WBcjs.stringifyError.call(void 0, nativeError)} Wasm runtime: ${_chunk4H2LT2WBcjs.stringifyError.call(void 0, wasmError)}`,
3699
3700
  {
3700
3701
  public: true,
3701
3702
  statusCode: 500
@@ -3903,7 +3904,7 @@ async function cleanupNativeSleepRuntimeState(runtime, ctx, afterTrackedWorkDrai
3903
3904
  }).catch((error) => {
3904
3905
  logger2().warn({
3905
3906
  msg: "deferred native sleep cleanup failed",
3906
- error: _chunk2MOLY6AMcjs.stringifyError.call(void 0, error)
3907
+ error: _chunk4H2LT2WBcjs.stringifyError.call(void 0, error)
3907
3908
  });
3908
3909
  });
3909
3910
  return;
@@ -4093,10 +4094,10 @@ function decodeValue(value) {
4093
4094
  if (!value || value.length === 0) {
4094
4095
  return void 0;
4095
4096
  }
4096
- return _chunk2MOLY6AMcjs.decodeCborCompat.call(void 0, value);
4097
+ return _chunk4H2LT2WBcjs.decodeCborCompat.call(void 0, value);
4097
4098
  }
4098
4099
  function encodeValue(value) {
4099
- return _chunk2MOLY6AMcjs.encodeCborCompat.call(void 0, value);
4100
+ return _chunk4H2LT2WBcjs.encodeCborCompat.call(void 0, value);
4100
4101
  }
4101
4102
  function normalizeArgs(value) {
4102
4103
  return Array.isArray(value) ? value : value === void 0 || value === null ? [] : [value];
@@ -4132,7 +4133,7 @@ function isStructuredBridgeError(error) {
4132
4133
  return _chunkMGI2VVF6cjs.isRivetErrorLike.call(void 0, error) && "__type" in error && (error.__type === "RivetError" || error.__type === "ActorError");
4133
4134
  }
4134
4135
  function encodeNativeCallbackError(error) {
4135
- const structuredError = isStructuredBridgeError(error) ? error : _chunk2MOLY6AMcjs.deconstructError.call(void 0, error, true);
4136
+ const structuredError = isStructuredBridgeError(error) ? error : _chunk4H2LT2WBcjs.deconstructError.call(void 0, error, true);
4136
4137
  const { encoded, droppedMetadataCause } = _chunkMGI2VVF6cjs.encodeBridgeRivetError.call(void 0, structuredError);
4137
4138
  if (droppedMetadataCause !== void 0) {
4138
4139
  logger2().warn(
@@ -4194,7 +4195,7 @@ function decodeWorkflowCbor(data) {
4194
4195
  return null;
4195
4196
  }
4196
4197
  try {
4197
- return _chunk2MOLY6AMcjs.decodeCborCompat.call(void 0, new Uint8Array(data));
4198
+ return _chunk4H2LT2WBcjs.decodeCborCompat.call(void 0, new Uint8Array(data));
4198
4199
  } catch (e3) {
4199
4200
  return null;
4200
4201
  }
@@ -4307,7 +4308,7 @@ function serializeWorkflowHistoryForJson(data) {
4307
4308
  if (data === null) {
4308
4309
  return null;
4309
4310
  }
4310
- const history = _chunkZ7E2G3JZcjs.decodeWorkflowHistoryTransport.call(void 0, data);
4311
+ const history = _chunkHU4F7H3Fcjs.decodeWorkflowHistoryTransport.call(void 0, data);
4311
4312
  return jsonSafe({
4312
4313
  nameRegistry: [...history.nameRegistry],
4313
4314
  entries: history.entries.map((entry) => ({
@@ -4453,7 +4454,7 @@ var NativeConnAdapter = class {
4453
4454
  },
4454
4455
  (newValue) => {
4455
4456
  assertCurrentState();
4456
- _chunk2MOLY6AMcjs.assertJsonCompatValue.call(void 0, newValue);
4457
+ _chunk4H2LT2WBcjs.assertJsonCompatValue.call(void 0, newValue);
4457
4458
  }
4458
4459
  );
4459
4460
  }
@@ -4461,7 +4462,7 @@ var NativeConnAdapter = class {
4461
4462
  var _a;
4462
4463
  (_a = this.#assertCanMutateState) == null ? void 0 : _a.call(this);
4463
4464
  const nextValue = unwrapWriteThroughProxy(value);
4464
- _chunk2MOLY6AMcjs.assertJsonCompatValue.call(void 0, nextValue);
4465
+ _chunk4H2LT2WBcjs.assertJsonCompatValue.call(void 0, nextValue);
4465
4466
  this.#writeState(nextValue, { writeNative: true });
4466
4467
  }
4467
4468
  initializeState(value) {
@@ -5540,7 +5541,7 @@ var ActorContextHandleAdapter = class {
5540
5541
  },
5541
5542
  (newValue) => {
5542
5543
  assertCurrentState();
5543
- _chunk2MOLY6AMcjs.assertJsonCompatValue.call(void 0, newValue);
5544
+ _chunk4H2LT2WBcjs.assertJsonCompatValue.call(void 0, newValue);
5544
5545
  }
5545
5546
  );
5546
5547
  }
@@ -5552,7 +5553,7 @@ var ActorContextHandleAdapter = class {
5552
5553
  }
5553
5554
  this.#assertCanMutateState();
5554
5555
  const nextValue = unwrapWriteThroughProxy(value);
5555
- _chunk2MOLY6AMcjs.assertJsonCompatValue.call(void 0, nextValue);
5556
+ _chunk4H2LT2WBcjs.assertJsonCompatValue.call(void 0, nextValue);
5556
5557
  this.#writeState(nextValue, { scheduleSave: true });
5557
5558
  }
5558
5559
  initializeState(value) {
@@ -5766,7 +5767,7 @@ var ActorContextHandleAdapter = class {
5766
5767
  log: {
5767
5768
  debug: (obj) => logger2().debug(obj)
5768
5769
  },
5769
- nativeDatabaseProvider: _chunk73RNTXHBcjs.registerNativeStateTransactionOpener.call(void 0,
5770
+ nativeDatabaseProvider: _chunkWX3JS4XUcjs.registerNativeStateTransactionOpener.call(void 0,
5770
5771
  {
5771
5772
  open: async (requestedActorId) => {
5772
5773
  void requestedActorId;
@@ -5791,7 +5792,7 @@ var ActorContextHandleAdapter = class {
5791
5792
  return this.#db;
5792
5793
  }
5793
5794
  #bindDatabaseClient(client) {
5794
- return _chunk73RNTXHBcjs.bindNativeStateTransactionContext.call(void 0, client, {
5795
+ return _chunkWX3JS4XUcjs.bindNativeStateTransactionContext.call(void 0, client, {
5795
5796
  enter: async () => await this.#enterStateTransaction(),
5796
5797
  exit: (scope) => this.#exitStateTransaction(
5797
5798
  scope
@@ -5995,7 +5996,7 @@ var ActorContextHandleAdapter = class {
5995
5996
  const trackedPromise = Promise.resolve(promise).catch((error) => {
5996
5997
  logger2().warn({
5997
5998
  msg: "keepAwake promise rejected",
5998
- error: _chunk2MOLY6AMcjs.stringifyError.call(void 0, error)
5999
+ error: _chunk4H2LT2WBcjs.stringifyError.call(void 0, error)
5999
6000
  });
6000
6001
  }).then(() => null);
6001
6002
  try {
@@ -6496,7 +6497,7 @@ function validateInspectorTabSource(tabId, resolved) {
6496
6497
  function buildNativeFactory(runtime, registryConfig, definition) {
6497
6498
  var _a;
6498
6499
  const config = definition.config;
6499
- const databaseProvider = _nullishCoalesce(config.db, () => ( _chunk73RNTXHBcjs.db.call(void 0, )));
6500
+ const databaseProvider = _nullishCoalesce(config.db, () => ( _chunkWX3JS4XUcjs.db.call(void 0, )));
6500
6501
  const actionHandlers = _chunkHDVZ6YZGcjs.flattenActionHandlers.call(void 0, config.actions);
6501
6502
  const schemaConfig = {
6502
6503
  actionInputSchemas: _chunkHDVZ6YZGcjs.flattenActionInputSchemas.call(void 0,
@@ -6507,9 +6508,9 @@ function buildNativeFactory(runtime, registryConfig, definition) {
6507
6508
  events: config.events,
6508
6509
  queues: config.queues
6509
6510
  };
6510
- const createClient = (ctx) => _chunkOTVJYZ2Lcjs.createClientWithDriver.call(void 0,
6511
- new (0, _chunkOTVJYZ2Lcjs.RemoteEngineControlClient)(
6512
- _chunkOTVJYZ2Lcjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
6511
+ const createClient = (ctx) => _chunkNE5CUQRNcjs.createClientWithDriver.call(void 0,
6512
+ new (0, _chunkNE5CUQRNcjs.RemoteEngineControlClient)(
6513
+ _chunkNE5CUQRNcjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
6513
6514
  ),
6514
6515
  {
6515
6516
  encoding: "bare",
@@ -6701,7 +6702,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
6701
6702
  400
6702
6703
  );
6703
6704
  }
6704
- const cbor = _chunk2MOLY6AMcjs.encodeCborCompat.call(void 0,
6705
+ const cbor = _chunk4H2LT2WBcjs.encodeCborCompat.call(void 0,
6705
6706
  _nullishCoalesce(body.body, () => ( null))
6706
6707
  );
6707
6708
  const message = await runtime.actorQueueSend(ctx, name, cbor);
@@ -7298,7 +7299,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
7298
7299
  ...request,
7299
7300
  abortController: requestAbortController
7300
7301
  });
7301
- const rawConnParams = handlerRequest.headers.get(_chunkOTVJYZ2Lcjs.HEADER_CONN_PARAMS);
7302
+ const rawConnParams = handlerRequest.headers.get(_chunkNE5CUQRNcjs.HEADER_CONN_PARAMS);
7302
7303
  let requestCtx;
7303
7304
  let conn;
7304
7305
  let removeRequestAbortListener;
@@ -7355,7 +7356,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
7355
7356
  requestCtx,
7356
7357
  handlerRequest
7357
7358
  );
7358
- if (!_chunkOTVJYZ2Lcjs.isResponseLike.call(void 0, response)) {
7359
+ if (!_chunkNE5CUQRNcjs.isResponseLike.call(void 0, response)) {
7359
7360
  throw new Error(
7360
7361
  "onRequest handler must return a Response"
7361
7362
  );
@@ -7450,7 +7451,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
7450
7451
  var _a2;
7451
7452
  const { ctx } = unwrapTsfnPayload(error, payload);
7452
7453
  const history = (_a2 = getNativeWorkflowInspector(ctx)) == null ? void 0 : _a2.getHistory();
7453
- return history == null ? void 0 : _chunk2MOLY6AMcjs.toUint8Array.call(void 0, history);
7454
+ return history == null ? void 0 : _chunk4H2LT2WBcjs.toUint8Array.call(void 0, history);
7454
7455
  }
7455
7456
  ) : void 0,
7456
7457
  replayWorkflow: _chunkHDVZ6YZGcjs.hasRunInspectorConfig.call(void 0, config.run) ? wrapNativeCallback(
@@ -7464,7 +7465,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
7464
7465
  return void 0;
7465
7466
  }
7466
7467
  const history = await _asyncNullishCoalesce(await workflowInspector.replayFromStep(entryId), async () => ( null));
7467
- return history == null ? void 0 : _chunk2MOLY6AMcjs.toUint8Array.call(void 0, history);
7468
+ return history == null ? void 0 : _chunk4H2LT2WBcjs.toUint8Array.call(void 0, history);
7468
7469
  }
7469
7470
  ) : void 0,
7470
7471
  actions: Object.fromEntries(
@@ -7601,7 +7602,7 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
7601
7602
  startServices: resolveServicesBinary && config.startServices,
7602
7603
  handleInspectorHttpInRuntime: true,
7603
7604
  serverlessBasePath: config.serverless.basePath,
7604
- serverlessPackageVersion: _chunk2MOLY6AMcjs.VERSION,
7605
+ serverlessPackageVersion: _chunk4H2LT2WBcjs.VERSION,
7605
7606
  serverlessClientEndpoint: config.publicEndpoint,
7606
7607
  serverlessClientNamespace: config.publicNamespace,
7607
7608
  serverlessClientToken: config.publicToken,
@@ -7614,11 +7615,11 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
7614
7615
  } catch (error) {
7615
7616
  logger2().warn({
7616
7617
  msg: "could not resolve a local engine binary; if a local engine must be spawned it will fail with engine.binary_unavailable \u2014 set RIVET_ENGINE_BINARY_PATH or install the @rivetkit/engine-cli platform package",
7617
- error: _chunk2MOLY6AMcjs.stringifyError.call(void 0, error)
7618
+ error: _chunk4H2LT2WBcjs.stringifyError.call(void 0, error)
7618
7619
  });
7619
7620
  }
7620
7621
  if (resolveServicesBinary && config.startServices) {
7621
- const servicesBinary = _chunk2MOLY6AMcjs.getEnvUniversal.call(void 0, "RIVET_SERVICES_BINARY");
7622
+ const servicesBinary = _chunk4H2LT2WBcjs.getEnvUniversal.call(void 0, "RIVET_SERVICES_BINARY");
7622
7623
  if (servicesBinary) {
7623
7624
  serveConfig.servicesBinaryPath = servicesBinary;
7624
7625
  } else {
@@ -7633,13 +7634,13 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
7633
7634
  serveConfig.engineHost = config.engineHost;
7634
7635
  serveConfig.enginePort = config.enginePort;
7635
7636
  if ((_a = config.test) == null ? void 0 : _a.enabled) {
7636
- serveConfig.inspectorTestToken = _nullishCoalesce(_chunk2MOLY6AMcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
7637
+ serveConfig.inspectorTestToken = _nullishCoalesce(_chunk4H2LT2WBcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
7637
7638
  }
7638
7639
  return serveConfig;
7639
7640
  }
7640
7641
  async function buildRegistryWithRuntime(config, runtime) {
7641
7642
  var _a;
7642
- if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunk2MOLY6AMcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
7643
+ if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunk4H2LT2WBcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
7643
7644
  trySetProcessEnv("_RIVET_TEST_INSPECTOR_TOKEN", "token");
7644
7645
  }
7645
7646
  if (runtime.kind === "napi") {
@@ -7669,6 +7670,8 @@ async function buildConfiguredRegistry(config) {
7669
7670
 
7670
7671
  // src/registry/index.ts
7671
7672
  var REGISTRY_READY_TIMEOUT_MS = 3e4;
7673
+ var LOCAL_ENGINE_READY_TIMEOUT_MS = 6e4;
7674
+ var LOCAL_DEV_SHUTDOWN_GRACE_PERIOD_MS = 4e3;
7672
7675
  function rejectServerless() {
7673
7676
  throw new Error("serverless is disabled in this version");
7674
7677
  }
@@ -7709,7 +7712,7 @@ function createApplicationFetch(application, runtime) {
7709
7712
  signal: abortController.signal
7710
7713
  })
7711
7714
  );
7712
- if (!_chunkOTVJYZ2Lcjs.isResponseLike.call(void 0, response)) {
7715
+ if (!_chunkNE5CUQRNcjs.isResponseLike.call(void 0, response)) {
7713
7716
  throw new TypeError(
7714
7717
  "registry.listen() application fetch must return a Response"
7715
7718
  );
@@ -7759,7 +7762,7 @@ var Registry = class {
7759
7762
  var _a;
7760
7763
  this.#config = config;
7761
7764
  if ((_a = config.logging) == null ? void 0 : _a.baseLogger) {
7762
- _chunk2MOLY6AMcjs.configureBaseLogger.call(void 0, config.logging.baseLogger);
7765
+ _chunk4H2LT2WBcjs.configureBaseLogger.call(void 0, config.logging.baseLogger);
7763
7766
  }
7764
7767
  this.#buildConfiguredRegistry = _nullishCoalesce((deps == null ? void 0 : deps.buildConfiguredRegistry), () => ( buildConfiguredRegistry));
7765
7768
  this.routes = {
@@ -7991,10 +7994,10 @@ var Registry = class {
7991
7994
  if (!opts.application) {
7992
7995
  rejectServerless();
7993
7996
  }
7994
- const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => ( _chunk2MOLY6AMcjs.parsePortEnv.call(void 0, process.env.RIVET_PORT))), () => ( 3e3));
7995
- const publicDir = _nullishCoalesce(opts.publicDir, () => ( _chunk2MOLY6AMcjs.getRivetkitPublicDir.call(void 0, )));
7997
+ const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => ( _chunk4H2LT2WBcjs.parsePortEnv.call(void 0, process.env.RIVET_PORT))), () => ( 3e3));
7998
+ const publicDir = _nullishCoalesce(opts.publicDir, () => ( _chunk4H2LT2WBcjs.getRivetkitPublicDir.call(void 0, )));
7996
7999
  const config = this.parseConfig();
7997
- if (opts.application && _chunk2MOLY6AMcjs.getRivetkitRuntimeMode.call(void 0, ) !== "serverless") {
8000
+ if (opts.application && _chunk4H2LT2WBcjs.getRivetkitRuntimeMode.call(void 0, ) !== "serverless") {
7998
8001
  if (config.runtime === "wasm") {
7999
8002
  throw new Error(
8000
8003
  "registry.listen() requires the native runtime; use an application-owned HTTP server with WebAssembly"
@@ -8070,7 +8073,7 @@ var Registry = class {
8070
8073
  return jsonRouteResponse(503, {
8071
8074
  status: "not_started",
8072
8075
  runtime: "rivetkit",
8073
- version: _chunk2MOLY6AMcjs.VERSION
8076
+ version: _chunk4H2LT2WBcjs.VERSION
8074
8077
  });
8075
8078
  }
8076
8079
  const { runtime, registry } = configured;
@@ -8078,7 +8081,7 @@ var Registry = class {
8078
8081
  return jsonRouteResponse(501, {
8079
8082
  status: "unsupported",
8080
8083
  runtime: "rivetkit",
8081
- version: _chunk2MOLY6AMcjs.VERSION
8084
+ version: _chunk4H2LT2WBcjs.VERSION
8082
8085
  });
8083
8086
  }
8084
8087
  const response = await runtime.registryHealth(registry);
@@ -8153,14 +8156,14 @@ var Registry = class {
8153
8156
  var _a;
8154
8157
  if (!this.#runtimeServePromise) {
8155
8158
  const configuredEnvoyVersion = (_a = this.#config.node) == null ? void 0 : _a.version;
8156
- const envoyVersionSource = configuredEnvoyVersion !== void 0 ? "config" : _chunk2MOLY6AMcjs.getRivetEnvoyVersion.call(void 0, ) !== void 0 ? "environment" : "default";
8159
+ const envoyVersionSource = configuredEnvoyVersion !== void 0 ? "config" : _chunk4H2LT2WBcjs.getRivetEnvoyVersion.call(void 0, ) !== void 0 ? "environment" : "default";
8157
8160
  logger2().info({
8158
8161
  msg: "starting rivetkit envoy",
8159
- rivetkitVersion: _chunk2MOLY6AMcjs.VERSION,
8162
+ rivetkitVersion: _chunk4H2LT2WBcjs.VERSION,
8160
8163
  envoyVersion: config.node.version,
8161
8164
  envoyVersionSource
8162
8165
  });
8163
- if (envoyVersionSource === "default" && _chunk2MOLY6AMcjs.getNodeEnv.call(void 0, ) === "production") {
8166
+ if (envoyVersionSource === "default" && _chunk4H2LT2WBcjs.getNodeEnv.call(void 0, ) === "production") {
8164
8167
  logger2().error({
8165
8168
  msg: "node version defaulted because neither config.node.version nor RIVET_NODE_VERSION is set; actors will not drain automatically across deploys. See https://rivet.dev/docs/actors/versions",
8166
8169
  envoyVersion: config.node.version,
@@ -8249,10 +8252,10 @@ var Registry = class {
8249
8252
  const modeAPromise = this.#runtimeServeConfiguredPromise;
8250
8253
  const modeBPromise = this.#runtimeServerlessPromise;
8251
8254
  const runtimes = /* @__PURE__ */ new Set();
8252
- const localDevSignal = signalDriven && _chunk2MOLY6AMcjs.getNodeEnv.call(void 0, ) !== "production" && config.engineSpawn && config.endpoint !== void 0 && _chunkOTVJYZ2Lcjs.isLocalEngineEndpoint.call(void 0, config.endpoint);
8255
+ const localDevSignal = signalDriven && _chunk4H2LT2WBcjs.getNodeEnv.call(void 0, ) !== "production" && config.engineSpawn && config.endpoint !== void 0 && _chunkNE5CUQRNcjs.isLocalEngineEndpoint.call(void 0, config.endpoint);
8253
8256
  let gracePeriodMs = (_a = config.shutdown) == null ? void 0 : _a.gracePeriodMs;
8254
8257
  if (gracePeriodMs === void 0) {
8255
- gracePeriodMs = localDevSignal ? 1e3 : await _asyncNullishCoalesce(await this.#actorStopThresholdMs(
8258
+ gracePeriodMs = localDevSignal ? LOCAL_DEV_SHUTDOWN_GRACE_PERIOD_MS : await _asyncNullishCoalesce(await this.#actorStopThresholdMs(
8256
8259
  _nullishCoalesce(modeAPromise, () => ( modeBPromise))
8257
8260
  ), async () => ( 30 * 60 * 1e3));
8258
8261
  }
@@ -8361,7 +8364,7 @@ var Registry = class {
8361
8364
  }
8362
8365
  if (this.#runtimeReadyPromise) return this.#runtimeReadyPromise;
8363
8366
  try {
8364
- if (_chunk2MOLY6AMcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
8367
+ if (_chunk4H2LT2WBcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
8365
8368
  return Promise.reject(
8366
8369
  new Error(
8367
8370
  "registry.startAndWait() requires envoy runtime mode; serverless registries become ready per request"
@@ -8385,16 +8388,17 @@ var Registry = class {
8385
8388
  if (!configuredRegistryPromise || !serveLifecyclePromise) {
8386
8389
  throw new Error("registry envoy startup did not initialize");
8387
8390
  }
8391
+ const readyTimeoutMs = config.engineSpawn && config.endpoint !== void 0 && _chunkNE5CUQRNcjs.isLocalEngineEndpoint.call(void 0, config.endpoint) ? LOCAL_ENGINE_READY_TIMEOUT_MS : REGISTRY_READY_TIMEOUT_MS;
8388
8392
  let timeout;
8389
8393
  const timeoutPromise = new Promise((_resolve, reject) => {
8390
8394
  var _a;
8391
8395
  timeout = setTimeout(
8392
8396
  () => reject(
8393
8397
  new Error(
8394
- `RivetKit registry did not register with the Engine within ${REGISTRY_READY_TIMEOUT_MS}ms`
8398
+ `RivetKit registry did not register with the Engine within ${readyTimeoutMs}ms`
8395
8399
  )
8396
8400
  ),
8397
- REGISTRY_READY_TIMEOUT_MS
8401
+ readyTimeoutMs
8398
8402
  );
8399
8403
  (_a = timeout.unref) == null ? void 0 : _a.call(timeout);
8400
8404
  });
@@ -8434,8 +8438,8 @@ var Registry = class {
8434
8438
  * ```
8435
8439
  */
8436
8440
  start() {
8437
- if (_chunk2MOLY6AMcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
8438
- const publicDir = _nullishCoalesce(_chunk2MOLY6AMcjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
8441
+ if (_chunk4H2LT2WBcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
8442
+ const publicDir = _nullishCoalesce(_chunk4H2LT2WBcjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
8439
8443
  this.listen({ publicDir }).catch((error) => {
8440
8444
  logger2().error({ error }, "auto-listen failed; exiting");
8441
8445
  if (typeof process !== "undefined" && typeof process.exit === "function") {
@@ -8456,13 +8460,13 @@ var Registry = class {
8456
8460
  };
8457
8461
  console.log();
8458
8462
  console.log(
8459
- ` RivetKit ${_chunk2MOLY6AMcjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
8463
+ ` RivetKit ${_chunk4H2LT2WBcjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
8460
8464
  );
8461
8465
  if (config.namespace !== "default") {
8462
8466
  logLine("Namespace", config.namespace);
8463
8467
  }
8464
8468
  if (config.endpoint) {
8465
- const endpointType = config.startEngine || _chunkOTVJYZ2Lcjs.isLocalEngineEndpoint.call(void 0, config.endpoint) ? "local native" : "remote";
8469
+ const endpointType = config.startEngine || _chunkNE5CUQRNcjs.isLocalEngineEndpoint.call(void 0, config.endpoint) ? "local native" : "remote";
8466
8470
  logLine("Endpoint", `${config.endpoint} (${endpointType})`);
8467
8471
  }
8468
8472
  if (kind === "serverless" && config.publicEndpoint) {
@@ -8532,5 +8536,5 @@ function setup(input) {
8532
8536
 
8533
8537
 
8534
8538
 
8535
- exports.ALLOWED_PUBLIC_HEADERS = _chunkOTVJYZ2Lcjs.ALLOWED_PUBLIC_HEADERS; exports.ActorDefinition = ActorDefinition; exports.ActorError = _chunkMGI2VVF6cjs.RivetError; exports.ActorsSchema = ActorsSchema; exports.DocConfigurePoolSchema = DocConfigurePoolSchema; exports.DocEnvoyConfigSchema = DocEnvoyConfigSchema; exports.DocRegistryConfigSchema = DocRegistryConfigSchema; exports.DocServerlessConfigSchema = DocServerlessConfigSchema; exports.DocSqliteConfigSchema = DocSqliteConfigSchema; exports.InlineWebSocketAdapter = InlineWebSocketAdapter; exports.Registry = Registry; exports.RegistryConfigSchema = RegistryConfigSchema; exports.RivetError = _chunkMGI2VVF6cjs.RivetError; exports.RuntimeKindSchema = RuntimeKindSchema; exports.SqliteBackendSchema = SqliteBackendSchema; exports.SqliteConfigSchema = SqliteConfigSchema; exports.TestConfigSchema = TestConfigSchema; exports.UserError = _chunkMGI2VVF6cjs.UserError; exports.WasmRuntimeConfigSchema = WasmRuntimeConfigSchema; exports.actor = actor; exports.buildActorNames = buildActorNames; exports.createClientWithDriver = _chunkOTVJYZ2Lcjs.createClientWithDriver; exports.defineRunHandler = _chunkHDVZ6YZGcjs.defineRunHandler; exports.event = event; exports.isStaticActorDefinition = isStaticActorDefinition; exports.isStaticActorInstance = isStaticActorInstance; exports.lookupInRegistry = lookupInRegistry; exports.noopNext = _chunk2MOLY6AMcjs.noopNext; exports.queue = queue; exports.setup = setup; exports.toUint8Array = _chunk2MOLY6AMcjs.toUint8Array;
8539
+ exports.ALLOWED_PUBLIC_HEADERS = _chunkNE5CUQRNcjs.ALLOWED_PUBLIC_HEADERS; exports.ActorDefinition = ActorDefinition; exports.ActorError = _chunkMGI2VVF6cjs.RivetError; exports.ActorsSchema = ActorsSchema; exports.DocConfigurePoolSchema = DocConfigurePoolSchema; exports.DocEnvoyConfigSchema = DocEnvoyConfigSchema; exports.DocRegistryConfigSchema = DocRegistryConfigSchema; exports.DocServerlessConfigSchema = DocServerlessConfigSchema; exports.DocSqliteConfigSchema = DocSqliteConfigSchema; exports.InlineWebSocketAdapter = InlineWebSocketAdapter; exports.Registry = Registry; exports.RegistryConfigSchema = RegistryConfigSchema; exports.RivetError = _chunkMGI2VVF6cjs.RivetError; exports.RuntimeKindSchema = RuntimeKindSchema; exports.SqliteBackendSchema = SqliteBackendSchema; exports.SqliteConfigSchema = SqliteConfigSchema; exports.TestConfigSchema = TestConfigSchema; exports.UserError = _chunkMGI2VVF6cjs.UserError; exports.WasmRuntimeConfigSchema = WasmRuntimeConfigSchema; exports.actor = actor; exports.buildActorNames = buildActorNames; exports.createClientWithDriver = _chunkNE5CUQRNcjs.createClientWithDriver; exports.defineRunHandler = _chunkHDVZ6YZGcjs.defineRunHandler; exports.event = event; exports.isStaticActorDefinition = isStaticActorDefinition; exports.isStaticActorInstance = isStaticActorInstance; exports.lookupInRegistry = lookupInRegistry; exports.noopNext = _chunk4H2LT2WBcjs.noopNext; exports.queue = queue; exports.setup = setup; exports.toUint8Array = _chunk4H2LT2WBcjs.toUint8Array;
8536
8540
  //# sourceMappingURL=mod.cjs.map