rivetkit 2.0.18 → 2.0.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 (90) hide show
  1. package/dist/tsup/{chunk-O7NI7QQW.cjs → chunk-2I6L3VRO.cjs} +14 -14
  2. package/dist/tsup/{chunk-O7NI7QQW.cjs.map → chunk-2I6L3VRO.cjs.map} +1 -1
  3. package/dist/tsup/{chunk-BGBEE6N2.cjs → chunk-2S7HJMMY.cjs} +240 -193
  4. package/dist/tsup/chunk-2S7HJMMY.cjs.map +1 -0
  5. package/dist/tsup/{chunk-JMSXK5ZO.js → chunk-5F6X4AFU.js} +6 -6
  6. package/dist/tsup/{chunk-2MUSMEMN.js → chunk-7ACKZS3T.js} +6 -5
  7. package/dist/tsup/chunk-7ACKZS3T.js.map +1 -0
  8. package/dist/tsup/{chunk-OPB45MKH.cjs → chunk-DUOTOMP7.cjs} +3 -3
  9. package/dist/tsup/{chunk-OPB45MKH.cjs.map → chunk-DUOTOMP7.cjs.map} +1 -1
  10. package/dist/tsup/{chunk-6JGEHV56.js → chunk-ER5OT3SQ.js} +2 -2
  11. package/dist/tsup/{chunk-4R5LOYEU.cjs → chunk-FYP3TZXD.cjs} +28 -27
  12. package/dist/tsup/chunk-FYP3TZXD.cjs.map +1 -0
  13. package/dist/tsup/{chunk-RFCYH6EC.cjs → chunk-G6JGHCG4.cjs} +6 -6
  14. package/dist/tsup/{chunk-RFCYH6EC.cjs.map → chunk-G6JGHCG4.cjs.map} +1 -1
  15. package/dist/tsup/{chunk-DZEQUURK.js → chunk-GQ5WTE64.js} +18 -10
  16. package/dist/tsup/chunk-GQ5WTE64.js.map +1 -0
  17. package/dist/tsup/{chunk-IXPZJCBE.cjs → chunk-JZD6FEOE.cjs} +219 -211
  18. package/dist/tsup/chunk-JZD6FEOE.cjs.map +1 -0
  19. package/dist/tsup/{chunk-F5VXILGA.cjs → chunk-KKRR7DSG.cjs} +8 -4
  20. package/dist/tsup/chunk-KKRR7DSG.cjs.map +1 -0
  21. package/dist/tsup/{chunk-FADDMRZP.cjs → chunk-KUZWEM23.cjs} +2 -2
  22. package/dist/tsup/{chunk-FADDMRZP.cjs.map → chunk-KUZWEM23.cjs.map} +1 -1
  23. package/dist/tsup/{chunk-S5K7CB2F.js → chunk-L3YPHXPE.js} +76 -29
  24. package/dist/tsup/{chunk-S5K7CB2F.js.map → chunk-L3YPHXPE.js.map} +1 -1
  25. package/dist/tsup/{chunk-IXPWBGXK.js → chunk-M6LIJ6BK.js} +3 -3
  26. package/dist/tsup/{chunk-2P4ENWQ6.js → chunk-MGHPBNWB.js} +7 -3
  27. package/dist/tsup/chunk-MGHPBNWB.js.map +1 -0
  28. package/dist/tsup/{chunk-SBBFWYNM.cjs → chunk-PV22ZBDE.cjs} +8 -8
  29. package/dist/tsup/{chunk-SBBFWYNM.cjs.map → chunk-PV22ZBDE.cjs.map} +1 -1
  30. package/dist/tsup/{chunk-42UD33X4.js → chunk-QMVCFQ37.js} +2 -2
  31. package/dist/tsup/{chunk-42UD33X4.js.map → chunk-QMVCFQ37.js.map} +1 -1
  32. package/dist/tsup/{chunk-YVK2XQNR.js → chunk-QRUGCDA5.js} +2 -2
  33. package/dist/tsup/{chunk-KPFRD7KN.js → chunk-RI4YHZZW.js} +2 -2
  34. package/dist/tsup/{chunk-QMF6X2E2.cjs → chunk-RJVSNJO7.cjs} +7 -7
  35. package/dist/tsup/{chunk-QMF6X2E2.cjs.map → chunk-RJVSNJO7.cjs.map} +1 -1
  36. package/dist/tsup/{chunk-AR5ZY563.js → chunk-YFFCPYHY.js} +3 -3
  37. package/dist/tsup/{chunk-ICPFPGOJ.cjs → chunk-ZODINJWN.cjs} +12 -12
  38. package/dist/tsup/{chunk-ICPFPGOJ.cjs.map → chunk-ZODINJWN.cjs.map} +1 -1
  39. package/dist/tsup/client/mod.cjs +9 -9
  40. package/dist/tsup/client/mod.d.cts +2 -2
  41. package/dist/tsup/client/mod.d.ts +2 -2
  42. package/dist/tsup/client/mod.js +8 -8
  43. package/dist/tsup/common/log.cjs +3 -3
  44. package/dist/tsup/common/log.js +2 -2
  45. package/dist/tsup/common/websocket.cjs +4 -4
  46. package/dist/tsup/common/websocket.js +3 -3
  47. package/dist/tsup/{conn-DhdZYlSX.d.ts → conn-CmPcqOCF.d.ts} +72 -67
  48. package/dist/tsup/{conn-CxCsTz2s.d.cts → conn-DU5EbfCu.d.cts} +72 -67
  49. package/dist/tsup/driver-helpers/mod.cjs +5 -5
  50. package/dist/tsup/driver-helpers/mod.d.cts +1 -1
  51. package/dist/tsup/driver-helpers/mod.d.ts +1 -1
  52. package/dist/tsup/driver-helpers/mod.js +4 -4
  53. package/dist/tsup/driver-test-suite/mod.cjs +71 -71
  54. package/dist/tsup/driver-test-suite/mod.d.cts +1 -1
  55. package/dist/tsup/driver-test-suite/mod.d.ts +1 -1
  56. package/dist/tsup/driver-test-suite/mod.js +11 -11
  57. package/dist/tsup/inspector/mod.cjs +6 -6
  58. package/dist/tsup/inspector/mod.d.cts +2 -2
  59. package/dist/tsup/inspector/mod.d.ts +2 -2
  60. package/dist/tsup/inspector/mod.js +5 -5
  61. package/dist/tsup/mod.cjs +10 -10
  62. package/dist/tsup/mod.d.cts +2 -2
  63. package/dist/tsup/mod.d.ts +2 -2
  64. package/dist/tsup/mod.js +9 -9
  65. package/dist/tsup/test/mod.cjs +11 -11
  66. package/dist/tsup/test/mod.d.cts +1 -1
  67. package/dist/tsup/test/mod.d.ts +1 -1
  68. package/dist/tsup/test/mod.js +10 -10
  69. package/dist/tsup/utils.cjs +2 -2
  70. package/dist/tsup/utils.js +1 -1
  71. package/package.json +1 -1
  72. package/src/common/eventsource.ts +7 -43
  73. package/src/common/websocket.ts +2 -1
  74. package/src/engine-process/mod.ts +66 -15
  75. package/src/registry/mod.ts +26 -2
  76. package/src/registry/run-config.ts +1 -0
  77. package/src/remote-manager-driver/mod.ts +12 -3
  78. package/dist/tsup/chunk-2MUSMEMN.js.map +0 -1
  79. package/dist/tsup/chunk-2P4ENWQ6.js.map +0 -1
  80. package/dist/tsup/chunk-4R5LOYEU.cjs.map +0 -1
  81. package/dist/tsup/chunk-BGBEE6N2.cjs.map +0 -1
  82. package/dist/tsup/chunk-DZEQUURK.js.map +0 -1
  83. package/dist/tsup/chunk-F5VXILGA.cjs.map +0 -1
  84. package/dist/tsup/chunk-IXPZJCBE.cjs.map +0 -1
  85. /package/dist/tsup/{chunk-JMSXK5ZO.js.map → chunk-5F6X4AFU.js.map} +0 -0
  86. /package/dist/tsup/{chunk-6JGEHV56.js.map → chunk-ER5OT3SQ.js.map} +0 -0
  87. /package/dist/tsup/{chunk-IXPWBGXK.js.map → chunk-M6LIJ6BK.js.map} +0 -0
  88. /package/dist/tsup/{chunk-YVK2XQNR.js.map → chunk-QRUGCDA5.js.map} +0 -0
  89. /package/dist/tsup/{chunk-KPFRD7KN.js.map → chunk-RI4YHZZW.js.map} +0 -0
  90. /package/dist/tsup/{chunk-AR5ZY563.js.map → chunk-YFFCPYHY.js.map} +0 -0
package/dist/tsup/mod.cjs CHANGED
@@ -10,27 +10,27 @@
10
10
 
11
11
 
12
12
 
13
- var _chunkBGBEE6N2cjs = require('./chunk-BGBEE6N2.cjs');
14
- require('./chunk-OPB45MKH.cjs');
13
+ var _chunk2S7HJMMYcjs = require('./chunk-2S7HJMMY.cjs');
14
+ require('./chunk-DUOTOMP7.cjs');
15
15
 
16
16
 
17
17
 
18
18
 
19
19
 
20
- var _chunkIXPZJCBEcjs = require('./chunk-IXPZJCBE.cjs');
21
- require('./chunk-ICPFPGOJ.cjs');
22
- require('./chunk-F5VXILGA.cjs');
23
- require('./chunk-4R5LOYEU.cjs');
20
+ var _chunkJZD6FEOEcjs = require('./chunk-JZD6FEOE.cjs');
21
+ require('./chunk-ZODINJWN.cjs');
22
+ require('./chunk-KKRR7DSG.cjs');
23
+ require('./chunk-FYP3TZXD.cjs');
24
24
 
25
25
 
26
26
 
27
27
 
28
- var _chunkSBBFWYNMcjs = require('./chunk-SBBFWYNM.cjs');
29
- require('./chunk-QMF6X2E2.cjs');
28
+ var _chunkPV22ZBDEcjs = require('./chunk-PV22ZBDE.cjs');
29
+ require('./chunk-RJVSNJO7.cjs');
30
30
 
31
31
 
32
32
 
33
- var _chunkFADDMRZPcjs = require('./chunk-FADDMRZP.cjs');
33
+ var _chunkKUZWEM23cjs = require('./chunk-KUZWEM23.cjs');
34
34
 
35
35
 
36
36
  var _chunkKSRXX3Z4cjs = require('./chunk-KSRXX3Z4.cjs');
@@ -56,5 +56,5 @@ var _chunkKSRXX3Z4cjs = require('./chunk-KSRXX3Z4.cjs');
56
56
 
57
57
 
58
58
 
59
- exports.ALLOWED_PUBLIC_HEADERS = _chunkSBBFWYNMcjs.ALLOWED_PUBLIC_HEADERS; exports.InlineWebSocketAdapter2 = _chunkBGBEE6N2cjs.InlineWebSocketAdapter2; exports.PATH_CONNECT_WEBSOCKET = _chunkSBBFWYNMcjs.PATH_CONNECT_WEBSOCKET; exports.PATH_RAW_WEBSOCKET_PREFIX = _chunkSBBFWYNMcjs.PATH_RAW_WEBSOCKET_PREFIX; exports.Registry = _chunkBGBEE6N2cjs.Registry; exports.RegistryConfigSchema = _chunkBGBEE6N2cjs.RegistryConfigSchema; exports.UserError = _chunkKSRXX3Z4cjs.UserError; exports.actor = _chunkBGBEE6N2cjs.actor; exports.createActorRouter = _chunkBGBEE6N2cjs.createActorRouter; exports.createClientWithDriver = _chunkIXPZJCBEcjs.createClientWithDriver; exports.createEngineDriver = _chunkBGBEE6N2cjs.createEngineDriver; exports.createFileSystemDriver = _chunkBGBEE6N2cjs.createFileSystemDriver; exports.createMemoryDriver = _chunkBGBEE6N2cjs.createMemoryDriver; exports.generateConnId = _chunkIXPZJCBEcjs.generateConnId; exports.generateConnToken = _chunkIXPZJCBEcjs.generateConnToken; exports.handleRawWebSocketHandler = _chunkBGBEE6N2cjs.handleRawWebSocketHandler; exports.handleWebSocketConnect = _chunkBGBEE6N2cjs.handleWebSocketConnect; exports.lookupInRegistry = _chunkIXPZJCBEcjs.lookupInRegistry; exports.noopNext = _chunkFADDMRZPcjs.noopNext; exports.setup = _chunkBGBEE6N2cjs.setup; exports.toUint8Array = _chunkFADDMRZPcjs.toUint8Array;
59
+ exports.ALLOWED_PUBLIC_HEADERS = _chunkPV22ZBDEcjs.ALLOWED_PUBLIC_HEADERS; exports.InlineWebSocketAdapter2 = _chunk2S7HJMMYcjs.InlineWebSocketAdapter2; exports.PATH_CONNECT_WEBSOCKET = _chunkPV22ZBDEcjs.PATH_CONNECT_WEBSOCKET; exports.PATH_RAW_WEBSOCKET_PREFIX = _chunkPV22ZBDEcjs.PATH_RAW_WEBSOCKET_PREFIX; exports.Registry = _chunk2S7HJMMYcjs.Registry; exports.RegistryConfigSchema = _chunk2S7HJMMYcjs.RegistryConfigSchema; exports.UserError = _chunkKSRXX3Z4cjs.UserError; exports.actor = _chunk2S7HJMMYcjs.actor; exports.createActorRouter = _chunk2S7HJMMYcjs.createActorRouter; exports.createClientWithDriver = _chunkJZD6FEOEcjs.createClientWithDriver; exports.createEngineDriver = _chunk2S7HJMMYcjs.createEngineDriver; exports.createFileSystemDriver = _chunk2S7HJMMYcjs.createFileSystemDriver; exports.createMemoryDriver = _chunk2S7HJMMYcjs.createMemoryDriver; exports.generateConnId = _chunkJZD6FEOEcjs.generateConnId; exports.generateConnToken = _chunkJZD6FEOEcjs.generateConnToken; exports.handleRawWebSocketHandler = _chunk2S7HJMMYcjs.handleRawWebSocketHandler; exports.handleWebSocketConnect = _chunk2S7HJMMYcjs.handleWebSocketConnect; exports.lookupInRegistry = _chunkJZD6FEOEcjs.lookupInRegistry; exports.noopNext = _chunkKUZWEM23cjs.noopNext; exports.setup = _chunk2S7HJMMYcjs.setup; exports.toUint8Array = _chunkKUZWEM23cjs.toUint8Array;
60
60
  //# sourceMappingURL=mod.cjs.map
@@ -1,5 +1,5 @@
1
- import { U as UniversalWebSocket, R as RivetEvent, a as RivetCloseEvent, b as RivetMessageEvent, A as ActorDriver, c as RunnerConfig, E as Encoding, d as AnyDatabaseProvider, e as Actions, f as ActorConfigInput, g as ActorDefinition, D as DriverConfig } from './conn-CxCsTz2s.cjs';
2
- export { n as ActionContext, r as ActionContextOf, z as ActorConfig, x as ActorConfigSchema, q as ActorContext, s as ActorContextOf, m as ActorKey, l as ActorQuery, w as ActorTypes, t as AnyActorDefinition, v as AnyActorInstance, j as AnyClient, y as AuthIntent, C as Client, o as Conn, p as ConnectionStatus, I as InitContext, O as OnConnectOptions, K as Registry, G as RegistryActors, F as RegistryConfig, J as RegistryConfigSchema, H as RunConfigInput, S as ServerlessActorDriverBuilder, k as createClientWithDriver, h as generateConnId, i as generateConnToken, u as lookupInRegistry, L as setup, B as test } from './conn-CxCsTz2s.cjs';
1
+ import { U as UniversalWebSocket, R as RivetEvent, a as RivetCloseEvent, b as RivetMessageEvent, A as ActorDriver, c as RunnerConfig, E as Encoding, d as AnyDatabaseProvider, e as Actions, f as ActorConfigInput, g as ActorDefinition, D as DriverConfig } from './conn-DU5EbfCu.cjs';
2
+ export { n as ActionContext, r as ActionContextOf, z as ActorConfig, x as ActorConfigSchema, q as ActorContext, s as ActorContextOf, m as ActorKey, l as ActorQuery, w as ActorTypes, t as AnyActorDefinition, v as AnyActorInstance, j as AnyClient, y as AuthIntent, C as Client, o as Conn, p as ConnectionStatus, I as InitContext, O as OnConnectOptions, K as Registry, G as RegistryActors, F as RegistryConfig, J as RegistryConfigSchema, H as RunConfigInput, S as ServerlessActorDriverBuilder, k as createClientWithDriver, h as generateConnId, i as generateConnToken, u as lookupInRegistry, L as setup, B as test } from './conn-DU5EbfCu.cjs';
3
3
  import { WSContext } from 'hono/ws';
4
4
  export { n as noopNext } from './utils-fwx3o3K9.cjs';
5
5
  export { toUint8Array } from './utils.cjs';
@@ -1,5 +1,5 @@
1
- import { U as UniversalWebSocket, R as RivetEvent, a as RivetCloseEvent, b as RivetMessageEvent, A as ActorDriver, c as RunnerConfig, E as Encoding, d as AnyDatabaseProvider, e as Actions, f as ActorConfigInput, g as ActorDefinition, D as DriverConfig } from './conn-DhdZYlSX.js';
2
- export { n as ActionContext, r as ActionContextOf, z as ActorConfig, x as ActorConfigSchema, q as ActorContext, s as ActorContextOf, m as ActorKey, l as ActorQuery, w as ActorTypes, t as AnyActorDefinition, v as AnyActorInstance, j as AnyClient, y as AuthIntent, C as Client, o as Conn, p as ConnectionStatus, I as InitContext, O as OnConnectOptions, K as Registry, G as RegistryActors, F as RegistryConfig, J as RegistryConfigSchema, H as RunConfigInput, S as ServerlessActorDriverBuilder, k as createClientWithDriver, h as generateConnId, i as generateConnToken, u as lookupInRegistry, L as setup, B as test } from './conn-DhdZYlSX.js';
1
+ import { U as UniversalWebSocket, R as RivetEvent, a as RivetCloseEvent, b as RivetMessageEvent, A as ActorDriver, c as RunnerConfig, E as Encoding, d as AnyDatabaseProvider, e as Actions, f as ActorConfigInput, g as ActorDefinition, D as DriverConfig } from './conn-CmPcqOCF.js';
2
+ export { n as ActionContext, r as ActionContextOf, z as ActorConfig, x as ActorConfigSchema, q as ActorContext, s as ActorContextOf, m as ActorKey, l as ActorQuery, w as ActorTypes, t as AnyActorDefinition, v as AnyActorInstance, j as AnyClient, y as AuthIntent, C as Client, o as Conn, p as ConnectionStatus, I as InitContext, O as OnConnectOptions, K as Registry, G as RegistryActors, F as RegistryConfig, J as RegistryConfigSchema, H as RunConfigInput, S as ServerlessActorDriverBuilder, k as createClientWithDriver, h as generateConnId, i as generateConnToken, u as lookupInRegistry, L as setup, B as test } from './conn-CmPcqOCF.js';
3
3
  import { WSContext } from 'hono/ws';
4
4
  export { n as noopNext } from './utils-fwx3o3K9.js';
5
5
  export { toUint8Array } from './utils.js';
package/dist/tsup/mod.js CHANGED
@@ -10,27 +10,27 @@ import {
10
10
  handleRawWebSocketHandler,
11
11
  handleWebSocketConnect,
12
12
  setup
13
- } from "./chunk-S5K7CB2F.js";
14
- import "./chunk-KPFRD7KN.js";
13
+ } from "./chunk-L3YPHXPE.js";
14
+ import "./chunk-RI4YHZZW.js";
15
15
  import {
16
16
  createClientWithDriver,
17
17
  generateConnId,
18
18
  generateConnToken,
19
19
  lookupInRegistry
20
- } from "./chunk-DZEQUURK.js";
21
- import "./chunk-YVK2XQNR.js";
22
- import "./chunk-2P4ENWQ6.js";
23
- import "./chunk-2MUSMEMN.js";
20
+ } from "./chunk-GQ5WTE64.js";
21
+ import "./chunk-QRUGCDA5.js";
22
+ import "./chunk-MGHPBNWB.js";
23
+ import "./chunk-7ACKZS3T.js";
24
24
  import {
25
25
  ALLOWED_PUBLIC_HEADERS,
26
26
  PATH_CONNECT_WEBSOCKET,
27
27
  PATH_RAW_WEBSOCKET_PREFIX
28
- } from "./chunk-AR5ZY563.js";
29
- import "./chunk-6JGEHV56.js";
28
+ } from "./chunk-YFFCPYHY.js";
29
+ import "./chunk-ER5OT3SQ.js";
30
30
  import {
31
31
  noopNext,
32
32
  toUint8Array
33
- } from "./chunk-42UD33X4.js";
33
+ } from "./chunk-QMVCFQ37.js";
34
34
  import {
35
35
  UserError
36
36
  } from "./chunk-G64QUEDJ.js";
@@ -1,19 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkO7NI7QQWcjs = require('../chunk-O7NI7QQW.cjs');
5
- require('../chunk-BGBEE6N2.cjs');
6
- require('../chunk-OPB45MKH.cjs');
7
- require('../chunk-IXPZJCBE.cjs');
8
- require('../chunk-ICPFPGOJ.cjs');
9
- require('../chunk-F5VXILGA.cjs');
10
- require('../chunk-4R5LOYEU.cjs');
11
- require('../chunk-SBBFWYNM.cjs');
12
- require('../chunk-QMF6X2E2.cjs');
13
- require('../chunk-FADDMRZP.cjs');
4
+ var _chunk2I6L3VROcjs = require('../chunk-2I6L3VRO.cjs');
5
+ require('../chunk-2S7HJMMY.cjs');
6
+ require('../chunk-DUOTOMP7.cjs');
7
+ require('../chunk-JZD6FEOE.cjs');
8
+ require('../chunk-ZODINJWN.cjs');
9
+ require('../chunk-KKRR7DSG.cjs');
10
+ require('../chunk-FYP3TZXD.cjs');
11
+ require('../chunk-PV22ZBDE.cjs');
12
+ require('../chunk-RJVSNJO7.cjs');
13
+ require('../chunk-KUZWEM23.cjs');
14
14
  require('../chunk-KSRXX3Z4.cjs');
15
15
 
16
16
 
17
17
 
18
- exports.getPort = _chunkO7NI7QQWcjs.getPort; exports.setupTest = _chunkO7NI7QQWcjs.setupTest;
18
+ exports.getPort = _chunk2I6L3VROcjs.getPort; exports.setupTest = _chunk2I6L3VROcjs.setupTest;
19
19
  //# sourceMappingURL=mod.cjs.map
@@ -1,5 +1,5 @@
1
1
  import { TestContext } from 'vitest';
2
- import { K as Registry, C as Client } from '../conn-CxCsTz2s.cjs';
2
+ import { K as Registry, C as Client } from '../conn-DU5EbfCu.cjs';
3
3
  import 'hono/streaming';
4
4
  import 'hono/ws';
5
5
  import '../utils.cjs';
@@ -1,5 +1,5 @@
1
1
  import { TestContext } from 'vitest';
2
- import { K as Registry, C as Client } from '../conn-DhdZYlSX.js';
2
+ import { K as Registry, C as Client } from '../conn-CmPcqOCF.js';
3
3
  import 'hono/streaming';
4
4
  import 'hono/ws';
5
5
  import '../utils.js';
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  getPort,
3
3
  setupTest
4
- } from "../chunk-JMSXK5ZO.js";
5
- import "../chunk-S5K7CB2F.js";
6
- import "../chunk-KPFRD7KN.js";
7
- import "../chunk-DZEQUURK.js";
8
- import "../chunk-YVK2XQNR.js";
9
- import "../chunk-2P4ENWQ6.js";
10
- import "../chunk-2MUSMEMN.js";
11
- import "../chunk-AR5ZY563.js";
12
- import "../chunk-6JGEHV56.js";
13
- import "../chunk-42UD33X4.js";
4
+ } from "../chunk-5F6X4AFU.js";
5
+ import "../chunk-L3YPHXPE.js";
6
+ import "../chunk-RI4YHZZW.js";
7
+ import "../chunk-GQ5WTE64.js";
8
+ import "../chunk-QRUGCDA5.js";
9
+ import "../chunk-MGHPBNWB.js";
10
+ import "../chunk-7ACKZS3T.js";
11
+ import "../chunk-YFFCPYHY.js";
12
+ import "../chunk-ER5OT3SQ.js";
13
+ import "../chunk-QMVCFQ37.js";
14
14
  import "../chunk-G64QUEDJ.js";
15
15
  export {
16
16
  getPort,
@@ -11,7 +11,7 @@
11
11
 
12
12
 
13
13
 
14
- var _chunkFADDMRZPcjs = require('./chunk-FADDMRZP.cjs');
14
+ var _chunkKUZWEM23cjs = require('./chunk-KUZWEM23.cjs');
15
15
  require('./chunk-KSRXX3Z4.cjs');
16
16
 
17
17
 
@@ -26,5 +26,5 @@ require('./chunk-KSRXX3Z4.cjs');
26
26
 
27
27
 
28
28
 
29
- exports.SinglePromiseQueue = _chunkFADDMRZPcjs.SinglePromiseQueue; exports.VERSION = _chunkFADDMRZPcjs.VERSION; exports.assertUnreachable = _chunkFADDMRZPcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkFADDMRZPcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkFADDMRZPcjs.combineUrlPath; exports.dbg = _chunkFADDMRZPcjs.dbg; exports.getEnvUniversal = _chunkFADDMRZPcjs.getEnvUniversal; exports.httpUserAgent = _chunkFADDMRZPcjs.httpUserAgent; exports.promiseWithResolvers = _chunkFADDMRZPcjs.promiseWithResolvers; exports.setLongTimeout = _chunkFADDMRZPcjs.setLongTimeout; exports.stringifyError = _chunkFADDMRZPcjs.stringifyError; exports.toUint8Array = _chunkFADDMRZPcjs.toUint8Array;
29
+ exports.SinglePromiseQueue = _chunkKUZWEM23cjs.SinglePromiseQueue; exports.VERSION = _chunkKUZWEM23cjs.VERSION; exports.assertUnreachable = _chunkKUZWEM23cjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkKUZWEM23cjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkKUZWEM23cjs.combineUrlPath; exports.dbg = _chunkKUZWEM23cjs.dbg; exports.getEnvUniversal = _chunkKUZWEM23cjs.getEnvUniversal; exports.httpUserAgent = _chunkKUZWEM23cjs.httpUserAgent; exports.promiseWithResolvers = _chunkKUZWEM23cjs.promiseWithResolvers; exports.setLongTimeout = _chunkKUZWEM23cjs.setLongTimeout; exports.stringifyError = _chunkKUZWEM23cjs.stringifyError; exports.toUint8Array = _chunkKUZWEM23cjs.toUint8Array;
30
30
  //# sourceMappingURL=utils.cjs.map
@@ -11,7 +11,7 @@ import {
11
11
  setLongTimeout,
12
12
  stringifyError,
13
13
  toUint8Array
14
- } from "./chunk-42UD33X4.js";
14
+ } from "./chunk-QMVCFQ37.js";
15
15
  import "./chunk-G64QUEDJ.js";
16
16
  export {
17
17
  SinglePromiseQueue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rivetkit",
3
- "version": "2.0.18",
3
+ "version": "2.0.20",
4
4
  "description": "Lightweight libraries for building stateful actors on edge platforms",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -4,10 +4,12 @@ import { logger } from "@/client/log";
4
4
  // Global singleton promise that will be reused for subsequent calls
5
5
  let eventSourcePromise: Promise<typeof EventSource> | null = null;
6
6
 
7
- /**
8
- * Import `eventsource` from the custom `eventsource` library. We need a custom implemnetation since we need to attach our own custom headers to the request.
9
- **/
10
7
  export async function importEventSource(): Promise<typeof EventSource> {
8
+ // IMPORTANT: Import `eventsource` from the custom `eventsource` library. We need a custom implementation
9
+ // since we need to attach our own custom headers to the request.
10
+ //
11
+ // We can't use the browser-provided EventSource since it does not allow providing custom headers.
12
+
11
13
  // Return existing promise if we already started loading
12
14
  if (eventSourcePromise !== null) {
13
15
  return eventSourcePromise;
@@ -19,7 +21,8 @@ export async function importEventSource(): Promise<typeof EventSource> {
19
21
 
20
22
  // Node.js environment
21
23
  try {
22
- const es = await import("eventsource");
24
+ const moduleName = "eventsource";
25
+ const es = await import(/* webpackIgnore: true */ moduleName);
23
26
  _EventSource = es.EventSource;
24
27
  logger().debug("using eventsource from npm");
25
28
  } catch (err) {
@@ -39,42 +42,3 @@ export async function importEventSource(): Promise<typeof EventSource> {
39
42
 
40
43
  return eventSourcePromise;
41
44
  }
42
-
43
- //export async function importEventSource(): Promise<typeof EventSource> {
44
- // // Return existing promise if we already started loading
45
- // if (eventSourcePromise !== null) {
46
- // return eventSourcePromise;
47
- // }
48
- //
49
- // // Create and store the promise
50
- // eventSourcePromise = (async () => {
51
- // let _EventSource: typeof EventSource;
52
- //
53
- // if (typeof EventSource !== "undefined") {
54
- // // Browser environment
55
- // _EventSource = EventSource;
56
- // logger().debug("using native eventsource");
57
- // } else {
58
- // // Node.js environment
59
- // try {
60
- // const es = await import("eventsource");
61
- // _EventSource = es.EventSource;
62
- // logger().debug("using eventsource from npm");
63
- // } catch (err) {
64
- // // EventSource not available
65
- // _EventSource = class MockEventSource {
66
- // constructor() {
67
- // throw new Error(
68
- // 'EventSource support requires installing the "eventsource" peer dependency.',
69
- // );
70
- // }
71
- // } as unknown as typeof EventSource;
72
- // logger().debug("using mock eventsource");
73
- // }
74
- // }
75
- //
76
- // return _EventSource;
77
- // })();
78
- //
79
- // return eventSourcePromise;
80
- //}
@@ -19,7 +19,8 @@ export async function importWebSocket(): Promise<typeof WebSocket> {
19
19
  } else {
20
20
  // Node.js environment
21
21
  try {
22
- const ws = await import("ws");
22
+ const moduleName = "ws";
23
+ const ws = await import(/* webpackIgnore: true */ moduleName);
23
24
  _WebSocket = ws.default as unknown as typeof WebSocket;
24
25
  logger().debug("using websocket from npm");
25
26
  } catch {
@@ -1,4 +1,5 @@
1
1
  import { spawn } from "node:child_process";
2
+ import { randomUUID } from "node:crypto";
2
3
  import { createWriteStream } from "node:fs";
3
4
  import * as fs from "node:fs/promises";
4
5
  import * as path from "node:path";
@@ -103,9 +104,11 @@ export async function ensureEngineProcess(
103
104
 
104
105
  child.once("exit", (code, signal) => {
105
106
  logger().warn({
106
- msg: "engine process exited",
107
+ msg: "engine process exited, please report this error",
107
108
  code,
108
109
  signal,
110
+ issues: "https://github.com/rivet-dev/rivetkit/issues",
111
+ support: "https://rivet.dev/discord",
109
112
  });
110
113
  // Clean up log streams
111
114
  stdoutStream.end();
@@ -168,22 +171,70 @@ async function downloadEngineBinaryIfNeeded(
168
171
  );
169
172
  }
170
173
 
171
- const tempPath = `${binaryPath}.${process.pid}.tmp`;
172
- await pipeline(response.body, createWriteStream(tempPath));
173
- if (process.platform !== "win32") {
174
- await fs.chmod(tempPath, 0o755);
175
- }
176
- await fs.rename(tempPath, binaryPath);
174
+ // Generate unique temp file name to prevent parallel download conflicts
175
+ const tempPath = `${binaryPath}.${randomUUID()}.tmp`;
176
+ const startTime = Date.now();
177
+
177
178
  logger().debug({
178
- msg: "engine binary download complete",
179
- version,
180
- path: binaryPath,
181
- });
182
- logger().info({
183
- msg: "engine binary downloaded",
184
- version,
185
- path: binaryPath,
179
+ msg: "starting binary download",
180
+ tempPath,
181
+ contentLength: response.headers.get("content-length"),
186
182
  });
183
+
184
+ // Warn user if download is taking a long time
185
+ const slowDownloadWarning = setTimeout(() => {
186
+ logger().warn({
187
+ msg: "engine binary download is taking longer than expected, please be patient",
188
+ version,
189
+ });
190
+ }, 5000);
191
+
192
+ try {
193
+ await pipeline(response.body, createWriteStream(tempPath));
194
+
195
+ // Clear the slow download warning
196
+ clearTimeout(slowDownloadWarning);
197
+
198
+ // Get file size to verify download
199
+ const stats = await fs.stat(tempPath);
200
+ const downloadDuration = Date.now() - startTime;
201
+
202
+ if (process.platform !== "win32") {
203
+ await fs.chmod(tempPath, 0o755);
204
+ }
205
+ await fs.rename(tempPath, binaryPath);
206
+
207
+ logger().debug({
208
+ msg: "engine binary download complete",
209
+ version,
210
+ path: binaryPath,
211
+ size: stats.size,
212
+ durationMs: downloadDuration,
213
+ });
214
+ logger().info({
215
+ msg: "engine binary downloaded",
216
+ version,
217
+ path: binaryPath,
218
+ });
219
+ } catch (error) {
220
+ // Clear the slow download warning
221
+ clearTimeout(slowDownloadWarning);
222
+
223
+ // Clean up partial temp file on error
224
+ logger().warn({
225
+ msg: "engine download failed, please report this error",
226
+ tempPath,
227
+ error,
228
+ issues: "https://github.com/rivet-dev/rivetkit/issues",
229
+ support: "https://rivet.dev/discord",
230
+ });
231
+ try {
232
+ await fs.unlink(tempPath);
233
+ } catch (unlinkError) {
234
+ // Ignore errors when cleaning up (file may not exist)
235
+ }
236
+ throw error;
237
+ }
187
238
  }
188
239
 
189
240
  function resolveTargetTriplet(): { targetTriplet: string; extension: string } {
@@ -71,6 +71,25 @@ export class Registry<A extends RegistryActors> {
71
71
  // Promise for any async operations we need to wait to complete
72
72
  const readyPromises = [];
73
73
 
74
+ // Disable health check if using serverless
75
+ //
76
+ // This is because the endpoint will not be configured until we receive
77
+ // a serverless runner request, so we do not know what to health check
78
+ if (config.runnerKind === "serverless") {
79
+ logger().debug("disabling health check since using serverless");
80
+ config.disableHealthCheck = true;
81
+ }
82
+
83
+ // Auto-configure serverless runner if not in prod
84
+ if (
85
+ process.env.NODE_ENV !== "production" &&
86
+ config.runnerKind === "serverless"
87
+ ) {
88
+ if (inputConfig?.runEngine === undefined) config.runEngine = true;
89
+ if (inputConfig?.autoConfigureServerless === undefined)
90
+ config.autoConfigureServerless = true;
91
+ }
92
+
74
93
  // Start engine
75
94
  if (config.runEngine) {
76
95
  logger().debug({
@@ -185,6 +204,7 @@ export class Registry<A extends RegistryActors> {
185
204
  // Even though we do not use the returned ActorDriver, this is required to start the code that will handle incoming actors
186
205
  if (!config.disableActorDriver) {
187
206
  Promise.all(readyPromises).then(async () => {
207
+ logger().debug("starting actor driver");
188
208
  driver.actor(this.#config, config, managerDriver, client);
189
209
  });
190
210
  }
@@ -220,6 +240,8 @@ export class Registry<A extends RegistryActors> {
220
240
  }
221
241
 
222
242
  async function configureServerlessRunner(config: RunnerConfig): Promise<void> {
243
+ logger().debug("configuring serverless runner");
244
+
223
245
  try {
224
246
  // Ensure we have required config values
225
247
  if (!config.runnerName) {
@@ -275,6 +297,7 @@ async function configureServerlessRunner(config: RunnerConfig): Promise<void> {
275
297
  slots_per_runner:
276
298
  customConfig.slotsPerRunner ?? config.totalSlots ?? 1000,
277
299
  },
300
+ metadata: customConfig.metadata ?? {},
278
301
  };
279
302
  await updateRunnerConfig(clientConfig, config.runnerName, {
280
303
  datacenters: Object.fromEntries(
@@ -289,10 +312,11 @@ async function configureServerlessRunner(config: RunnerConfig): Promise<void> {
289
312
  });
290
313
  } catch (error) {
291
314
  logger().error({
292
- msg: "failed to configure serverless runner",
315
+ msg: "failed to configure serverless runner, validate endpoint is configured correctly then restart this process",
293
316
  error,
294
317
  });
295
- throw error;
318
+
319
+ // Don't throw, allow the runner to continue
296
320
  }
297
321
  }
298
322
 
@@ -119,6 +119,7 @@ export const RunnerConfigSchema = z
119
119
  requestLifespan: z.number().optional(),
120
120
  runnersMargin: z.number().optional(),
121
121
  slotsPerRunner: z.number().optional(),
122
+ metadata: z.record(z.unknown()).optional(),
122
123
  }),
123
124
  ])
124
125
  .optional(),
@@ -16,7 +16,7 @@ import type {
16
16
  } from "@/driver-helpers/mod";
17
17
  import type { Encoding, UniversalWebSocket } from "@/mod";
18
18
  import { uint8ArrayToBase64 } from "@/serde";
19
- import { combineUrlPath } from "@/utils";
19
+ import { combineUrlPath, getEnvUniversal } from "@/utils";
20
20
  import { sendHttpRequestToActor } from "./actor-http-client";
21
21
  import {
22
22
  buildWebSocketProtocols,
@@ -56,13 +56,22 @@ export class RemoteManagerDriver implements ManagerDriver {
56
56
  #metadataPromise: Promise<void> | undefined;
57
57
 
58
58
  constructor(runConfig: ClientConfig) {
59
+ // Disable health check if in Next.js build phase since there is no `/metadata` endpoint
60
+ //
61
+ // See https://github.com/vercel/next.js/blob/5e6b008b561caf2710ab7be63320a3d549474a5b/packages/next/shared/lib/constants.ts#L19-L23
62
+ if (getEnvUniversal("NEXT_PHASE") === "phase-production-build") {
63
+ logger().info("detected next.js build phase, disabling health check");
64
+ runConfig.disableHealthCheck = true;
65
+ }
66
+
59
67
  this.#config = runConfig;
60
68
 
61
69
  // Perform metadata check if enabled
62
70
  if (!runConfig.disableHealthCheck) {
63
71
  this.#metadataPromise = this.#performMetadataCheck(runConfig);
64
72
  this.#metadataPromise.catch((error) => {
65
- logger().error({
73
+ // TODO: Promot to error after metadata endpoint merged on prod
74
+ logger().info({
66
75
  msg: "metadata check failed",
67
76
  error: error instanceof Error ? error.message : String(error),
68
77
  });
@@ -101,7 +110,7 @@ export class RemoteManagerDriver implements ManagerDriver {
101
110
  });
102
111
  } catch (error) {
103
112
  logger().error({
104
- msg: "failed to connect to metadata endpoint",
113
+ msg: "health check failed, validate the Rivet endpoint is configured correctly",
105
114
  endpoint,
106
115
  error: stringifyError(error),
107
116
  });