rivetkit 2.0.39 → 2.0.40
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.
- package/dist/tsup/{chunk-KMYFL3OL.cjs → chunk-4KNL47JA.cjs} +68 -61
- package/dist/tsup/chunk-4KNL47JA.cjs.map +1 -0
- package/dist/tsup/{chunk-T7IPDBWH.js → chunk-4T4UWXHN.js} +4 -4
- package/dist/tsup/{chunk-UAX5E3EU.cjs → chunk-6NBNCWEC.cjs} +250 -249
- package/dist/tsup/chunk-6NBNCWEC.cjs.map +1 -0
- package/dist/tsup/{chunk-PHCD25XO.js → chunk-7Q7R3QYT.js} +2 -2
- package/dist/tsup/{chunk-7E3RWMR6.cjs → chunk-B5BMSBR4.cjs} +161 -105
- package/dist/tsup/chunk-B5BMSBR4.cjs.map +1 -0
- package/dist/tsup/{chunk-MZPYVTVG.cjs → chunk-D2HB4PM5.cjs} +9 -9
- package/dist/tsup/{chunk-MZPYVTVG.cjs.map → chunk-D2HB4PM5.cjs.map} +1 -1
- package/dist/tsup/{chunk-DY4H3ASE.cjs → chunk-FB4TVPDQ.cjs} +46 -46
- package/dist/tsup/{chunk-DY4H3ASE.cjs.map → chunk-FB4TVPDQ.cjs.map} +1 -1
- package/dist/tsup/{chunk-X72X7I7T.cjs → chunk-HZOBB3KP.cjs} +2 -2
- package/dist/tsup/{chunk-X72X7I7T.cjs.map → chunk-HZOBB3KP.cjs.map} +1 -1
- package/dist/tsup/{chunk-OJZRCEIA.js → chunk-J2R742IE.js} +5 -5
- package/dist/tsup/{chunk-BQ36VTSB.js → chunk-J6YRLC6K.js} +74 -18
- package/dist/tsup/{chunk-BQ36VTSB.js.map → chunk-J6YRLC6K.js.map} +1 -1
- package/dist/tsup/{chunk-PVKUXMOA.js → chunk-KVB2SG32.js} +12 -5
- package/dist/tsup/chunk-KVB2SG32.js.map +1 -0
- package/dist/tsup/{chunk-C64FV764.cjs → chunk-XCDGPOZT.cjs} +3 -3
- package/dist/tsup/{chunk-C64FV764.cjs.map → chunk-XCDGPOZT.cjs.map} +1 -1
- package/dist/tsup/{chunk-XU74APB4.js → chunk-XCRJ245S.js} +6 -5
- package/dist/tsup/{chunk-XU74APB4.js.map → chunk-XCRJ245S.js.map} +1 -1
- package/dist/tsup/{chunk-CDK6DRO2.js → chunk-ZUMPCWKF.js} +2 -2
- package/dist/tsup/{chunk-CDK6DRO2.js.map → chunk-ZUMPCWKF.js.map} +1 -1
- package/dist/tsup/client/mod.cjs +5 -5
- package/dist/tsup/client/mod.d.cts +2 -2
- package/dist/tsup/client/mod.d.ts +2 -2
- package/dist/tsup/client/mod.js +4 -4
- package/dist/tsup/common/log.cjs +2 -2
- package/dist/tsup/common/log.js +1 -1
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/{config-CBwo4ooA.d.ts → config-OR5ZtHFa.d.ts} +3 -0
- package/dist/tsup/{config-BuBlMs6C.d.cts → config-cizn-tcF.d.cts} +3 -0
- package/dist/tsup/{driver-CPXmh8f8.d.cts → driver-Bg4evbcN.d.cts} +1 -1
- package/dist/tsup/{driver-DxWa6HUO.d.ts → driver-BrAG8ioa.d.ts} +1 -1
- package/dist/tsup/driver-helpers/mod.cjs +3 -3
- package/dist/tsup/driver-helpers/mod.d.cts +2 -2
- package/dist/tsup/driver-helpers/mod.d.ts +2 -2
- package/dist/tsup/driver-helpers/mod.js +2 -2
- package/dist/tsup/driver-test-suite/mod.cjs +62 -34
- package/dist/tsup/driver-test-suite/mod.cjs.map +1 -1
- package/dist/tsup/driver-test-suite/mod.d.cts +2 -2
- package/dist/tsup/driver-test-suite/mod.d.ts +2 -2
- package/dist/tsup/driver-test-suite/mod.js +35 -7
- package/dist/tsup/driver-test-suite/mod.js.map +1 -1
- package/dist/tsup/mod.cjs +7 -7
- package/dist/tsup/mod.d.cts +4 -4
- package/dist/tsup/mod.d.ts +4 -4
- package/dist/tsup/mod.js +6 -6
- package/dist/tsup/test/mod.cjs +7 -7
- package/dist/tsup/test/mod.d.cts +1 -1
- package/dist/tsup/test/mod.d.ts +1 -1
- package/dist/tsup/test/mod.js +6 -6
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/package.json +2 -2
- package/src/actor/instance/schedule-manager.ts +2 -1
- package/src/actor/router-websocket-endpoints.test.ts +54 -0
- package/src/actor/router-websocket-endpoints.ts +9 -4
- package/src/driver-test-suite/tests/raw-websocket.ts +40 -0
- package/src/engine-process/mod.ts +62 -7
- package/src/registry/config/index.ts +6 -0
- package/src/registry/serve.ts +9 -5
- package/dist/tsup/chunk-7E3RWMR6.cjs.map +0 -1
- package/dist/tsup/chunk-KMYFL3OL.cjs.map +0 -1
- package/dist/tsup/chunk-PVKUXMOA.js.map +0 -1
- package/dist/tsup/chunk-UAX5E3EU.cjs.map +0 -1
- /package/dist/tsup/{chunk-T7IPDBWH.js.map → chunk-4T4UWXHN.js.map} +0 -0
- /package/dist/tsup/{chunk-PHCD25XO.js.map → chunk-7Q7R3QYT.js.map} +0 -0
- /package/dist/tsup/{chunk-OJZRCEIA.js.map → chunk-J2R742IE.js.map} +0 -0
package/dist/tsup/mod.cjs
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkB5BMSBR4cjs = require('./chunk-B5BMSBR4.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkFB4TVPDQcjs = require('./chunk-FB4TVPDQ.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
17
|
-
require('./chunk-
|
|
16
|
+
var _chunk6NBNCWECcjs = require('./chunk-6NBNCWEC.cjs');
|
|
17
|
+
require('./chunk-XCDGPOZT.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -32,12 +32,12 @@ require('./chunk-C64FV764.cjs');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunk4KNL47JAcjs = require('./chunk-4KNL47JA.cjs');
|
|
36
36
|
require('./chunk-KDFWJKMJ.cjs');
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _chunkHZOBB3KPcjs = require('./chunk-HZOBB3KP.cjs');
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
var _chunkSNAUKDDKcjs = require('./chunk-SNAUKDDK.cjs');
|
|
@@ -72,5 +72,5 @@ require('./chunk-GBENOENJ.cjs');
|
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
exports.ALLOWED_PUBLIC_HEADERS =
|
|
75
|
+
exports.ALLOWED_PUBLIC_HEADERS = _chunk4KNL47JAcjs.ALLOWED_PUBLIC_HEADERS; exports.ActorKv = _chunk4KNL47JAcjs.ActorKv; exports.ActorsSchema = _chunk4KNL47JAcjs.ActorsSchema; exports.DocConfigureRunnerPoolSchema = _chunk4KNL47JAcjs.DocConfigureRunnerPoolSchema; exports.DocInspectorConfigSchema = _chunk4KNL47JAcjs.DocInspectorConfigSchema; exports.DocRegistryConfigSchema = _chunk4KNL47JAcjs.DocRegistryConfigSchema; exports.DocRunnerConfigSchema = _chunk4KNL47JAcjs.DocRunnerConfigSchema; exports.DocServerlessConfigSchema = _chunk4KNL47JAcjs.DocServerlessConfigSchema; exports.DriverConfigSchema = _chunk4KNL47JAcjs.DriverConfigSchema; exports.InlineWebSocketAdapter = _chunkFB4TVPDQcjs.InlineWebSocketAdapter; exports.KV_KEYS = _chunk4KNL47JAcjs.KEYS; exports.PATH_CONNECT = _chunk4KNL47JAcjs.PATH_CONNECT; exports.PATH_WEBSOCKET_PREFIX = _chunk4KNL47JAcjs.PATH_WEBSOCKET_PREFIX; exports.Registry = _chunkB5BMSBR4cjs.Registry; exports.RegistryConfigSchema = _chunk4KNL47JAcjs.RegistryConfigSchema; exports.TestConfigSchema = _chunk4KNL47JAcjs.TestConfigSchema; exports.UserError = _chunkSNAUKDDKcjs.UserError; exports.actor = _chunkB5BMSBR4cjs.actor; exports.buildActorNames = _chunk4KNL47JAcjs.buildActorNames; exports.createActorRouter = _chunkFB4TVPDQcjs.createActorRouter; exports.createClientWithDriver = _chunk6NBNCWECcjs.createClientWithDriver; exports.createEngineDriver = _chunkB5BMSBR4cjs.createEngineDriver; exports.createFileSystemDriver = _chunkFB4TVPDQcjs.createFileSystemDriver; exports.createMemoryDriver = _chunkFB4TVPDQcjs.createMemoryDriver; exports.lookupInRegistry = _chunk6NBNCWECcjs.lookupInRegistry; exports.noopNext = _chunkHZOBB3KPcjs.noopNext; exports.routeWebSocket = _chunk4KNL47JAcjs.routeWebSocket; exports.setup = _chunkB5BMSBR4cjs.setup; exports.toUint8Array = _chunkHZOBB3KPcjs.toUint8Array;
|
|
76
76
|
//# sourceMappingURL=mod.cjs.map
|
package/dist/tsup/mod.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { R as RegistryConfig, A as ActorDriver, a as AnyConn, b as AnyActorInstance, E as Encoding, c as AnyDatabaseProvider, d as Actions, e as ActorConfigInput, f as ActorDefinition } from './config-
|
|
2
|
-
export { B as ActionContext, F as ActionContextOf, r as ActorConfig, p as ActorConfigSchema, u as ActorContext, v as ActorContextOf, j as ActorKey, n as ActorKv, i as ActorQuery, o as ActorTypes, ac as ActorsSchema, l as AnyActorDefinition, g as AnyClient, q as AuthIntent, G as BeforeActionResponseContext, H as BeforeActionResponseContextOf, I as BeforeConnectContext, J as BeforeConnectContextOf, C as Client, k as Conn, w as ConnContext, x as ConnContextOf, y as ConnInitContext, z as ConnInitContextOf, K as ConnectContext, L as ConnectContextOf, O as CreateConnStateContext, P as CreateConnStateContextOf, M as CreateContext, N as CreateContextOf, Q as CreateVarsContext, S as CreateVarsContextOf, T as DestroyContext, U as DestroyContextOf, V as DisconnectContext, W as DisconnectContextOf, s as DocActorConfigSchema, D as DocActorOptionsSchema, ai as DocConfigureRunnerPoolSchema, ah as DocInspectorConfigSchema, al as DocRegistryConfigSchema, ak as DocRunnerConfigSchema, aj as DocServerlessConfigSchema, a7 as FetchHandler, a9 as LegacyStartServerOutput, aa as Registry, a5 as RegistryActors, af as RegistryConfigInput, a6 as RegistryConfigSchema, X as RequestContext, Y as RequestContextOf, a8 as ServerlessHandler, Z as SleepContext, _ as SleepContextOf, $ as StateChangeContext, a0 as StateChangeContextOf, ae as TestConfig, ad as TestConfigSchema, a1 as WakeContext, a2 as WakeContextOf, a3 as WebSocketContext, a4 as WebSocketContextOf, ag as buildActorNames, h as createClientWithDriver, m as lookupInRegistry, ab as setup, t as test } from './config-
|
|
1
|
+
import { R as RegistryConfig, A as ActorDriver, a as AnyConn, b as AnyActorInstance, E as Encoding, c as AnyDatabaseProvider, d as Actions, e as ActorConfigInput, f as ActorDefinition } from './config-cizn-tcF.cjs';
|
|
2
|
+
export { B as ActionContext, F as ActionContextOf, r as ActorConfig, p as ActorConfigSchema, u as ActorContext, v as ActorContextOf, j as ActorKey, n as ActorKv, i as ActorQuery, o as ActorTypes, ac as ActorsSchema, l as AnyActorDefinition, g as AnyClient, q as AuthIntent, G as BeforeActionResponseContext, H as BeforeActionResponseContextOf, I as BeforeConnectContext, J as BeforeConnectContextOf, C as Client, k as Conn, w as ConnContext, x as ConnContextOf, y as ConnInitContext, z as ConnInitContextOf, K as ConnectContext, L as ConnectContextOf, O as CreateConnStateContext, P as CreateConnStateContextOf, M as CreateContext, N as CreateContextOf, Q as CreateVarsContext, S as CreateVarsContextOf, T as DestroyContext, U as DestroyContextOf, V as DisconnectContext, W as DisconnectContextOf, s as DocActorConfigSchema, D as DocActorOptionsSchema, ai as DocConfigureRunnerPoolSchema, ah as DocInspectorConfigSchema, al as DocRegistryConfigSchema, ak as DocRunnerConfigSchema, aj as DocServerlessConfigSchema, a7 as FetchHandler, a9 as LegacyStartServerOutput, aa as Registry, a5 as RegistryActors, af as RegistryConfigInput, a6 as RegistryConfigSchema, X as RequestContext, Y as RequestContextOf, a8 as ServerlessHandler, Z as SleepContext, _ as SleepContextOf, $ as StateChangeContext, a0 as StateChangeContextOf, ae as TestConfig, ad as TestConfigSchema, a1 as WakeContext, a2 as WakeContextOf, a3 as WebSocketContext, a4 as WebSocketContextOf, ag as buildActorNames, h as createClientWithDriver, m as lookupInRegistry, ab as setup, t as test } from './config-cizn-tcF.cjs';
|
|
3
3
|
import { WSContext } from 'hono/ws';
|
|
4
4
|
import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
5
5
|
export { RivetCloseEvent, RivetEvent, RivetMessageEvent, UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
6
6
|
export { n as noopNext } from './utils-fwx3o3K9.cjs';
|
|
7
|
-
import { D as DriverConfig } from './driver-
|
|
8
|
-
export { a as DriverConfigSchema } from './driver-
|
|
7
|
+
import { D as DriverConfig } from './driver-Bg4evbcN.cjs';
|
|
8
|
+
export { a as DriverConfigSchema } from './driver-Bg4evbcN.cjs';
|
|
9
9
|
import { GetUpgradeWebSocket } from './utils.cjs';
|
|
10
10
|
export { toUint8Array } from './utils.cjs';
|
|
11
11
|
export { A as ALLOWED_PUBLIC_HEADERS, P as PATH_CONNECT, a as PATH_WEBSOCKET_PREFIX } from './actor-router-consts-DzI2szci.cjs';
|
package/dist/tsup/mod.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { R as RegistryConfig, A as ActorDriver, a as AnyConn, b as AnyActorInstance, E as Encoding, c as AnyDatabaseProvider, d as Actions, e as ActorConfigInput, f as ActorDefinition } from './config-
|
|
2
|
-
export { B as ActionContext, F as ActionContextOf, r as ActorConfig, p as ActorConfigSchema, u as ActorContext, v as ActorContextOf, j as ActorKey, n as ActorKv, i as ActorQuery, o as ActorTypes, ac as ActorsSchema, l as AnyActorDefinition, g as AnyClient, q as AuthIntent, G as BeforeActionResponseContext, H as BeforeActionResponseContextOf, I as BeforeConnectContext, J as BeforeConnectContextOf, C as Client, k as Conn, w as ConnContext, x as ConnContextOf, y as ConnInitContext, z as ConnInitContextOf, K as ConnectContext, L as ConnectContextOf, O as CreateConnStateContext, P as CreateConnStateContextOf, M as CreateContext, N as CreateContextOf, Q as CreateVarsContext, S as CreateVarsContextOf, T as DestroyContext, U as DestroyContextOf, V as DisconnectContext, W as DisconnectContextOf, s as DocActorConfigSchema, D as DocActorOptionsSchema, ai as DocConfigureRunnerPoolSchema, ah as DocInspectorConfigSchema, al as DocRegistryConfigSchema, ak as DocRunnerConfigSchema, aj as DocServerlessConfigSchema, a7 as FetchHandler, a9 as LegacyStartServerOutput, aa as Registry, a5 as RegistryActors, af as RegistryConfigInput, a6 as RegistryConfigSchema, X as RequestContext, Y as RequestContextOf, a8 as ServerlessHandler, Z as SleepContext, _ as SleepContextOf, $ as StateChangeContext, a0 as StateChangeContextOf, ae as TestConfig, ad as TestConfigSchema, a1 as WakeContext, a2 as WakeContextOf, a3 as WebSocketContext, a4 as WebSocketContextOf, ag as buildActorNames, h as createClientWithDriver, m as lookupInRegistry, ab as setup, t as test } from './config-
|
|
1
|
+
import { R as RegistryConfig, A as ActorDriver, a as AnyConn, b as AnyActorInstance, E as Encoding, c as AnyDatabaseProvider, d as Actions, e as ActorConfigInput, f as ActorDefinition } from './config-OR5ZtHFa.js';
|
|
2
|
+
export { B as ActionContext, F as ActionContextOf, r as ActorConfig, p as ActorConfigSchema, u as ActorContext, v as ActorContextOf, j as ActorKey, n as ActorKv, i as ActorQuery, o as ActorTypes, ac as ActorsSchema, l as AnyActorDefinition, g as AnyClient, q as AuthIntent, G as BeforeActionResponseContext, H as BeforeActionResponseContextOf, I as BeforeConnectContext, J as BeforeConnectContextOf, C as Client, k as Conn, w as ConnContext, x as ConnContextOf, y as ConnInitContext, z as ConnInitContextOf, K as ConnectContext, L as ConnectContextOf, O as CreateConnStateContext, P as CreateConnStateContextOf, M as CreateContext, N as CreateContextOf, Q as CreateVarsContext, S as CreateVarsContextOf, T as DestroyContext, U as DestroyContextOf, V as DisconnectContext, W as DisconnectContextOf, s as DocActorConfigSchema, D as DocActorOptionsSchema, ai as DocConfigureRunnerPoolSchema, ah as DocInspectorConfigSchema, al as DocRegistryConfigSchema, ak as DocRunnerConfigSchema, aj as DocServerlessConfigSchema, a7 as FetchHandler, a9 as LegacyStartServerOutput, aa as Registry, a5 as RegistryActors, af as RegistryConfigInput, a6 as RegistryConfigSchema, X as RequestContext, Y as RequestContextOf, a8 as ServerlessHandler, Z as SleepContext, _ as SleepContextOf, $ as StateChangeContext, a0 as StateChangeContextOf, ae as TestConfig, ad as TestConfigSchema, a1 as WakeContext, a2 as WakeContextOf, a3 as WebSocketContext, a4 as WebSocketContextOf, ag as buildActorNames, h as createClientWithDriver, m as lookupInRegistry, ab as setup, t as test } from './config-OR5ZtHFa.js';
|
|
3
3
|
import { WSContext } from 'hono/ws';
|
|
4
4
|
import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
5
5
|
export { RivetCloseEvent, RivetEvent, RivetMessageEvent, UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
6
6
|
export { n as noopNext } from './utils-fwx3o3K9.js';
|
|
7
|
-
import { D as DriverConfig } from './driver-
|
|
8
|
-
export { a as DriverConfigSchema } from './driver-
|
|
7
|
+
import { D as DriverConfig } from './driver-BrAG8ioa.js';
|
|
8
|
+
export { a as DriverConfigSchema } from './driver-BrAG8ioa.js';
|
|
9
9
|
import { GetUpgradeWebSocket } from './utils.js';
|
|
10
10
|
export { toUint8Array } from './utils.js';
|
|
11
11
|
export { A as ALLOWED_PUBLIC_HEADERS, P as PATH_CONNECT, a as PATH_WEBSOCKET_PREFIX } from './actor-router-consts-DzI2szci.js';
|
package/dist/tsup/mod.js
CHANGED
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
actor,
|
|
4
4
|
createEngineDriver,
|
|
5
5
|
setup
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-J6YRLC6K.js";
|
|
7
7
|
import {
|
|
8
8
|
InlineWebSocketAdapter,
|
|
9
9
|
createActorRouter,
|
|
10
10
|
createFileSystemDriver,
|
|
11
11
|
createMemoryDriver
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4T4UWXHN.js";
|
|
13
13
|
import {
|
|
14
14
|
createClientWithDriver,
|
|
15
15
|
lookupInRegistry
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-XCRJ245S.js";
|
|
17
|
+
import "./chunk-7Q7R3QYT.js";
|
|
18
18
|
import {
|
|
19
19
|
ALLOWED_PUBLIC_HEADERS,
|
|
20
20
|
ActorKv,
|
|
@@ -32,12 +32,12 @@ import {
|
|
|
32
32
|
TestConfigSchema,
|
|
33
33
|
buildActorNames,
|
|
34
34
|
routeWebSocket
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-KVB2SG32.js";
|
|
36
36
|
import "./chunk-E6ZE2YEA.js";
|
|
37
37
|
import {
|
|
38
38
|
noopNext,
|
|
39
39
|
toUint8Array
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-ZUMPCWKF.js";
|
|
41
41
|
import {
|
|
42
42
|
UserError
|
|
43
43
|
} from "./chunk-2YHR67M4.js";
|
package/dist/tsup/test/mod.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
4
|
+
var _chunkD2HB4PM5cjs = require('../chunk-D2HB4PM5.cjs');
|
|
5
|
+
require('../chunk-FB4TVPDQ.cjs');
|
|
6
|
+
require('../chunk-6NBNCWEC.cjs');
|
|
7
|
+
require('../chunk-XCDGPOZT.cjs');
|
|
8
|
+
require('../chunk-4KNL47JA.cjs');
|
|
9
9
|
require('../chunk-KDFWJKMJ.cjs');
|
|
10
|
-
require('../chunk-
|
|
10
|
+
require('../chunk-HZOBB3KP.cjs');
|
|
11
11
|
require('../chunk-SNAUKDDK.cjs');
|
|
12
12
|
require('../chunk-GBENOENJ.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.getPort =
|
|
16
|
+
exports.getPort = _chunkD2HB4PM5cjs.getPort; exports.setupTest = _chunkD2HB4PM5cjs.setupTest;
|
|
17
17
|
//# sourceMappingURL=mod.cjs.map
|
package/dist/tsup/test/mod.d.cts
CHANGED
package/dist/tsup/test/mod.d.ts
CHANGED
package/dist/tsup/test/mod.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getPort,
|
|
3
3
|
setupTest
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-J2R742IE.js";
|
|
5
|
+
import "../chunk-4T4UWXHN.js";
|
|
6
|
+
import "../chunk-XCRJ245S.js";
|
|
7
|
+
import "../chunk-7Q7R3QYT.js";
|
|
8
|
+
import "../chunk-KVB2SG32.js";
|
|
9
9
|
import "../chunk-E6ZE2YEA.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-ZUMPCWKF.js";
|
|
11
11
|
import "../chunk-2YHR67M4.js";
|
|
12
12
|
export {
|
|
13
13
|
getPort,
|
package/dist/tsup/utils.cjs
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkHZOBB3KPcjs = require('./chunk-HZOBB3KP.cjs');
|
|
18
18
|
require('./chunk-SNAUKDDK.cjs');
|
|
19
19
|
require('./chunk-GBENOENJ.cjs');
|
|
20
20
|
|
|
@@ -33,5 +33,5 @@ require('./chunk-GBENOENJ.cjs');
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
exports.EXTRA_ERROR_LOG =
|
|
36
|
+
exports.EXTRA_ERROR_LOG = _chunkHZOBB3KPcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunkHZOBB3KPcjs.SinglePromiseQueue; exports.VERSION = _chunkHZOBB3KPcjs.VERSION; exports.arrayBuffersEqual = _chunkHZOBB3KPcjs.arrayBuffersEqual; exports.assertUnreachable = _chunkHZOBB3KPcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkHZOBB3KPcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkHZOBB3KPcjs.combineUrlPath; exports.dbg = _chunkHZOBB3KPcjs.dbg; exports.detectRuntime = _chunkHZOBB3KPcjs.detectRuntime; exports.getEnvUniversal = _chunkHZOBB3KPcjs.getEnvUniversal; exports.httpUserAgent = _chunkHZOBB3KPcjs.httpUserAgent; exports.promiseWithResolvers = _chunkHZOBB3KPcjs.promiseWithResolvers; exports.setLongTimeout = _chunkHZOBB3KPcjs.setLongTimeout; exports.stringifyError = _chunkHZOBB3KPcjs.stringifyError; exports.toUint8Array = _chunkHZOBB3KPcjs.toUint8Array;
|
|
37
37
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/tsup/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rivetkit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.40",
|
|
4
4
|
"description": "Lightweight libraries for building stateful actors on edge platforms",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"uuid": "^12.0.0",
|
|
168
168
|
"vbare": "^0.0.4",
|
|
169
169
|
"zod": "^4.1.0",
|
|
170
|
-
"@rivetkit/engine-runner": "2.0.
|
|
170
|
+
"@rivetkit/engine-runner": "2.0.40",
|
|
171
171
|
"@rivetkit/virtual-websocket": "2.0.33"
|
|
172
172
|
},
|
|
173
173
|
"devDependencies": {
|
|
@@ -261,7 +261,8 @@ export class ScheduleManager<S, CP, CS, V, I, DB extends AnyDatabaseProvider> {
|
|
|
261
261
|
});
|
|
262
262
|
|
|
263
263
|
// Look up the action function
|
|
264
|
-
const
|
|
264
|
+
const actions = this.#config.actions ?? {};
|
|
265
|
+
const fn = actions[event.action];
|
|
265
266
|
|
|
266
267
|
if (!fn) {
|
|
267
268
|
throw new Error(
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import {
|
|
3
|
+
PATH_WEBSOCKET_BASE,
|
|
4
|
+
PATH_WEBSOCKET_PREFIX,
|
|
5
|
+
} from "@/common/actor-router-consts";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Unit tests for WebSocket path routing logic.
|
|
9
|
+
*
|
|
10
|
+
* These tests verify the path matching behavior in routeWebSocket
|
|
11
|
+
* without needing a full actor setup.
|
|
12
|
+
*
|
|
13
|
+
* NOTE: The driver-file-system end-to-end tests pass because the driver
|
|
14
|
+
* correctly strips query parameters before calling routeWebSocket
|
|
15
|
+
* (see FileSystemManagerDriver.openWebSocket). However, the bug still
|
|
16
|
+
* exists in routeWebSocket itself and could be triggered by other callers
|
|
17
|
+
* (e.g., engine driver's runnerWebSocket which passes requestPath directly).
|
|
18
|
+
*/
|
|
19
|
+
describe("websocket path routing", () => {
|
|
20
|
+
// Helper that replicates the routing logic from routeWebSocket
|
|
21
|
+
// After fix: strips query params before comparing
|
|
22
|
+
function matchesWebSocketPath(requestPath: string): boolean {
|
|
23
|
+
const requestPathWithoutQuery = requestPath.split("?")[0];
|
|
24
|
+
return (
|
|
25
|
+
requestPathWithoutQuery === PATH_WEBSOCKET_BASE ||
|
|
26
|
+
requestPathWithoutQuery.startsWith(PATH_WEBSOCKET_PREFIX)
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
test("should match base websocket path without query", () => {
|
|
31
|
+
expect(matchesWebSocketPath("/websocket")).toBe(true);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test("should match websocket path with trailing slash", () => {
|
|
35
|
+
expect(matchesWebSocketPath("/websocket/")).toBe(true);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test("should match websocket path with subpath", () => {
|
|
39
|
+
expect(matchesWebSocketPath("/websocket/foo")).toBe(true);
|
|
40
|
+
expect(matchesWebSocketPath("/websocket/foo/bar")).toBe(true);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test("should match websocket path with subpath and query", () => {
|
|
44
|
+
// This works because "/websocket/foo?query" starts with "/websocket/"
|
|
45
|
+
expect(matchesWebSocketPath("/websocket/foo?query=value")).toBe(true);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// FIX: Query parameters are now stripped before routing comparison.
|
|
49
|
+
// This ensures /websocket?query correctly routes to the websocket handler.
|
|
50
|
+
test("should match base websocket path with query parameters", () => {
|
|
51
|
+
expect(matchesWebSocketPath("/websocket?token=abc")).toBe(true);
|
|
52
|
+
expect(matchesWebSocketPath("/websocket?foo=bar&baz=123")).toBe(true);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -88,10 +88,15 @@ export async function routeWebSocket(
|
|
|
88
88
|
// Promise used to wait for the websocket close in `disconnect`
|
|
89
89
|
const closePromiseResolvers = promiseWithResolvers<void>();
|
|
90
90
|
|
|
91
|
+
// Strip query parameters from requestPath for routing purposes.
|
|
92
|
+
// This handles paths like "/websocket?query=value" which should route
|
|
93
|
+
// to the raw websocket handler.
|
|
94
|
+
const requestPathWithoutQuery = requestPath.split("?")[0];
|
|
95
|
+
|
|
91
96
|
// Route WebSocket & create driver
|
|
92
97
|
let handler: WebSocketHandler;
|
|
93
98
|
let connDriver: ConnDriver;
|
|
94
|
-
if (
|
|
99
|
+
if (requestPathWithoutQuery === PATH_CONNECT) {
|
|
95
100
|
const { driver, setWebSocket } = createWebSocketDriver(
|
|
96
101
|
isHibernatable
|
|
97
102
|
? { gatewayId: gatewayId!, requestId: requestId! }
|
|
@@ -103,8 +108,8 @@ export async function routeWebSocket(
|
|
|
103
108
|
handler = handleWebSocketConnect.bind(undefined, setWebSocket);
|
|
104
109
|
connDriver = driver;
|
|
105
110
|
} else if (
|
|
106
|
-
|
|
107
|
-
|
|
111
|
+
requestPathWithoutQuery === PATH_WEBSOCKET_BASE ||
|
|
112
|
+
requestPathWithoutQuery.startsWith(PATH_WEBSOCKET_PREFIX)
|
|
108
113
|
) {
|
|
109
114
|
const { driver, setWebSocket } = createRawWebSocketDriver(
|
|
110
115
|
isHibernatable
|
|
@@ -114,7 +119,7 @@ export async function routeWebSocket(
|
|
|
114
119
|
);
|
|
115
120
|
handler = handleRawWebSocket.bind(undefined, setWebSocket);
|
|
116
121
|
connDriver = driver;
|
|
117
|
-
} else if (
|
|
122
|
+
} else if (requestPathWithoutQuery === PATH_INSPECTOR_CONNECT) {
|
|
118
123
|
if (!actor.inspectorToken) {
|
|
119
124
|
throw "WebSocket Inspector Unauthorized: actor does not provide inspector access";
|
|
120
125
|
}
|
|
@@ -469,5 +469,45 @@ export function runRawWebSocketTests(driverTestConfig: DriverTestConfig) {
|
|
|
469
469
|
|
|
470
470
|
ws.close();
|
|
471
471
|
});
|
|
472
|
+
|
|
473
|
+
test("should handle query parameters on base websocket path (no subpath)", async (c) => {
|
|
474
|
+
const { client } = await setupDriverTest(c, driverTestConfig);
|
|
475
|
+
const actor = client.rawWebSocketActor.getOrCreate([
|
|
476
|
+
"base-path-query-params",
|
|
477
|
+
]);
|
|
478
|
+
|
|
479
|
+
// Test WebSocket with ONLY query parameters on the base path
|
|
480
|
+
// This tests the case where path is "/websocket?foo=bar" without trailing slash
|
|
481
|
+
const ws = await actor.websocket("?token=secret&session=123");
|
|
482
|
+
|
|
483
|
+
await new Promise<void>((resolve, reject) => {
|
|
484
|
+
ws.addEventListener("open", () => resolve(), { once: true });
|
|
485
|
+
ws.addEventListener("error", reject);
|
|
486
|
+
ws.addEventListener("close", (evt: any) => {
|
|
487
|
+
reject(new Error(`WebSocket closed: code=${evt.code} reason=${evt.reason}`));
|
|
488
|
+
});
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
const requestInfoPromise = new Promise<any>((resolve, reject) => {
|
|
492
|
+
ws.addEventListener("message", (event: any) => {
|
|
493
|
+
const data = JSON.parse(event.data as string);
|
|
494
|
+
if (data.type === "requestInfo") {
|
|
495
|
+
resolve(data);
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
ws.addEventListener("close", reject);
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
// Send request to get the request info
|
|
502
|
+
ws.send(JSON.stringify({ type: "getRequestInfo" }));
|
|
503
|
+
|
|
504
|
+
const requestInfo = await requestInfoPromise;
|
|
505
|
+
|
|
506
|
+
// Verify query parameters were preserved even on base websocket path
|
|
507
|
+
expect(requestInfo.url).toContain("token=secret");
|
|
508
|
+
expect(requestInfo.url).toContain("session=123");
|
|
509
|
+
|
|
510
|
+
ws.close();
|
|
511
|
+
});
|
|
472
512
|
});
|
|
473
513
|
}
|
|
@@ -96,6 +96,30 @@ export async function ensureEngineProcess(
|
|
|
96
96
|
stdio: ["inherit", "pipe", "pipe"],
|
|
97
97
|
env: {
|
|
98
98
|
...process.env,
|
|
99
|
+
// In development, runners can be terminated without a graceful
|
|
100
|
+
// shutdown (i.e. SIGKILL instead of SIGTERM). This is treated as a
|
|
101
|
+
// crash by Rivet Engine in production and implements a backoff for
|
|
102
|
+
// rescheduling actors in case of a crash loop.
|
|
103
|
+
//
|
|
104
|
+
// This is problematic in development since this will cause actors
|
|
105
|
+
// to become unresponsive if frequently killing your dev server.
|
|
106
|
+
//
|
|
107
|
+
// We reduce the timeouts for resetting a runner as healthy in
|
|
108
|
+
// order to account for this.
|
|
109
|
+
RIVET__PEGBOARD__RETRY_RESET_DURATION: "100",
|
|
110
|
+
RIVET__PEGBOARD__BASE_RETRY_TIMEOUT: "100",
|
|
111
|
+
// Set max exponent to 1 to have a maximum of base_retry_timeout
|
|
112
|
+
RIVET__PEGBOARD__RESCHEDULE_BACKOFF_MAX_EXPONENT: "1",
|
|
113
|
+
// Reduce thresholds for faster development iteration
|
|
114
|
+
//
|
|
115
|
+
// Default ping interval is 3s, this gives a 2s & 4s grace
|
|
116
|
+
RIVET__PEGBOARD__RUNNER_ELIGIBLE_THRESHOLD: "5000",
|
|
117
|
+
RIVET__PEGBOARD__RUNNER_LOST_THRESHOLD: "7000",
|
|
118
|
+
// Reduce shutdown durations for faster development iteration (in seconds)
|
|
119
|
+
RIVET__RUNTIME__WORKER_SHUTDOWN_DURATION: "1",
|
|
120
|
+
RIVET__RUNTIME__GUARD_SHUTDOWN_DURATION: "1",
|
|
121
|
+
// Force exit after this duration (must be > worker and guard shutdown durations)
|
|
122
|
+
RIVET__RUNTIME__FORCE_SHUTDOWN_DURATION: "2",
|
|
99
123
|
},
|
|
100
124
|
});
|
|
101
125
|
|
|
@@ -107,7 +131,12 @@ export async function ensureEngineProcess(
|
|
|
107
131
|
if (child.stdout) {
|
|
108
132
|
child.stdout.pipe(stdoutStream);
|
|
109
133
|
}
|
|
134
|
+
// Collect stderr for error detection
|
|
135
|
+
const stderrChunks: Buffer[] = [];
|
|
110
136
|
if (child.stderr) {
|
|
137
|
+
child.stderr.on("data", (chunk: Buffer) => {
|
|
138
|
+
stderrChunks.push(chunk);
|
|
139
|
+
});
|
|
111
140
|
child.stderr.pipe(stderrStream);
|
|
112
141
|
}
|
|
113
142
|
logger().debug({
|
|
@@ -117,13 +146,39 @@ export async function ensureEngineProcess(
|
|
|
117
146
|
});
|
|
118
147
|
|
|
119
148
|
child.once("exit", (code, signal) => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
149
|
+
const stderrOutput = Buffer.concat(stderrChunks).toString("utf-8");
|
|
150
|
+
|
|
151
|
+
// Check for specific error conditions
|
|
152
|
+
if (stderrOutput.includes("failed to open rocksdb") && stderrOutput.includes("LOCK: Resource temporarily unavailable")) {
|
|
153
|
+
logger().error({
|
|
154
|
+
msg: "another instance of rivet engine is unexpectedly running, this is an internal error",
|
|
155
|
+
code,
|
|
156
|
+
signal,
|
|
157
|
+
stdoutLog: stdoutLogPath,
|
|
158
|
+
stderrLog: stderrLogPath,
|
|
159
|
+
issues: "https://github.com/rivet-dev/rivetkit/issues",
|
|
160
|
+
support: "https://rivet.dev/discord",
|
|
161
|
+
});
|
|
162
|
+
} else if (stderrOutput.includes("Rivet Engine has been rolled back to a previous version")) {
|
|
163
|
+
logger().error({
|
|
164
|
+
msg: "rivet engine version downgrade detected",
|
|
165
|
+
hint: `You attempted to downgrade the RivetKit version in development. To fix this, nuke the database by running: '${binaryPath}' database nuke --yes`,
|
|
166
|
+
code,
|
|
167
|
+
signal,
|
|
168
|
+
stdoutLog: stdoutLogPath,
|
|
169
|
+
stderrLog: stderrLogPath,
|
|
170
|
+
});
|
|
171
|
+
} else {
|
|
172
|
+
logger().warn({
|
|
173
|
+
msg: "engine process exited, please report this error",
|
|
174
|
+
code,
|
|
175
|
+
signal,
|
|
176
|
+
stdoutLog: stdoutLogPath,
|
|
177
|
+
stderrLog: stderrLogPath,
|
|
178
|
+
issues: "https://github.com/rivet-dev/rivetkit/issues",
|
|
179
|
+
support: "https://rivet.dev/discord",
|
|
180
|
+
});
|
|
181
|
+
}
|
|
127
182
|
// Clean up log streams
|
|
128
183
|
stdoutStream.end();
|
|
129
184
|
stderrStream.end();
|
|
@@ -126,6 +126,12 @@ export const RegistryConfigSchema = z
|
|
|
126
126
|
* What port to run the manager on.
|
|
127
127
|
*/
|
|
128
128
|
managerPort: z.number().optional().default(6420),
|
|
129
|
+
/**
|
|
130
|
+
* @experimental
|
|
131
|
+
*
|
|
132
|
+
* What host to bind the manager server to.
|
|
133
|
+
*/
|
|
134
|
+
managerHost: z.string().optional(),
|
|
129
135
|
|
|
130
136
|
/** @experimental */
|
|
131
137
|
inspector: InspectorConfigSchema,
|
package/src/registry/serve.ts
CHANGED
|
@@ -96,8 +96,9 @@ async function serveNode(
|
|
|
96
96
|
|
|
97
97
|
// Start server
|
|
98
98
|
const port = managerPort;
|
|
99
|
-
const
|
|
100
|
-
|
|
99
|
+
const hostname = config.managerHost;
|
|
100
|
+
const server = serve({ fetch: app.fetch, port, hostname }, () =>
|
|
101
|
+
logger().info({ msg: "server listening", port, hostname }),
|
|
101
102
|
);
|
|
102
103
|
injectWebSocket(server);
|
|
103
104
|
|
|
@@ -127,10 +128,11 @@ async function serveDeno(
|
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
const port = config.managerPort;
|
|
131
|
+
const hostname = config.managerHost;
|
|
130
132
|
|
|
131
133
|
// Use Deno.serve
|
|
132
|
-
Deno.serve({ port }, app.fetch);
|
|
133
|
-
logger().info({ msg: "server listening", port });
|
|
134
|
+
Deno.serve({ port, hostname }, app.fetch);
|
|
135
|
+
logger().info({ msg: "server listening", port, hostname });
|
|
134
136
|
|
|
135
137
|
return { upgradeWebSocket };
|
|
136
138
|
}
|
|
@@ -160,15 +162,17 @@ async function serveBun(
|
|
|
160
162
|
const { websocket, upgradeWebSocket } = createBunWebSocket();
|
|
161
163
|
|
|
162
164
|
const port = config.managerPort;
|
|
165
|
+
const hostname = config.managerHost;
|
|
163
166
|
|
|
164
167
|
// Use Bun.serve
|
|
165
168
|
// @ts-expect-error - Bun global
|
|
166
169
|
Bun.serve({
|
|
167
170
|
fetch: app.fetch,
|
|
168
171
|
port,
|
|
172
|
+
hostname,
|
|
169
173
|
websocket,
|
|
170
174
|
});
|
|
171
|
-
logger().info({ msg: "server listening", port });
|
|
175
|
+
logger().info({ msg: "server listening", port, hostname });
|
|
172
176
|
|
|
173
177
|
return { upgradeWebSocket };
|
|
174
178
|
}
|