rivetkit 2.3.12-rc.4 → 2.3.12

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 (121) hide show
  1. package/dist/browser/client.d.ts +17 -4
  2. package/dist/browser/client.js +32 -24
  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 +2 -2
  7. package/dist/tsup/actor/errors.js +1 -1
  8. package/dist/tsup/agent-os/index.cjs +3 -19
  9. package/dist/tsup/agent-os/index.cjs.map +1 -1
  10. package/dist/tsup/agent-os/index.d.cts +17 -4
  11. package/dist/tsup/agent-os/index.d.ts +17 -4
  12. package/dist/tsup/agent-os/index.js +3 -19
  13. package/dist/tsup/agent-os/index.js.map +1 -1
  14. package/dist/tsup/{chunk-SPJORZMM.cjs → chunk-2JSYYH6P.cjs} +1 -1
  15. package/dist/tsup/chunk-2JSYYH6P.cjs.map +1 -0
  16. package/dist/tsup/{chunk-IAH47VDZ.cjs → chunk-4KGXFC6M.cjs} +2 -19
  17. package/dist/tsup/chunk-4KGXFC6M.cjs.map +1 -0
  18. package/dist/tsup/{chunk-DLQSZ6Q7.js → chunk-6W5VGLFT.js} +2 -19
  19. package/dist/tsup/chunk-6W5VGLFT.js.map +1 -0
  20. package/dist/tsup/{chunk-JIOLC5I2.cjs → chunk-AN7WO7BM.cjs} +3 -3
  21. package/dist/tsup/{chunk-JIOLC5I2.cjs.map → chunk-AN7WO7BM.cjs.map} +1 -1
  22. package/dist/tsup/{chunk-AF2VKCFA.js → chunk-EBXARMGI.js} +2 -2
  23. package/dist/tsup/{chunk-4LRWLBTR.cjs → chunk-FGQABMXZ.cjs} +3 -3
  24. package/dist/tsup/{chunk-4LRWLBTR.cjs.map → chunk-FGQABMXZ.cjs.map} +1 -1
  25. package/dist/tsup/{chunk-BQ7YJ3PG.js → chunk-GEN4NHXM.js} +2 -2
  26. package/dist/tsup/{chunk-NVMHEG5J.js → chunk-JYTXOMM7.js} +2 -2
  27. package/dist/tsup/{chunk-NKLM6C5A.cjs → chunk-MEF7RVQ7.cjs} +10 -10
  28. package/dist/tsup/{chunk-NKLM6C5A.cjs.map → chunk-MEF7RVQ7.cjs.map} +1 -1
  29. package/dist/tsup/{chunk-64DT44V2.js → chunk-MF42PRF2.js} +9 -3
  30. package/dist/tsup/chunk-MF42PRF2.js.map +1 -0
  31. package/dist/tsup/{chunk-IXBD7BXC.js → chunk-OUQUIBVW.js} +1 -1
  32. package/dist/tsup/chunk-OUQUIBVW.js.map +1 -0
  33. package/dist/tsup/{chunk-S3GXVCIM.cjs → chunk-PW2VSGUR.cjs} +4 -4
  34. package/dist/tsup/{chunk-S3GXVCIM.cjs.map → chunk-PW2VSGUR.cjs.map} +1 -1
  35. package/dist/tsup/{chunk-GMBCKV6C.js → chunk-RBXJWAJB.js} +3 -3
  36. package/dist/tsup/{chunk-XDYECGCT.cjs → chunk-SSPTEGTX.cjs} +7 -7
  37. package/dist/tsup/{chunk-XDYECGCT.cjs.map → chunk-SSPTEGTX.cjs.map} +1 -1
  38. package/dist/tsup/{chunk-ARFTQ5HY.cjs → chunk-TAG6UEL5.cjs} +17 -11
  39. package/dist/tsup/chunk-TAG6UEL5.cjs.map +1 -0
  40. package/dist/tsup/{chunk-OCXHNHGQ.cjs → chunk-TXUHVBKH.cjs} +3 -3
  41. package/dist/tsup/{chunk-OCXHNHGQ.cjs.map → chunk-TXUHVBKH.cjs.map} +1 -1
  42. package/dist/tsup/{chunk-F7G5WHOD.cjs → chunk-TZPNSOG2.cjs} +203 -195
  43. package/dist/tsup/chunk-TZPNSOG2.cjs.map +1 -0
  44. package/dist/tsup/{chunk-O74736N5.js → chunk-VOYNLY57.js} +41 -33
  45. package/dist/tsup/chunk-VOYNLY57.js.map +1 -0
  46. package/dist/tsup/{chunk-3CBQIP37.js → chunk-XUODFCRJ.js} +4 -4
  47. package/dist/tsup/{chunk-P5JJG4KY.js → chunk-ZIPXAVKR.js} +2 -2
  48. package/dist/tsup/client/mod.cjs +6 -6
  49. package/dist/tsup/client/mod.d.cts +2 -2
  50. package/dist/tsup/client/mod.d.ts +2 -2
  51. package/dist/tsup/client/mod.js +5 -5
  52. package/dist/tsup/common/log.cjs +3 -3
  53. package/dist/tsup/common/log.js +2 -2
  54. package/dist/tsup/common/websocket.cjs +4 -4
  55. package/dist/tsup/common/websocket.js +3 -3
  56. package/dist/tsup/{config-DzaddF-j.d.ts → config-BGTanB_3.d.ts} +19 -10
  57. package/dist/tsup/{config-VxDc6yMu.d.cts → config-NHz6oMb9.d.cts} +19 -10
  58. package/dist/tsup/{context-Cn8CIrOR.d.cts → context-DB8zG_Ib.d.cts} +1 -1
  59. package/dist/tsup/{context-B6HYokje.d.ts → context-SHomdVV8.d.ts} +1 -1
  60. package/dist/tsup/db/drizzle.cjs +3 -3
  61. package/dist/tsup/db/drizzle.js +2 -2
  62. package/dist/tsup/db/mod.cjs +4 -4
  63. package/dist/tsup/db/mod.js +3 -3
  64. package/dist/tsup/dynamic/mod.cjs +2 -2
  65. package/dist/tsup/dynamic/mod.d.cts +1 -1
  66. package/dist/tsup/dynamic/mod.d.ts +1 -1
  67. package/dist/tsup/dynamic/mod.js +1 -1
  68. package/dist/tsup/inspector/mod.cjs +6 -6
  69. package/dist/tsup/inspector/mod.js +5 -5
  70. package/dist/tsup/inspector/workflow.cjs +5 -5
  71. package/dist/tsup/inspector/workflow.js +4 -4
  72. package/dist/tsup/inspector-tab/mod.cjs +2 -2
  73. package/dist/tsup/inspector-tab/mod.d.cts +2 -2
  74. package/dist/tsup/inspector-tab/mod.d.ts +2 -2
  75. package/dist/tsup/inspector-tab/mod.js +1 -1
  76. package/dist/tsup/mod.cjs +444 -199
  77. package/dist/tsup/mod.cjs.map +1 -1
  78. package/dist/tsup/mod.d.cts +3 -3
  79. package/dist/tsup/mod.d.ts +3 -3
  80. package/dist/tsup/mod.js +323 -78
  81. package/dist/tsup/mod.js.map +1 -1
  82. package/dist/tsup/test/mod.cjs +7 -7
  83. package/dist/tsup/test/mod.d.cts +1 -1
  84. package/dist/tsup/test/mod.d.ts +1 -1
  85. package/dist/tsup/test/mod.js +5 -5
  86. package/dist/tsup/utils.cjs +3 -3
  87. package/dist/tsup/utils.js +2 -2
  88. package/dist/tsup/workflow/mod.cjs +14 -14
  89. package/dist/tsup/workflow/mod.d.cts +3 -3
  90. package/dist/tsup/workflow/mod.d.ts +3 -3
  91. package/dist/tsup/workflow/mod.js +6 -6
  92. package/package.json +9 -8
  93. package/src/actor/config.test.ts +0 -8
  94. package/src/actor/config.ts +1 -24
  95. package/src/actor/errors.ts +2 -1
  96. package/src/client/actor-handle.ts +10 -3
  97. package/src/client/raw-utils.ts +8 -0
  98. package/src/common/actor-router-consts.ts +2 -0
  99. package/src/engine-client/actor-http-client.ts +6 -22
  100. package/src/engine-client/mod.ts +1 -1
  101. package/src/registry/config/index.ts +27 -1
  102. package/src/registry/index.ts +48 -14
  103. package/src/registry/napi-runtime.ts +32 -5
  104. package/src/registry/native-http.ts +225 -0
  105. package/src/registry/native.ts +130 -65
  106. package/src/registry/runtime.ts +30 -3
  107. package/src/utils/env-vars.ts +4 -0
  108. package/dist/tsup/chunk-64DT44V2.js.map +0 -1
  109. package/dist/tsup/chunk-ARFTQ5HY.cjs.map +0 -1
  110. package/dist/tsup/chunk-DLQSZ6Q7.js.map +0 -1
  111. package/dist/tsup/chunk-F7G5WHOD.cjs.map +0 -1
  112. package/dist/tsup/chunk-IAH47VDZ.cjs.map +0 -1
  113. package/dist/tsup/chunk-IXBD7BXC.js.map +0 -1
  114. package/dist/tsup/chunk-O74736N5.js.map +0 -1
  115. package/dist/tsup/chunk-SPJORZMM.cjs.map +0 -1
  116. /package/dist/tsup/{chunk-AF2VKCFA.js.map → chunk-EBXARMGI.js.map} +0 -0
  117. /package/dist/tsup/{chunk-BQ7YJ3PG.js.map → chunk-GEN4NHXM.js.map} +0 -0
  118. /package/dist/tsup/{chunk-NVMHEG5J.js.map → chunk-JYTXOMM7.js.map} +0 -0
  119. /package/dist/tsup/{chunk-GMBCKV6C.js.map → chunk-RBXJWAJB.js.map} +0 -0
  120. /package/dist/tsup/{chunk-3CBQIP37.js.map → chunk-XUODFCRJ.js.map} +0 -0
  121. /package/dist/tsup/{chunk-P5JJG4KY.js.map → chunk-ZIPXAVKR.js.map} +0 -0
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkXDYECGCTcjs = require('../chunk-XDYECGCT.cjs');
3
+ var _chunkSSPTEGTXcjs = require('../chunk-SSPTEGTX.cjs');
4
4
 
5
5
 
6
- var _chunkF7G5WHODcjs = require('../chunk-F7G5WHOD.cjs');
6
+ var _chunkTZPNSOG2cjs = require('../chunk-TZPNSOG2.cjs');
7
7
  require('../chunk-MYWZCDML.cjs');
8
+ require('../chunk-TXUHVBKH.cjs');
8
9
  require('../chunk-KVFIONKQ.cjs');
9
- require('../chunk-OCXHNHGQ.cjs');
10
- require('../chunk-ARFTQ5HY.cjs');
11
- require('../chunk-SPJORZMM.cjs');
10
+ require('../chunk-TAG6UEL5.cjs');
11
+ require('../chunk-2JSYYH6P.cjs');
12
12
 
13
13
  // src/test/ready.ts
14
14
  var _pretry = require('p-retry'); var _pretry2 = _interopRequireDefault(_pretry);
@@ -36,8 +36,8 @@ async function setupTest(c, registry) {
36
36
  registry.config.noWelcome = true;
37
37
  registry.start();
38
38
  await waitForRegistryReady(registry);
39
- const client = _chunkXDYECGCTcjs.createClient.call(void 0, {
40
- ..._chunkF7G5WHODcjs.convertRegistryConfigToClientConfig.call(void 0, registry.parseConfig()),
39
+ const client = _chunkSSPTEGTXcjs.createClient.call(void 0, {
40
+ ..._chunkTZPNSOG2cjs.convertRegistryConfigToClientConfig.call(void 0, registry.parseConfig()),
41
41
  disableMetadataLookup: false
42
42
  });
43
43
  c.onTestFinished(async () => {
@@ -1,5 +1,5 @@
1
1
  import { TestContext } from 'vitest';
2
- import { aG as Registry, a3 as Client } from '../config-VxDc6yMu.cjs';
2
+ import { aF as Registry, a3 as Client } from '../config-NHz6oMb9.cjs';
3
3
  import 'zod/v4';
4
4
  import '../config-ey2I2zz5.cjs';
5
5
  import '@rivetkit/rivetkit-wasm';
@@ -1,5 +1,5 @@
1
1
  import { TestContext } from 'vitest';
2
- import { aG as Registry, a3 as Client } from '../config-DzaddF-j.js';
2
+ import { aF as Registry, a3 as Client } from '../config-BGTanB_3.js';
3
3
  import 'zod/v4';
4
4
  import '../config-ey2I2zz5.js';
5
5
  import '@rivetkit/rivetkit-wasm';
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  createClient
3
- } from "../chunk-GMBCKV6C.js";
3
+ } from "../chunk-RBXJWAJB.js";
4
4
  import {
5
5
  convertRegistryConfigToClientConfig
6
- } from "../chunk-O74736N5.js";
6
+ } from "../chunk-VOYNLY57.js";
7
7
  import "../chunk-JI6GZ2C2.js";
8
+ import "../chunk-JYTXOMM7.js";
8
9
  import "../chunk-JTHHCZCZ.js";
9
- import "../chunk-NVMHEG5J.js";
10
- import "../chunk-64DT44V2.js";
11
- import "../chunk-IXBD7BXC.js";
10
+ import "../chunk-MF42PRF2.js";
11
+ import "../chunk-OUQUIBVW.js";
12
12
 
13
13
  // src/test/ready.ts
14
14
  import pRetry from "p-retry";
@@ -19,8 +19,8 @@
19
19
 
20
20
 
21
21
 
22
- var _chunkARFTQ5HYcjs = require('./chunk-ARFTQ5HY.cjs');
23
- require('./chunk-SPJORZMM.cjs');
22
+ var _chunkTAG6UEL5cjs = require('./chunk-TAG6UEL5.cjs');
23
+ require('./chunk-2JSYYH6P.cjs');
24
24
 
25
25
 
26
26
 
@@ -42,5 +42,5 @@ require('./chunk-SPJORZMM.cjs');
42
42
 
43
43
 
44
44
 
45
- exports.EXTRA_ERROR_LOG = _chunkARFTQ5HYcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunkARFTQ5HYcjs.SinglePromiseQueue; exports.VERSION = _chunkARFTQ5HYcjs.VERSION; exports.arrayBuffersEqual = _chunkARFTQ5HYcjs.arrayBuffersEqual; exports.assertUnreachable = _chunkARFTQ5HYcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkARFTQ5HYcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkARFTQ5HYcjs.combineUrlPath; exports.dbg = _chunkARFTQ5HYcjs.dbg; exports.detectRuntime = _chunkARFTQ5HYcjs.detectRuntime; exports.getEnvUniversal = _chunkARFTQ5HYcjs.getEnvUniversal; exports.httpUserAgent = _chunkARFTQ5HYcjs.httpUserAgent; exports.interval = _chunkARFTQ5HYcjs.interval; exports.joinSignals = _chunkARFTQ5HYcjs.joinSignals; exports.jsonParseCompat = _chunkARFTQ5HYcjs.jsonParseCompat; exports.jsonStringifyCompat = _chunkARFTQ5HYcjs.jsonStringifyCompat; exports.promiseWithResolvers = _chunkARFTQ5HYcjs.promiseWithResolvers; exports.setLongTimeout = _chunkARFTQ5HYcjs.setLongTimeout; exports.sleep = _chunkARFTQ5HYcjs.sleep; exports.stringifyError = _chunkARFTQ5HYcjs.stringifyError; exports.toUint8Array = _chunkARFTQ5HYcjs.toUint8Array;
45
+ exports.EXTRA_ERROR_LOG = _chunkTAG6UEL5cjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunkTAG6UEL5cjs.SinglePromiseQueue; exports.VERSION = _chunkTAG6UEL5cjs.VERSION; exports.arrayBuffersEqual = _chunkTAG6UEL5cjs.arrayBuffersEqual; exports.assertUnreachable = _chunkTAG6UEL5cjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkTAG6UEL5cjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkTAG6UEL5cjs.combineUrlPath; exports.dbg = _chunkTAG6UEL5cjs.dbg; exports.detectRuntime = _chunkTAG6UEL5cjs.detectRuntime; exports.getEnvUniversal = _chunkTAG6UEL5cjs.getEnvUniversal; exports.httpUserAgent = _chunkTAG6UEL5cjs.httpUserAgent; exports.interval = _chunkTAG6UEL5cjs.interval; exports.joinSignals = _chunkTAG6UEL5cjs.joinSignals; exports.jsonParseCompat = _chunkTAG6UEL5cjs.jsonParseCompat; exports.jsonStringifyCompat = _chunkTAG6UEL5cjs.jsonStringifyCompat; exports.promiseWithResolvers = _chunkTAG6UEL5cjs.promiseWithResolvers; exports.setLongTimeout = _chunkTAG6UEL5cjs.setLongTimeout; exports.sleep = _chunkTAG6UEL5cjs.sleep; exports.stringifyError = _chunkTAG6UEL5cjs.stringifyError; exports.toUint8Array = _chunkTAG6UEL5cjs.toUint8Array;
46
46
  //# sourceMappingURL=utils.cjs.map
@@ -19,8 +19,8 @@ import {
19
19
  sleep,
20
20
  stringifyError,
21
21
  toUint8Array
22
- } from "./chunk-64DT44V2.js";
23
- import "./chunk-IXBD7BXC.js";
22
+ } from "./chunk-MF42PRF2.js";
23
+ import "./chunk-OUQUIBVW.js";
24
24
  export {
25
25
  EXTRA_ERROR_LOG,
26
26
  SinglePromiseQueue,
@@ -1,23 +1,23 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } var _class; var _class2;
2
2
 
3
- var _chunkNKLM6C5Acjs = require('../chunk-NKLM6C5A.cjs');
4
- require('../chunk-JIOLC5I2.cjs');
5
- require('../chunk-S3GXVCIM.cjs');
3
+ var _chunkMEF7RVQ7cjs = require('../chunk-MEF7RVQ7.cjs');
4
+ require('../chunk-AN7WO7BM.cjs');
5
+ require('../chunk-PW2VSGUR.cjs');
6
6
 
7
7
 
8
8
 
9
- var _chunkIAH47VDZcjs = require('../chunk-IAH47VDZ.cjs');
9
+ var _chunk4KGXFC6Mcjs = require('../chunk-4KGXFC6M.cjs');
10
10
 
11
11
 
12
12
 
13
13
  var _chunkMYWZCDMLcjs = require('../chunk-MYWZCDML.cjs');
14
14
 
15
15
 
16
- var _chunkARFTQ5HYcjs = require('../chunk-ARFTQ5HY.cjs');
16
+ var _chunkTAG6UEL5cjs = require('../chunk-TAG6UEL5.cjs');
17
17
 
18
18
 
19
19
 
20
- var _chunkSPJORZMMcjs = require('../chunk-SPJORZMM.cjs');
20
+ var _chunk2JSYYH6Pcjs = require('../chunk-2JSYYH6P.cjs');
21
21
 
22
22
  // src/workflow/mod.ts
23
23
 
@@ -705,7 +705,7 @@ function shouldRethrowWorkflowError(error) {
705
705
  return true;
706
706
  }
707
707
  function workflowReplayInFlightError() {
708
- return new (0, _chunkSPJORZMMcjs.RivetError)(
708
+ return new (0, _chunk2JSYYH6Pcjs.RivetError)(
709
709
  "actor",
710
710
  "workflow_in_flight",
711
711
  "Workflow replay is unavailable while the workflow is currently in flight.",
@@ -719,7 +719,7 @@ function isWorkflowReplayBlockedByRunningEntry(error) {
719
719
  return error instanceof Error && error.message === "Cannot replay a workflow while a step is currently running";
720
720
  }
721
721
  function isRunHandlerUnavailable(error) {
722
- return error instanceof _chunkSPJORZMMcjs.RivetError && error.group === "actor" && error.code === "run_handler_unavailable";
722
+ return error instanceof _chunk2JSYYH6Pcjs.RivetError && error.group === "actor" && error.code === "run_handler_unavailable";
723
723
  }
724
724
  function workflow(fn, options = {}) {
725
725
  const onError = options.onError;
@@ -727,13 +727,13 @@ function workflow(fn, options = {}) {
727
727
  function getWorkflowInspector(actorId) {
728
728
  let workflowInspector = workflowInspectors.get(actorId);
729
729
  if (!workflowInspector) {
730
- workflowInspector = _chunkNKLM6C5Acjs.createWorkflowInspectorAdapter.call(void 0, );
730
+ workflowInspector = _chunkMEF7RVQ7cjs.createWorkflowInspectorAdapter.call(void 0, );
731
731
  workflowInspectors.set(actorId, workflowInspector);
732
732
  }
733
733
  return workflowInspector;
734
734
  }
735
735
  async function run(runCtx) {
736
- const actor = runCtx[_chunkIAH47VDZcjs.ACTOR_CONTEXT_INTERNAL_SYMBOL];
736
+ const actor = runCtx[_chunk4KGXFC6Mcjs.ACTOR_CONTEXT_INTERNAL_SYMBOL];
737
737
  _invariant2.default.call(void 0, actor, "workflow() requires an actor instance");
738
738
  const workflowInspector = getWorkflowInspector(actor.id);
739
739
  const driver = new ActorWorkflowDriver(actor, runCtx);
@@ -794,25 +794,25 @@ function workflow(fn, options = {}) {
794
794
  try {
795
795
  await handle.result;
796
796
  } catch (error) {
797
- if (runCtx.abortSignal.aborted || _chunkSPJORZMMcjs.isActorAbortedError.call(void 0, error)) {
797
+ if (runCtx.abortSignal.aborted || _chunk2JSYYH6Pcjs.isActorAbortedError.call(void 0, error)) {
798
798
  return;
799
799
  }
800
800
  if (shouldRethrowWorkflowError(error)) {
801
801
  runCtx.log.error({
802
802
  msg: "workflow run failed",
803
- error: _chunkARFTQ5HYcjs.stringifyError.call(void 0, error)
803
+ error: _chunkTAG6UEL5cjs.stringifyError.call(void 0, error)
804
804
  });
805
805
  throw error;
806
806
  }
807
807
  runCtx.log.warn({
808
808
  msg: "workflow failed and will sleep until woken",
809
- error: _chunkARFTQ5HYcjs.stringifyError.call(void 0, error)
809
+ error: _chunkTAG6UEL5cjs.stringifyError.call(void 0, error)
810
810
  });
811
811
  } finally {
812
812
  runCtx.abortSignal.removeEventListener("abort", onAbort);
813
813
  }
814
814
  }
815
- return _chunkIAH47VDZcjs.defineRunHandler.call(void 0, run, {
815
+ return _chunk4KGXFC6Mcjs.defineRunHandler.call(void 0, run, {
816
816
  icon: "diagram-project",
817
817
  inspectorKind: "workflow",
818
818
  createInspector: ({ actorId, control }) => {
@@ -1,9 +1,9 @@
1
1
  import { WorkflowErrorEvent } from '@rivetkit/workflow-engine';
2
2
  export { Loop, TryBlockCatchKind, TryBlockConfig, TryBlockFailure, TryBlockResult, TryStepCatchKind, TryStepConfig, TryStepFailure, TryStepResult, WorkflowError, WorkflowErrorEvent } from '@rivetkit/workflow-engine';
3
- import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-VxDc6yMu.cjs';
3
+ import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-NHz6oMb9.cjs';
4
4
  import { A as AnyDatabaseProvider } from '../config-ey2I2zz5.cjs';
5
- import { d as WorkflowContext } from '../context-Cn8CIrOR.cjs';
6
- export { e as WorkflowBranchConfig, W as WorkflowBranchContextOf, a as WorkflowContextOf, f as WorkflowLoopConfig, b as WorkflowLoopContextOf, g as WorkflowStepConfig, h as WorkflowStepContext, c as WorkflowStepContextOf, i as WorkflowTryConfig, j as WorkflowTryStepConfig } from '../context-Cn8CIrOR.cjs';
5
+ import { d as WorkflowContext } from '../context-DB8zG_Ib.cjs';
6
+ export { e as WorkflowBranchConfig, W as WorkflowBranchContextOf, a as WorkflowContextOf, f as WorkflowLoopConfig, b as WorkflowLoopContextOf, g as WorkflowStepConfig, h as WorkflowStepContext, c as WorkflowStepContextOf, i as WorkflowTryConfig, j as WorkflowTryStepConfig } from '../context-DB8zG_Ib.cjs';
7
7
  import 'zod/v4';
8
8
  import '@rivetkit/rivetkit-wasm';
9
9
  import 'zod';
@@ -1,9 +1,9 @@
1
1
  import { WorkflowErrorEvent } from '@rivetkit/workflow-engine';
2
2
  export { Loop, TryBlockCatchKind, TryBlockConfig, TryBlockFailure, TryBlockResult, TryStepCatchKind, TryStepConfig, TryStepFailure, TryStepResult, WorkflowError, WorkflowErrorEvent } from '@rivetkit/workflow-engine';
3
- import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-DzaddF-j.js';
3
+ import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-BGTanB_3.js';
4
4
  import { A as AnyDatabaseProvider } from '../config-ey2I2zz5.js';
5
- import { d as WorkflowContext } from '../context-B6HYokje.js';
6
- export { e as WorkflowBranchConfig, W as WorkflowBranchContextOf, a as WorkflowContextOf, f as WorkflowLoopConfig, b as WorkflowLoopContextOf, g as WorkflowStepConfig, h as WorkflowStepContext, c as WorkflowStepContextOf, i as WorkflowTryConfig, j as WorkflowTryStepConfig } from '../context-B6HYokje.js';
5
+ import { d as WorkflowContext } from '../context-SHomdVV8.js';
6
+ export { e as WorkflowBranchConfig, W as WorkflowBranchContextOf, a as WorkflowContextOf, f as WorkflowLoopConfig, b as WorkflowLoopContextOf, g as WorkflowStepConfig, h as WorkflowStepContext, c as WorkflowStepContextOf, i as WorkflowTryConfig, j as WorkflowTryStepConfig } from '../context-SHomdVV8.js';
7
7
  import 'zod/v4';
8
8
  import '@rivetkit/rivetkit-wasm';
9
9
  import 'zod';
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  createWorkflowInspectorAdapter
3
- } from "../chunk-3CBQIP37.js";
4
- import "../chunk-P5JJG4KY.js";
5
- import "../chunk-BQ7YJ3PG.js";
3
+ } from "../chunk-XUODFCRJ.js";
4
+ import "../chunk-ZIPXAVKR.js";
5
+ import "../chunk-GEN4NHXM.js";
6
6
  import {
7
7
  ACTOR_CONTEXT_INTERNAL_SYMBOL,
8
8
  defineRunHandler
9
- } from "../chunk-DLQSZ6Q7.js";
9
+ } from "../chunk-6W5VGLFT.js";
10
10
  import {
11
11
  makeWorkflowKey,
12
12
  workflowStoragePrefix
13
13
  } from "../chunk-JI6GZ2C2.js";
14
14
  import {
15
15
  stringifyError
16
- } from "../chunk-64DT44V2.js";
16
+ } from "../chunk-MF42PRF2.js";
17
17
  import {
18
18
  RivetError,
19
19
  isActorAbortedError
20
- } from "../chunk-IXBD7BXC.js";
20
+ } from "../chunk-OUQUIBVW.js";
21
21
 
22
22
  // src/workflow/mod.ts
23
23
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rivetkit",
3
- "version": "2.3.12-rc.4",
3
+ "version": "2.3.12",
4
4
  "description": "Lightweight libraries for building stateful actors on edge platforms",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -210,15 +210,16 @@
210
210
  "dependencies": {
211
211
  "@hono/zod-openapi": "^1.1.5",
212
212
  "@rivet-dev/agent-os-core": "^0.1.1",
213
+ "@rivet-dev/services": "^0.1.3",
213
214
  "@rivetkit/bare-ts": "^0.6.2",
214
- "@rivetkit/engine-cli": "2.3.12-rc.4",
215
- "@rivetkit/engine-envoy-protocol": "2.3.12-rc.4",
215
+ "@rivetkit/engine-cli": "2.3.12",
216
+ "@rivetkit/engine-envoy-protocol": "2.3.12",
216
217
  "@rivetkit/on-change": "6.0.1",
217
- "@rivetkit/rivetkit-napi": "2.3.12-rc.4",
218
- "@rivetkit/rivetkit-wasm": "2.3.12-rc.4",
219
- "@rivetkit/traces": "2.3.12-rc.4",
220
- "@rivetkit/virtual-websocket": "2.3.12-rc.4",
221
- "@rivetkit/workflow-engine": "2.3.12-rc.4",
218
+ "@rivetkit/rivetkit-napi": "2.3.12",
219
+ "@rivetkit/rivetkit-wasm": "2.3.12",
220
+ "@rivetkit/traces": "2.3.12",
221
+ "@rivetkit/virtual-websocket": "2.3.12",
222
+ "@rivetkit/workflow-engine": "2.3.12",
222
223
  "cbor-x": "^1.6.0",
223
224
  "drizzle-orm": "^0.44.2",
224
225
  "hono": "^4.7.0",
@@ -18,14 +18,6 @@ describe("ActorOptionsSchema", () => {
18
18
  .enableActorRuntimeSocket,
19
19
  ).toBe(true);
20
20
  });
21
-
22
- test("defaults the action limit to 128 and accepts overrides", () => {
23
- expect(ActorOptionsSchema.parse({}).maxActions).toBe(128);
24
- expect(ActorOptionsSchema.parse({ maxActions: 256 }).maxActions).toBe(
25
- 256,
26
- );
27
- expect(() => ActorOptionsSchema.parse({ maxActions: -1 })).toThrow();
28
- });
29
21
  });
30
22
 
31
23
  describe("defineRunHandler", () => {
@@ -18,7 +18,6 @@ import type {
18
18
  } from "./schema";
19
19
 
20
20
  export const DEFAULT_SLEEP_GRACE_PERIOD = 15_000;
21
- export const DEFAULT_MAX_ACTIONS = 128;
22
21
 
23
22
  export const ACTOR_CONTEXT_INTERNAL_SYMBOL = Symbol(
24
23
  "rivetkit.actor_context_internal",
@@ -1230,8 +1229,6 @@ const GlobalActorOptionsBaseSchema = z
1230
1229
  name: z.string().optional(),
1231
1230
  /** Icon for the actor in the Inspector UI. Can be an emoji or FontAwesome icon name. */
1232
1231
  icon: z.string().optional(),
1233
- /** Maximum number of action handlers that may be defined on this actor. */
1234
- maxActions: z.number().int().nonnegative().default(DEFAULT_MAX_ACTIONS),
1235
1232
  /** Enables the experimental Actor Runtime Socket for this actor. */
1236
1233
  enableActorRuntimeSocket: z.boolean().default(false),
1237
1234
  /**
@@ -1362,19 +1359,7 @@ export const ActorConfigSchema = z
1362
1359
  message: "Cannot define both 'vars' and 'createVars'",
1363
1360
  path: ["vars"],
1364
1361
  },
1365
- )
1366
- .superRefine((data, ctx) => {
1367
- const actionCount = Object.keys(
1368
- flattenActionHandlers(data.actions),
1369
- ).length;
1370
- if (actionCount > data.options.maxActions) {
1371
- ctx.addIssue({
1372
- code: "custom",
1373
- message: `Actor defines ${actionCount} actions, but maxActions is ${data.options.maxActions}`,
1374
- path: ["actions"],
1375
- });
1376
- }
1377
- });
1362
+ );
1378
1363
 
1379
1364
  // Creates state config
1380
1365
  //
@@ -2175,14 +2160,6 @@ export const DocActorOptionsSchema = z
2175
2160
  .describe(
2176
2161
  "Icon for the actor in the Inspector UI. Can be an emoji (e.g., '🚀') or FontAwesome icon name (e.g., 'rocket').",
2177
2162
  ),
2178
- maxActions: z
2179
- .number()
2180
- .int()
2181
- .nonnegative()
2182
- .optional()
2183
- .describe(
2184
- `Maximum number of action handlers that may be defined on this actor. Default: ${DEFAULT_MAX_ACTIONS}`,
2185
- ),
2186
2163
  enableActorRuntimeSocket: z
2187
2164
  .boolean()
2188
2165
  .optional()
@@ -45,7 +45,8 @@ export interface BridgeRivetErrorPayload extends RivetErrorLike {}
45
45
  * Shape as it arrives from the native bridge, where an absent ray ID serializes
46
46
  * to null. Normalized to a BridgeRivetErrorPayload before validation.
47
47
  */
48
- interface NativeBridgeErrorPayload extends Omit<BridgeRivetErrorPayload, "rayId"> {
48
+ interface NativeBridgeErrorPayload
49
+ extends Omit<BridgeRivetErrorPayload, "rayId"> {
49
50
  rayId?: string | null;
50
51
  }
51
52
 
@@ -4,6 +4,7 @@ import {
4
4
  HEADER_CONN_PARAMS,
5
5
  HEADER_ENCODING,
6
6
  } from "@/common/actor-router-consts";
7
+ import { isRequestLike } from "@/common/fetch-like";
7
8
  import type * as protocol from "@/common/client-protocol";
8
9
  import {
9
10
  CURRENT_VERSION as CLIENT_PROTOCOL_CURRENT_VERSION,
@@ -142,7 +143,9 @@ export class ActorHandleRaw {
142
143
  // Dynamic (get/getOrCreate) handles resolve at the gateway per
143
144
  // request so cross-datacenter queries forward to the reserved dc,
144
145
  // rather than pre-resolving via the non-forwarding PUT /actors path.
145
- let useQueryTarget = isDynamicActorQuery(this.#actorResolutionState);
146
+ let useQueryTarget = isDynamicActorQuery(
147
+ this.#actorResolutionState,
148
+ );
146
149
 
147
150
  for (let attempt = 0; attempt < maxAttempts; attempt++) {
148
151
  let actorId: string | undefined;
@@ -651,9 +654,13 @@ export class ActorHandleRaw {
651
654
  input: string | URL | Request,
652
655
  init?: ActorFetchInit,
653
656
  ) {
654
- const maxAttempts = this.#getDynamicQueryMaxAttempts();
655
- let useQueryTarget = isDynamicActorQuery(this.#actorResolutionState);
656
657
  const { skipReadyWait, ...requestInit } = init ?? {};
658
+ const hasBody =
659
+ requestInit.body !== undefined
660
+ ? requestInit.body !== null
661
+ : isRequestLike(input) && input.body !== null;
662
+ const maxAttempts = hasBody ? 1 : this.#getDynamicQueryMaxAttempts();
663
+ let useQueryTarget = isDynamicActorQuery(this.#actorResolutionState);
657
664
  const gatewayOptions = resolveActorGatewayOptions(
658
665
  this.#gatewayOptions,
659
666
  {
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  HEADER_CONN_PARAMS,
3
+ HEADER_ORIGINAL_REQUEST_URL,
3
4
  PATH_WEBSOCKET_PREFIX,
4
5
  } from "@/common/actor-router-consts";
5
6
  import { deconstructError } from "@/common/utils";
@@ -25,16 +26,19 @@ export async function rawHttpFetch(
25
26
  ): Promise<Response> {
26
27
  // Extract path and merge init options
27
28
  let path: string;
29
+ let originalUrl: string | undefined;
28
30
  let mergedInit: RequestInit = init || {};
29
31
 
30
32
  if (typeof input === "string") {
31
33
  path = input;
32
34
  } else if (isUrlLike(input)) {
33
35
  path = input.pathname + input.search;
36
+ originalUrl = input.toString();
34
37
  } else if (isRequestLike(input)) {
35
38
  // Extract path from Request URL
36
39
  const url = new URL(input.url);
37
40
  path = url.pathname + url.search;
41
+ originalUrl = url.toString();
38
42
  // Merge Request properties with init
39
43
  const requestHeaders = new Headers(input.headers);
40
44
  const initHeaders = new Headers(init?.headers || {});
@@ -86,6 +90,10 @@ export async function rawHttpFetch(
86
90
 
87
91
  // Forward conn params if provided
88
92
  const proxyRequestHeaders = new Headers(mergedInit.headers);
93
+ proxyRequestHeaders.delete(HEADER_ORIGINAL_REQUEST_URL);
94
+ if (originalUrl) {
95
+ proxyRequestHeaders.set(HEADER_ORIGINAL_REQUEST_URL, originalUrl);
96
+ }
89
97
  if (params) {
90
98
  proxyRequestHeaders.set(HEADER_CONN_PARAMS, JSON.stringify(params));
91
99
  }
@@ -12,6 +12,8 @@ export const HEADER_ENCODING = "x-rivet-encoding";
12
12
 
13
13
  // IMPORTANT: Params must be in headers or in an E2EE part of the request (i.e. NOT the URL or query string) in order to ensure that tokens can be securely passed in params.
14
14
  export const HEADER_CONN_PARAMS = "x-rivet-conn-params";
15
+ export const HEADER_ORIGINAL_REQUEST_URL =
16
+ "x-rivet-internal-original-request-url";
15
17
 
16
18
  export const HEADER_ACTOR_ID = "x-rivet-actor";
17
19
  export const HEADER_ACTOR_GENERATION = "x-rivet-actor-generation";
@@ -17,8 +17,7 @@ export async function sendHttpRequestToGateway(
17
17
  actorRequest: Request,
18
18
  options: HttpGatewayRequestOptions = {},
19
19
  ): Promise<Response> {
20
- // Handle body properly based on method and presence
21
- let bodyToSend: ArrayBuffer | null = null;
20
+ let bodyToSend: ReadableStream<Uint8Array> | null = null;
22
21
  const guardHeaders = buildGuardHeaders(runConfig, actorRequest, options);
23
22
 
24
23
  if (actorRequest.method !== "GET" && actorRequest.method !== "HEAD") {
@@ -26,35 +25,20 @@ export async function sendHttpRequestToGateway(
26
25
  throw new Error("Request body has already been consumed");
27
26
  }
28
27
 
29
- // TODO: This buffers the entire request in memory every time. We
30
- // need to properly implement streaming bodies.
31
- const reqBody = await actorRequest.arrayBuffer();
32
-
33
- if (reqBody.byteLength !== 0) {
34
- bodyToSend = reqBody;
35
-
36
- // If this is a streaming request, we need to convert the headers
37
- // for the basic array buffer.
28
+ if (actorRequest.body) {
29
+ bodyToSend = actorRequest.body;
38
30
  guardHeaders.delete("transfer-encoding");
39
31
  guardHeaders.delete("content-length");
40
32
  }
41
33
  }
42
34
 
43
- const guardRequest = new Request(gatewayUrl, {
35
+ return fetch(gatewayUrl, {
44
36
  method: actorRequest.method,
45
37
  headers: guardHeaders,
46
38
  body: bodyToSend,
47
39
  signal: actorRequest.signal,
48
- });
49
-
50
- return mutableResponse(await fetch(guardRequest));
51
- }
52
-
53
- function mutableResponse(fetchRes: Response): Response {
54
- // We cannot return the raw response from `fetch` since the response type is not mutable.
55
- //
56
- // In order for middleware to be able to mutate the response, we need to build a new Response object that is mutable.
57
- return new Response(fetchRes.body, fetchRes);
40
+ ...(bodyToSend ? { duplex: "half" } : {}),
41
+ } as RequestInit);
58
42
  }
59
43
 
60
44
  function buildGuardHeaders(
@@ -462,7 +462,7 @@ export class RemoteEngineControlClient implements EngineControlClient {
462
462
  undefined,
463
463
  "getOrCreateForKey" in target
464
464
  ? (target.getOrCreateForKey.poolName ??
465
- this.#config.poolName)
465
+ this.#config.poolName)
466
466
  : undefined,
467
467
  options,
468
468
  );
@@ -1,7 +1,12 @@
1
1
  import { z } from "zod";
2
2
  import { getRunMetadata } from "@/actor/config";
3
3
  import type { AnyActorDefinition } from "@/actor/definition";
4
- import { buildEngineEndpoint, ENGINE_HOST, ENGINE_PORT } from "@/common/engine";
4
+ import {
5
+ buildEngineEndpoint,
6
+ ENGINE_HOST,
7
+ ENGINE_PORT,
8
+ isLocalEngineEndpoint,
9
+ } from "@/common/engine";
5
10
  import { type Logger, LogLevelSchema } from "@/common/log";
6
11
  import { VERSION } from "@/utils";
7
12
  import { tryParseEndpoint } from "@/utils/endpoint-parser";
@@ -14,6 +19,7 @@ import {
14
19
  getRivetRunEngineHost,
15
20
  getRivetRunEnginePort,
16
21
  getRivetRunEngineVersion,
22
+ getRivetRunServices,
17
23
  getRivetToken,
18
24
  isDev,
19
25
  } from "@/utils/env-vars";
@@ -243,6 +249,12 @@ export const RegistryConfigSchema = z
243
249
  .string()
244
250
  .optional()
245
251
  .default(() => getRivetRunEngineVersion() ?? VERSION),
252
+ /**
253
+ * Starts the first-party Services actor host when RivetKit manages
254
+ * a local engine. Defaults to the local-engine decision. Set
255
+ * RIVET_RUN_SERVICES=0 or 1 to override it.
256
+ */
257
+ startServices: z.boolean().optional(),
246
258
  /**
247
259
  * @experimental
248
260
  *
@@ -354,6 +366,13 @@ export const RegistryConfigSchema = z
354
366
  ? localEngineEndpoint
355
367
  : (parsedEndpoint?.endpoint ??
356
368
  (isDevEnv ? localEngineEndpoint : undefined));
369
+ // Services is another local development actor host. Its default
370
+ // follows the same local-endpoint decision that causes core to manage the
371
+ // Engine, while explicit config and RIVET_RUN_SERVICES take precedence.
372
+ const startServices =
373
+ config.startServices ??
374
+ getRivetRunServices() ??
375
+ Boolean(endpoint && isLocalEngineEndpoint(endpoint));
357
376
  const validateServerlessEndpoint = Boolean(
358
377
  config.startEngine || parsedEndpoint,
359
378
  );
@@ -398,6 +417,7 @@ export const RegistryConfigSchema = z
398
417
  ...config,
399
418
  sqlite,
400
419
  endpoint,
420
+ startServices,
401
421
  namespace,
402
422
  token,
403
423
  publicEndpoint,
@@ -629,6 +649,12 @@ export const DocRegistryConfigSchema = z
629
649
  .describe(
630
650
  "Version of the local engine package to use. Defaults to the current RivetKit version.",
631
651
  ),
652
+ startServices: z
653
+ .boolean()
654
+ .optional()
655
+ .describe(
656
+ "Starts Services when RivetKit manages a local Engine. Defaults to the local-Engine decision. Set RIVET_RUN_SERVICES=0 or 1 to override.",
657
+ ),
632
658
  configurePool: DocConfigurePoolSchema.describe(
633
659
  "Automatically configure serverless runners in the engine.",
634
660
  ),