rivetkit 2.3.20 → 2.3.21

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 (130) hide show
  1. package/dist/browser/client.d.ts +43 -5
  2. package/dist/browser/client.js +302 -60
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.js +2 -1
  5. package/dist/browser/inspector/client.js.map +1 -1
  6. package/dist/tsup/actor/errors.cjs.map +1 -1
  7. package/dist/tsup/agent-os/index.cjs +2 -1
  8. package/dist/tsup/agent-os/index.cjs.map +1 -1
  9. package/dist/tsup/agent-os/index.d.cts +32 -4
  10. package/dist/tsup/agent-os/index.d.ts +32 -4
  11. package/dist/tsup/agent-os/index.js +2 -1
  12. package/dist/tsup/agent-os/index.js.map +1 -1
  13. package/dist/tsup/{chunk-553CIQJY.js → chunk-2CI2IEVN.js} +2 -2
  14. package/dist/tsup/{chunk-W2PXGWMR.js → chunk-5EGLHQJJ.js} +2 -2
  15. package/dist/tsup/{chunk-DMQUERRN.js → chunk-5IBUZFLP.js} +2 -2
  16. package/dist/tsup/{chunk-76YTS32R.cjs → chunk-6LRPYB4Q.cjs} +4 -4
  17. package/dist/tsup/chunk-6LRPYB4Q.cjs.map +1 -0
  18. package/dist/tsup/{chunk-WAISW7KR.cjs → chunk-APOANSDG.cjs} +10 -10
  19. package/dist/tsup/chunk-APOANSDG.cjs.map +1 -0
  20. package/dist/tsup/{chunk-IHKDFKM4.cjs → chunk-ARGNQGYG.cjs} +3 -3
  21. package/dist/tsup/chunk-ARGNQGYG.cjs.map +1 -0
  22. package/dist/tsup/{chunk-A36FMKOV.cjs → chunk-B5SNXPSS.cjs} +448 -199
  23. package/dist/tsup/chunk-B5SNXPSS.cjs.map +1 -0
  24. package/dist/tsup/{chunk-SNNVRHLX.js → chunk-CJXBGTVT.js} +2 -2
  25. package/dist/tsup/{chunk-CVLNRT7O.cjs → chunk-GHKQC4PD.cjs} +3 -3
  26. package/dist/tsup/chunk-GHKQC4PD.cjs.map +1 -0
  27. package/dist/tsup/chunk-JX2ITWAV.cjs.map +1 -1
  28. package/dist/tsup/chunk-KVFIONKQ.cjs.map +1 -1
  29. package/dist/tsup/{chunk-2CE5UNWK.cjs → chunk-KWGN2ZBJ.cjs} +3 -2
  30. package/dist/tsup/chunk-KWGN2ZBJ.cjs.map +1 -0
  31. package/dist/tsup/{chunk-3WS7Z64U.cjs → chunk-LWSLKKZ5.cjs} +3 -3
  32. package/dist/tsup/chunk-LWSLKKZ5.cjs.map +1 -0
  33. package/dist/tsup/chunk-MYWZCDML.cjs.map +1 -1
  34. package/dist/tsup/{chunk-RSIOGT2U.cjs → chunk-NL2EIKK6.cjs} +7 -7
  35. package/dist/tsup/chunk-NL2EIKK6.cjs.map +1 -0
  36. package/dist/tsup/chunk-NWCAIWHL.cjs.map +1 -1
  37. package/dist/tsup/{chunk-5G2J26VM.js → chunk-PYRI75DL.js} +314 -65
  38. package/dist/tsup/chunk-PYRI75DL.js.map +1 -0
  39. package/dist/tsup/{chunk-2NXLTFWI.js → chunk-RFN3BG6D.js} +3 -3
  40. package/dist/tsup/chunk-RFN3BG6D.js.map +1 -0
  41. package/dist/tsup/{chunk-DHWZTUKA.js → chunk-RGIZNZYO.js} +3 -2
  42. package/dist/tsup/chunk-RGIZNZYO.js.map +1 -0
  43. package/dist/tsup/{chunk-TZVAVPGJ.js → chunk-VMMXXVDO.js} +4 -4
  44. package/dist/tsup/client/mod.cjs +5 -5
  45. package/dist/tsup/client/mod.cjs.map +1 -1
  46. package/dist/tsup/client/mod.d.cts +12 -3
  47. package/dist/tsup/client/mod.d.ts +12 -3
  48. package/dist/tsup/client/mod.js +4 -4
  49. package/dist/tsup/common/log.cjs +2 -2
  50. package/dist/tsup/common/log.cjs.map +1 -1
  51. package/dist/tsup/common/log.js +1 -1
  52. package/dist/tsup/common/websocket.cjs +3 -3
  53. package/dist/tsup/common/websocket.cjs.map +1 -1
  54. package/dist/tsup/common/websocket.js +2 -2
  55. package/dist/tsup/{config-Be-VOHaX.d.ts → config-Bc1nnvUl.d.ts} +35 -5
  56. package/dist/tsup/{config-Ct5uXxXk.d.cts → config-Do_0guSS.d.cts} +35 -5
  57. package/dist/tsup/{context-Cw-11Q-B.d.cts → context-CgNkhjdY.d.cts} +1 -1
  58. package/dist/tsup/{context-CXLa0BIM.d.ts → context-oGQxZDPz.d.ts} +1 -1
  59. package/dist/tsup/db/drizzle.cjs +2 -2
  60. package/dist/tsup/db/drizzle.cjs.map +1 -1
  61. package/dist/tsup/db/drizzle.js +1 -1
  62. package/dist/tsup/db/mod.cjs +3 -3
  63. package/dist/tsup/db/mod.cjs.map +1 -1
  64. package/dist/tsup/db/mod.js +2 -2
  65. package/dist/tsup/dynamic/mod.cjs.map +1 -1
  66. package/dist/tsup/dynamic/mod.d.cts +2 -1
  67. package/dist/tsup/dynamic/mod.d.ts +2 -1
  68. package/dist/tsup/inspector/mod.cjs +5 -5
  69. package/dist/tsup/inspector/mod.cjs.map +1 -1
  70. package/dist/tsup/inspector/mod.js +4 -4
  71. package/dist/tsup/inspector/workflow.cjs +4 -4
  72. package/dist/tsup/inspector/workflow.cjs.map +1 -1
  73. package/dist/tsup/inspector/workflow.js +3 -3
  74. package/dist/tsup/inspector-tab/mod.cjs.map +1 -1
  75. package/dist/tsup/inspector-tab/mod.d.cts +3 -2
  76. package/dist/tsup/inspector-tab/mod.d.ts +3 -2
  77. package/dist/tsup/mod.cjs +105 -115
  78. package/dist/tsup/mod.cjs.map +1 -1
  79. package/dist/tsup/mod.d.cts +4 -3
  80. package/dist/tsup/mod.d.ts +4 -3
  81. package/dist/tsup/mod.js +29 -39
  82. package/dist/tsup/mod.js.map +1 -1
  83. package/dist/tsup/test/mod.cjs +6 -6
  84. package/dist/tsup/test/mod.cjs.map +1 -1
  85. package/dist/tsup/test/mod.d.cts +2 -1
  86. package/dist/tsup/test/mod.d.ts +2 -1
  87. package/dist/tsup/test/mod.js +4 -4
  88. package/dist/tsup/unstable/migrations.cjs.map +1 -1
  89. package/dist/tsup/utils.cjs +2 -2
  90. package/dist/tsup/utils.cjs.map +1 -1
  91. package/dist/tsup/utils.js +1 -1
  92. package/dist/tsup/workflow/mod.cjs +7 -7
  93. package/dist/tsup/workflow/mod.cjs.map +1 -1
  94. package/dist/tsup/workflow/mod.d.cts +4 -3
  95. package/dist/tsup/workflow/mod.d.ts +4 -3
  96. package/dist/tsup/workflow/mod.js +4 -4
  97. package/package.json +10 -9
  98. package/src/client/actor-conn.ts +34 -1
  99. package/src/client/actor-handle.ts +29 -1
  100. package/src/client/auth.ts +37 -0
  101. package/src/client/client.ts +10 -2
  102. package/src/client/config.ts +12 -1
  103. package/src/client/mod.ts +9 -0
  104. package/src/client/token-provider.test.ts +86 -0
  105. package/src/client/token-provider.ts +93 -0
  106. package/src/client/utils.ts +1 -0
  107. package/src/engine-client/actor-websocket-client.ts +2 -1
  108. package/src/engine-client/api-endpoints.ts +28 -0
  109. package/src/engine-client/driver.ts +4 -0
  110. package/src/engine-client/mod.ts +201 -64
  111. package/src/registry/config/envoy.ts +1 -17
  112. package/src/registry/config/index.test.ts +2 -2
  113. package/src/registry/config/index.ts +7 -2
  114. package/src/registry/index.ts +28 -0
  115. package/dist/tsup/chunk-2CE5UNWK.cjs.map +0 -1
  116. package/dist/tsup/chunk-2NXLTFWI.js.map +0 -1
  117. package/dist/tsup/chunk-3WS7Z64U.cjs.map +0 -1
  118. package/dist/tsup/chunk-5G2J26VM.js.map +0 -1
  119. package/dist/tsup/chunk-76YTS32R.cjs.map +0 -1
  120. package/dist/tsup/chunk-A36FMKOV.cjs.map +0 -1
  121. package/dist/tsup/chunk-CVLNRT7O.cjs.map +0 -1
  122. package/dist/tsup/chunk-DHWZTUKA.js.map +0 -1
  123. package/dist/tsup/chunk-IHKDFKM4.cjs.map +0 -1
  124. package/dist/tsup/chunk-RSIOGT2U.cjs.map +0 -1
  125. package/dist/tsup/chunk-WAISW7KR.cjs.map +0 -1
  126. /package/dist/tsup/{chunk-553CIQJY.js.map → chunk-2CI2IEVN.js.map} +0 -0
  127. /package/dist/tsup/{chunk-W2PXGWMR.js.map → chunk-5EGLHQJJ.js.map} +0 -0
  128. /package/dist/tsup/{chunk-DMQUERRN.js.map → chunk-5IBUZFLP.js.map} +0 -0
  129. /package/dist/tsup/{chunk-SNNVRHLX.js.map → chunk-CJXBGTVT.js.map} +0 -0
  130. /package/dist/tsup/{chunk-TZVAVPGJ.js.map → chunk-VMMXXVDO.js.map} +0 -0
package/dist/tsup/mod.cjs CHANGED
@@ -1,5 +1,8 @@
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(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } var _class; var _class2; var _class3;
2
2
 
3
+ var _chunk6LRPYB4Qcjs = require('./chunk-6LRPYB4Q.cjs');
4
+
5
+
3
6
 
4
7
 
5
8
 
@@ -17,7 +20,6 @@
17
20
  var _chunkNWCAIWHLcjs = require('./chunk-NWCAIWHL.cjs');
18
21
 
19
22
 
20
- var _chunk76YTS32Rcjs = require('./chunk-76YTS32R.cjs');
21
23
 
22
24
 
23
25
 
@@ -31,17 +33,19 @@ var _chunk76YTS32Rcjs = require('./chunk-76YTS32R.cjs');
31
33
 
32
34
 
33
35
 
34
- var _chunkA36FMKOVcjs = require('./chunk-A36FMKOV.cjs');
36
+
37
+
38
+ var _chunkB5SNXPSScjs = require('./chunk-B5SNXPSS.cjs');
35
39
 
36
40
 
37
41
 
38
42
  var _chunkMYWZCDMLcjs = require('./chunk-MYWZCDML.cjs');
39
- require('./chunk-3WS7Z64U.cjs');
43
+ require('./chunk-LWSLKKZ5.cjs');
40
44
 
41
45
 
42
46
 
43
47
 
44
- var _chunkCVLNRT7Ocjs = require('./chunk-CVLNRT7O.cjs');
48
+ var _chunkGHKQC4PDcjs = require('./chunk-GHKQC4PD.cjs');
45
49
  require('./chunk-KVFIONKQ.cjs');
46
50
 
47
51
 
@@ -76,7 +80,7 @@ require('./chunk-KVFIONKQ.cjs');
76
80
 
77
81
 
78
82
 
79
- var _chunk2CE5UNWKcjs = require('./chunk-2CE5UNWK.cjs');
83
+ var _chunkKWGN2ZBJcjs = require('./chunk-KWGN2ZBJ.cjs');
80
84
 
81
85
 
82
86
 
@@ -93,7 +97,7 @@ var _chunkJX2ITWAVcjs = require('./chunk-JX2ITWAV.cjs');
93
97
 
94
98
  // src/actor/log.ts
95
99
  function loggerWithoutContext() {
96
- return _chunk2CE5UNWKcjs.getLogger.call(void 0, "actor-runtime");
100
+ return _chunkKWGN2ZBJcjs.getLogger.call(void 0, "actor-runtime");
97
101
  }
98
102
 
99
103
  // src/actor/definition.ts
@@ -235,7 +239,7 @@ function validateSchemaSync(schemas, key, data) {
235
239
  var _virtualwebsocket = require('@rivetkit/virtual-websocket');
236
240
  var _ws = require('hono/ws');
237
241
  function logger() {
238
- return _chunk2CE5UNWKcjs.getLogger.call(void 0, "inline-websocket-adapter");
242
+ return _chunkKWGN2ZBJcjs.getLogger.call(void 0, "inline-websocket-adapter");
239
243
  }
240
244
  var InlineWebSocketAdapter = class {
241
245
  #handler;
@@ -385,28 +389,9 @@ var InlineWebSocketAdapter = class {
385
389
  }
386
390
  };
387
391
 
388
- // src/common/engine.ts
389
- var ENGINE_HOST = "127.0.0.1";
390
- var ENGINE_PORT = 6420;
391
- var ENGINE_ENDPOINT = buildEngineEndpoint(ENGINE_HOST, ENGINE_PORT);
392
- function buildEngineEndpoint(host, port) {
393
- const urlHost = host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
394
- return `http://${urlHost}:${port}`;
395
- }
396
- function isLocalEngineEndpoint(endpoint) {
397
- let url;
398
- try {
399
- url = new URL(endpoint);
400
- } catch (e) {
401
- return false;
402
- }
403
- const hostname = url.hostname.toLowerCase();
404
- return hostname === "localhost" || hostname === "0.0.0.0" || hostname === "::" || hostname === "[::]" || hostname === "::1" || hostname === "[::1]" || /^127(?:\.\d{1,3}){0,3}$/.test(hostname);
405
- }
406
-
407
392
  // src/registry/log.ts
408
393
  function logger2() {
409
- return _chunk2CE5UNWKcjs.getLogger.call(void 0, "registry");
394
+ return _chunkKWGN2ZBJcjs.getLogger.call(void 0, "registry");
410
395
  }
411
396
 
412
397
  // src/serverless/configure.ts
@@ -452,8 +437,8 @@ async function configureServerlessPool(config) {
452
437
  );
453
438
  }
454
439
  const customConfig = config.configurePool;
455
- const clientConfig = _chunkA36FMKOVcjs.convertRegistryConfigToClientConfig.call(void 0, config);
456
- const dcsRes = await _chunkA36FMKOVcjs.getDatacenters.call(void 0, clientConfig);
440
+ const clientConfig = _chunkB5SNXPSScjs.convertRegistryConfigToClientConfig.call(void 0, config);
441
+ const dcsRes = await _chunkB5SNXPSScjs.getDatacenters.call(void 0, clientConfig);
457
442
  const poolName = _nullishCoalesce(customConfig.name, () => ( "default"));
458
443
  const serverlessToken = _nullishCoalesce(config.token, () => ( config.publicToken));
459
444
  const headers = {
@@ -475,7 +460,7 @@ async function configureServerlessPool(config) {
475
460
  metadata: _nullishCoalesce(customConfig.metadata, () => ( {})),
476
461
  drain_on_version_upgrade: _nullishCoalesce(customConfig.drainOnVersionUpgrade, () => ( true))
477
462
  };
478
- await _chunkA36FMKOVcjs.updateRunnerConfig.call(void 0, clientConfig, poolName, {
463
+ await _chunkB5SNXPSScjs.updateRunnerConfig.call(void 0, clientConfig, poolName, {
479
464
  datacenters: Object.fromEntries(
480
465
  dcsRes.datacenters.map((dc) => [dc.name, serverlessConfig])
481
466
  )
@@ -492,7 +477,7 @@ async function configureServerlessPool(config) {
492
477
  logger2().warn({
493
478
  msg: "serverless pool configuration attempt failed",
494
479
  attempts,
495
- error: _chunk2CE5UNWKcjs.stringifyError.call(void 0, error)
480
+ error: _chunkKWGN2ZBJcjs.stringifyError.call(void 0, error)
496
481
  });
497
482
  await sleep(CONFIGURE_RETRY_DELAY_MS);
498
483
  }
@@ -500,7 +485,7 @@ async function configureServerlessPool(config) {
500
485
  logger2().error({
501
486
  msg: "failed to configure serverless pool, validate endpoint is configured correctly then restart this process",
502
487
  attempts,
503
- error: _chunk2CE5UNWKcjs.stringifyError.call(void 0, lastError)
488
+ error: _chunkKWGN2ZBJcjs.stringifyError.call(void 0, lastError)
504
489
  });
505
490
  throw lastError;
506
491
  }
@@ -510,22 +495,11 @@ var _zod = require('zod');
510
495
 
511
496
  // src/registry/config/envoy.ts
512
497
  var _v4 = require('zod/v4');
513
- var warnedMissingVersion = false;
514
498
  var EnvoyConfigSchema = _v4.z.object({
515
- poolName: _v4.z.string().default(() => _nullishCoalesce(_chunk2CE5UNWKcjs.getRivetPool.call(void 0, ), () => ( "default"))),
516
- version: _v4.z.number().default(() => {
517
- const version = _chunk2CE5UNWKcjs.getRivetEnvoyVersion.call(void 0, );
518
- if (version !== void 0) return version;
519
- if (_chunk2CE5UNWKcjs.getNodeEnv.call(void 0, ) === "production" && !warnedMissingVersion) {
520
- warnedMissingVersion = true;
521
- _chunk2CE5UNWKcjs.getLogger.call(void 0, "rivetkit").error(
522
- "RIVET_ENVOY_VERSION is not set. Actors will not be versioned, which means they won't be drained on deploy. This is only needed when self-hosting or using a custom envoy (not needed for Rivet Compute). Set this as a build arg in your Dockerfile. See https://rivet.dev/docs/actors/versions"
523
- );
524
- }
525
- return 1;
526
- }),
499
+ poolName: _v4.z.string().default(() => _nullishCoalesce(_chunkKWGN2ZBJcjs.getRivetPool.call(void 0, ), () => ( "default"))),
500
+ version: _v4.z.number().default(() => _nullishCoalesce(_chunkKWGN2ZBJcjs.getRivetEnvoyVersion.call(void 0, ), () => ( 1))),
527
501
  // Deprecated.
528
- totalSlots: _v4.z.number().default(() => _nullishCoalesce(_chunk2CE5UNWKcjs.getRivetTotalSlots.call(void 0, ), () => ( 1e5))),
502
+ totalSlots: _v4.z.number().default(() => _nullishCoalesce(_chunkKWGN2ZBJcjs.getRivetTotalSlots.call(void 0, ), () => ( 1e5))),
529
503
  envoyKey: _v4.z.string().optional()
530
504
  });
531
505
 
@@ -563,7 +537,7 @@ var ServerlessConfigSchema = _v4.z.object({
563
537
  *
564
538
  * Can also be set via RIVET_PUBLIC_ENDPOINT environment variable.
565
539
  */
566
- publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk2CE5UNWKcjs.getRivetPublicEndpoint.call(void 0, )))),
540
+ publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkKWGN2ZBJcjs.getRivetPublicEndpoint.call(void 0, )))),
567
541
  /**
568
542
  * Token that clients should use when connecting via the public endpoint.
569
543
  *
@@ -571,7 +545,7 @@ var ServerlessConfigSchema = _v4.z.object({
571
545
  *
572
546
  * Can also be specified in the publicEndpoint URL as `https://namespace:token@host`.
573
547
  */
574
- publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk2CE5UNWKcjs.getRivetPublicToken.call(void 0, ))))
548
+ publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkKWGN2ZBJcjs.getRivetPublicToken.call(void 0, ))))
575
549
  // There is no publicNamespace config option because the frontend and backend
576
550
  // cannot use different namespaces. The namespace is extracted from the
577
551
  // publicEndpoint URL auth syntax if provided.
@@ -625,7 +599,7 @@ var RegistryConfigSchema = _zod.z.object({
625
599
  * Runtime binding to use for RivetKit core.
626
600
  * */
627
601
  runtime: RuntimeKindSchema.optional().transform((val, ctx) => {
628
- const rawRuntime = _nullishCoalesce(val, () => ( _chunk2CE5UNWKcjs.getRivetkitRuntime.call(void 0, )));
602
+ const rawRuntime = _nullishCoalesce(val, () => ( _chunkKWGN2ZBJcjs.getRivetkitRuntime.call(void 0, )));
629
603
  if (rawRuntime === void 0) {
630
604
  return "auto";
631
605
  }
@@ -662,7 +636,7 @@ var RegistryConfigSchema = _zod.z.object({
662
636
  * */
663
637
  logging: _zod.z.object({
664
638
  baseLogger: _zod.z.custom().optional(),
665
- level: _chunk2CE5UNWKcjs.LogLevelSchema.optional()
639
+ level: _chunkKWGN2ZBJcjs.LogLevelSchema.optional()
666
640
  }).optional().default(() => ({})),
667
641
  // MARK: Routing
668
642
  // // This is a function to allow for lazy configuration of upgradeWebSocket on the
@@ -680,9 +654,9 @@ var RegistryConfigSchema = _zod.z.object({
680
654
  *
681
655
  * Can also be set via RIVET_ENDPOINT environment variables.
682
656
  */
683
- endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => ( _chunk2CE5UNWKcjs.getRivetEngine.call(void 0, ))), () => ( _chunk2CE5UNWKcjs.getRivetEndpoint.call(void 0, )))),
684
- token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk2CE5UNWKcjs.getRivetToken.call(void 0, )))),
685
- namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk2CE5UNWKcjs.getRivetNamespace.call(void 0, )))),
657
+ endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => ( _chunkKWGN2ZBJcjs.getRivetEngine.call(void 0, ))), () => ( _chunkKWGN2ZBJcjs.getRivetEndpoint.call(void 0, )))),
658
+ token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkKWGN2ZBJcjs.getRivetToken.call(void 0, )))),
659
+ namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkKWGN2ZBJcjs.getRivetNamespace.call(void 0, )))),
686
660
  headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional().default({}),
687
661
  // MARK: Client
688
662
  // TODO:
@@ -722,21 +696,21 @@ var RegistryConfigSchema = _zod.z.object({
722
696
  *
723
697
  * Starts the full Rust engine process locally.
724
698
  */
725
- startEngine: _zod.z.boolean().default(() => _chunk2CE5UNWKcjs.getRivetRunEngine.call(void 0, )),
699
+ startEngine: _zod.z.boolean().default(() => _chunkKWGN2ZBJcjs.getRivetRunEngine.call(void 0, )),
726
700
  /**
727
701
  * @experimental
728
702
  *
729
703
  * Host to bind the spawned local engine process to.
730
704
  */
731
- engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(_chunk2CE5UNWKcjs.getRivetRunEngineHost.call(void 0, ), () => ( ENGINE_HOST))),
705
+ engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkKWGN2ZBJcjs.getRivetRunEngineHost.call(void 0, ), () => ( _chunkB5SNXPSScjs.ENGINE_HOST))),
732
706
  /**
733
707
  * @experimental
734
708
  *
735
709
  * Port to bind the spawned local engine process to.
736
710
  */
737
- enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(_chunk2CE5UNWKcjs.getRivetRunEnginePort.call(void 0, ), () => ( ENGINE_PORT))),
711
+ enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(_chunkKWGN2ZBJcjs.getRivetRunEnginePort.call(void 0, ), () => ( _chunkB5SNXPSScjs.ENGINE_PORT))),
738
712
  /** @experimental */
739
- engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunk2CE5UNWKcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunk2CE5UNWKcjs.VERSION))),
713
+ engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkKWGN2ZBJcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunkKWGN2ZBJcjs.VERSION))),
740
714
  /**
741
715
  * Starts the first-party Services actor host when RivetKit manages
742
716
  * a local engine. Defaults to the local-engine decision. Set
@@ -790,7 +764,7 @@ var RegistryConfigSchema = _zod.z.object({
790
764
  }))
791
765
  }).transform((config, ctx) => {
792
766
  var _a, _b, _c;
793
- const isDevEnv = _chunk2CE5UNWKcjs.isDev.call(void 0, );
767
+ const isDevEnv = _chunkKWGN2ZBJcjs.isDev.call(void 0, );
794
768
  const sqliteBackend = _nullishCoalesce(((_a = config.sqlite) == null ? void 0 : _a.backend), () => ( ((_b = config.test) == null ? void 0 : _b.sqliteBackend)));
795
769
  if (config.runtime === "wasm" && sqliteBackend === "local") {
796
770
  ctx.addIssue({
@@ -800,7 +774,7 @@ var RegistryConfigSchema = _zod.z.object({
800
774
  });
801
775
  }
802
776
  const sqlite = config.runtime === "wasm" && config.sqlite === void 0 ? { backend: "remote" } : config.sqlite;
803
- const parsedEndpoint = config.endpoint ? _chunkA36FMKOVcjs.tryParseEndpoint.call(void 0, ctx, {
777
+ const parsedEndpoint = config.endpoint ? _chunkB5SNXPSScjs.tryParseEndpoint.call(void 0, ctx, {
804
778
  endpoint: config.endpoint,
805
779
  path: ["endpoint"],
806
780
  namespace: config.namespace,
@@ -818,18 +792,18 @@ var RegistryConfigSchema = _zod.z.object({
818
792
  message: "configurePool requires either endpoint or startEngine"
819
793
  });
820
794
  }
821
- const localEngineEndpoint = buildEngineEndpoint(
795
+ const localEngineEndpoint = _chunkB5SNXPSScjs.buildEngineEndpoint.call(void 0,
822
796
  config.engineHost,
823
797
  config.enginePort
824
798
  );
825
799
  const endpoint = config.startEngine ? localEngineEndpoint : _nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.endpoint), () => ( (isDevEnv ? localEngineEndpoint : void 0)));
826
- const startServices = _nullishCoalesce(_nullishCoalesce(config.startServices, () => ( _chunk2CE5UNWKcjs.getRivetRunServices.call(void 0, ))), () => ( Boolean(endpoint && isLocalEngineEndpoint(endpoint))));
800
+ const startServices = _nullishCoalesce(_nullishCoalesce(config.startServices, () => ( _chunkKWGN2ZBJcjs.getRivetRunServices.call(void 0, ))), () => ( Boolean(endpoint && _chunkB5SNXPSScjs.isLocalEngineEndpoint.call(void 0, endpoint))));
827
801
  const validateServerlessEndpoint = Boolean(
828
802
  config.startEngine || parsedEndpoint
829
803
  );
830
804
  const namespace = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.namespace), () => ( config.namespace)), () => ( "default"));
831
- const token = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token)), () => ( "dev"));
832
- const parsedPublicEndpoint = config.serverless.publicEndpoint ? _chunkA36FMKOVcjs.tryParseEndpoint.call(void 0, ctx, {
805
+ const token = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token)), () => ( (endpoint && _chunkB5SNXPSScjs.isLocalEngineEndpoint.call(void 0, endpoint) ? "default" : void 0)));
806
+ const parsedPublicEndpoint = config.serverless.publicEndpoint ? _chunkB5SNXPSScjs.tryParseEndpoint.call(void 0, ctx, {
833
807
  endpoint: config.serverless.publicEndpoint,
834
808
  path: ["serverless", "publicEndpoint"]
835
809
  }) : void 0;
@@ -933,7 +907,7 @@ var DocRegistryConfigSchema = _zod.z.object({
933
907
  noWelcome: _zod.z.boolean().optional().describe("Disable the welcome message on startup. Default: false"),
934
908
  sqlite: DocSqliteConfigSchema,
935
909
  logging: _zod.z.object({
936
- level: _chunk2CE5UNWKcjs.LogLevelSchema.optional().describe(
910
+ level: _chunkKWGN2ZBJcjs.LogLevelSchema.optional().describe(
937
911
  "Log level for RivetKit. Default: 'warn'"
938
912
  )
939
913
  }).optional().describe("Logging configuration."),
@@ -1213,7 +1187,7 @@ function wrapJsNativeDatabase(database) {
1213
1187
  if (transaction) {
1214
1188
  try {
1215
1189
  await transaction.rollback();
1216
- } catch (e2) {
1190
+ } catch (e) {
1217
1191
  }
1218
1192
  }
1219
1193
  enrichNativeDatabaseError(database, error);
@@ -1563,7 +1537,7 @@ var NapiCoreRuntime = (_class = class {
1563
1537
  if (!(active == null ? void 0 : active.sameActorInstance(ownerCtx))) {
1564
1538
  return ownerCtx;
1565
1539
  }
1566
- const applicationSpan = _chunkA36FMKOVcjs.readActiveTraceHeaders.call(void 0, );
1540
+ const applicationSpan = _chunkB5SNXPSScjs.readActiveTraceHeaders.call(void 0, );
1567
1541
  if (!applicationSpan) {
1568
1542
  return active;
1569
1543
  }
@@ -1766,7 +1740,7 @@ var NapiCoreRuntime = (_class = class {
1766
1740
  const span = (_a = nativeCtx.invocationTraceContext()) == null ? void 0 : _a.span;
1767
1741
  return this.#invocationContext.run(
1768
1742
  nativeCtx,
1769
- () => _chunkA36FMKOVcjs.runWithActorInvocationSpan.call(void 0, span, run)
1743
+ () => _chunkB5SNXPSScjs.runWithActorInvocationSpan.call(void 0, span, run)
1770
1744
  );
1771
1745
  }
1772
1746
  actorInvocationTraceContext(ctx) {
@@ -2141,8 +2115,8 @@ function runtimeBytesToArrayBuffer(value) {
2141
2115
  function buildNativeHttpRequest(init) {
2142
2116
  var _a;
2143
2117
  const headers = new Headers(init.headers);
2144
- const originalUrl = headers.get(_chunkA36FMKOVcjs.HEADER_ORIGINAL_REQUEST_URL);
2145
- headers.delete(_chunkA36FMKOVcjs.HEADER_ORIGINAL_REQUEST_URL);
2118
+ const originalUrl = headers.get(_chunkB5SNXPSScjs.HEADER_ORIGINAL_REQUEST_URL);
2119
+ headers.delete(_chunkB5SNXPSScjs.HEADER_ORIGINAL_REQUEST_URL);
2146
2120
  const url = _nullishCoalesce(originalUrl, () => ( (init.uri.startsWith("http") ? init.uri : new URL(init.uri, "http://127.0.0.1").toString())));
2147
2121
  const method2 = init.method.toUpperCase();
2148
2122
  const bodyForbidden = method2 === "GET" || method2 === "HEAD";
@@ -2221,7 +2195,7 @@ async function pumpResponseBody(reader, stream) {
2221
2195
  }
2222
2196
  } catch (error) {
2223
2197
  try {
2224
- await stream.error(_chunk2CE5UNWKcjs.stringifyError.call(void 0, error));
2198
+ await stream.error(_chunkKWGN2ZBJcjs.stringifyError.call(void 0, error));
2225
2199
  } catch (streamError) {
2226
2200
  logger2().debug({
2227
2201
  msg: "failed to report native http response stream error",
@@ -3417,7 +3391,7 @@ function trySetProcessEnv(key, value) {
3417
3391
  if (typeof process === "undefined") return;
3418
3392
  try {
3419
3393
  process.env[key] = value;
3420
- } catch (e3) {
3394
+ } catch (e2) {
3421
3395
  }
3422
3396
  }
3423
3397
  function detectRuntimeHost() {
@@ -3459,7 +3433,7 @@ async function loadAutoRuntime(config, loaders = defaultRuntimeLoaders) {
3459
3433
  nativeError = error;
3460
3434
  logger2().warn({
3461
3435
  msg: "native runtime failed to load; falling back to wasm",
3462
- error: _chunk2CE5UNWKcjs.stringifyError.call(void 0, error)
3436
+ error: _chunkKWGN2ZBJcjs.stringifyError.call(void 0, error)
3463
3437
  });
3464
3438
  }
3465
3439
  try {
@@ -3468,7 +3442,7 @@ async function loadAutoRuntime(config, loaders = defaultRuntimeLoaders) {
3468
3442
  throw new (0, _chunkJX2ITWAVcjs.RivetError)(
3469
3443
  "config",
3470
3444
  "runtime_unavailable",
3471
- `RivetKit could not load a core runtime. Native runtime: ${_chunk2CE5UNWKcjs.stringifyError.call(void 0, nativeError)} Wasm runtime: ${_chunk2CE5UNWKcjs.stringifyError.call(void 0, wasmError)}`,
3445
+ `RivetKit could not load a core runtime. Native runtime: ${_chunkKWGN2ZBJcjs.stringifyError.call(void 0, nativeError)} Wasm runtime: ${_chunkKWGN2ZBJcjs.stringifyError.call(void 0, wasmError)}`,
3472
3446
  {
3473
3447
  public: true,
3474
3448
  statusCode: 500
@@ -3662,7 +3636,7 @@ async function cleanupNativeSleepRuntimeState(runtime, ctx, afterTrackedWorkDrai
3662
3636
  }).catch((error) => {
3663
3637
  logger2().warn({
3664
3638
  msg: "deferred native sleep cleanup failed",
3665
- error: _chunk2CE5UNWKcjs.stringifyError.call(void 0, error)
3639
+ error: _chunkKWGN2ZBJcjs.stringifyError.call(void 0, error)
3666
3640
  });
3667
3641
  });
3668
3642
  return;
@@ -3825,10 +3799,10 @@ function decodeValue(value) {
3825
3799
  if (!value || value.length === 0) {
3826
3800
  return void 0;
3827
3801
  }
3828
- return _chunk2CE5UNWKcjs.decodeCborCompat.call(void 0, value);
3802
+ return _chunkKWGN2ZBJcjs.decodeCborCompat.call(void 0, value);
3829
3803
  }
3830
3804
  function encodeValue(value) {
3831
- return _chunk2CE5UNWKcjs.encodeCborCompat.call(void 0, value);
3805
+ return _chunkKWGN2ZBJcjs.encodeCborCompat.call(void 0, value);
3832
3806
  }
3833
3807
  function normalizeArgs(value) {
3834
3808
  return Array.isArray(value) ? value : value === void 0 || value === null ? [] : [value];
@@ -3864,7 +3838,7 @@ function isStructuredBridgeError(error) {
3864
3838
  return _chunkJX2ITWAVcjs.isRivetErrorLike.call(void 0, error) && "__type" in error && (error.__type === "RivetError" || error.__type === "ActorError");
3865
3839
  }
3866
3840
  function encodeNativeCallbackError(error) {
3867
- const structuredError = isStructuredBridgeError(error) ? error : _chunk2CE5UNWKcjs.deconstructError.call(void 0, error, true);
3841
+ const structuredError = isStructuredBridgeError(error) ? error : _chunkKWGN2ZBJcjs.deconstructError.call(void 0, error, true);
3868
3842
  const bridgeError = new Error(_chunkJX2ITWAVcjs.encodeBridgeRivetError.call(void 0, structuredError), {
3869
3843
  cause: error instanceof Error ? error : void 0
3870
3844
  });
@@ -3915,8 +3889,8 @@ function decodeWorkflowCbor(data) {
3915
3889
  return null;
3916
3890
  }
3917
3891
  try {
3918
- return _chunk2CE5UNWKcjs.decodeCborCompat.call(void 0, new Uint8Array(data));
3919
- } catch (e4) {
3892
+ return _chunkKWGN2ZBJcjs.decodeCborCompat.call(void 0, new Uint8Array(data));
3893
+ } catch (e3) {
3920
3894
  return null;
3921
3895
  }
3922
3896
  }
@@ -4028,7 +4002,7 @@ function serializeWorkflowHistoryForJson(data) {
4028
4002
  if (data === null) {
4029
4003
  return null;
4030
4004
  }
4031
- const history = _chunk76YTS32Rcjs.decodeWorkflowHistoryTransport.call(void 0, data);
4005
+ const history = _chunk6LRPYB4Qcjs.decodeWorkflowHistoryTransport.call(void 0, data);
4032
4006
  return jsonSafe({
4033
4007
  nameRegistry: [...history.nameRegistry],
4034
4008
  entries: history.entries.map((entry) => ({
@@ -4174,7 +4148,7 @@ var NativeConnAdapter = class {
4174
4148
  },
4175
4149
  (newValue) => {
4176
4150
  assertCurrentState();
4177
- _chunk2CE5UNWKcjs.assertJsonCompatValue.call(void 0, newValue);
4151
+ _chunkKWGN2ZBJcjs.assertJsonCompatValue.call(void 0, newValue);
4178
4152
  }
4179
4153
  );
4180
4154
  }
@@ -4182,7 +4156,7 @@ var NativeConnAdapter = class {
4182
4156
  var _a;
4183
4157
  (_a = this.#assertCanMutateState) == null ? void 0 : _a.call(this);
4184
4158
  const nextValue = unwrapWriteThroughProxy(value);
4185
- _chunk2CE5UNWKcjs.assertJsonCompatValue.call(void 0, nextValue);
4159
+ _chunkKWGN2ZBJcjs.assertJsonCompatValue.call(void 0, nextValue);
4186
4160
  this.#writeState(nextValue, { writeNative: true });
4187
4161
  }
4188
4162
  initializeState(value) {
@@ -5258,7 +5232,7 @@ var ActorContextHandleAdapter = class {
5258
5232
  },
5259
5233
  (newValue) => {
5260
5234
  assertCurrentState();
5261
- _chunk2CE5UNWKcjs.assertJsonCompatValue.call(void 0, newValue);
5235
+ _chunkKWGN2ZBJcjs.assertJsonCompatValue.call(void 0, newValue);
5262
5236
  }
5263
5237
  );
5264
5238
  }
@@ -5270,7 +5244,7 @@ var ActorContextHandleAdapter = class {
5270
5244
  }
5271
5245
  this.#assertCanMutateState();
5272
5246
  const nextValue = unwrapWriteThroughProxy(value);
5273
- _chunk2CE5UNWKcjs.assertJsonCompatValue.call(void 0, nextValue);
5247
+ _chunkKWGN2ZBJcjs.assertJsonCompatValue.call(void 0, nextValue);
5274
5248
  this.#writeState(nextValue, { scheduleSave: true });
5275
5249
  }
5276
5250
  initializeState(value) {
@@ -5479,7 +5453,7 @@ var ActorContextHandleAdapter = class {
5479
5453
  log: {
5480
5454
  debug: (obj) => logger2().debug(obj)
5481
5455
  },
5482
- nativeDatabaseProvider: _chunkCVLNRT7Ocjs.registerNativeStateTransactionOpener.call(void 0,
5456
+ nativeDatabaseProvider: _chunkGHKQC4PDcjs.registerNativeStateTransactionOpener.call(void 0,
5483
5457
  {
5484
5458
  open: async (requestedActorId) => {
5485
5459
  void requestedActorId;
@@ -5502,7 +5476,7 @@ var ActorContextHandleAdapter = class {
5502
5476
  return this.#db;
5503
5477
  }
5504
5478
  #bindDatabaseClient(client) {
5505
- return _chunkCVLNRT7Ocjs.bindNativeStateTransactionContext.call(void 0, client, {
5479
+ return _chunkGHKQC4PDcjs.bindNativeStateTransactionContext.call(void 0, client, {
5506
5480
  enter: async () => await this.#enterStateTransaction(),
5507
5481
  exit: (scope) => this.#exitStateTransaction(
5508
5482
  scope
@@ -5706,7 +5680,7 @@ var ActorContextHandleAdapter = class {
5706
5680
  const trackedPromise = Promise.resolve(promise).catch((error) => {
5707
5681
  logger2().warn({
5708
5682
  msg: "keepAwake promise rejected",
5709
- error: _chunk2CE5UNWKcjs.stringifyError.call(void 0, error)
5683
+ error: _chunkKWGN2ZBJcjs.stringifyError.call(void 0, error)
5710
5684
  });
5711
5685
  }).then(() => null);
5712
5686
  try {
@@ -6179,7 +6153,7 @@ function validateInspectorTabSource(tabId, resolved) {
6179
6153
  function buildNativeFactory(runtime, registryConfig, definition) {
6180
6154
  var _a;
6181
6155
  const config = definition.config;
6182
- const databaseProvider = _nullishCoalesce(config.db, () => ( _chunkCVLNRT7Ocjs.db.call(void 0, )));
6156
+ const databaseProvider = _nullishCoalesce(config.db, () => ( _chunkGHKQC4PDcjs.db.call(void 0, )));
6183
6157
  const actionHandlers = _chunkNWCAIWHLcjs.flattenActionHandlers.call(void 0, config.actions);
6184
6158
  const schemaConfig = {
6185
6159
  actionInputSchemas: _chunkNWCAIWHLcjs.flattenActionInputSchemas.call(void 0,
@@ -6190,9 +6164,9 @@ function buildNativeFactory(runtime, registryConfig, definition) {
6190
6164
  events: config.events,
6191
6165
  queues: config.queues
6192
6166
  };
6193
- const createClient = (ctx) => _chunkA36FMKOVcjs.createClientWithDriver.call(void 0,
6194
- new (0, _chunkA36FMKOVcjs.RemoteEngineControlClient)(
6195
- _chunkA36FMKOVcjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
6167
+ const createClient = (ctx) => _chunkB5SNXPSScjs.createClientWithDriver.call(void 0,
6168
+ new (0, _chunkB5SNXPSScjs.RemoteEngineControlClient)(
6169
+ _chunkB5SNXPSScjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
6196
6170
  ),
6197
6171
  {
6198
6172
  encoding: "bare",
@@ -6361,7 +6335,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
6361
6335
  let body;
6362
6336
  try {
6363
6337
  body = await jsRequest.json();
6364
- } catch (e5) {
6338
+ } catch (e4) {
6365
6339
  return errorResponse(
6366
6340
  new (0, _chunkJX2ITWAVcjs.RivetError)(
6367
6341
  "actor",
@@ -6384,7 +6358,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
6384
6358
  400
6385
6359
  );
6386
6360
  }
6387
- const cbor = _chunk2CE5UNWKcjs.encodeCborCompat.call(void 0,
6361
+ const cbor = _chunkKWGN2ZBJcjs.encodeCborCompat.call(void 0,
6388
6362
  _nullishCoalesce(body.body, () => ( null))
6389
6363
  );
6390
6364
  const message = await runtime.actorQueueSend(ctx, name, cbor);
@@ -6981,7 +6955,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
6981
6955
  ...request,
6982
6956
  abortController: requestAbortController
6983
6957
  });
6984
- const rawConnParams = handlerRequest.headers.get(_chunkA36FMKOVcjs.HEADER_CONN_PARAMS);
6958
+ const rawConnParams = handlerRequest.headers.get(_chunkB5SNXPSScjs.HEADER_CONN_PARAMS);
6985
6959
  let requestCtx;
6986
6960
  let conn;
6987
6961
  let removeRequestAbortListener;
@@ -7038,7 +7012,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
7038
7012
  requestCtx,
7039
7013
  handlerRequest
7040
7014
  );
7041
- if (!_chunkA36FMKOVcjs.isResponseLike.call(void 0, response)) {
7015
+ if (!_chunkB5SNXPSScjs.isResponseLike.call(void 0, response)) {
7042
7016
  throw new Error(
7043
7017
  "onRequest handler must return a Response"
7044
7018
  );
@@ -7133,7 +7107,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
7133
7107
  var _a2;
7134
7108
  const { ctx } = unwrapTsfnPayload(error, payload);
7135
7109
  const history = (_a2 = getNativeWorkflowInspector(ctx)) == null ? void 0 : _a2.getHistory();
7136
- return history == null ? void 0 : _chunk2CE5UNWKcjs.toUint8Array.call(void 0, history);
7110
+ return history == null ? void 0 : _chunkKWGN2ZBJcjs.toUint8Array.call(void 0, history);
7137
7111
  }
7138
7112
  ) : void 0,
7139
7113
  replayWorkflow: _chunkNWCAIWHLcjs.hasRunInspectorConfig.call(void 0, config.run) ? wrapNativeCallback(
@@ -7147,7 +7121,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
7147
7121
  return void 0;
7148
7122
  }
7149
7123
  const history = await _asyncNullishCoalesce(await workflowInspector.replayFromStep(entryId), async () => ( null));
7150
- return history == null ? void 0 : _chunk2CE5UNWKcjs.toUint8Array.call(void 0, history);
7124
+ return history == null ? void 0 : _chunkKWGN2ZBJcjs.toUint8Array.call(void 0, history);
7151
7125
  }
7152
7126
  ) : void 0,
7153
7127
  actions: Object.fromEntries(
@@ -7283,7 +7257,7 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
7283
7257
  startServices: resolveServicesBinary && config.startServices,
7284
7258
  handleInspectorHttpInRuntime: true,
7285
7259
  serverlessBasePath: config.serverless.basePath,
7286
- serverlessPackageVersion: _chunk2CE5UNWKcjs.VERSION,
7260
+ serverlessPackageVersion: _chunkKWGN2ZBJcjs.VERSION,
7287
7261
  serverlessClientEndpoint: config.publicEndpoint,
7288
7262
  serverlessClientNamespace: config.publicNamespace,
7289
7263
  serverlessClientToken: config.publicToken,
@@ -7296,7 +7270,7 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
7296
7270
  } catch (error) {
7297
7271
  logger2().warn({
7298
7272
  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",
7299
- error: _chunk2CE5UNWKcjs.stringifyError.call(void 0, error)
7273
+ error: _chunkKWGN2ZBJcjs.stringifyError.call(void 0, error)
7300
7274
  });
7301
7275
  }
7302
7276
  if (resolveServicesBinary && config.startServices) {
@@ -7306,20 +7280,20 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
7306
7280
  } catch (error) {
7307
7281
  logger2().warn({
7308
7282
  msg: "could not resolve the Services binary; a local engine will fail with services.binary_unavailable \u2014 set RIVET_RUN_SERVICES=0 to disable Services or RIVET_SERVICES_BINARY to a local rivet-services binary",
7309
- error: _chunk2CE5UNWKcjs.stringifyError.call(void 0, error)
7283
+ error: _chunkKWGN2ZBJcjs.stringifyError.call(void 0, error)
7310
7284
  });
7311
7285
  }
7312
7286
  }
7313
7287
  serveConfig.engineHost = config.engineHost;
7314
7288
  serveConfig.enginePort = config.enginePort;
7315
7289
  if ((_a = config.test) == null ? void 0 : _a.enabled) {
7316
- serveConfig.inspectorTestToken = _nullishCoalesce(_chunk2CE5UNWKcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
7290
+ serveConfig.inspectorTestToken = _nullishCoalesce(_chunkKWGN2ZBJcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
7317
7291
  }
7318
7292
  return serveConfig;
7319
7293
  }
7320
7294
  async function buildRegistryWithRuntime(config, runtime) {
7321
7295
  var _a;
7322
- if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunk2CE5UNWKcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
7296
+ if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunkKWGN2ZBJcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
7323
7297
  trySetProcessEnv("_RIVET_TEST_INSPECTOR_TOKEN", "token");
7324
7298
  }
7325
7299
  if (runtime.kind === "napi") {
@@ -7386,7 +7360,7 @@ function createApplicationFetch(application, runtime) {
7386
7360
  signal: abortController.signal
7387
7361
  })
7388
7362
  );
7389
- if (!_chunkA36FMKOVcjs.isResponseLike.call(void 0, response)) {
7363
+ if (!_chunkB5SNXPSScjs.isResponseLike.call(void 0, response)) {
7390
7364
  throw new TypeError(
7391
7365
  "registry.listen() application fetch must return a Response"
7392
7366
  );
@@ -7436,7 +7410,7 @@ var Registry = class {
7436
7410
  var _a;
7437
7411
  this.#config = config;
7438
7412
  if ((_a = config.logging) == null ? void 0 : _a.baseLogger) {
7439
- _chunk2CE5UNWKcjs.configureBaseLogger.call(void 0, config.logging.baseLogger);
7413
+ _chunkKWGN2ZBJcjs.configureBaseLogger.call(void 0, config.logging.baseLogger);
7440
7414
  }
7441
7415
  this.#buildConfiguredRegistry = _nullishCoalesce((deps == null ? void 0 : deps.buildConfiguredRegistry), () => ( buildConfiguredRegistry));
7442
7416
  this.routes = {
@@ -7662,10 +7636,10 @@ var Registry = class {
7662
7636
  * ```
7663
7637
  */
7664
7638
  async listen(opts = {}) {
7665
- const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => ( _chunk2CE5UNWKcjs.parsePortEnv.call(void 0, process.env.RIVET_PORT))), () => ( 3e3));
7666
- const publicDir = _nullishCoalesce(opts.publicDir, () => ( _chunk2CE5UNWKcjs.getRivetkitPublicDir.call(void 0, )));
7639
+ const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => ( _chunkKWGN2ZBJcjs.parsePortEnv.call(void 0, process.env.RIVET_PORT))), () => ( 3e3));
7640
+ const publicDir = _nullishCoalesce(opts.publicDir, () => ( _chunkKWGN2ZBJcjs.getRivetkitPublicDir.call(void 0, )));
7667
7641
  const config = this.parseConfig();
7668
- if (opts.application && _chunk2CE5UNWKcjs.getRivetkitRuntimeMode.call(void 0, ) !== "serverless") {
7642
+ if (opts.application && _chunkKWGN2ZBJcjs.getRivetkitRuntimeMode.call(void 0, ) !== "serverless") {
7669
7643
  if (config.runtime === "wasm") {
7670
7644
  throw new Error(
7671
7645
  "registry.listen() requires the native runtime; use an application-owned HTTP server with WebAssembly"
@@ -7741,7 +7715,7 @@ var Registry = class {
7741
7715
  return jsonRouteResponse(503, {
7742
7716
  status: "not_started",
7743
7717
  runtime: "rivetkit",
7744
- version: _chunk2CE5UNWKcjs.VERSION
7718
+ version: _chunkKWGN2ZBJcjs.VERSION
7745
7719
  });
7746
7720
  }
7747
7721
  const { runtime, registry } = configured;
@@ -7749,7 +7723,7 @@ var Registry = class {
7749
7723
  return jsonRouteResponse(501, {
7750
7724
  status: "unsupported",
7751
7725
  runtime: "rivetkit",
7752
- version: _chunk2CE5UNWKcjs.VERSION
7726
+ version: _chunkKWGN2ZBJcjs.VERSION
7753
7727
  });
7754
7728
  }
7755
7729
  const response = await runtime.registryHealth(registry);
@@ -7820,7 +7794,23 @@ var Registry = class {
7820
7794
  * Starts an actor envoy for standalone server deployments.
7821
7795
  */
7822
7796
  #startEnvoy(config, printWelcome) {
7797
+ var _a;
7823
7798
  if (!this.#runtimeServePromise) {
7799
+ const configuredEnvoyVersion = (_a = this.#config.envoy) == null ? void 0 : _a.version;
7800
+ const envoyVersionSource = configuredEnvoyVersion !== void 0 ? "config" : _chunkKWGN2ZBJcjs.getRivetEnvoyVersion.call(void 0, ) !== void 0 ? "environment" : "default";
7801
+ logger2().info({
7802
+ msg: "starting rivetkit envoy",
7803
+ rivetkitVersion: _chunkKWGN2ZBJcjs.VERSION,
7804
+ envoyVersion: config.envoy.version,
7805
+ envoyVersionSource
7806
+ });
7807
+ if (envoyVersionSource === "default" && _chunkKWGN2ZBJcjs.getNodeEnv.call(void 0, ) === "production") {
7808
+ logger2().error({
7809
+ msg: "envoy version defaulted because neither config.envoy.version nor RIVET_ENVOY_VERSION is set; actors will not drain automatically across deploys. See https://rivet.dev/docs/actors/versions",
7810
+ envoyVersion: config.envoy.version,
7811
+ envoyVersionSource
7812
+ });
7813
+ }
7824
7814
  const configuredRegistryPromise = this.#buildConfiguredRegistry(config);
7825
7815
  this.#runtimeServeConfiguredPromise = configuredRegistryPromise;
7826
7816
  this.#runtimeServeLifecyclePromise = configuredRegistryPromise.then(
@@ -8005,7 +7995,7 @@ var Registry = class {
8005
7995
  );
8006
7996
  }
8007
7997
  if (this.#runtimeReadyPromise) return this.#runtimeReadyPromise;
8008
- if (_chunk2CE5UNWKcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
7998
+ if (_chunkKWGN2ZBJcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
8009
7999
  return Promise.reject(
8010
8000
  new Error(
8011
8001
  "registry.startAndWait() requires envoy runtime mode; serverless registries become ready per request"
@@ -8075,8 +8065,8 @@ var Registry = class {
8075
8065
  * ```
8076
8066
  */
8077
8067
  start() {
8078
- if (_chunk2CE5UNWKcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
8079
- const publicDir = _nullishCoalesce(_chunk2CE5UNWKcjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
8068
+ if (_chunkKWGN2ZBJcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
8069
+ const publicDir = _nullishCoalesce(_chunkKWGN2ZBJcjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
8080
8070
  this.listen({ publicDir }).catch((error) => {
8081
8071
  logger2().error({ error }, "auto-listen failed; exiting");
8082
8072
  if (typeof process !== "undefined" && typeof process.exit === "function") {
@@ -8097,13 +8087,13 @@ var Registry = class {
8097
8087
  };
8098
8088
  console.log();
8099
8089
  console.log(
8100
- ` RivetKit ${_chunk2CE5UNWKcjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
8090
+ ` RivetKit ${_chunkKWGN2ZBJcjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
8101
8091
  );
8102
8092
  if (config.namespace !== "default") {
8103
8093
  logLine("Namespace", config.namespace);
8104
8094
  }
8105
8095
  if (config.endpoint) {
8106
- const endpointType = config.startEngine || isLocalEngineEndpoint(config.endpoint) ? "local native" : "remote";
8096
+ const endpointType = config.startEngine || _chunkB5SNXPSScjs.isLocalEngineEndpoint.call(void 0, config.endpoint) ? "local native" : "remote";
8107
8097
  logLine("Endpoint", `${config.endpoint} (${endpointType})`);
8108
8098
  }
8109
8099
  if (kind === "serverless" && config.publicEndpoint) {
@@ -8173,5 +8163,5 @@ function setup(input) {
8173
8163
 
8174
8164
 
8175
8165
 
8176
- exports.ALLOWED_PUBLIC_HEADERS = _chunkA36FMKOVcjs.ALLOWED_PUBLIC_HEADERS; exports.ActorDefinition = ActorDefinition; exports.ActorError = _chunkJX2ITWAVcjs.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 = _chunkJX2ITWAVcjs.RivetError; exports.RuntimeKindSchema = RuntimeKindSchema; exports.SqliteBackendSchema = SqliteBackendSchema; exports.SqliteConfigSchema = SqliteConfigSchema; exports.TestConfigSchema = TestConfigSchema; exports.UserError = _chunkJX2ITWAVcjs.UserError; exports.WasmRuntimeConfigSchema = WasmRuntimeConfigSchema; exports.actor = actor; exports.buildActorNames = buildActorNames; exports.createClientWithDriver = _chunkA36FMKOVcjs.createClientWithDriver; exports.defineRunHandler = _chunkNWCAIWHLcjs.defineRunHandler; exports.event = event; exports.isStaticActorDefinition = isStaticActorDefinition; exports.isStaticActorInstance = isStaticActorInstance; exports.lookupInRegistry = lookupInRegistry; exports.noopNext = _chunk2CE5UNWKcjs.noopNext; exports.queue = queue; exports.setup = setup; exports.toUint8Array = _chunk2CE5UNWKcjs.toUint8Array;
8166
+ exports.ALLOWED_PUBLIC_HEADERS = _chunkB5SNXPSScjs.ALLOWED_PUBLIC_HEADERS; exports.ActorDefinition = ActorDefinition; exports.ActorError = _chunkJX2ITWAVcjs.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 = _chunkJX2ITWAVcjs.RivetError; exports.RuntimeKindSchema = RuntimeKindSchema; exports.SqliteBackendSchema = SqliteBackendSchema; exports.SqliteConfigSchema = SqliteConfigSchema; exports.TestConfigSchema = TestConfigSchema; exports.UserError = _chunkJX2ITWAVcjs.UserError; exports.WasmRuntimeConfigSchema = WasmRuntimeConfigSchema; exports.actor = actor; exports.buildActorNames = buildActorNames; exports.createClientWithDriver = _chunkB5SNXPSScjs.createClientWithDriver; exports.defineRunHandler = _chunkNWCAIWHLcjs.defineRunHandler; exports.event = event; exports.isStaticActorDefinition = isStaticActorDefinition; exports.isStaticActorInstance = isStaticActorInstance; exports.lookupInRegistry = lookupInRegistry; exports.noopNext = _chunkKWGN2ZBJcjs.noopNext; exports.queue = queue; exports.setup = setup; exports.toUint8Array = _chunkKWGN2ZBJcjs.toUint8Array;
8177
8167
  //# sourceMappingURL=mod.cjs.map