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.
- package/dist/tsup/{chunk-O7NI7QQW.cjs → chunk-2I6L3VRO.cjs} +14 -14
- package/dist/tsup/{chunk-O7NI7QQW.cjs.map → chunk-2I6L3VRO.cjs.map} +1 -1
- package/dist/tsup/{chunk-BGBEE6N2.cjs → chunk-2S7HJMMY.cjs} +240 -193
- package/dist/tsup/chunk-2S7HJMMY.cjs.map +1 -0
- package/dist/tsup/{chunk-JMSXK5ZO.js → chunk-5F6X4AFU.js} +6 -6
- package/dist/tsup/{chunk-2MUSMEMN.js → chunk-7ACKZS3T.js} +6 -5
- package/dist/tsup/chunk-7ACKZS3T.js.map +1 -0
- package/dist/tsup/{chunk-OPB45MKH.cjs → chunk-DUOTOMP7.cjs} +3 -3
- package/dist/tsup/{chunk-OPB45MKH.cjs.map → chunk-DUOTOMP7.cjs.map} +1 -1
- package/dist/tsup/{chunk-6JGEHV56.js → chunk-ER5OT3SQ.js} +2 -2
- package/dist/tsup/{chunk-4R5LOYEU.cjs → chunk-FYP3TZXD.cjs} +28 -27
- package/dist/tsup/chunk-FYP3TZXD.cjs.map +1 -0
- package/dist/tsup/{chunk-RFCYH6EC.cjs → chunk-G6JGHCG4.cjs} +6 -6
- package/dist/tsup/{chunk-RFCYH6EC.cjs.map → chunk-G6JGHCG4.cjs.map} +1 -1
- package/dist/tsup/{chunk-DZEQUURK.js → chunk-GQ5WTE64.js} +18 -10
- package/dist/tsup/chunk-GQ5WTE64.js.map +1 -0
- package/dist/tsup/{chunk-IXPZJCBE.cjs → chunk-JZD6FEOE.cjs} +219 -211
- package/dist/tsup/chunk-JZD6FEOE.cjs.map +1 -0
- package/dist/tsup/{chunk-F5VXILGA.cjs → chunk-KKRR7DSG.cjs} +8 -4
- package/dist/tsup/chunk-KKRR7DSG.cjs.map +1 -0
- package/dist/tsup/{chunk-FADDMRZP.cjs → chunk-KUZWEM23.cjs} +2 -2
- package/dist/tsup/{chunk-FADDMRZP.cjs.map → chunk-KUZWEM23.cjs.map} +1 -1
- package/dist/tsup/{chunk-S5K7CB2F.js → chunk-L3YPHXPE.js} +76 -29
- package/dist/tsup/{chunk-S5K7CB2F.js.map → chunk-L3YPHXPE.js.map} +1 -1
- package/dist/tsup/{chunk-IXPWBGXK.js → chunk-M6LIJ6BK.js} +3 -3
- package/dist/tsup/{chunk-2P4ENWQ6.js → chunk-MGHPBNWB.js} +7 -3
- package/dist/tsup/chunk-MGHPBNWB.js.map +1 -0
- package/dist/tsup/{chunk-SBBFWYNM.cjs → chunk-PV22ZBDE.cjs} +8 -8
- package/dist/tsup/{chunk-SBBFWYNM.cjs.map → chunk-PV22ZBDE.cjs.map} +1 -1
- package/dist/tsup/{chunk-42UD33X4.js → chunk-QMVCFQ37.js} +2 -2
- package/dist/tsup/{chunk-42UD33X4.js.map → chunk-QMVCFQ37.js.map} +1 -1
- package/dist/tsup/{chunk-YVK2XQNR.js → chunk-QRUGCDA5.js} +2 -2
- package/dist/tsup/{chunk-KPFRD7KN.js → chunk-RI4YHZZW.js} +2 -2
- package/dist/tsup/{chunk-QMF6X2E2.cjs → chunk-RJVSNJO7.cjs} +7 -7
- package/dist/tsup/{chunk-QMF6X2E2.cjs.map → chunk-RJVSNJO7.cjs.map} +1 -1
- package/dist/tsup/{chunk-AR5ZY563.js → chunk-YFFCPYHY.js} +3 -3
- package/dist/tsup/{chunk-ICPFPGOJ.cjs → chunk-ZODINJWN.cjs} +12 -12
- package/dist/tsup/{chunk-ICPFPGOJ.cjs.map → chunk-ZODINJWN.cjs.map} +1 -1
- package/dist/tsup/client/mod.cjs +9 -9
- package/dist/tsup/client/mod.d.cts +2 -2
- package/dist/tsup/client/mod.d.ts +2 -2
- package/dist/tsup/client/mod.js +8 -8
- package/dist/tsup/common/log.cjs +3 -3
- package/dist/tsup/common/log.js +2 -2
- package/dist/tsup/common/websocket.cjs +4 -4
- package/dist/tsup/common/websocket.js +3 -3
- package/dist/tsup/{conn-DhdZYlSX.d.ts → conn-CmPcqOCF.d.ts} +72 -67
- package/dist/tsup/{conn-CxCsTz2s.d.cts → conn-DU5EbfCu.d.cts} +72 -67
- package/dist/tsup/driver-helpers/mod.cjs +5 -5
- package/dist/tsup/driver-helpers/mod.d.cts +1 -1
- package/dist/tsup/driver-helpers/mod.d.ts +1 -1
- package/dist/tsup/driver-helpers/mod.js +4 -4
- package/dist/tsup/driver-test-suite/mod.cjs +71 -71
- package/dist/tsup/driver-test-suite/mod.d.cts +1 -1
- package/dist/tsup/driver-test-suite/mod.d.ts +1 -1
- package/dist/tsup/driver-test-suite/mod.js +11 -11
- package/dist/tsup/inspector/mod.cjs +6 -6
- package/dist/tsup/inspector/mod.d.cts +2 -2
- package/dist/tsup/inspector/mod.d.ts +2 -2
- package/dist/tsup/inspector/mod.js +5 -5
- package/dist/tsup/mod.cjs +10 -10
- package/dist/tsup/mod.d.cts +2 -2
- package/dist/tsup/mod.d.ts +2 -2
- package/dist/tsup/mod.js +9 -9
- package/dist/tsup/test/mod.cjs +11 -11
- package/dist/tsup/test/mod.d.cts +1 -1
- package/dist/tsup/test/mod.d.ts +1 -1
- package/dist/tsup/test/mod.js +10 -10
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/package.json +1 -1
- package/src/common/eventsource.ts +7 -43
- package/src/common/websocket.ts +2 -1
- package/src/engine-process/mod.ts +66 -15
- package/src/registry/mod.ts +26 -2
- package/src/registry/run-config.ts +1 -0
- package/src/remote-manager-driver/mod.ts +12 -3
- package/dist/tsup/chunk-2MUSMEMN.js.map +0 -1
- package/dist/tsup/chunk-2P4ENWQ6.js.map +0 -1
- package/dist/tsup/chunk-4R5LOYEU.cjs.map +0 -1
- package/dist/tsup/chunk-BGBEE6N2.cjs.map +0 -1
- package/dist/tsup/chunk-DZEQUURK.js.map +0 -1
- package/dist/tsup/chunk-F5VXILGA.cjs.map +0 -1
- package/dist/tsup/chunk-IXPZJCBE.cjs.map +0 -1
- /package/dist/tsup/{chunk-JMSXK5ZO.js.map → chunk-5F6X4AFU.js.map} +0 -0
- /package/dist/tsup/{chunk-6JGEHV56.js.map → chunk-ER5OT3SQ.js.map} +0 -0
- /package/dist/tsup/{chunk-IXPWBGXK.js.map → chunk-M6LIJ6BK.js.map} +0 -0
- /package/dist/tsup/{chunk-YVK2XQNR.js.map → chunk-QRUGCDA5.js.map} +0 -0
- /package/dist/tsup/{chunk-KPFRD7KN.js.map → chunk-RI4YHZZW.js.map} +0 -0
- /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
|
|
14
|
-
require('./chunk-
|
|
13
|
+
var _chunk2S7HJMMYcjs = require('./chunk-2S7HJMMY.cjs');
|
|
14
|
+
require('./chunk-DUOTOMP7.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
21
|
-
require('./chunk-
|
|
22
|
-
require('./chunk-
|
|
23
|
-
require('./chunk-
|
|
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
|
|
29
|
-
require('./chunk-
|
|
28
|
+
var _chunkPV22ZBDEcjs = require('./chunk-PV22ZBDE.cjs');
|
|
29
|
+
require('./chunk-RJVSNJO7.cjs');
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
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 =
|
|
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
|
package/dist/tsup/mod.d.cts
CHANGED
|
@@ -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-
|
|
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-
|
|
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';
|
package/dist/tsup/mod.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
14
|
-
import "./chunk-
|
|
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-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
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-
|
|
29
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-YFFCPYHY.js";
|
|
29
|
+
import "./chunk-ER5OT3SQ.js";
|
|
30
30
|
import {
|
|
31
31
|
noopNext,
|
|
32
32
|
toUint8Array
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-QMVCFQ37.js";
|
|
34
34
|
import {
|
|
35
35
|
UserError
|
|
36
36
|
} from "./chunk-G64QUEDJ.js";
|
package/dist/tsup/test/mod.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
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-
|
|
9
|
-
require('../chunk-
|
|
10
|
-
require('../chunk-
|
|
11
|
-
require('../chunk-
|
|
12
|
-
require('../chunk-
|
|
13
|
-
require('../chunk-
|
|
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 =
|
|
18
|
+
exports.getPort = _chunk2I6L3VROcjs.getPort; exports.setupTest = _chunk2I6L3VROcjs.setupTest;
|
|
19
19
|
//# 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,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getPort,
|
|
3
3
|
setupTest
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
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,
|
package/dist/tsup/utils.cjs
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
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 =
|
|
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
|
package/dist/tsup/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -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
|
|
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
|
-
//}
|
package/src/common/websocket.ts
CHANGED
|
@@ -19,7 +19,8 @@ export async function importWebSocket(): Promise<typeof WebSocket> {
|
|
|
19
19
|
} else {
|
|
20
20
|
// Node.js environment
|
|
21
21
|
try {
|
|
22
|
-
const
|
|
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
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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: "
|
|
179
|
-
|
|
180
|
-
|
|
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 } {
|
package/src/registry/mod.ts
CHANGED
|
@@ -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
|
-
|
|
318
|
+
|
|
319
|
+
// Don't throw, allow the runner to continue
|
|
296
320
|
}
|
|
297
321
|
}
|
|
298
322
|
|
|
@@ -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
|
-
|
|
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
|
|
113
|
+
msg: "health check failed, validate the Rivet endpoint is configured correctly",
|
|
105
114
|
endpoint,
|
|
106
115
|
error: stringifyError(error),
|
|
107
116
|
});
|