rivetkit 2.0.18 → 2.0.19
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-ICPFPGOJ.cjs → chunk-2N5T57W5.cjs} +12 -12
- package/dist/tsup/{chunk-ICPFPGOJ.cjs.map → chunk-2N5T57W5.cjs.map} +1 -1
- package/dist/tsup/{chunk-42UD33X4.js → chunk-6MI3RWWC.js} +2 -2
- package/dist/tsup/{chunk-42UD33X4.js.map → chunk-6MI3RWWC.js.map} +1 -1
- package/dist/tsup/{chunk-SBBFWYNM.cjs → chunk-7BTAYSZC.cjs} +8 -8
- package/dist/tsup/{chunk-SBBFWYNM.cjs.map → chunk-7BTAYSZC.cjs.map} +1 -1
- package/dist/tsup/{chunk-FADDMRZP.cjs → chunk-7RKGZXDH.cjs} +2 -2
- package/dist/tsup/{chunk-FADDMRZP.cjs.map → chunk-7RKGZXDH.cjs.map} +1 -1
- package/dist/tsup/{chunk-OPB45MKH.cjs → chunk-AXQWQIUS.cjs} +3 -3
- package/dist/tsup/{chunk-OPB45MKH.cjs.map → chunk-AXQWQIUS.cjs.map} +1 -1
- package/dist/tsup/{chunk-QMF6X2E2.cjs → chunk-AYNDGM4A.cjs} +7 -7
- package/dist/tsup/{chunk-QMF6X2E2.cjs.map → chunk-AYNDGM4A.cjs.map} +1 -1
- package/dist/tsup/{chunk-DZEQUURK.js → chunk-DAAQFFK3.js} +17 -9
- package/dist/tsup/chunk-DAAQFFK3.js.map +1 -0
- package/dist/tsup/{chunk-2P4ENWQ6.js → chunk-DAZ2YBCM.js} +7 -3
- package/dist/tsup/chunk-DAZ2YBCM.js.map +1 -0
- package/dist/tsup/{chunk-F5VXILGA.cjs → chunk-DGXMPCNI.cjs} +8 -4
- package/dist/tsup/chunk-DGXMPCNI.cjs.map +1 -0
- package/dist/tsup/{chunk-O7NI7QQW.cjs → chunk-EXP6CQEI.cjs} +14 -14
- package/dist/tsup/{chunk-O7NI7QQW.cjs.map → chunk-EXP6CQEI.cjs.map} +1 -1
- package/dist/tsup/{chunk-4R5LOYEU.cjs → chunk-F4PHLUIT.cjs} +28 -27
- package/dist/tsup/chunk-F4PHLUIT.cjs.map +1 -0
- package/dist/tsup/{chunk-YVK2XQNR.js → chunk-FO4Q36GQ.js} +2 -2
- package/dist/tsup/{chunk-JMSXK5ZO.js → chunk-GBVUP7IH.js} +6 -6
- package/dist/tsup/{chunk-RFCYH6EC.cjs → chunk-J5PFJTK3.cjs} +6 -6
- package/dist/tsup/{chunk-RFCYH6EC.cjs.map → chunk-J5PFJTK3.cjs.map} +1 -1
- package/dist/tsup/{chunk-2MUSMEMN.js → chunk-LWQDW6VP.js} +6 -5
- package/dist/tsup/chunk-LWQDW6VP.js.map +1 -0
- package/dist/tsup/{chunk-IXPWBGXK.js → chunk-NCVKAD3U.js} +3 -3
- package/dist/tsup/{chunk-IXPZJCBE.cjs → chunk-RIK4JNIG.cjs} +218 -210
- package/dist/tsup/chunk-RIK4JNIG.cjs.map +1 -0
- package/dist/tsup/{chunk-KPFRD7KN.js → chunk-SO6CSZPF.js} +2 -2
- package/dist/tsup/{chunk-6JGEHV56.js → chunk-U3PO7PEY.js} +2 -2
- package/dist/tsup/{chunk-AR5ZY563.js → chunk-UBS2ARYU.js} +3 -3
- package/dist/tsup/{chunk-S5K7CB2F.js → chunk-UGLCR467.js} +76 -29
- package/dist/tsup/{chunk-S5K7CB2F.js.map → chunk-UGLCR467.js.map} +1 -1
- package/dist/tsup/{chunk-BGBEE6N2.cjs → chunk-ZB3DP5IR.cjs} +240 -193
- package/dist/tsup/chunk-ZB3DP5IR.cjs.map +1 -0
- 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-CxCsTz2s.d.cts → conn--6rFdSfD.d.cts} +5 -0
- package/dist/tsup/{conn-DhdZYlSX.d.ts → conn-DAXlyhVg.d.ts} +5 -0
- 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 +10 -2
- 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-YVK2XQNR.js.map → chunk-FO4Q36GQ.js.map} +0 -0
- /package/dist/tsup/{chunk-JMSXK5ZO.js.map → chunk-GBVUP7IH.js.map} +0 -0
- /package/dist/tsup/{chunk-IXPWBGXK.js.map → chunk-NCVKAD3U.js.map} +0 -0
- /package/dist/tsup/{chunk-KPFRD7KN.js.map → chunk-SO6CSZPF.js.map} +0 -0
- /package/dist/tsup/{chunk-6JGEHV56.js.map → chunk-U3PO7PEY.js.map} +0 -0
- /package/dist/tsup/{chunk-AR5ZY563.js.map → chunk-UBS2ARYU.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getLogger
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U3PO7PEY.js";
|
|
4
4
|
|
|
5
5
|
// src/inspector/protocol/actor.ts
|
|
6
6
|
import { hc } from "hono/client";
|
|
@@ -100,4 +100,4 @@ export {
|
|
|
100
100
|
createActorInspectorClient,
|
|
101
101
|
createManagerInspectorClient
|
|
102
102
|
};
|
|
103
|
-
//# sourceMappingURL=chunk-
|
|
103
|
+
//# sourceMappingURL=chunk-SO6CSZPF.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getEnvUniversal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6MI3RWWC.js";
|
|
4
4
|
|
|
5
5
|
// src/common/log.ts
|
|
6
6
|
import {
|
|
@@ -247,4 +247,4 @@ export {
|
|
|
247
247
|
getBaseLogger,
|
|
248
248
|
getLogger
|
|
249
249
|
};
|
|
250
|
-
//# sourceMappingURL=chunk-
|
|
250
|
+
//# sourceMappingURL=chunk-U3PO7PEY.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getLogger
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U3PO7PEY.js";
|
|
4
4
|
import {
|
|
5
5
|
assertUnreachable
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6MI3RWWC.js";
|
|
7
7
|
import {
|
|
8
8
|
Unreachable
|
|
9
9
|
} from "./chunk-G64QUEDJ.js";
|
|
@@ -310,4 +310,4 @@ export {
|
|
|
310
310
|
WS_PROTOCOL_PATH,
|
|
311
311
|
ALLOWED_PUBLIC_HEADERS
|
|
312
312
|
};
|
|
313
|
-
//# sourceMappingURL=chunk-
|
|
313
|
+
//# sourceMappingURL=chunk-UBS2ARYU.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
inspectorLogger,
|
|
5
5
|
isInspectorEnabled,
|
|
6
6
|
secureInspector
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SO6CSZPF.js";
|
|
8
8
|
import {
|
|
9
9
|
ActorDefinition,
|
|
10
10
|
RemoteManagerDriver,
|
|
@@ -17,10 +17,10 @@ import {
|
|
|
17
17
|
lookupInRegistry,
|
|
18
18
|
serializeActorKey,
|
|
19
19
|
updateRunnerConfig
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DAAQFFK3.js";
|
|
21
21
|
import {
|
|
22
22
|
CreateActorSchema
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-FO4Q36GQ.js";
|
|
24
24
|
import {
|
|
25
25
|
ActionContext,
|
|
26
26
|
ClientConfigSchema,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
createVersionedDataHandler,
|
|
33
33
|
parseMessage,
|
|
34
34
|
serializeEmptyPersistData
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-LWQDW6VP.js";
|
|
36
36
|
import {
|
|
37
37
|
EncodingSchema,
|
|
38
38
|
HEADER_ACTOR_ID,
|
|
@@ -58,12 +58,12 @@ import {
|
|
|
58
58
|
generateRandomString,
|
|
59
59
|
loggerWithoutContext,
|
|
60
60
|
serializeWithEncoding
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-UBS2ARYU.js";
|
|
62
62
|
import {
|
|
63
63
|
configureBaseLogger,
|
|
64
64
|
configureDefaultLogger,
|
|
65
65
|
getLogger
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-U3PO7PEY.js";
|
|
67
67
|
import {
|
|
68
68
|
VERSION,
|
|
69
69
|
assertUnreachable,
|
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
promiseWithResolvers,
|
|
76
76
|
setLongTimeout,
|
|
77
77
|
stringifyError
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-6MI3RWWC.js";
|
|
79
79
|
import {
|
|
80
80
|
ActorAlreadyExists,
|
|
81
81
|
ConnNotFound,
|
|
@@ -2439,8 +2439,8 @@ var FileSystemGlobalState = class {
|
|
|
2439
2439
|
for (const tempFile of tempFiles) {
|
|
2440
2440
|
try {
|
|
2441
2441
|
const fullPath = path2.join(this.#stateDir, tempFile);
|
|
2442
|
-
const
|
|
2443
|
-
if (
|
|
2442
|
+
const stat2 = fsSync2.statSync(fullPath);
|
|
2443
|
+
if (stat2.mtimeMs < oneHourAgo) {
|
|
2444
2444
|
fsSync2.unlinkSync(fullPath);
|
|
2445
2445
|
logger5().info({
|
|
2446
2446
|
msg: "cleaned up stale temp file",
|
|
@@ -2806,6 +2806,7 @@ function chooseDefaultDriver(runConfig) {
|
|
|
2806
2806
|
|
|
2807
2807
|
// src/engine-process/mod.ts
|
|
2808
2808
|
import { spawn } from "child_process";
|
|
2809
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
2809
2810
|
import { createWriteStream } from "fs";
|
|
2810
2811
|
import * as fs3 from "fs/promises";
|
|
2811
2812
|
import * as path3 from "path";
|
|
@@ -2884,9 +2885,11 @@ async function ensureEngineProcess(options) {
|
|
|
2884
2885
|
});
|
|
2885
2886
|
child.once("exit", (code, signal) => {
|
|
2886
2887
|
logger6().warn({
|
|
2887
|
-
msg: "engine process exited",
|
|
2888
|
+
msg: "engine process exited, please report this error",
|
|
2888
2889
|
code,
|
|
2889
|
-
signal
|
|
2890
|
+
signal,
|
|
2891
|
+
issues: "https://github.com/rivet-dev/rivetkit/issues",
|
|
2892
|
+
support: "https://rivet.dev/discord"
|
|
2890
2893
|
});
|
|
2891
2894
|
stdoutStream.end();
|
|
2892
2895
|
stderrStream.end();
|
|
@@ -2935,22 +2938,55 @@ async function downloadEngineBinaryIfNeeded(binaryPath, version, varDir) {
|
|
|
2935
2938
|
`failed to download rivet engine binary from ${downloadUrl}: ${response.status} ${response.statusText}`
|
|
2936
2939
|
);
|
|
2937
2940
|
}
|
|
2938
|
-
const tempPath = `${binaryPath}.${
|
|
2939
|
-
|
|
2940
|
-
if (process.platform !== "win32") {
|
|
2941
|
-
await fs3.chmod(tempPath, 493);
|
|
2942
|
-
}
|
|
2943
|
-
await fs3.rename(tempPath, binaryPath);
|
|
2941
|
+
const tempPath = `${binaryPath}.${randomUUID2()}.tmp`;
|
|
2942
|
+
const startTime = Date.now();
|
|
2944
2943
|
logger6().debug({
|
|
2945
|
-
msg: "
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
});
|
|
2949
|
-
logger6().info({
|
|
2950
|
-
msg: "engine binary downloaded",
|
|
2951
|
-
version,
|
|
2952
|
-
path: binaryPath
|
|
2944
|
+
msg: "starting binary download",
|
|
2945
|
+
tempPath,
|
|
2946
|
+
contentLength: response.headers.get("content-length")
|
|
2953
2947
|
});
|
|
2948
|
+
const slowDownloadWarning = setTimeout(() => {
|
|
2949
|
+
logger6().warn({
|
|
2950
|
+
msg: "engine binary download is taking longer than expected, please be patient",
|
|
2951
|
+
version
|
|
2952
|
+
});
|
|
2953
|
+
}, 5e3);
|
|
2954
|
+
try {
|
|
2955
|
+
await pipeline(response.body, createWriteStream(tempPath));
|
|
2956
|
+
clearTimeout(slowDownloadWarning);
|
|
2957
|
+
const stats = await fs3.stat(tempPath);
|
|
2958
|
+
const downloadDuration = Date.now() - startTime;
|
|
2959
|
+
if (process.platform !== "win32") {
|
|
2960
|
+
await fs3.chmod(tempPath, 493);
|
|
2961
|
+
}
|
|
2962
|
+
await fs3.rename(tempPath, binaryPath);
|
|
2963
|
+
logger6().debug({
|
|
2964
|
+
msg: "engine binary download complete",
|
|
2965
|
+
version,
|
|
2966
|
+
path: binaryPath,
|
|
2967
|
+
size: stats.size,
|
|
2968
|
+
durationMs: downloadDuration
|
|
2969
|
+
});
|
|
2970
|
+
logger6().info({
|
|
2971
|
+
msg: "engine binary downloaded",
|
|
2972
|
+
version,
|
|
2973
|
+
path: binaryPath
|
|
2974
|
+
});
|
|
2975
|
+
} catch (error) {
|
|
2976
|
+
clearTimeout(slowDownloadWarning);
|
|
2977
|
+
logger6().warn({
|
|
2978
|
+
msg: "engine download failed, please report this error",
|
|
2979
|
+
tempPath,
|
|
2980
|
+
error,
|
|
2981
|
+
issues: "https://github.com/rivet-dev/rivetkit/issues",
|
|
2982
|
+
support: "https://rivet.dev/discord"
|
|
2983
|
+
});
|
|
2984
|
+
try {
|
|
2985
|
+
await fs3.unlink(tempPath);
|
|
2986
|
+
} catch (unlinkError) {
|
|
2987
|
+
}
|
|
2988
|
+
throw error;
|
|
2989
|
+
}
|
|
2954
2990
|
}
|
|
2955
2991
|
function resolveTargetTriplet() {
|
|
2956
2992
|
return resolveTargetTripletFor(process.platform, process.arch);
|
|
@@ -3925,6 +3961,15 @@ var Registry = class {
|
|
|
3925
3961
|
);
|
|
3926
3962
|
}
|
|
3927
3963
|
const readyPromises = [];
|
|
3964
|
+
if (config2.runnerKind === "serverless") {
|
|
3965
|
+
logger7().debug("disabling health check since using serverless");
|
|
3966
|
+
config2.disableHealthCheck = true;
|
|
3967
|
+
}
|
|
3968
|
+
if (process.env.NODE_ENV !== "production" && config2.runnerKind === "serverless") {
|
|
3969
|
+
if ((inputConfig == null ? void 0 : inputConfig.runEngine) === void 0) config2.runEngine = true;
|
|
3970
|
+
if ((inputConfig == null ? void 0 : inputConfig.autoConfigureServerless) === void 0)
|
|
3971
|
+
config2.autoConfigureServerless = true;
|
|
3972
|
+
}
|
|
3928
3973
|
if (config2.runEngine) {
|
|
3929
3974
|
logger7().debug({
|
|
3930
3975
|
msg: "run engine requested",
|
|
@@ -4005,6 +4050,7 @@ var Registry = class {
|
|
|
4005
4050
|
}
|
|
4006
4051
|
if (!config2.disableActorDriver) {
|
|
4007
4052
|
Promise.all(readyPromises).then(async () => {
|
|
4053
|
+
logger7().debug("starting actor driver");
|
|
4008
4054
|
driver.actor(this.#config, config2, managerDriver, client);
|
|
4009
4055
|
});
|
|
4010
4056
|
}
|
|
@@ -4033,6 +4079,7 @@ var Registry = class {
|
|
|
4033
4079
|
}
|
|
4034
4080
|
};
|
|
4035
4081
|
async function configureServerlessRunner(config2) {
|
|
4082
|
+
logger7().debug("configuring serverless runner");
|
|
4036
4083
|
try {
|
|
4037
4084
|
if (!config2.runnerName) {
|
|
4038
4085
|
throw new Error("runnerName is required for serverless configuration");
|
|
@@ -4075,7 +4122,8 @@ async function configureServerlessRunner(config2) {
|
|
|
4075
4122
|
request_lifespan: customConfig.requestLifespan ?? 15 * 60,
|
|
4076
4123
|
runners_margin: customConfig.runnersMargin ?? 0,
|
|
4077
4124
|
slots_per_runner: customConfig.slotsPerRunner ?? config2.totalSlots ?? 1e3
|
|
4078
|
-
}
|
|
4125
|
+
},
|
|
4126
|
+
metadata: customConfig.metadata ?? {}
|
|
4079
4127
|
};
|
|
4080
4128
|
await updateRunnerConfig(clientConfig, config2.runnerName, {
|
|
4081
4129
|
datacenters: Object.fromEntries(
|
|
@@ -4089,10 +4137,9 @@ async function configureServerlessRunner(config2) {
|
|
|
4089
4137
|
});
|
|
4090
4138
|
} catch (error) {
|
|
4091
4139
|
logger7().error({
|
|
4092
|
-
msg: "failed to configure serverless runner",
|
|
4140
|
+
msg: "failed to configure serverless runner, validate endpoint is configured correctly then restart this process",
|
|
4093
4141
|
error
|
|
4094
4142
|
});
|
|
4095
|
-
throw error;
|
|
4096
4143
|
}
|
|
4097
4144
|
}
|
|
4098
4145
|
function setup(input) {
|
|
@@ -4116,4 +4163,4 @@ export {
|
|
|
4116
4163
|
setup
|
|
4117
4164
|
};
|
|
4118
4165
|
//! These configs configs hold anything that's not platform-specific about running actors.
|
|
4119
|
-
//# sourceMappingURL=chunk-
|
|
4166
|
+
//# sourceMappingURL=chunk-UGLCR467.js.map
|