rivetkit 2.3.0-rc.13 → 2.3.0-rc.15

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 (58) hide show
  1. package/dist/browser/client.js +1 -1
  2. package/dist/browser/client.js.map +1 -1
  3. package/dist/browser/inspector/client.js +1 -1
  4. package/dist/browser/inspector/client.js.map +1 -1
  5. package/dist/tsup/agent-os/index.cjs +1 -1
  6. package/dist/tsup/agent-os/index.cjs.map +1 -1
  7. package/dist/tsup/agent-os/index.js +1 -1
  8. package/dist/tsup/agent-os/index.js.map +1 -1
  9. package/dist/tsup/{chunk-BSPS6NSN.cjs → chunk-3XH56YLI.cjs} +5 -5
  10. package/dist/tsup/{chunk-BSPS6NSN.cjs.map → chunk-3XH56YLI.cjs.map} +1 -1
  11. package/dist/tsup/{chunk-ISDKSSYR.cjs → chunk-3ZLK5QPM.cjs} +4 -4
  12. package/dist/tsup/{chunk-ISDKSSYR.cjs.map → chunk-3ZLK5QPM.cjs.map} +1 -1
  13. package/dist/tsup/{chunk-ZI5CNA2Z.js → chunk-4DU63P3H.js} +2 -2
  14. package/dist/tsup/{chunk-33YE6XCI.js → chunk-6DWQ4GIW.js} +4 -4
  15. package/dist/tsup/{chunk-KWABEUUA.cjs → chunk-FYLD6HMH.cjs} +7 -7
  16. package/dist/tsup/{chunk-KWABEUUA.cjs.map → chunk-FYLD6HMH.cjs.map} +1 -1
  17. package/dist/tsup/{chunk-E5CLYAUZ.cjs → chunk-HMYIDZL2.cjs} +141 -141
  18. package/dist/tsup/{chunk-E5CLYAUZ.cjs.map → chunk-HMYIDZL2.cjs.map} +1 -1
  19. package/dist/tsup/{chunk-EBWOJRCC.cjs → chunk-HW5L2LUK.cjs} +2 -2
  20. package/dist/tsup/{chunk-EBWOJRCC.cjs.map → chunk-HW5L2LUK.cjs.map} +1 -1
  21. package/dist/tsup/{chunk-7OR3CHD5.cjs → chunk-HYNXIWBZ.cjs} +10 -10
  22. package/dist/tsup/{chunk-7OR3CHD5.cjs.map → chunk-HYNXIWBZ.cjs.map} +1 -1
  23. package/dist/tsup/{chunk-T44AVAGW.js → chunk-MVW3IQKA.js} +2 -2
  24. package/dist/tsup/{chunk-HHNYEQD3.js → chunk-RR3TYP75.js} +3 -3
  25. package/dist/tsup/{chunk-7XQCARVY.cjs → chunk-TINIJ6FD.cjs} +3 -3
  26. package/dist/tsup/{chunk-7XQCARVY.cjs.map → chunk-TINIJ6FD.cjs.map} +1 -1
  27. package/dist/tsup/{chunk-TCXEM6PA.js → chunk-UFMCFSDS.js} +2 -2
  28. package/dist/tsup/{chunk-J72WHUBC.js → chunk-W2IEVMNI.js} +7 -7
  29. package/dist/tsup/{chunk-IOUSQVXI.js → chunk-Y2BCRVFQ.js} +2 -2
  30. package/dist/tsup/{chunk-IOUSQVXI.js.map → chunk-Y2BCRVFQ.js.map} +1 -1
  31. package/dist/tsup/client/mod.cjs +7 -7
  32. package/dist/tsup/client/mod.cjs.map +1 -1
  33. package/dist/tsup/client/mod.js +6 -6
  34. package/dist/tsup/common/log.cjs +2 -2
  35. package/dist/tsup/common/log.js +1 -1
  36. package/dist/tsup/common/websocket.cjs +3 -3
  37. package/dist/tsup/common/websocket.js +2 -2
  38. package/dist/tsup/inspector/mod.cjs +5 -5
  39. package/dist/tsup/inspector/mod.js +4 -4
  40. package/dist/tsup/mod.cjs +70 -65
  41. package/dist/tsup/mod.cjs.map +1 -1
  42. package/dist/tsup/mod.js +14 -9
  43. package/dist/tsup/mod.js.map +1 -1
  44. package/dist/tsup/test/mod.cjs +10 -10
  45. package/dist/tsup/test/mod.js +6 -6
  46. package/dist/tsup/utils.cjs +2 -2
  47. package/dist/tsup/utils.js +1 -1
  48. package/dist/tsup/workflow/mod.cjs +7 -7
  49. package/dist/tsup/workflow/mod.js +4 -4
  50. package/package.json +8 -8
  51. package/src/registry/native.ts +20 -3
  52. package/src/registry/runtime.ts +19 -3
  53. /package/dist/tsup/{chunk-ZI5CNA2Z.js.map → chunk-4DU63P3H.js.map} +0 -0
  54. /package/dist/tsup/{chunk-33YE6XCI.js.map → chunk-6DWQ4GIW.js.map} +0 -0
  55. /package/dist/tsup/{chunk-T44AVAGW.js.map → chunk-MVW3IQKA.js.map} +0 -0
  56. /package/dist/tsup/{chunk-HHNYEQD3.js.map → chunk-RR3TYP75.js.map} +0 -0
  57. /package/dist/tsup/{chunk-TCXEM6PA.js.map → chunk-UFMCFSDS.js.map} +0 -0
  58. /package/dist/tsup/{chunk-J72WHUBC.js.map → chunk-W2IEVMNI.js.map} +0 -0
@@ -1,26 +1,26 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkKWABEUUAcjs = require('../chunk-KWABEUUA.cjs');
3
+ var _chunkFYLD6HMHcjs = require('../chunk-FYLD6HMH.cjs');
4
4
 
5
5
 
6
6
 
7
- var _chunkE5CLYAUZcjs = require('../chunk-E5CLYAUZ.cjs');
7
+ var _chunkHMYIDZL2cjs = require('../chunk-HMYIDZL2.cjs');
8
8
  require('../chunk-VE2X4KMG.cjs');
9
- require('../chunk-BSPS6NSN.cjs');
10
- require('../chunk-7XQCARVY.cjs');
11
- require('../chunk-EBWOJRCC.cjs');
12
- require('../chunk-KORQB2IR.cjs');
9
+ require('../chunk-3XH56YLI.cjs');
13
10
  require('../chunk-ZA7FLHKH.cjs');
11
+ require('../chunk-TINIJ6FD.cjs');
12
+ require('../chunk-HW5L2LUK.cjs');
13
+ require('../chunk-KORQB2IR.cjs');
14
14
 
15
15
  // src/test/mod.ts
16
16
  var _pretry = require('p-retry'); var _pretry2 = _interopRequireDefault(_pretry);
17
17
  async function waitForRegistryReady(registry) {
18
- const clientConfig = _chunkE5CLYAUZcjs.convertRegistryConfigToClientConfig.call(void 0,
18
+ const clientConfig = _chunkHMYIDZL2cjs.convertRegistryConfigToClientConfig.call(void 0,
19
19
  registry.parseConfig()
20
20
  );
21
21
  await _pretry2.default.call(void 0,
22
22
  async () => {
23
- await _chunkE5CLYAUZcjs.getMetadata.call(void 0, clientConfig);
23
+ await _chunkHMYIDZL2cjs.getMetadata.call(void 0, clientConfig);
24
24
  },
25
25
  {
26
26
  retries: 20,
@@ -34,8 +34,8 @@ async function setupTest(c, registry) {
34
34
  registry.config.noWelcome = true;
35
35
  registry.start();
36
36
  await waitForRegistryReady(registry);
37
- const client = _chunkKWABEUUAcjs.createClient.call(void 0, {
38
- ..._chunkE5CLYAUZcjs.convertRegistryConfigToClientConfig.call(void 0, registry.parseConfig()),
37
+ const client = _chunkFYLD6HMHcjs.createClient.call(void 0, {
38
+ ..._chunkHMYIDZL2cjs.convertRegistryConfigToClientConfig.call(void 0, registry.parseConfig()),
39
39
  disableMetadataLookup: false
40
40
  });
41
41
  c.onTestFinished(async () => {
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  createClient
3
- } from "../chunk-HHNYEQD3.js";
3
+ } from "../chunk-RR3TYP75.js";
4
4
  import {
5
5
  convertRegistryConfigToClientConfig,
6
6
  getMetadata
7
- } from "../chunk-J72WHUBC.js";
7
+ } from "../chunk-W2IEVMNI.js";
8
8
  import "../chunk-HXUEHHJF.js";
9
- import "../chunk-ZI5CNA2Z.js";
10
- import "../chunk-T44AVAGW.js";
11
- import "../chunk-IOUSQVXI.js";
12
- import "../chunk-BRP62GZC.js";
9
+ import "../chunk-4DU63P3H.js";
13
10
  import "../chunk-JZ7TWV65.js";
11
+ import "../chunk-MVW3IQKA.js";
12
+ import "../chunk-Y2BCRVFQ.js";
13
+ import "../chunk-BRP62GZC.js";
14
14
 
15
15
  // src/test/mod.ts
16
16
  import pRetry from "p-retry";
@@ -17,7 +17,7 @@
17
17
 
18
18
 
19
19
 
20
- var _chunkEBWOJRCCcjs = require('./chunk-EBWOJRCC.cjs');
20
+ var _chunkHW5L2LUKcjs = require('./chunk-HW5L2LUK.cjs');
21
21
  require('./chunk-KORQB2IR.cjs');
22
22
 
23
23
 
@@ -38,5 +38,5 @@ require('./chunk-KORQB2IR.cjs');
38
38
 
39
39
 
40
40
 
41
- exports.EXTRA_ERROR_LOG = _chunkEBWOJRCCcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunkEBWOJRCCcjs.SinglePromiseQueue; exports.VERSION = _chunkEBWOJRCCcjs.VERSION; exports.arrayBuffersEqual = _chunkEBWOJRCCcjs.arrayBuffersEqual; exports.assertUnreachable = _chunkEBWOJRCCcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkEBWOJRCCcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkEBWOJRCCcjs.combineUrlPath; exports.dbg = _chunkEBWOJRCCcjs.dbg; exports.detectRuntime = _chunkEBWOJRCCcjs.detectRuntime; exports.getEnvUniversal = _chunkEBWOJRCCcjs.getEnvUniversal; exports.httpUserAgent = _chunkEBWOJRCCcjs.httpUserAgent; exports.interval = _chunkEBWOJRCCcjs.interval; exports.joinSignals = _chunkEBWOJRCCcjs.joinSignals; exports.promiseWithResolvers = _chunkEBWOJRCCcjs.promiseWithResolvers; exports.setLongTimeout = _chunkEBWOJRCCcjs.setLongTimeout; exports.sleep = _chunkEBWOJRCCcjs.sleep; exports.stringifyError = _chunkEBWOJRCCcjs.stringifyError; exports.toUint8Array = _chunkEBWOJRCCcjs.toUint8Array;
41
+ exports.EXTRA_ERROR_LOG = _chunkHW5L2LUKcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunkHW5L2LUKcjs.SinglePromiseQueue; exports.VERSION = _chunkHW5L2LUKcjs.VERSION; exports.arrayBuffersEqual = _chunkHW5L2LUKcjs.arrayBuffersEqual; exports.assertUnreachable = _chunkHW5L2LUKcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkHW5L2LUKcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkHW5L2LUKcjs.combineUrlPath; exports.dbg = _chunkHW5L2LUKcjs.dbg; exports.detectRuntime = _chunkHW5L2LUKcjs.detectRuntime; exports.getEnvUniversal = _chunkHW5L2LUKcjs.getEnvUniversal; exports.httpUserAgent = _chunkHW5L2LUKcjs.httpUserAgent; exports.interval = _chunkHW5L2LUKcjs.interval; exports.joinSignals = _chunkHW5L2LUKcjs.joinSignals; exports.promiseWithResolvers = _chunkHW5L2LUKcjs.promiseWithResolvers; exports.setLongTimeout = _chunkHW5L2LUKcjs.setLongTimeout; exports.sleep = _chunkHW5L2LUKcjs.sleep; exports.stringifyError = _chunkHW5L2LUKcjs.stringifyError; exports.toUint8Array = _chunkHW5L2LUKcjs.toUint8Array;
42
42
  //# sourceMappingURL=utils.cjs.map
@@ -17,7 +17,7 @@ import {
17
17
  sleep,
18
18
  stringifyError,
19
19
  toUint8Array
20
- } from "./chunk-IOUSQVXI.js";
20
+ } from "./chunk-Y2BCRVFQ.js";
21
21
  import "./chunk-BRP62GZC.js";
22
22
  export {
23
23
  EXTRA_ERROR_LOG,
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class; var _class2;
2
2
 
3
- var _chunk7OR3CHD5cjs = require('../chunk-7OR3CHD5.cjs');
4
- require('../chunk-ISDKSSYR.cjs');
3
+ var _chunkHYNXIWBZcjs = require('../chunk-HYNXIWBZ.cjs');
4
+ require('../chunk-3ZLK5QPM.cjs');
5
5
 
6
6
 
7
7
 
@@ -11,10 +11,10 @@ var _chunkNIY3RSPXcjs = require('../chunk-NIY3RSPX.cjs');
11
11
 
12
12
 
13
13
  var _chunkVE2X4KMGcjs = require('../chunk-VE2X4KMG.cjs');
14
- require('../chunk-BSPS6NSN.cjs');
14
+ require('../chunk-3XH56YLI.cjs');
15
15
 
16
16
 
17
- var _chunkEBWOJRCCcjs = require('../chunk-EBWOJRCC.cjs');
17
+ var _chunkHW5L2LUKcjs = require('../chunk-HW5L2LUK.cjs');
18
18
 
19
19
 
20
20
  var _chunkKORQB2IRcjs = require('../chunk-KORQB2IR.cjs');
@@ -639,7 +639,7 @@ function workflow(fn, options = {}) {
639
639
  function getWorkflowInspector(actorId) {
640
640
  let workflowInspector = workflowInspectors.get(actorId);
641
641
  if (!workflowInspector) {
642
- workflowInspector = _chunk7OR3CHD5cjs.createWorkflowInspectorAdapter.call(void 0, );
642
+ workflowInspector = _chunkHYNXIWBZcjs.createWorkflowInspectorAdapter.call(void 0, );
643
643
  workflowInspectors.set(actorId, workflowInspector);
644
644
  }
645
645
  return workflowInspector;
@@ -705,13 +705,13 @@ function workflow(fn, options = {}) {
705
705
  if (shouldRethrowWorkflowError(error)) {
706
706
  runCtx.log.error({
707
707
  msg: "workflow run failed",
708
- error: _chunkEBWOJRCCcjs.stringifyError.call(void 0, error)
708
+ error: _chunkHW5L2LUKcjs.stringifyError.call(void 0, error)
709
709
  });
710
710
  throw error;
711
711
  }
712
712
  runCtx.log.warn({
713
713
  msg: "workflow failed and will sleep until woken",
714
- error: _chunkEBWOJRCCcjs.stringifyError.call(void 0, error)
714
+ error: _chunkHW5L2LUKcjs.stringifyError.call(void 0, error)
715
715
  });
716
716
  } finally {
717
717
  runCtx.abortSignal.removeEventListener("abort", onAbort);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createWorkflowInspectorAdapter
3
- } from "../chunk-33YE6XCI.js";
4
- import "../chunk-TCXEM6PA.js";
3
+ } from "../chunk-6DWQ4GIW.js";
4
+ import "../chunk-UFMCFSDS.js";
5
5
  import {
6
6
  ACTOR_CONTEXT_INTERNAL_SYMBOL,
7
7
  RAW_STATE_SYMBOL,
@@ -11,10 +11,10 @@ import {
11
11
  makeWorkflowKey,
12
12
  workflowStoragePrefix
13
13
  } from "../chunk-HXUEHHJF.js";
14
- import "../chunk-ZI5CNA2Z.js";
14
+ import "../chunk-4DU63P3H.js";
15
15
  import {
16
16
  stringifyError
17
- } from "../chunk-IOUSQVXI.js";
17
+ } from "../chunk-Y2BCRVFQ.js";
18
18
  import {
19
19
  RivetError
20
20
  } from "../chunk-BRP62GZC.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rivetkit",
3
- "version": "2.3.0-rc.13",
3
+ "version": "2.3.0-rc.15",
4
4
  "description": "Lightweight libraries for building stateful actors on edge platforms",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -193,14 +193,14 @@
193
193
  "@hono/zod-openapi": "^1.1.5",
194
194
  "@rivet-dev/agent-os-core": "^0.1.1",
195
195
  "@rivetkit/bare-ts": "^0.6.2",
196
- "@rivetkit/engine-cli": "2.3.0-rc.13",
197
- "@rivetkit/engine-envoy-protocol": "2.3.0-rc.13",
196
+ "@rivetkit/engine-cli": "2.3.0-rc.15",
197
+ "@rivetkit/engine-envoy-protocol": "2.3.0-rc.15",
198
198
  "@rivetkit/on-change": "6.0.1",
199
- "@rivetkit/rivetkit-napi": "2.3.0-rc.13",
200
- "@rivetkit/rivetkit-wasm": "2.3.0-rc.13",
201
- "@rivetkit/traces": "2.3.0-rc.13",
202
- "@rivetkit/virtual-websocket": "2.3.0-rc.13",
203
- "@rivetkit/workflow-engine": "2.3.0-rc.13",
199
+ "@rivetkit/rivetkit-napi": "2.3.0-rc.15",
200
+ "@rivetkit/rivetkit-wasm": "2.3.0-rc.15",
201
+ "@rivetkit/traces": "2.3.0-rc.15",
202
+ "@rivetkit/virtual-websocket": "2.3.0-rc.15",
203
+ "@rivetkit/workflow-engine": "2.3.0-rc.15",
204
204
  "cbor-x": "^1.6.0",
205
205
  "drizzle-orm": "^0.44.2",
206
206
  "get-port": "^7.1.0",
@@ -4756,12 +4756,29 @@ export async function buildServeConfig(
4756
4756
  serverlessMaxStartPayloadBytes: config.serverless.maxStartPayloadBytes,
4757
4757
  };
4758
4758
 
4759
- if (config.startEngine) {
4759
+ // Always best-effort resolve the npm-installed engine binary and hand its
4760
+ // path to the core. The core alone decides whether to actually spawn a local
4761
+ // engine (its `should_manage_engine`, based on the endpoint + spawn mode), so
4762
+ // JS must not duplicate that decision here. Only JS knows the npm
4763
+ // `node_modules` layout, so it resolves the path; if no binary is available
4764
+ // (remote-only install, unsupported platform, optional deps skipped), leave
4765
+ // it unset and let the core report `engine.binary_unavailable` if it actually
4766
+ // needs one.
4767
+ try {
4760
4768
  const { getEnginePath } = await loadEngineCli();
4761
4769
  serveConfig.engineBinaryPath = getEnginePath();
4762
- serveConfig.engineHost = config.engineHost;
4763
- serveConfig.enginePort = config.enginePort;
4770
+ } catch (error) {
4771
+ // The npm-installed engine binary could not be resolved. The core still
4772
+ // decides whether it needs to spawn a local engine; if it does, it will
4773
+ // fail with engine.binary_unavailable (auto-download is off in the napi
4774
+ // runtime). Warn so the cause is actionable.
4775
+ logger().warn({
4776
+ msg: "could not resolve a local engine binary; if a local engine must be spawned it will fail with engine.binary_unavailable — set RIVET_ENGINE_BINARY_PATH or install the @rivetkit/engine-cli platform package",
4777
+ error: stringifyError(error),
4778
+ });
4764
4779
  }
4780
+ serveConfig.engineHost = config.engineHost;
4781
+ serveConfig.enginePort = config.enginePort;
4765
4782
  if (config.test?.enabled) {
4766
4783
  serveConfig.inspectorTestToken =
4767
4784
  getEnvUniversal("_RIVET_TEST_INSPECTOR_TOKEN") ?? "token";
@@ -1,5 +1,7 @@
1
+ import { stringifyError } from "@/common/utils";
1
2
  import type { SqliteNativeMetrics } from "@/common/database/config";
2
3
  import type { RegistryConfig } from "./config";
4
+ import { logger } from "./log";
3
5
 
4
6
  declare const handleBrand: unique symbol;
5
7
 
@@ -599,11 +601,25 @@ export async function buildServeConfig(
599
601
  serverlessMaxStartPayloadBytes: config.serverless.maxStartPayloadBytes,
600
602
  };
601
603
 
602
- if (config.startEngine) {
604
+ // Always best-effort resolve the engine binary path and hand it to the core.
605
+ // The core alone decides whether to actually spawn a local engine, so JS must
606
+ // not duplicate that decision here. `loadEnginePath` throws when no binary is
607
+ // available (remote-only install, unsupported platform, optional deps
608
+ // skipped); in that case leave it unset and let the core report
609
+ // `engine.binary_unavailable` only if it actually needs one.
610
+ try {
603
611
  serveConfig.engineBinaryPath = await loadEnginePath();
604
- serveConfig.engineHost = config.engineHost;
605
- serveConfig.enginePort = config.enginePort;
612
+ } catch (error) {
613
+ // The engine binary could not be resolved. The core still decides whether
614
+ // it needs to spawn a local engine; if it does, it will fail with
615
+ // engine.binary_unavailable (auto-download is off in the napi runtime).
616
+ logger().warn({
617
+ msg: "could not resolve a local engine binary; if a local engine must be spawned it will fail with engine.binary_unavailable — set RIVET_ENGINE_BINARY_PATH or install the @rivetkit/engine-cli platform package",
618
+ error: stringifyError(error),
619
+ });
606
620
  }
621
+ serveConfig.engineHost = config.engineHost;
622
+ serveConfig.enginePort = config.enginePort;
607
623
  if (config.test?.enabled) {
608
624
  serveConfig.inspectorTestToken =
609
625
  process.env._RIVET_TEST_INSPECTOR_TOKEN ?? "token";