rivetkit 2.3.19 → 2.3.20

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 (101) hide show
  1. package/dist/browser/client.d.ts +39 -0
  2. package/dist/browser/client.js +1 -1
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.js +1 -1
  5. package/dist/browser/inspector/client.js.map +1 -1
  6. package/dist/tsup/agent-os/index.cjs +34 -1
  7. package/dist/tsup/agent-os/index.cjs.map +1 -1
  8. package/dist/tsup/agent-os/index.d.cts +39 -0
  9. package/dist/tsup/agent-os/index.d.ts +39 -0
  10. package/dist/tsup/agent-os/index.js +34 -1
  11. package/dist/tsup/agent-os/index.js.map +1 -1
  12. package/dist/tsup/{chunk-RJC5O2SD.cjs → chunk-2CE5UNWK.cjs} +2 -2
  13. package/dist/tsup/{chunk-RJC5O2SD.cjs.map → chunk-2CE5UNWK.cjs.map} +1 -1
  14. package/dist/tsup/{chunk-7HTST3NX.js → chunk-2NXLTFWI.js} +3 -3
  15. package/dist/tsup/{chunk-OGPFN6BT.cjs → chunk-3WS7Z64U.cjs} +3 -3
  16. package/dist/tsup/{chunk-OGPFN6BT.cjs.map → chunk-3WS7Z64U.cjs.map} +1 -1
  17. package/dist/tsup/{chunk-X7RMJQGY.js → chunk-553CIQJY.js} +2 -2
  18. package/dist/tsup/{chunk-BKX7UDTA.js → chunk-5G2J26VM.js} +3 -3
  19. package/dist/tsup/{chunk-PPEIPCW4.cjs → chunk-76YTS32R.cjs} +4 -4
  20. package/dist/tsup/{chunk-PPEIPCW4.cjs.map → chunk-76YTS32R.cjs.map} +1 -1
  21. package/dist/tsup/{chunk-IJUXBWH4.cjs → chunk-A36FMKOV.cjs} +138 -138
  22. package/dist/tsup/{chunk-IJUXBWH4.cjs.map → chunk-A36FMKOV.cjs.map} +1 -1
  23. package/dist/tsup/{chunk-EB77NZL4.js → chunk-CSOHAAZK.js} +33 -1
  24. package/dist/tsup/chunk-CSOHAAZK.js.map +1 -0
  25. package/dist/tsup/{chunk-Z4RAXFSD.cjs → chunk-CVLNRT7O.cjs} +3 -3
  26. package/dist/tsup/{chunk-Z4RAXFSD.cjs.map → chunk-CVLNRT7O.cjs.map} +1 -1
  27. package/dist/tsup/{chunk-DN6MD3KK.js → chunk-DHWZTUKA.js} +2 -2
  28. package/dist/tsup/{chunk-DN6MD3KK.js.map → chunk-DHWZTUKA.js.map} +1 -1
  29. package/dist/tsup/{chunk-464WE4RF.js → chunk-DMQUERRN.js} +2 -2
  30. package/dist/tsup/{chunk-G4U5L6AX.cjs → chunk-IHKDFKM4.cjs} +3 -3
  31. package/dist/tsup/{chunk-G4U5L6AX.cjs.map → chunk-IHKDFKM4.cjs.map} +1 -1
  32. package/dist/tsup/{chunk-EO5UOXXY.cjs → chunk-NWCAIWHL.cjs} +34 -2
  33. package/dist/tsup/chunk-NWCAIWHL.cjs.map +1 -0
  34. package/dist/tsup/{chunk-7A5EIXJJ.cjs → chunk-RSIOGT2U.cjs} +7 -7
  35. package/dist/tsup/{chunk-7A5EIXJJ.cjs.map → chunk-RSIOGT2U.cjs.map} +1 -1
  36. package/dist/tsup/{chunk-4SC2NSAV.js → chunk-SNNVRHLX.js} +2 -2
  37. package/dist/tsup/{chunk-DK3L22R6.js → chunk-TZVAVPGJ.js} +4 -4
  38. package/dist/tsup/{chunk-WME6KOXW.js → chunk-W2PXGWMR.js} +2 -2
  39. package/dist/tsup/{chunk-7BRRGBRY.cjs → chunk-WAISW7KR.cjs} +10 -10
  40. package/dist/tsup/{chunk-7BRRGBRY.cjs.map → chunk-WAISW7KR.cjs.map} +1 -1
  41. package/dist/tsup/client/mod.cjs +5 -5
  42. package/dist/tsup/client/mod.d.cts +2 -2
  43. package/dist/tsup/client/mod.d.ts +2 -2
  44. package/dist/tsup/client/mod.js +4 -4
  45. package/dist/tsup/common/log.cjs +2 -2
  46. package/dist/tsup/common/log.js +1 -1
  47. package/dist/tsup/common/websocket.cjs +3 -3
  48. package/dist/tsup/common/websocket.js +2 -2
  49. package/dist/tsup/{config-DEm0yIVV.d.ts → config-Be-VOHaX.d.ts} +42 -2
  50. package/dist/tsup/{config-8n2AOhXK.d.cts → config-Ct5uXxXk.d.cts} +42 -2
  51. package/dist/tsup/{context-DGg2-IOm.d.ts → context-CXLa0BIM.d.ts} +1 -1
  52. package/dist/tsup/{context-DwjOVvlE.d.cts → context-Cw-11Q-B.d.cts} +1 -1
  53. package/dist/tsup/db/drizzle.cjs +2 -2
  54. package/dist/tsup/db/drizzle.js +1 -1
  55. package/dist/tsup/db/mod.cjs +3 -3
  56. package/dist/tsup/db/mod.js +2 -2
  57. package/dist/tsup/dynamic/mod.cjs +2 -2
  58. package/dist/tsup/dynamic/mod.d.cts +1 -1
  59. package/dist/tsup/dynamic/mod.d.ts +1 -1
  60. package/dist/tsup/dynamic/mod.js +1 -1
  61. package/dist/tsup/inspector/mod.cjs +5 -5
  62. package/dist/tsup/inspector/mod.js +4 -4
  63. package/dist/tsup/inspector/workflow.cjs +4 -4
  64. package/dist/tsup/inspector/workflow.js +3 -3
  65. package/dist/tsup/inspector-tab/mod.cjs +2 -2
  66. package/dist/tsup/inspector-tab/mod.d.cts +2 -2
  67. package/dist/tsup/inspector-tab/mod.d.ts +2 -2
  68. package/dist/tsup/inspector-tab/mod.js +1 -1
  69. package/dist/tsup/mod.cjs +115 -101
  70. package/dist/tsup/mod.cjs.map +1 -1
  71. package/dist/tsup/mod.d.cts +3 -3
  72. package/dist/tsup/mod.d.ts +3 -3
  73. package/dist/tsup/mod.js +20 -6
  74. package/dist/tsup/mod.js.map +1 -1
  75. package/dist/tsup/test/mod.cjs +6 -6
  76. package/dist/tsup/test/mod.d.cts +1 -1
  77. package/dist/tsup/test/mod.d.ts +1 -1
  78. package/dist/tsup/test/mod.js +4 -4
  79. package/dist/tsup/utils.cjs +2 -2
  80. package/dist/tsup/utils.js +1 -1
  81. package/dist/tsup/workflow/mod.cjs +10 -10
  82. package/dist/tsup/workflow/mod.d.cts +3 -3
  83. package/dist/tsup/workflow/mod.d.ts +3 -3
  84. package/dist/tsup/workflow/mod.js +5 -5
  85. package/package.json +8 -8
  86. package/src/actor/actions.ts +36 -0
  87. package/src/actor/config.ts +27 -0
  88. package/src/actor/definition.ts +6 -1
  89. package/src/actor/mod.ts +5 -0
  90. package/src/actor/tracing.ts +28 -0
  91. package/src/registry/native.ts +18 -0
  92. package/src/registry/runtime.ts +8 -0
  93. package/dist/tsup/chunk-EB77NZL4.js.map +0 -1
  94. package/dist/tsup/chunk-EO5UOXXY.cjs.map +0 -1
  95. /package/dist/tsup/{chunk-7HTST3NX.js.map → chunk-2NXLTFWI.js.map} +0 -0
  96. /package/dist/tsup/{chunk-X7RMJQGY.js.map → chunk-553CIQJY.js.map} +0 -0
  97. /package/dist/tsup/{chunk-BKX7UDTA.js.map → chunk-5G2J26VM.js.map} +0 -0
  98. /package/dist/tsup/{chunk-464WE4RF.js.map → chunk-DMQUERRN.js.map} +0 -0
  99. /package/dist/tsup/{chunk-4SC2NSAV.js.map → chunk-SNNVRHLX.js.map} +0 -0
  100. /package/dist/tsup/{chunk-DK3L22R6.js.map → chunk-TZVAVPGJ.js.map} +0 -0
  101. /package/dist/tsup/{chunk-WME6KOXW.js.map → chunk-W2PXGWMR.js.map} +0 -0
package/dist/tsup/mod.cjs CHANGED
@@ -13,11 +13,11 @@
13
13
 
14
14
 
15
15
 
16
- var _chunkEO5UOXXYcjs = require('./chunk-EO5UOXXY.cjs');
17
16
 
17
+ var _chunkNWCAIWHLcjs = require('./chunk-NWCAIWHL.cjs');
18
18
 
19
- var _chunkPPEIPCW4cjs = require('./chunk-PPEIPCW4.cjs');
20
19
 
20
+ var _chunk76YTS32Rcjs = require('./chunk-76YTS32R.cjs');
21
21
 
22
22
 
23
23
 
@@ -30,17 +30,18 @@ var _chunkPPEIPCW4cjs = require('./chunk-PPEIPCW4.cjs');
30
30
 
31
31
 
32
32
 
33
- var _chunkIJUXBWH4cjs = require('./chunk-IJUXBWH4.cjs');
33
+
34
+ var _chunkA36FMKOVcjs = require('./chunk-A36FMKOV.cjs');
34
35
 
35
36
 
36
37
 
37
38
  var _chunkMYWZCDMLcjs = require('./chunk-MYWZCDML.cjs');
38
- require('./chunk-OGPFN6BT.cjs');
39
+ require('./chunk-3WS7Z64U.cjs');
39
40
 
40
41
 
41
42
 
42
43
 
43
- var _chunkZ4RAXFSDcjs = require('./chunk-Z4RAXFSD.cjs');
44
+ var _chunkCVLNRT7Ocjs = require('./chunk-CVLNRT7O.cjs');
44
45
  require('./chunk-KVFIONKQ.cjs');
45
46
 
46
47
 
@@ -75,7 +76,7 @@ require('./chunk-KVFIONKQ.cjs');
75
76
 
76
77
 
77
78
 
78
- var _chunkRJC5O2SDcjs = require('./chunk-RJC5O2SD.cjs');
79
+ var _chunk2CE5UNWKcjs = require('./chunk-2CE5UNWK.cjs');
79
80
 
80
81
 
81
82
 
@@ -92,7 +93,7 @@ var _chunkJX2ITWAVcjs = require('./chunk-JX2ITWAV.cjs');
92
93
 
93
94
  // src/actor/log.ts
94
95
  function loggerWithoutContext() {
95
- return _chunkRJC5O2SDcjs.getLogger.call(void 0, "actor-runtime");
96
+ return _chunk2CE5UNWKcjs.getLogger.call(void 0, "actor-runtime");
96
97
  }
97
98
 
98
99
  // src/actor/definition.ts
@@ -128,12 +129,14 @@ function isStaticActorInstance(_actor) {
128
129
  return true;
129
130
  }
130
131
  function actor(input) {
132
+ var _a;
131
133
  warnDeprecatedOptionKeys(
132
134
  input == null ? void 0 : input.options
133
135
  );
134
- const config = _chunkEO5UOXXYcjs.ActorConfigSchema.parse(input);
135
- _chunkEO5UOXXYcjs.flattenActionHandlers.call(void 0, config.actions);
136
- _chunkEO5UOXXYcjs.flattenActionInputSchemas.call(void 0, config.actions, config.actionInputSchemas);
136
+ const config = _chunkNWCAIWHLcjs.ActorConfigSchema.parse(input);
137
+ _chunkNWCAIWHLcjs.flattenActionHandlers.call(void 0, config.actions);
138
+ _chunkNWCAIWHLcjs.flattenActionInputSchemas.call(void 0, config.actions, config.actionInputSchemas);
139
+ _chunkNWCAIWHLcjs.flattenActionTraceSamplers.call(void 0, config.actions, (_a = config.tracing) == null ? void 0 : _a.actions);
137
140
  return new ActorDefinition(config);
138
141
  }
139
142
  function isStaticActorDefinition(definition) {
@@ -232,7 +235,7 @@ function validateSchemaSync(schemas, key, data) {
232
235
  var _virtualwebsocket = require('@rivetkit/virtual-websocket');
233
236
  var _ws = require('hono/ws');
234
237
  function logger() {
235
- return _chunkRJC5O2SDcjs.getLogger.call(void 0, "inline-websocket-adapter");
238
+ return _chunk2CE5UNWKcjs.getLogger.call(void 0, "inline-websocket-adapter");
236
239
  }
237
240
  var InlineWebSocketAdapter = class {
238
241
  #handler;
@@ -403,7 +406,7 @@ function isLocalEngineEndpoint(endpoint) {
403
406
 
404
407
  // src/registry/log.ts
405
408
  function logger2() {
406
- return _chunkRJC5O2SDcjs.getLogger.call(void 0, "registry");
409
+ return _chunk2CE5UNWKcjs.getLogger.call(void 0, "registry");
407
410
  }
408
411
 
409
412
  // src/serverless/configure.ts
@@ -449,8 +452,8 @@ async function configureServerlessPool(config) {
449
452
  );
450
453
  }
451
454
  const customConfig = config.configurePool;
452
- const clientConfig = _chunkIJUXBWH4cjs.convertRegistryConfigToClientConfig.call(void 0, config);
453
- const dcsRes = await _chunkIJUXBWH4cjs.getDatacenters.call(void 0, clientConfig);
455
+ const clientConfig = _chunkA36FMKOVcjs.convertRegistryConfigToClientConfig.call(void 0, config);
456
+ const dcsRes = await _chunkA36FMKOVcjs.getDatacenters.call(void 0, clientConfig);
454
457
  const poolName = _nullishCoalesce(customConfig.name, () => ( "default"));
455
458
  const serverlessToken = _nullishCoalesce(config.token, () => ( config.publicToken));
456
459
  const headers = {
@@ -472,7 +475,7 @@ async function configureServerlessPool(config) {
472
475
  metadata: _nullishCoalesce(customConfig.metadata, () => ( {})),
473
476
  drain_on_version_upgrade: _nullishCoalesce(customConfig.drainOnVersionUpgrade, () => ( true))
474
477
  };
475
- await _chunkIJUXBWH4cjs.updateRunnerConfig.call(void 0, clientConfig, poolName, {
478
+ await _chunkA36FMKOVcjs.updateRunnerConfig.call(void 0, clientConfig, poolName, {
476
479
  datacenters: Object.fromEntries(
477
480
  dcsRes.datacenters.map((dc) => [dc.name, serverlessConfig])
478
481
  )
@@ -489,7 +492,7 @@ async function configureServerlessPool(config) {
489
492
  logger2().warn({
490
493
  msg: "serverless pool configuration attempt failed",
491
494
  attempts,
492
- error: _chunkRJC5O2SDcjs.stringifyError.call(void 0, error)
495
+ error: _chunk2CE5UNWKcjs.stringifyError.call(void 0, error)
493
496
  });
494
497
  await sleep(CONFIGURE_RETRY_DELAY_MS);
495
498
  }
@@ -497,7 +500,7 @@ async function configureServerlessPool(config) {
497
500
  logger2().error({
498
501
  msg: "failed to configure serverless pool, validate endpoint is configured correctly then restart this process",
499
502
  attempts,
500
- error: _chunkRJC5O2SDcjs.stringifyError.call(void 0, lastError)
503
+ error: _chunk2CE5UNWKcjs.stringifyError.call(void 0, lastError)
501
504
  });
502
505
  throw lastError;
503
506
  }
@@ -509,20 +512,20 @@ var _zod = require('zod');
509
512
  var _v4 = require('zod/v4');
510
513
  var warnedMissingVersion = false;
511
514
  var EnvoyConfigSchema = _v4.z.object({
512
- poolName: _v4.z.string().default(() => _nullishCoalesce(_chunkRJC5O2SDcjs.getRivetPool.call(void 0, ), () => ( "default"))),
515
+ poolName: _v4.z.string().default(() => _nullishCoalesce(_chunk2CE5UNWKcjs.getRivetPool.call(void 0, ), () => ( "default"))),
513
516
  version: _v4.z.number().default(() => {
514
- const version = _chunkRJC5O2SDcjs.getRivetEnvoyVersion.call(void 0, );
517
+ const version = _chunk2CE5UNWKcjs.getRivetEnvoyVersion.call(void 0, );
515
518
  if (version !== void 0) return version;
516
- if (_chunkRJC5O2SDcjs.getNodeEnv.call(void 0, ) === "production" && !warnedMissingVersion) {
519
+ if (_chunk2CE5UNWKcjs.getNodeEnv.call(void 0, ) === "production" && !warnedMissingVersion) {
517
520
  warnedMissingVersion = true;
518
- _chunkRJC5O2SDcjs.getLogger.call(void 0, "rivetkit").error(
521
+ _chunk2CE5UNWKcjs.getLogger.call(void 0, "rivetkit").error(
519
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"
520
523
  );
521
524
  }
522
525
  return 1;
523
526
  }),
524
527
  // Deprecated.
525
- totalSlots: _v4.z.number().default(() => _nullishCoalesce(_chunkRJC5O2SDcjs.getRivetTotalSlots.call(void 0, ), () => ( 1e5))),
528
+ totalSlots: _v4.z.number().default(() => _nullishCoalesce(_chunk2CE5UNWKcjs.getRivetTotalSlots.call(void 0, ), () => ( 1e5))),
526
529
  envoyKey: _v4.z.string().optional()
527
530
  });
528
531
 
@@ -560,7 +563,7 @@ var ServerlessConfigSchema = _v4.z.object({
560
563
  *
561
564
  * Can also be set via RIVET_PUBLIC_ENDPOINT environment variable.
562
565
  */
563
- publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkRJC5O2SDcjs.getRivetPublicEndpoint.call(void 0, )))),
566
+ publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk2CE5UNWKcjs.getRivetPublicEndpoint.call(void 0, )))),
564
567
  /**
565
568
  * Token that clients should use when connecting via the public endpoint.
566
569
  *
@@ -568,7 +571,7 @@ var ServerlessConfigSchema = _v4.z.object({
568
571
  *
569
572
  * Can also be specified in the publicEndpoint URL as `https://namespace:token@host`.
570
573
  */
571
- publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkRJC5O2SDcjs.getRivetPublicToken.call(void 0, ))))
574
+ publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk2CE5UNWKcjs.getRivetPublicToken.call(void 0, ))))
572
575
  // There is no publicNamespace config option because the frontend and backend
573
576
  // cannot use different namespaces. The namespace is extracted from the
574
577
  // publicEndpoint URL auth syntax if provided.
@@ -622,7 +625,7 @@ var RegistryConfigSchema = _zod.z.object({
622
625
  * Runtime binding to use for RivetKit core.
623
626
  * */
624
627
  runtime: RuntimeKindSchema.optional().transform((val, ctx) => {
625
- const rawRuntime = _nullishCoalesce(val, () => ( _chunkRJC5O2SDcjs.getRivetkitRuntime.call(void 0, )));
628
+ const rawRuntime = _nullishCoalesce(val, () => ( _chunk2CE5UNWKcjs.getRivetkitRuntime.call(void 0, )));
626
629
  if (rawRuntime === void 0) {
627
630
  return "auto";
628
631
  }
@@ -659,7 +662,7 @@ var RegistryConfigSchema = _zod.z.object({
659
662
  * */
660
663
  logging: _zod.z.object({
661
664
  baseLogger: _zod.z.custom().optional(),
662
- level: _chunkRJC5O2SDcjs.LogLevelSchema.optional()
665
+ level: _chunk2CE5UNWKcjs.LogLevelSchema.optional()
663
666
  }).optional().default(() => ({})),
664
667
  // MARK: Routing
665
668
  // // This is a function to allow for lazy configuration of upgradeWebSocket on the
@@ -677,9 +680,9 @@ var RegistryConfigSchema = _zod.z.object({
677
680
  *
678
681
  * Can also be set via RIVET_ENDPOINT environment variables.
679
682
  */
680
- endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => ( _chunkRJC5O2SDcjs.getRivetEngine.call(void 0, ))), () => ( _chunkRJC5O2SDcjs.getRivetEndpoint.call(void 0, )))),
681
- token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkRJC5O2SDcjs.getRivetToken.call(void 0, )))),
682
- namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkRJC5O2SDcjs.getRivetNamespace.call(void 0, )))),
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, )))),
683
686
  headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional().default({}),
684
687
  // MARK: Client
685
688
  // TODO:
@@ -719,21 +722,21 @@ var RegistryConfigSchema = _zod.z.object({
719
722
  *
720
723
  * Starts the full Rust engine process locally.
721
724
  */
722
- startEngine: _zod.z.boolean().default(() => _chunkRJC5O2SDcjs.getRivetRunEngine.call(void 0, )),
725
+ startEngine: _zod.z.boolean().default(() => _chunk2CE5UNWKcjs.getRivetRunEngine.call(void 0, )),
723
726
  /**
724
727
  * @experimental
725
728
  *
726
729
  * Host to bind the spawned local engine process to.
727
730
  */
728
- engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkRJC5O2SDcjs.getRivetRunEngineHost.call(void 0, ), () => ( ENGINE_HOST))),
731
+ engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(_chunk2CE5UNWKcjs.getRivetRunEngineHost.call(void 0, ), () => ( ENGINE_HOST))),
729
732
  /**
730
733
  * @experimental
731
734
  *
732
735
  * Port to bind the spawned local engine process to.
733
736
  */
734
- enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(_chunkRJC5O2SDcjs.getRivetRunEnginePort.call(void 0, ), () => ( ENGINE_PORT))),
737
+ enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(_chunk2CE5UNWKcjs.getRivetRunEnginePort.call(void 0, ), () => ( ENGINE_PORT))),
735
738
  /** @experimental */
736
- engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkRJC5O2SDcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunkRJC5O2SDcjs.VERSION))),
739
+ engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunk2CE5UNWKcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunk2CE5UNWKcjs.VERSION))),
737
740
  /**
738
741
  * Starts the first-party Services actor host when RivetKit manages
739
742
  * a local engine. Defaults to the local-engine decision. Set
@@ -787,7 +790,7 @@ var RegistryConfigSchema = _zod.z.object({
787
790
  }))
788
791
  }).transform((config, ctx) => {
789
792
  var _a, _b, _c;
790
- const isDevEnv = _chunkRJC5O2SDcjs.isDev.call(void 0, );
793
+ const isDevEnv = _chunk2CE5UNWKcjs.isDev.call(void 0, );
791
794
  const sqliteBackend = _nullishCoalesce(((_a = config.sqlite) == null ? void 0 : _a.backend), () => ( ((_b = config.test) == null ? void 0 : _b.sqliteBackend)));
792
795
  if (config.runtime === "wasm" && sqliteBackend === "local") {
793
796
  ctx.addIssue({
@@ -797,7 +800,7 @@ var RegistryConfigSchema = _zod.z.object({
797
800
  });
798
801
  }
799
802
  const sqlite = config.runtime === "wasm" && config.sqlite === void 0 ? { backend: "remote" } : config.sqlite;
800
- const parsedEndpoint = config.endpoint ? _chunkIJUXBWH4cjs.tryParseEndpoint.call(void 0, ctx, {
803
+ const parsedEndpoint = config.endpoint ? _chunkA36FMKOVcjs.tryParseEndpoint.call(void 0, ctx, {
801
804
  endpoint: config.endpoint,
802
805
  path: ["endpoint"],
803
806
  namespace: config.namespace,
@@ -820,13 +823,13 @@ var RegistryConfigSchema = _zod.z.object({
820
823
  config.enginePort
821
824
  );
822
825
  const endpoint = config.startEngine ? localEngineEndpoint : _nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.endpoint), () => ( (isDevEnv ? localEngineEndpoint : void 0)));
823
- const startServices = _nullishCoalesce(_nullishCoalesce(config.startServices, () => ( _chunkRJC5O2SDcjs.getRivetRunServices.call(void 0, ))), () => ( Boolean(endpoint && isLocalEngineEndpoint(endpoint))));
826
+ const startServices = _nullishCoalesce(_nullishCoalesce(config.startServices, () => ( _chunk2CE5UNWKcjs.getRivetRunServices.call(void 0, ))), () => ( Boolean(endpoint && isLocalEngineEndpoint(endpoint))));
824
827
  const validateServerlessEndpoint = Boolean(
825
828
  config.startEngine || parsedEndpoint
826
829
  );
827
830
  const namespace = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.namespace), () => ( config.namespace)), () => ( "default"));
828
831
  const token = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token)), () => ( "dev"));
829
- const parsedPublicEndpoint = config.serverless.publicEndpoint ? _chunkIJUXBWH4cjs.tryParseEndpoint.call(void 0, ctx, {
832
+ const parsedPublicEndpoint = config.serverless.publicEndpoint ? _chunkA36FMKOVcjs.tryParseEndpoint.call(void 0, ctx, {
830
833
  endpoint: config.serverless.publicEndpoint,
831
834
  path: ["serverless", "publicEndpoint"]
832
835
  }) : void 0;
@@ -862,7 +865,7 @@ function buildActorNames(config) {
862
865
  Object.keys(config.use).map((actorName) => {
863
866
  const definition = config.use[actorName];
864
867
  const options = _nullishCoalesce(definition.config.options, () => ( {}));
865
- const runMeta = _chunkEO5UOXXYcjs.getRunMetadata.call(void 0, definition.config.run);
868
+ const runMeta = _chunkNWCAIWHLcjs.getRunMetadata.call(void 0, definition.config.run);
866
869
  const metadata = {};
867
870
  metadata.icon = _nullishCoalesce(options.icon, () => ( runMeta.icon));
868
871
  metadata.name = _nullishCoalesce(options.name, () => ( runMeta.name));
@@ -930,7 +933,7 @@ var DocRegistryConfigSchema = _zod.z.object({
930
933
  noWelcome: _zod.z.boolean().optional().describe("Disable the welcome message on startup. Default: false"),
931
934
  sqlite: DocSqliteConfigSchema,
932
935
  logging: _zod.z.object({
933
- level: _chunkRJC5O2SDcjs.LogLevelSchema.optional().describe(
936
+ level: _chunk2CE5UNWKcjs.LogLevelSchema.optional().describe(
934
937
  "Log level for RivetKit. Default: 'warn'"
935
938
  )
936
939
  }).optional().describe("Logging configuration."),
@@ -1560,7 +1563,7 @@ var NapiCoreRuntime = (_class = class {
1560
1563
  if (!(active == null ? void 0 : active.sameActorInstance(ownerCtx))) {
1561
1564
  return ownerCtx;
1562
1565
  }
1563
- const applicationSpan = _chunkIJUXBWH4cjs.readActiveTraceHeaders.call(void 0, );
1566
+ const applicationSpan = _chunkA36FMKOVcjs.readActiveTraceHeaders.call(void 0, );
1564
1567
  if (!applicationSpan) {
1565
1568
  return active;
1566
1569
  }
@@ -1763,7 +1766,7 @@ var NapiCoreRuntime = (_class = class {
1763
1766
  const span = (_a = nativeCtx.invocationTraceContext()) == null ? void 0 : _a.span;
1764
1767
  return this.#invocationContext.run(
1765
1768
  nativeCtx,
1766
- () => _chunkIJUXBWH4cjs.runWithActorInvocationSpan.call(void 0, span, run)
1769
+ () => _chunkA36FMKOVcjs.runWithActorInvocationSpan.call(void 0, span, run)
1767
1770
  );
1768
1771
  }
1769
1772
  actorInvocationTraceContext(ctx) {
@@ -2138,8 +2141,8 @@ function runtimeBytesToArrayBuffer(value) {
2138
2141
  function buildNativeHttpRequest(init) {
2139
2142
  var _a;
2140
2143
  const headers = new Headers(init.headers);
2141
- const originalUrl = headers.get(_chunkIJUXBWH4cjs.HEADER_ORIGINAL_REQUEST_URL);
2142
- headers.delete(_chunkIJUXBWH4cjs.HEADER_ORIGINAL_REQUEST_URL);
2144
+ const originalUrl = headers.get(_chunkA36FMKOVcjs.HEADER_ORIGINAL_REQUEST_URL);
2145
+ headers.delete(_chunkA36FMKOVcjs.HEADER_ORIGINAL_REQUEST_URL);
2143
2146
  const url = _nullishCoalesce(originalUrl, () => ( (init.uri.startsWith("http") ? init.uri : new URL(init.uri, "http://127.0.0.1").toString())));
2144
2147
  const method2 = init.method.toUpperCase();
2145
2148
  const bodyForbidden = method2 === "GET" || method2 === "HEAD";
@@ -2218,7 +2221,7 @@ async function pumpResponseBody(reader, stream) {
2218
2221
  }
2219
2222
  } catch (error) {
2220
2223
  try {
2221
- await stream.error(_chunkRJC5O2SDcjs.stringifyError.call(void 0, error));
2224
+ await stream.error(_chunk2CE5UNWKcjs.stringifyError.call(void 0, error));
2222
2225
  } catch (streamError) {
2223
2226
  logger2().debug({
2224
2227
  msg: "failed to report native http response stream error",
@@ -2386,7 +2389,7 @@ var RunHandlerCoordinator = class {
2386
2389
  this.#run = run;
2387
2390
  }
2388
2391
  get inspectorKind() {
2389
- return _chunkEO5UOXXYcjs.getRunInspectorKind.call(void 0, this.#run);
2392
+ return _chunkNWCAIWHLcjs.getRunInspectorKind.call(void 0, this.#run);
2390
2393
  }
2391
2394
  async run(actorId, restart, callback) {
2392
2395
  const state = this.#getOrCreate(actorId);
@@ -2494,7 +2497,7 @@ var RunHandlerCoordinator = class {
2494
2497
  }
2495
2498
  #initializeInspector(actorId, state) {
2496
2499
  if (state.inspectorInitialized) return;
2497
- const inspector = _chunkEO5UOXXYcjs.createRunInspector.call(void 0, this.#run, {
2500
+ const inspector = _chunkNWCAIWHLcjs.createRunInspector.call(void 0, this.#run, {
2498
2501
  actorId,
2499
2502
  control: this.#control(actorId, state)
2500
2503
  });
@@ -3456,7 +3459,7 @@ async function loadAutoRuntime(config, loaders = defaultRuntimeLoaders) {
3456
3459
  nativeError = error;
3457
3460
  logger2().warn({
3458
3461
  msg: "native runtime failed to load; falling back to wasm",
3459
- error: _chunkRJC5O2SDcjs.stringifyError.call(void 0, error)
3462
+ error: _chunk2CE5UNWKcjs.stringifyError.call(void 0, error)
3460
3463
  });
3461
3464
  }
3462
3465
  try {
@@ -3465,7 +3468,7 @@ async function loadAutoRuntime(config, loaders = defaultRuntimeLoaders) {
3465
3468
  throw new (0, _chunkJX2ITWAVcjs.RivetError)(
3466
3469
  "config",
3467
3470
  "runtime_unavailable",
3468
- `RivetKit could not load a core runtime. Native runtime: ${_chunkRJC5O2SDcjs.stringifyError.call(void 0, nativeError)} Wasm runtime: ${_chunkRJC5O2SDcjs.stringifyError.call(void 0, wasmError)}`,
3471
+ `RivetKit could not load a core runtime. Native runtime: ${_chunk2CE5UNWKcjs.stringifyError.call(void 0, nativeError)} Wasm runtime: ${_chunk2CE5UNWKcjs.stringifyError.call(void 0, wasmError)}`,
3469
3472
  {
3470
3473
  public: true,
3471
3474
  statusCode: 500
@@ -3659,7 +3662,7 @@ async function cleanupNativeSleepRuntimeState(runtime, ctx, afterTrackedWorkDrai
3659
3662
  }).catch((error) => {
3660
3663
  logger2().warn({
3661
3664
  msg: "deferred native sleep cleanup failed",
3662
- error: _chunkRJC5O2SDcjs.stringifyError.call(void 0, error)
3665
+ error: _chunk2CE5UNWKcjs.stringifyError.call(void 0, error)
3663
3666
  });
3664
3667
  });
3665
3668
  return;
@@ -3822,10 +3825,10 @@ function decodeValue(value) {
3822
3825
  if (!value || value.length === 0) {
3823
3826
  return void 0;
3824
3827
  }
3825
- return _chunkRJC5O2SDcjs.decodeCborCompat.call(void 0, value);
3828
+ return _chunk2CE5UNWKcjs.decodeCborCompat.call(void 0, value);
3826
3829
  }
3827
3830
  function encodeValue(value) {
3828
- return _chunkRJC5O2SDcjs.encodeCborCompat.call(void 0, value);
3831
+ return _chunk2CE5UNWKcjs.encodeCborCompat.call(void 0, value);
3829
3832
  }
3830
3833
  function normalizeArgs(value) {
3831
3834
  return Array.isArray(value) ? value : value === void 0 || value === null ? [] : [value];
@@ -3861,7 +3864,7 @@ function isStructuredBridgeError(error) {
3861
3864
  return _chunkJX2ITWAVcjs.isRivetErrorLike.call(void 0, error) && "__type" in error && (error.__type === "RivetError" || error.__type === "ActorError");
3862
3865
  }
3863
3866
  function encodeNativeCallbackError(error) {
3864
- const structuredError = isStructuredBridgeError(error) ? error : _chunkRJC5O2SDcjs.deconstructError.call(void 0, error, true);
3867
+ const structuredError = isStructuredBridgeError(error) ? error : _chunk2CE5UNWKcjs.deconstructError.call(void 0, error, true);
3865
3868
  const bridgeError = new Error(_chunkJX2ITWAVcjs.encodeBridgeRivetError.call(void 0, structuredError), {
3866
3869
  cause: error instanceof Error ? error : void 0
3867
3870
  });
@@ -3912,7 +3915,7 @@ function decodeWorkflowCbor(data) {
3912
3915
  return null;
3913
3916
  }
3914
3917
  try {
3915
- return _chunkRJC5O2SDcjs.decodeCborCompat.call(void 0, new Uint8Array(data));
3918
+ return _chunk2CE5UNWKcjs.decodeCborCompat.call(void 0, new Uint8Array(data));
3916
3919
  } catch (e4) {
3917
3920
  return null;
3918
3921
  }
@@ -4025,7 +4028,7 @@ function serializeWorkflowHistoryForJson(data) {
4025
4028
  if (data === null) {
4026
4029
  return null;
4027
4030
  }
4028
- const history = _chunkPPEIPCW4cjs.decodeWorkflowHistoryTransport.call(void 0, data);
4031
+ const history = _chunk76YTS32Rcjs.decodeWorkflowHistoryTransport.call(void 0, data);
4029
4032
  return jsonSafe({
4030
4033
  nameRegistry: [...history.nameRegistry],
4031
4034
  entries: history.entries.map((entry) => ({
@@ -4124,7 +4127,7 @@ var NativeConnAdapter = class {
4124
4127
  this.#ctx = ctx;
4125
4128
  this.#queueHibernationRemoval = queueHibernationRemoval;
4126
4129
  this.#assertCanMutateState = assertCanMutateState;
4127
- this[_chunkEO5UOXXYcjs.CONN_STATE_MANAGER_SYMBOL] = {
4130
+ this[_chunkNWCAIWHLcjs.CONN_STATE_MANAGER_SYMBOL] = {
4128
4131
  stateEnabled: true,
4129
4132
  get state() {
4130
4133
  return thisConn.state;
@@ -4141,7 +4144,7 @@ var NativeConnAdapter = class {
4141
4144
  decodeValue(this.#runtime.connParams(this.#conn))
4142
4145
  );
4143
4146
  }
4144
- [_chunkEO5UOXXYcjs.RAW_STATE_SYMBOL]() {
4147
+ [_chunkNWCAIWHLcjs.RAW_STATE_SYMBOL]() {
4145
4148
  return this.#readState();
4146
4149
  }
4147
4150
  get state() {
@@ -4171,7 +4174,7 @@ var NativeConnAdapter = class {
4171
4174
  },
4172
4175
  (newValue) => {
4173
4176
  assertCurrentState();
4174
- _chunkRJC5O2SDcjs.assertJsonCompatValue.call(void 0, newValue);
4177
+ _chunk2CE5UNWKcjs.assertJsonCompatValue.call(void 0, newValue);
4175
4178
  }
4176
4179
  );
4177
4180
  }
@@ -4179,7 +4182,7 @@ var NativeConnAdapter = class {
4179
4182
  var _a;
4180
4183
  (_a = this.#assertCanMutateState) == null ? void 0 : _a.call(this);
4181
4184
  const nextValue = unwrapWriteThroughProxy(value);
4182
- _chunkRJC5O2SDcjs.assertJsonCompatValue.call(void 0, nextValue);
4185
+ _chunk2CE5UNWKcjs.assertJsonCompatValue.call(void 0, nextValue);
4183
4186
  this.#writeState(nextValue, { writeNative: true });
4184
4187
  }
4185
4188
  initializeState(value) {
@@ -5198,7 +5201,7 @@ var ActorContextHandleAdapter = class {
5198
5201
  this.#databaseProvider = databaseProvider;
5199
5202
  }
5200
5203
  this.#request = request;
5201
- this[_chunkEO5UOXXYcjs.ACTOR_CONTEXT_INTERNAL_SYMBOL] = new NativeWorkflowRuntimeAdapter(
5204
+ this[_chunkNWCAIWHLcjs.ACTOR_CONTEXT_INTERNAL_SYMBOL] = new NativeWorkflowRuntimeAdapter(
5202
5205
  this
5203
5206
  );
5204
5207
  }
@@ -5228,7 +5231,7 @@ var ActorContextHandleAdapter = class {
5228
5231
  }
5229
5232
  throw databaseClientNotReadyError();
5230
5233
  }
5231
- [_chunkEO5UOXXYcjs.RAW_STATE_SYMBOL]() {
5234
+ [_chunkNWCAIWHLcjs.RAW_STATE_SYMBOL]() {
5232
5235
  if (!this.#stateEnabled) {
5233
5236
  throw stateNotEnabledError();
5234
5237
  }
@@ -5255,7 +5258,7 @@ var ActorContextHandleAdapter = class {
5255
5258
  },
5256
5259
  (newValue) => {
5257
5260
  assertCurrentState();
5258
- _chunkRJC5O2SDcjs.assertJsonCompatValue.call(void 0, newValue);
5261
+ _chunk2CE5UNWKcjs.assertJsonCompatValue.call(void 0, newValue);
5259
5262
  }
5260
5263
  );
5261
5264
  }
@@ -5267,7 +5270,7 @@ var ActorContextHandleAdapter = class {
5267
5270
  }
5268
5271
  this.#assertCanMutateState();
5269
5272
  const nextValue = unwrapWriteThroughProxy(value);
5270
- _chunkRJC5O2SDcjs.assertJsonCompatValue.call(void 0, nextValue);
5273
+ _chunk2CE5UNWKcjs.assertJsonCompatValue.call(void 0, nextValue);
5271
5274
  this.#writeState(nextValue, { scheduleSave: true });
5272
5275
  }
5273
5276
  initializeState(value) {
@@ -5476,7 +5479,7 @@ var ActorContextHandleAdapter = class {
5476
5479
  log: {
5477
5480
  debug: (obj) => logger2().debug(obj)
5478
5481
  },
5479
- nativeDatabaseProvider: _chunkZ4RAXFSDcjs.registerNativeStateTransactionOpener.call(void 0,
5482
+ nativeDatabaseProvider: _chunkCVLNRT7Ocjs.registerNativeStateTransactionOpener.call(void 0,
5480
5483
  {
5481
5484
  open: async (requestedActorId) => {
5482
5485
  void requestedActorId;
@@ -5499,7 +5502,7 @@ var ActorContextHandleAdapter = class {
5499
5502
  return this.#db;
5500
5503
  }
5501
5504
  #bindDatabaseClient(client) {
5502
- return _chunkZ4RAXFSDcjs.bindNativeStateTransactionContext.call(void 0, client, {
5505
+ return _chunkCVLNRT7Ocjs.bindNativeStateTransactionContext.call(void 0, client, {
5503
5506
  enter: async () => await this.#enterStateTransaction(),
5504
5507
  exit: (scope) => this.#exitStateTransaction(
5505
5508
  scope
@@ -5703,7 +5706,7 @@ var ActorContextHandleAdapter = class {
5703
5706
  const trackedPromise = Promise.resolve(promise).catch((error) => {
5704
5707
  logger2().warn({
5705
5708
  msg: "keepAwake promise rejected",
5706
- error: _chunkRJC5O2SDcjs.stringifyError.call(void 0, error)
5709
+ error: _chunk2CE5UNWKcjs.stringifyError.call(void 0, error)
5707
5710
  });
5708
5711
  }).then(() => null);
5709
5712
  try {
@@ -6054,6 +6057,13 @@ function withConnContext(runtime, ctx, conn, clientFactory, schemas = {}, databa
6054
6057
  )
6055
6058
  });
6056
6059
  }
6060
+ function buildActorTracingConfig(actions, tracing) {
6061
+ if (tracing === void 0) return void 0;
6062
+ return {
6063
+ sampler: tracing.sampler,
6064
+ actions: _chunkNWCAIWHLcjs.flattenActionTraceSamplers.call(void 0, actions, tracing.actions)
6065
+ };
6066
+ }
6057
6067
  function buildActorConfig(definition, registryConfig, runtimeKind) {
6058
6068
  var _a;
6059
6069
  const config = definition.config;
@@ -6067,6 +6077,10 @@ function buildActorConfig(definition, registryConfig, runtimeKind) {
6067
6077
  hasDatabase: true,
6068
6078
  remoteSqlite: usesRemoteSqlite,
6069
6079
  sqliteProfiling,
6080
+ tracing: buildActorTracingConfig(
6081
+ definition.config.actions,
6082
+ definition.config.tracing
6083
+ ),
6070
6084
  enableActorRuntimeSocket: options.enableActorRuntimeSocket === true,
6071
6085
  hasState: config.state !== void 0 || typeof config.createState === "function",
6072
6086
  canHibernateWebsocket: typeof canHibernate === "boolean" ? canHibernate : void 0,
@@ -6089,7 +6103,7 @@ function buildActorConfig(definition, registryConfig, runtimeKind) {
6089
6103
  maxOutgoingMessageSize: registryConfig.maxOutgoingMessageSize,
6090
6104
  preloadMaxWorkflowBytes: options.preloadMaxWorkflowBytes,
6091
6105
  preloadMaxConnectionsBytes: options.preloadMaxConnectionsBytes,
6092
- actions: Object.keys(_chunkEO5UOXXYcjs.flattenActionHandlers.call(void 0, config.actions)).sort().map((name) => ({ name })),
6106
+ actions: Object.keys(_chunkNWCAIWHLcjs.flattenActionHandlers.call(void 0, config.actions)).sort().map((name) => ({ name })),
6093
6107
  inspectorTabs: buildInspectorTabs(config.inspector, runtimeKind)
6094
6108
  };
6095
6109
  }
@@ -6165,10 +6179,10 @@ function validateInspectorTabSource(tabId, resolved) {
6165
6179
  function buildNativeFactory(runtime, registryConfig, definition) {
6166
6180
  var _a;
6167
6181
  const config = definition.config;
6168
- const databaseProvider = _nullishCoalesce(config.db, () => ( _chunkZ4RAXFSDcjs.db.call(void 0, )));
6169
- const actionHandlers = _chunkEO5UOXXYcjs.flattenActionHandlers.call(void 0, config.actions);
6182
+ const databaseProvider = _nullishCoalesce(config.db, () => ( _chunkCVLNRT7Ocjs.db.call(void 0, )));
6183
+ const actionHandlers = _chunkNWCAIWHLcjs.flattenActionHandlers.call(void 0, config.actions);
6170
6184
  const schemaConfig = {
6171
- actionInputSchemas: _chunkEO5UOXXYcjs.flattenActionInputSchemas.call(void 0,
6185
+ actionInputSchemas: _chunkNWCAIWHLcjs.flattenActionInputSchemas.call(void 0,
6172
6186
  config.actions,
6173
6187
  config.actionInputSchemas
6174
6188
  ),
@@ -6176,9 +6190,9 @@ function buildNativeFactory(runtime, registryConfig, definition) {
6176
6190
  events: config.events,
6177
6191
  queues: config.queues
6178
6192
  };
6179
- const createClient = (ctx) => _chunkIJUXBWH4cjs.createClientWithDriver.call(void 0,
6180
- new (0, _chunkIJUXBWH4cjs.RemoteEngineControlClient)(
6181
- _chunkIJUXBWH4cjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
6193
+ const createClient = (ctx) => _chunkA36FMKOVcjs.createClientWithDriver.call(void 0,
6194
+ new (0, _chunkA36FMKOVcjs.RemoteEngineControlClient)(
6195
+ _chunkA36FMKOVcjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
6182
6196
  ),
6183
6197
  {
6184
6198
  encoding: "bare",
@@ -6190,13 +6204,13 @@ function buildNativeFactory(runtime, registryConfig, definition) {
6190
6204
  )
6191
6205
  }
6192
6206
  );
6193
- const run = _chunkEO5UOXXYcjs.getRunFunction.call(void 0, config.run);
6194
- const runHandlerCoordinator = _chunkEO5UOXXYcjs.getRunInspectorKind.call(void 0, config.run) === "workflow" ? new RunHandlerCoordinator(config.run) : void 0;
6207
+ const run = _chunkNWCAIWHLcjs.getRunFunction.call(void 0, config.run);
6208
+ const runHandlerCoordinator = _chunkNWCAIWHLcjs.getRunInspectorKind.call(void 0, config.run) === "workflow" ? new RunHandlerCoordinator(config.run) : void 0;
6195
6209
  const getNativeWorkflowInspector = (ctx) => {
6196
6210
  var _a2, _b;
6197
6211
  const actorId = callNativeSync(() => runtime.actorId(ctx));
6198
6212
  const restart = () => callNativeSync(() => runtime.actorRestartRunHandler(ctx));
6199
- return _nullishCoalesce(((_a2 = runHandlerCoordinator == null ? void 0 : runHandlerCoordinator.getInspector(actorId, restart)) == null ? void 0 : _a2.workflow), () => ( ((_b = _chunkEO5UOXXYcjs.getRunInspectorConfig.call(void 0, config.run, actorId)) == null ? void 0 : _b.workflow)));
6213
+ return _nullishCoalesce(((_a2 = runHandlerCoordinator == null ? void 0 : runHandlerCoordinator.getInspector(actorId, restart)) == null ? void 0 : _a2.workflow), () => ( ((_b = _chunkNWCAIWHLcjs.getRunInspectorConfig.call(void 0, config.run, actorId)) == null ? void 0 : _b.workflow)));
6200
6214
  };
6201
6215
  const onStateChange = typeof config.onStateChange === "function" ? (actorCtx, nextState) => {
6202
6216
  config.onStateChange(actorCtx, nextState);
@@ -6370,7 +6384,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
6370
6384
  400
6371
6385
  );
6372
6386
  }
6373
- const cbor = _chunkRJC5O2SDcjs.encodeCborCompat.call(void 0,
6387
+ const cbor = _chunk2CE5UNWKcjs.encodeCborCompat.call(void 0,
6374
6388
  _nullishCoalesce(body.body, () => ( null))
6375
6389
  );
6376
6390
  const message = await runtime.actorQueueSend(ctx, name, cbor);
@@ -6738,7 +6752,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
6738
6752
  );
6739
6753
  } finally {
6740
6754
  runHandlerCoordinator == null ? void 0 : runHandlerCoordinator.destroy(actorId);
6741
- _chunkEO5UOXXYcjs.disposeRunInspector.call(void 0, config.run, actorId);
6755
+ _chunkNWCAIWHLcjs.disposeRunInspector.call(void 0, config.run, actorId);
6742
6756
  await actorCtx.dispose();
6743
6757
  }
6744
6758
  }
@@ -6750,7 +6764,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
6750
6764
  const actorCtx = makeActorCtx(ctx);
6751
6765
  const actorId = callNativeSync(() => runtime.actorId(ctx));
6752
6766
  runHandlerCoordinator == null ? void 0 : runHandlerCoordinator.destroy(actorId);
6753
- _chunkEO5UOXXYcjs.disposeRunInspector.call(void 0, config.run, actorId);
6767
+ _chunkNWCAIWHLcjs.disposeRunInspector.call(void 0, config.run, actorId);
6754
6768
  try {
6755
6769
  if (typeof config.onDestroy === "function") {
6756
6770
  await config.onDestroy(actorCtx);
@@ -6967,7 +6981,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
6967
6981
  ...request,
6968
6982
  abortController: requestAbortController
6969
6983
  });
6970
- const rawConnParams = handlerRequest.headers.get(_chunkIJUXBWH4cjs.HEADER_CONN_PARAMS);
6984
+ const rawConnParams = handlerRequest.headers.get(_chunkA36FMKOVcjs.HEADER_CONN_PARAMS);
6971
6985
  let requestCtx;
6972
6986
  let conn;
6973
6987
  let removeRequestAbortListener;
@@ -7024,7 +7038,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
7024
7038
  requestCtx,
7025
7039
  handlerRequest
7026
7040
  );
7027
- if (!_chunkIJUXBWH4cjs.isResponseLike.call(void 0, response)) {
7041
+ if (!_chunkA36FMKOVcjs.isResponseLike.call(void 0, response)) {
7028
7042
  throw new Error(
7029
7043
  "onRequest handler must return a Response"
7030
7044
  );
@@ -7114,15 +7128,15 @@ function buildNativeFactory(runtime, registryConfig, definition) {
7114
7128
  }
7115
7129
  );
7116
7130
  })(),
7117
- getWorkflowHistory: _chunkEO5UOXXYcjs.hasRunInspectorConfig.call(void 0, config.run) ? wrapNativeCallback(
7131
+ getWorkflowHistory: _chunkNWCAIWHLcjs.hasRunInspectorConfig.call(void 0, config.run) ? wrapNativeCallback(
7118
7132
  async (error, payload) => {
7119
7133
  var _a2;
7120
7134
  const { ctx } = unwrapTsfnPayload(error, payload);
7121
7135
  const history = (_a2 = getNativeWorkflowInspector(ctx)) == null ? void 0 : _a2.getHistory();
7122
- return history == null ? void 0 : _chunkRJC5O2SDcjs.toUint8Array.call(void 0, history);
7136
+ return history == null ? void 0 : _chunk2CE5UNWKcjs.toUint8Array.call(void 0, history);
7123
7137
  }
7124
7138
  ) : void 0,
7125
- replayWorkflow: _chunkEO5UOXXYcjs.hasRunInspectorConfig.call(void 0, config.run) ? wrapNativeCallback(
7139
+ replayWorkflow: _chunkNWCAIWHLcjs.hasRunInspectorConfig.call(void 0, config.run) ? wrapNativeCallback(
7126
7140
  async (error, payload) => {
7127
7141
  const { ctx, entryId } = unwrapTsfnPayload(
7128
7142
  error,
@@ -7133,7 +7147,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
7133
7147
  return void 0;
7134
7148
  }
7135
7149
  const history = await _asyncNullishCoalesce(await workflowInspector.replayFromStep(entryId), async () => ( null));
7136
- return history == null ? void 0 : _chunkRJC5O2SDcjs.toUint8Array.call(void 0, history);
7150
+ return history == null ? void 0 : _chunk2CE5UNWKcjs.toUint8Array.call(void 0, history);
7137
7151
  }
7138
7152
  ) : void 0,
7139
7153
  actions: Object.fromEntries(
@@ -7269,7 +7283,7 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
7269
7283
  startServices: resolveServicesBinary && config.startServices,
7270
7284
  handleInspectorHttpInRuntime: true,
7271
7285
  serverlessBasePath: config.serverless.basePath,
7272
- serverlessPackageVersion: _chunkRJC5O2SDcjs.VERSION,
7286
+ serverlessPackageVersion: _chunk2CE5UNWKcjs.VERSION,
7273
7287
  serverlessClientEndpoint: config.publicEndpoint,
7274
7288
  serverlessClientNamespace: config.publicNamespace,
7275
7289
  serverlessClientToken: config.publicToken,
@@ -7282,7 +7296,7 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
7282
7296
  } catch (error) {
7283
7297
  logger2().warn({
7284
7298
  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",
7285
- error: _chunkRJC5O2SDcjs.stringifyError.call(void 0, error)
7299
+ error: _chunk2CE5UNWKcjs.stringifyError.call(void 0, error)
7286
7300
  });
7287
7301
  }
7288
7302
  if (resolveServicesBinary && config.startServices) {
@@ -7292,20 +7306,20 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
7292
7306
  } catch (error) {
7293
7307
  logger2().warn({
7294
7308
  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",
7295
- error: _chunkRJC5O2SDcjs.stringifyError.call(void 0, error)
7309
+ error: _chunk2CE5UNWKcjs.stringifyError.call(void 0, error)
7296
7310
  });
7297
7311
  }
7298
7312
  }
7299
7313
  serveConfig.engineHost = config.engineHost;
7300
7314
  serveConfig.enginePort = config.enginePort;
7301
7315
  if ((_a = config.test) == null ? void 0 : _a.enabled) {
7302
- serveConfig.inspectorTestToken = _nullishCoalesce(_chunkRJC5O2SDcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
7316
+ serveConfig.inspectorTestToken = _nullishCoalesce(_chunk2CE5UNWKcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
7303
7317
  }
7304
7318
  return serveConfig;
7305
7319
  }
7306
7320
  async function buildRegistryWithRuntime(config, runtime) {
7307
7321
  var _a;
7308
- if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunkRJC5O2SDcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
7322
+ if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunk2CE5UNWKcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
7309
7323
  trySetProcessEnv("_RIVET_TEST_INSPECTOR_TOKEN", "token");
7310
7324
  }
7311
7325
  if (runtime.kind === "napi") {
@@ -7372,7 +7386,7 @@ function createApplicationFetch(application, runtime) {
7372
7386
  signal: abortController.signal
7373
7387
  })
7374
7388
  );
7375
- if (!_chunkIJUXBWH4cjs.isResponseLike.call(void 0, response)) {
7389
+ if (!_chunkA36FMKOVcjs.isResponseLike.call(void 0, response)) {
7376
7390
  throw new TypeError(
7377
7391
  "registry.listen() application fetch must return a Response"
7378
7392
  );
@@ -7422,7 +7436,7 @@ var Registry = class {
7422
7436
  var _a;
7423
7437
  this.#config = config;
7424
7438
  if ((_a = config.logging) == null ? void 0 : _a.baseLogger) {
7425
- _chunkRJC5O2SDcjs.configureBaseLogger.call(void 0, config.logging.baseLogger);
7439
+ _chunk2CE5UNWKcjs.configureBaseLogger.call(void 0, config.logging.baseLogger);
7426
7440
  }
7427
7441
  this.#buildConfiguredRegistry = _nullishCoalesce((deps == null ? void 0 : deps.buildConfiguredRegistry), () => ( buildConfiguredRegistry));
7428
7442
  this.routes = {
@@ -7648,10 +7662,10 @@ var Registry = class {
7648
7662
  * ```
7649
7663
  */
7650
7664
  async listen(opts = {}) {
7651
- const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => ( _chunkRJC5O2SDcjs.parsePortEnv.call(void 0, process.env.RIVET_PORT))), () => ( 3e3));
7652
- const publicDir = _nullishCoalesce(opts.publicDir, () => ( _chunkRJC5O2SDcjs.getRivetkitPublicDir.call(void 0, )));
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, )));
7653
7667
  const config = this.parseConfig();
7654
- if (opts.application && _chunkRJC5O2SDcjs.getRivetkitRuntimeMode.call(void 0, ) !== "serverless") {
7668
+ if (opts.application && _chunk2CE5UNWKcjs.getRivetkitRuntimeMode.call(void 0, ) !== "serverless") {
7655
7669
  if (config.runtime === "wasm") {
7656
7670
  throw new Error(
7657
7671
  "registry.listen() requires the native runtime; use an application-owned HTTP server with WebAssembly"
@@ -7727,7 +7741,7 @@ var Registry = class {
7727
7741
  return jsonRouteResponse(503, {
7728
7742
  status: "not_started",
7729
7743
  runtime: "rivetkit",
7730
- version: _chunkRJC5O2SDcjs.VERSION
7744
+ version: _chunk2CE5UNWKcjs.VERSION
7731
7745
  });
7732
7746
  }
7733
7747
  const { runtime, registry } = configured;
@@ -7735,7 +7749,7 @@ var Registry = class {
7735
7749
  return jsonRouteResponse(501, {
7736
7750
  status: "unsupported",
7737
7751
  runtime: "rivetkit",
7738
- version: _chunkRJC5O2SDcjs.VERSION
7752
+ version: _chunk2CE5UNWKcjs.VERSION
7739
7753
  });
7740
7754
  }
7741
7755
  const response = await runtime.registryHealth(registry);
@@ -7991,7 +8005,7 @@ var Registry = class {
7991
8005
  );
7992
8006
  }
7993
8007
  if (this.#runtimeReadyPromise) return this.#runtimeReadyPromise;
7994
- if (_chunkRJC5O2SDcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
8008
+ if (_chunk2CE5UNWKcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
7995
8009
  return Promise.reject(
7996
8010
  new Error(
7997
8011
  "registry.startAndWait() requires envoy runtime mode; serverless registries become ready per request"
@@ -8061,8 +8075,8 @@ var Registry = class {
8061
8075
  * ```
8062
8076
  */
8063
8077
  start() {
8064
- if (_chunkRJC5O2SDcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
8065
- const publicDir = _nullishCoalesce(_chunkRJC5O2SDcjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
8078
+ if (_chunk2CE5UNWKcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
8079
+ const publicDir = _nullishCoalesce(_chunk2CE5UNWKcjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
8066
8080
  this.listen({ publicDir }).catch((error) => {
8067
8081
  logger2().error({ error }, "auto-listen failed; exiting");
8068
8082
  if (typeof process !== "undefined" && typeof process.exit === "function") {
@@ -8083,7 +8097,7 @@ var Registry = class {
8083
8097
  };
8084
8098
  console.log();
8085
8099
  console.log(
8086
- ` RivetKit ${_chunkRJC5O2SDcjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
8100
+ ` RivetKit ${_chunk2CE5UNWKcjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
8087
8101
  );
8088
8102
  if (config.namespace !== "default") {
8089
8103
  logLine("Namespace", config.namespace);
@@ -8159,5 +8173,5 @@ function setup(input) {
8159
8173
 
8160
8174
 
8161
8175
 
8162
- exports.ALLOWED_PUBLIC_HEADERS = _chunkIJUXBWH4cjs.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 = _chunkIJUXBWH4cjs.createClientWithDriver; exports.defineRunHandler = _chunkEO5UOXXYcjs.defineRunHandler; exports.event = event; exports.isStaticActorDefinition = isStaticActorDefinition; exports.isStaticActorInstance = isStaticActorInstance; exports.lookupInRegistry = lookupInRegistry; exports.noopNext = _chunkRJC5O2SDcjs.noopNext; exports.queue = queue; exports.setup = setup; exports.toUint8Array = _chunkRJC5O2SDcjs.toUint8Array;
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;
8163
8177
  //# sourceMappingURL=mod.cjs.map