rivetkit 2.3.11 → 2.3.12-rc.2
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/browser/client.d.ts +4 -0
- package/dist/browser/client.js +65 -32
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +1 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/actor/errors.cjs +2 -2
- package/dist/tsup/actor/errors.d.cts +1 -1
- package/dist/tsup/actor/errors.d.ts +1 -1
- package/dist/tsup/actor/errors.js +1 -1
- package/dist/tsup/agent-os/index.cjs +2 -2
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +4 -0
- package/dist/tsup/agent-os/index.d.ts +4 -0
- package/dist/tsup/agent-os/index.js +2 -2
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-MO2SSUOR.js → chunk-3JBE7REK.js} +4 -4
- package/dist/tsup/{chunk-5UYWLCRO.js → chunk-6XR7IKBZ.js} +2 -2
- package/dist/tsup/{chunk-GU7ML3KE.cjs → chunk-APQQFCPR.cjs} +15 -10
- package/dist/tsup/chunk-APQQFCPR.cjs.map +1 -0
- package/dist/tsup/{chunk-3ZR542SK.js → chunk-BK2JOGQQ.js} +62 -36
- package/dist/tsup/chunk-BK2JOGQQ.js.map +1 -0
- package/dist/tsup/{chunk-VBJQIBXI.cjs → chunk-CZKQ2UR5.cjs} +4 -4
- package/dist/tsup/{chunk-VBJQIBXI.cjs.map → chunk-CZKQ2UR5.cjs.map} +1 -1
- package/dist/tsup/{chunk-RXXDNJXB.cjs → chunk-DXN6RPPQ.cjs} +214 -188
- package/dist/tsup/chunk-DXN6RPPQ.cjs.map +1 -0
- package/dist/tsup/{chunk-GLIPKKEC.cjs → chunk-GGGZ4TN7.cjs} +7 -7
- package/dist/tsup/{chunk-GLIPKKEC.cjs.map → chunk-GGGZ4TN7.cjs.map} +1 -1
- package/dist/tsup/{chunk-LWQFXGKS.cjs → chunk-HRJHLVHZ.cjs} +3 -3
- package/dist/tsup/{chunk-LWQFXGKS.cjs.map → chunk-HRJHLVHZ.cjs.map} +1 -1
- package/dist/tsup/{chunk-PUZY2XCD.cjs → chunk-IU6TTH6L.cjs} +10 -10
- package/dist/tsup/{chunk-PUZY2XCD.cjs.map → chunk-IU6TTH6L.cjs.map} +1 -1
- package/dist/tsup/{chunk-ZZ3WBRPD.js → chunk-IXBD7BXC.js} +15 -4
- package/dist/tsup/chunk-IXBD7BXC.js.map +1 -0
- package/dist/tsup/{chunk-JQ2AZ5FN.js → chunk-JZGMOEEI.js} +3 -3
- package/dist/tsup/{chunk-QFJ24MBU.js → chunk-KPZQI3TG.js} +2 -2
- package/dist/tsup/{chunk-6WYATRS4.js → chunk-KRQI5GXM.js} +2 -2
- package/dist/tsup/{chunk-4FC7TVS6.cjs → chunk-SPJORZMM.cjs} +15 -4
- package/dist/tsup/chunk-SPJORZMM.cjs.map +1 -0
- package/dist/tsup/{chunk-B3W74FBB.cjs → chunk-WTD54OHL.cjs} +3 -3
- package/dist/tsup/{chunk-B3W74FBB.cjs.map → chunk-WTD54OHL.cjs.map} +1 -1
- package/dist/tsup/{chunk-GN2EUMEW.cjs → chunk-XBPOYV4E.cjs} +3 -3
- package/dist/tsup/{chunk-GN2EUMEW.cjs.map → chunk-XBPOYV4E.cjs.map} +1 -1
- package/dist/tsup/{chunk-OUENKQHB.js → chunk-YW75TS76.js} +8 -3
- package/dist/tsup/chunk-YW75TS76.js.map +1 -0
- package/dist/tsup/{chunk-FWROC5LA.js → chunk-ZEIH7S4M.js} +2 -2
- package/dist/tsup/client/mod.cjs +6 -6
- package/dist/tsup/client/mod.d.cts +5 -5
- package/dist/tsup/client/mod.d.ts +5 -5
- package/dist/tsup/client/mod.js +5 -5
- 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/{config-DTGoWdkG.d.cts → config-BXSV17G7.d.cts} +2 -2
- package/dist/tsup/{config-C4OSv0QP.d.ts → config-Bi1r6gI7.d.ts} +2 -2
- package/dist/tsup/{context-C6cvDNyk.d.cts → context-4fJemY0D.d.cts} +1 -1
- package/dist/tsup/{context-CMygeBxS.d.ts → context-D4sNYboo.d.ts} +1 -1
- package/dist/tsup/db/drizzle.cjs +3 -3
- package/dist/tsup/db/drizzle.js +2 -2
- package/dist/tsup/db/mod.cjs +4 -4
- package/dist/tsup/db/mod.js +3 -3
- package/dist/tsup/dynamic/mod.d.cts +3 -3
- package/dist/tsup/dynamic/mod.d.ts +3 -3
- package/dist/tsup/inspector/mod.cjs +6 -6
- package/dist/tsup/inspector/mod.js +5 -5
- package/dist/tsup/inspector/workflow.cjs +5 -5
- package/dist/tsup/inspector/workflow.js +4 -4
- package/dist/tsup/inspector-tab/mod.d.cts +4 -4
- package/dist/tsup/inspector-tab/mod.d.ts +4 -4
- package/dist/tsup/mod.cjs +112 -111
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +5 -5
- package/dist/tsup/mod.d.ts +5 -5
- package/dist/tsup/mod.js +10 -9
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +7 -7
- package/dist/tsup/test/mod.d.cts +3 -3
- package/dist/tsup/test/mod.d.ts +3 -3
- package/dist/tsup/test/mod.js +5 -5
- package/dist/tsup/{utils-DQDCphrl.d.cts → utils-Bbz-3411.d.cts} +1 -1
- package/dist/tsup/{utils-CV0akuDD.d.ts → utils-BqdWVlzm.d.ts} +1 -1
- package/dist/tsup/{utils-CqDnC_PS.d.cts → utils-vvJQyygr.d.cts} +5 -0
- package/dist/tsup/{utils-CqDnC_PS.d.ts → utils-vvJQyygr.d.ts} +5 -0
- package/dist/tsup/utils.cjs +3 -3
- package/dist/tsup/utils.d.cts +2 -2
- package/dist/tsup/utils.d.ts +2 -2
- package/dist/tsup/utils.js +2 -2
- package/dist/tsup/workflow/mod.cjs +11 -11
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +5 -5
- package/dist/tsup/workflow/mod.d.ts +5 -5
- package/dist/tsup/workflow/mod.js +5 -5
- package/package.json +8 -8
- package/src/actor/errors.ts +29 -2
- package/src/client/actor-conn.ts +5 -4
- package/src/client/actor-handle.ts +32 -9
- package/src/client/actor-query.ts +8 -1
- package/src/client/errors.ts +2 -1
- package/src/client/raw-utils.ts +3 -5
- package/src/client/utils.ts +2 -0
- package/src/common/utils.ts +6 -0
- package/src/registry/native.ts +1 -0
- package/dist/tsup/chunk-3ZR542SK.js.map +0 -1
- package/dist/tsup/chunk-4FC7TVS6.cjs.map +0 -1
- package/dist/tsup/chunk-GU7ML3KE.cjs.map +0 -1
- package/dist/tsup/chunk-OUENKQHB.js.map +0 -1
- package/dist/tsup/chunk-RXXDNJXB.cjs.map +0 -1
- package/dist/tsup/chunk-ZZ3WBRPD.js.map +0 -1
- /package/dist/tsup/{chunk-MO2SSUOR.js.map → chunk-3JBE7REK.js.map} +0 -0
- /package/dist/tsup/{chunk-5UYWLCRO.js.map → chunk-6XR7IKBZ.js.map} +0 -0
- /package/dist/tsup/{chunk-JQ2AZ5FN.js.map → chunk-JZGMOEEI.js.map} +0 -0
- /package/dist/tsup/{chunk-QFJ24MBU.js.map → chunk-KPZQI3TG.js.map} +0 -0
- /package/dist/tsup/{chunk-6WYATRS4.js.map → chunk-KRQI5GXM.js.map} +0 -0
- /package/dist/tsup/{chunk-FWROC5LA.js.map → chunk-ZEIH7S4M.js.map} +0 -0
package/dist/tsup/mod.cjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } var _class; var _class2; var _class3;
|
|
2
2
|
|
|
3
|
-
var _chunkVBJQIBXIcjs = require('./chunk-VBJQIBXI.cjs');
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
|
|
@@ -14,9 +13,10 @@ var _chunkVBJQIBXIcjs = require('./chunk-VBJQIBXI.cjs');
|
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
|
|
16
|
+
var _chunk4KGXFC6Mcjs = require('./chunk-4KGXFC6M.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkCZKQ2UR5cjs = require('./chunk-CZKQ2UR5.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
@@ -27,18 +27,18 @@ var _chunk4KGXFC6Mcjs = require('./chunk-4KGXFC6M.cjs');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkDXN6RPPQcjs = require('./chunk-DXN6RPPQ.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
var _chunkMYWZCDMLcjs = require('./chunk-MYWZCDML.cjs');
|
|
35
|
+
require('./chunk-XBPOYV4E.cjs');
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
|
|
38
39
|
|
|
39
|
-
var
|
|
40
|
+
var _chunkHRJHLVHZcjs = require('./chunk-HRJHLVHZ.cjs');
|
|
40
41
|
require('./chunk-KVFIONKQ.cjs');
|
|
41
|
-
require('./chunk-GN2EUMEW.cjs');
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
@@ -71,7 +71,7 @@ require('./chunk-GN2EUMEW.cjs');
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
var
|
|
74
|
+
var _chunkAPQQFCPRcjs = require('./chunk-APQQFCPR.cjs');
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
|
|
@@ -83,11 +83,11 @@ var _chunkGU7ML3KEcjs = require('./chunk-GU7ML3KE.cjs');
|
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
var
|
|
86
|
+
var _chunkSPJORZMMcjs = require('./chunk-SPJORZMM.cjs');
|
|
87
87
|
|
|
88
88
|
// src/actor/log.ts
|
|
89
89
|
function loggerWithoutContext() {
|
|
90
|
-
return
|
|
90
|
+
return _chunkAPQQFCPRcjs.getLogger.call(void 0, "actor-runtime");
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// src/actor/definition.ts
|
|
@@ -210,7 +210,7 @@ function validateSchemaSync(schemas, key, data) {
|
|
|
210
210
|
if (isStandardSchema(schema)) {
|
|
211
211
|
const result = schema["~standard"].validate(data);
|
|
212
212
|
if (isPromiseLike(result)) {
|
|
213
|
-
throw
|
|
213
|
+
throw _chunkSPJORZMMcjs.unsupportedFeature.call(void 0, "async schema validation");
|
|
214
214
|
}
|
|
215
215
|
if (result.issues) {
|
|
216
216
|
return { success: false, issues: [...result.issues] };
|
|
@@ -227,7 +227,7 @@ function validateSchemaSync(schemas, key, data) {
|
|
|
227
227
|
var _virtualwebsocket = require('@rivetkit/virtual-websocket');
|
|
228
228
|
var _ws = require('hono/ws');
|
|
229
229
|
function logger() {
|
|
230
|
-
return
|
|
230
|
+
return _chunkAPQQFCPRcjs.getLogger.call(void 0, "inline-websocket-adapter");
|
|
231
231
|
}
|
|
232
232
|
var InlineWebSocketAdapter = class {
|
|
233
233
|
#handler;
|
|
@@ -398,7 +398,7 @@ function isLocalEngineEndpoint(endpoint) {
|
|
|
398
398
|
|
|
399
399
|
// src/registry/log.ts
|
|
400
400
|
function logger2() {
|
|
401
|
-
return
|
|
401
|
+
return _chunkAPQQFCPRcjs.getLogger.call(void 0, "registry");
|
|
402
402
|
}
|
|
403
403
|
|
|
404
404
|
// src/serverless/configure.ts
|
|
@@ -444,8 +444,8 @@ async function configureServerlessPool(config) {
|
|
|
444
444
|
);
|
|
445
445
|
}
|
|
446
446
|
const customConfig = config.configurePool;
|
|
447
|
-
const clientConfig =
|
|
448
|
-
const dcsRes = await
|
|
447
|
+
const clientConfig = _chunkDXN6RPPQcjs.convertRegistryConfigToClientConfig.call(void 0, config);
|
|
448
|
+
const dcsRes = await _chunkDXN6RPPQcjs.getDatacenters.call(void 0, clientConfig);
|
|
449
449
|
const poolName = _nullishCoalesce(customConfig.name, () => ( "default"));
|
|
450
450
|
const serverlessToken = _nullishCoalesce(config.token, () => ( config.publicToken));
|
|
451
451
|
const headers = {
|
|
@@ -467,7 +467,7 @@ async function configureServerlessPool(config) {
|
|
|
467
467
|
metadata: _nullishCoalesce(customConfig.metadata, () => ( {})),
|
|
468
468
|
drain_on_version_upgrade: _nullishCoalesce(customConfig.drainOnVersionUpgrade, () => ( true))
|
|
469
469
|
};
|
|
470
|
-
await
|
|
470
|
+
await _chunkDXN6RPPQcjs.updateRunnerConfig.call(void 0, clientConfig, poolName, {
|
|
471
471
|
datacenters: Object.fromEntries(
|
|
472
472
|
dcsRes.datacenters.map((dc) => [dc.name, serverlessConfig])
|
|
473
473
|
)
|
|
@@ -484,7 +484,7 @@ async function configureServerlessPool(config) {
|
|
|
484
484
|
logger2().warn({
|
|
485
485
|
msg: "serverless pool configuration attempt failed",
|
|
486
486
|
attempts,
|
|
487
|
-
error:
|
|
487
|
+
error: _chunkAPQQFCPRcjs.stringifyError.call(void 0, error)
|
|
488
488
|
});
|
|
489
489
|
await sleep(CONFIGURE_RETRY_DELAY_MS);
|
|
490
490
|
}
|
|
@@ -492,7 +492,7 @@ async function configureServerlessPool(config) {
|
|
|
492
492
|
logger2().error({
|
|
493
493
|
msg: "failed to configure serverless pool, validate endpoint is configured correctly then restart this process",
|
|
494
494
|
attempts,
|
|
495
|
-
error:
|
|
495
|
+
error: _chunkAPQQFCPRcjs.stringifyError.call(void 0, lastError)
|
|
496
496
|
});
|
|
497
497
|
throw lastError;
|
|
498
498
|
}
|
|
@@ -504,20 +504,20 @@ var _zod = require('zod');
|
|
|
504
504
|
var _v4 = require('zod/v4');
|
|
505
505
|
var warnedMissingVersion = false;
|
|
506
506
|
var EnvoyConfigSchema = _v4.z.object({
|
|
507
|
-
poolName: _v4.z.string().default(() => _nullishCoalesce(
|
|
507
|
+
poolName: _v4.z.string().default(() => _nullishCoalesce(_chunkAPQQFCPRcjs.getRivetPool.call(void 0, ), () => ( "default"))),
|
|
508
508
|
version: _v4.z.number().default(() => {
|
|
509
|
-
const version =
|
|
509
|
+
const version = _chunkAPQQFCPRcjs.getRivetEnvoyVersion.call(void 0, );
|
|
510
510
|
if (version !== void 0) return version;
|
|
511
|
-
if (
|
|
511
|
+
if (_chunkAPQQFCPRcjs.getNodeEnv.call(void 0, ) === "production" && !warnedMissingVersion) {
|
|
512
512
|
warnedMissingVersion = true;
|
|
513
|
-
|
|
513
|
+
_chunkAPQQFCPRcjs.getLogger.call(void 0, "rivetkit").error(
|
|
514
514
|
"RIVET_ENVOY_VERSION is not set. Actors will not be versioned, which means they won't be drained on deploy. This is only needed when self-hosting or using a custom envoy (not needed for Rivet Compute). Set this as a build arg in your Dockerfile. See https://rivet.dev/docs/actors/versions"
|
|
515
515
|
);
|
|
516
516
|
}
|
|
517
517
|
return 1;
|
|
518
518
|
}),
|
|
519
519
|
// Deprecated.
|
|
520
|
-
totalSlots: _v4.z.number().default(() => _nullishCoalesce(
|
|
520
|
+
totalSlots: _v4.z.number().default(() => _nullishCoalesce(_chunkAPQQFCPRcjs.getRivetTotalSlots.call(void 0, ), () => ( 1e5))),
|
|
521
521
|
envoyKey: _v4.z.string().optional()
|
|
522
522
|
});
|
|
523
523
|
|
|
@@ -555,7 +555,7 @@ var ServerlessConfigSchema = _v4.z.object({
|
|
|
555
555
|
*
|
|
556
556
|
* Can also be set via RIVET_PUBLIC_ENDPOINT environment variable.
|
|
557
557
|
*/
|
|
558
|
-
publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
558
|
+
publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkAPQQFCPRcjs.getRivetPublicEndpoint.call(void 0, )))),
|
|
559
559
|
/**
|
|
560
560
|
* Token that clients should use when connecting via the public endpoint.
|
|
561
561
|
*
|
|
@@ -563,7 +563,7 @@ var ServerlessConfigSchema = _v4.z.object({
|
|
|
563
563
|
*
|
|
564
564
|
* Can also be specified in the publicEndpoint URL as `https://namespace:token@host`.
|
|
565
565
|
*/
|
|
566
|
-
publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
566
|
+
publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkAPQQFCPRcjs.getRivetPublicToken.call(void 0, ))))
|
|
567
567
|
// There is no publicNamespace config option because the frontend and backend
|
|
568
568
|
// cannot use different namespaces. The namespace is extracted from the
|
|
569
569
|
// publicEndpoint URL auth syntax if provided.
|
|
@@ -617,7 +617,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
617
617
|
* Runtime binding to use for RivetKit core.
|
|
618
618
|
* */
|
|
619
619
|
runtime: RuntimeKindSchema.optional().transform((val, ctx) => {
|
|
620
|
-
const rawRuntime = _nullishCoalesce(val, () => (
|
|
620
|
+
const rawRuntime = _nullishCoalesce(val, () => ( _chunkAPQQFCPRcjs.getRivetkitRuntime.call(void 0, )));
|
|
621
621
|
if (rawRuntime === void 0) {
|
|
622
622
|
return "auto";
|
|
623
623
|
}
|
|
@@ -654,7 +654,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
654
654
|
* */
|
|
655
655
|
logging: _zod.z.object({
|
|
656
656
|
baseLogger: _zod.z.custom().optional(),
|
|
657
|
-
level:
|
|
657
|
+
level: _chunkAPQQFCPRcjs.LogLevelSchema.optional()
|
|
658
658
|
}).optional().default(() => ({})),
|
|
659
659
|
// MARK: Routing
|
|
660
660
|
// // This is a function to allow for lazy configuration of upgradeWebSocket on the
|
|
@@ -672,9 +672,9 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
672
672
|
*
|
|
673
673
|
* Can also be set via RIVET_ENDPOINT environment variables.
|
|
674
674
|
*/
|
|
675
|
-
endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => (
|
|
676
|
-
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
677
|
-
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
675
|
+
endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => ( _chunkAPQQFCPRcjs.getRivetEngine.call(void 0, ))), () => ( _chunkAPQQFCPRcjs.getRivetEndpoint.call(void 0, )))),
|
|
676
|
+
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkAPQQFCPRcjs.getRivetToken.call(void 0, )))),
|
|
677
|
+
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkAPQQFCPRcjs.getRivetNamespace.call(void 0, )))),
|
|
678
678
|
headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional().default({}),
|
|
679
679
|
// MARK: Client
|
|
680
680
|
// TODO:
|
|
@@ -714,21 +714,21 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
714
714
|
*
|
|
715
715
|
* Starts the full Rust engine process locally.
|
|
716
716
|
*/
|
|
717
|
-
startEngine: _zod.z.boolean().default(() =>
|
|
717
|
+
startEngine: _zod.z.boolean().default(() => _chunkAPQQFCPRcjs.getRivetRunEngine.call(void 0, )),
|
|
718
718
|
/**
|
|
719
719
|
* @experimental
|
|
720
720
|
*
|
|
721
721
|
* Host to bind the spawned local engine process to.
|
|
722
722
|
*/
|
|
723
|
-
engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
723
|
+
engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkAPQQFCPRcjs.getRivetRunEngineHost.call(void 0, ), () => ( ENGINE_HOST))),
|
|
724
724
|
/**
|
|
725
725
|
* @experimental
|
|
726
726
|
*
|
|
727
727
|
* Port to bind the spawned local engine process to.
|
|
728
728
|
*/
|
|
729
|
-
enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(
|
|
729
|
+
enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(_chunkAPQQFCPRcjs.getRivetRunEnginePort.call(void 0, ), () => ( ENGINE_PORT))),
|
|
730
730
|
/** @experimental */
|
|
731
|
-
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
731
|
+
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkAPQQFCPRcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunkAPQQFCPRcjs.VERSION))),
|
|
732
732
|
/**
|
|
733
733
|
* @experimental
|
|
734
734
|
*
|
|
@@ -776,7 +776,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
776
776
|
}))
|
|
777
777
|
}).transform((config, ctx) => {
|
|
778
778
|
var _a, _b, _c;
|
|
779
|
-
const isDevEnv =
|
|
779
|
+
const isDevEnv = _chunkAPQQFCPRcjs.isDev.call(void 0, );
|
|
780
780
|
const sqliteBackend = _nullishCoalesce(((_a = config.sqlite) == null ? void 0 : _a.backend), () => ( ((_b = config.test) == null ? void 0 : _b.sqliteBackend)));
|
|
781
781
|
if (config.runtime === "wasm" && sqliteBackend === "local") {
|
|
782
782
|
ctx.addIssue({
|
|
@@ -786,7 +786,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
788
|
const sqlite = config.runtime === "wasm" && config.sqlite === void 0 ? { backend: "remote" } : config.sqlite;
|
|
789
|
-
const parsedEndpoint = config.endpoint ?
|
|
789
|
+
const parsedEndpoint = config.endpoint ? _chunkDXN6RPPQcjs.tryParseEndpoint.call(void 0, ctx, {
|
|
790
790
|
endpoint: config.endpoint,
|
|
791
791
|
path: ["endpoint"],
|
|
792
792
|
namespace: config.namespace,
|
|
@@ -814,7 +814,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
814
814
|
);
|
|
815
815
|
const namespace = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.namespace), () => ( config.namespace)), () => ( "default"));
|
|
816
816
|
const token = _nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token));
|
|
817
|
-
const parsedPublicEndpoint = config.serverless.publicEndpoint ?
|
|
817
|
+
const parsedPublicEndpoint = config.serverless.publicEndpoint ? _chunkDXN6RPPQcjs.tryParseEndpoint.call(void 0, ctx, {
|
|
818
818
|
endpoint: config.serverless.publicEndpoint,
|
|
819
819
|
path: ["serverless", "publicEndpoint"]
|
|
820
820
|
}) : void 0;
|
|
@@ -917,7 +917,7 @@ var DocRegistryConfigSchema = _zod.z.object({
|
|
|
917
917
|
noWelcome: _zod.z.boolean().optional().describe("Disable the welcome message on startup. Default: false"),
|
|
918
918
|
sqlite: DocSqliteConfigSchema,
|
|
919
919
|
logging: _zod.z.object({
|
|
920
|
-
level:
|
|
920
|
+
level: _chunkAPQQFCPRcjs.LogLevelSchema.optional().describe(
|
|
921
921
|
"Log level for RivetKit. Default: 'warn'"
|
|
922
922
|
)
|
|
923
923
|
}).optional().describe("Logging configuration."),
|
|
@@ -962,7 +962,7 @@ function shouldAttachNativeKvError(message) {
|
|
|
962
962
|
function enrichNativeDatabaseError(database, error) {
|
|
963
963
|
var _a;
|
|
964
964
|
const bridgeReason = typeof error === "string" ? error : error instanceof Error ? error.message : void 0;
|
|
965
|
-
const bridged = bridgeReason === void 0 ? void 0 :
|
|
965
|
+
const bridged = bridgeReason === void 0 ? void 0 : _chunkSPJORZMMcjs.decodeBridgeRivetError.call(void 0, bridgeReason);
|
|
966
966
|
if (bridged) {
|
|
967
967
|
throw bridged;
|
|
968
968
|
}
|
|
@@ -2097,7 +2097,7 @@ function validateQueueComplete(schemas, name, response) {
|
|
|
2097
2097
|
return result.data;
|
|
2098
2098
|
}
|
|
2099
2099
|
function validationError(target, issues) {
|
|
2100
|
-
return new (0,
|
|
2100
|
+
return new (0, _chunkSPJORZMMcjs.RivetError)("actor", "validation_error", `Invalid ${target}`, {
|
|
2101
2101
|
public: true,
|
|
2102
2102
|
metadata: { issues }
|
|
2103
2103
|
});
|
|
@@ -2105,7 +2105,7 @@ function validationError(target, issues) {
|
|
|
2105
2105
|
|
|
2106
2106
|
// src/registry/run-handler-coordinator.ts
|
|
2107
2107
|
function runUnavailable(actorId, reason) {
|
|
2108
|
-
return new (0,
|
|
2108
|
+
return new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
2109
2109
|
"actor",
|
|
2110
2110
|
"run_handler_unavailable",
|
|
2111
2111
|
`Run handler control is unavailable for actor ${actorId}: ${reason}.`,
|
|
@@ -2326,16 +2326,16 @@ function normalizeQueueMessage(message) {
|
|
|
2326
2326
|
}
|
|
2327
2327
|
function normalizeWasmBridgeError(error) {
|
|
2328
2328
|
if (typeof error === "string") {
|
|
2329
|
-
return _nullishCoalesce(
|
|
2329
|
+
return _nullishCoalesce(_chunkSPJORZMMcjs.decodeBridgeRivetError.call(void 0, error), () => ( error));
|
|
2330
2330
|
}
|
|
2331
2331
|
if (error instanceof Error) {
|
|
2332
|
-
const bridged =
|
|
2332
|
+
const bridged = _chunkSPJORZMMcjs.decodeBridgeRivetError.call(void 0, error.message);
|
|
2333
2333
|
if (bridged) {
|
|
2334
2334
|
return bridged;
|
|
2335
2335
|
}
|
|
2336
2336
|
}
|
|
2337
2337
|
if (typeof error === "object" && error !== null && "reason" in error && typeof error.reason === "string") {
|
|
2338
|
-
const bridged =
|
|
2338
|
+
const bridged = _chunkSPJORZMMcjs.decodeBridgeRivetError.call(void 0, error.reason);
|
|
2339
2339
|
if (bridged) {
|
|
2340
2340
|
return bridged;
|
|
2341
2341
|
}
|
|
@@ -2357,7 +2357,7 @@ function callWasmSync(invoke) {
|
|
|
2357
2357
|
}
|
|
2358
2358
|
}
|
|
2359
2359
|
function unsupportedWasmMethod(method2) {
|
|
2360
|
-
throw new (0,
|
|
2360
|
+
throw new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
2361
2361
|
"runtime",
|
|
2362
2362
|
"unsupported",
|
|
2363
2363
|
`Unsupported wasm runtime method: ${method2}`,
|
|
@@ -2792,7 +2792,7 @@ var WasmCoreRuntime = (_class2 = class {
|
|
|
2792
2792
|
await callWasm(() => database.close());
|
|
2793
2793
|
}
|
|
2794
2794
|
async actorRuntimeSocketProvision(_ctx) {
|
|
2795
|
-
throw new (0,
|
|
2795
|
+
throw new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
2796
2796
|
"actor_runtime_socket",
|
|
2797
2797
|
"unsupported",
|
|
2798
2798
|
"Actor Runtime Socket is only available on Unix native runtimes.",
|
|
@@ -3161,7 +3161,7 @@ function loadedRuntimeKind(runtime) {
|
|
|
3161
3161
|
case "wasm":
|
|
3162
3162
|
return "wasm";
|
|
3163
3163
|
}
|
|
3164
|
-
throw new (0,
|
|
3164
|
+
throw new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
3165
3165
|
"config",
|
|
3166
3166
|
"unknown_runtime",
|
|
3167
3167
|
"RivetKit runtime must be NAPI or wasm.",
|
|
@@ -3201,7 +3201,7 @@ function normalizeRuntimeConfigForKind(config, runtimeKind) {
|
|
|
3201
3201
|
return config;
|
|
3202
3202
|
}
|
|
3203
3203
|
if (sqliteBackendForConfig(config) === "local") {
|
|
3204
|
-
throw new (0,
|
|
3204
|
+
throw new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
3205
3205
|
"config",
|
|
3206
3206
|
"wasm_local_sqlite",
|
|
3207
3207
|
"WebAssembly runtime cannot use local SQLite. Use remote SQLite instead.",
|
|
@@ -3267,14 +3267,14 @@ function getNativeConnPersistState(runtime, ctx, conn) {
|
|
|
3267
3267
|
return connState;
|
|
3268
3268
|
}
|
|
3269
3269
|
function stateMutationReentrantError() {
|
|
3270
|
-
return new (0,
|
|
3270
|
+
return new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
3271
3271
|
"actor",
|
|
3272
3272
|
"state_mutation_reentrant",
|
|
3273
3273
|
"State mutations are not allowed inside onStateChange."
|
|
3274
3274
|
);
|
|
3275
3275
|
}
|
|
3276
3276
|
function stateTransactionConflictError() {
|
|
3277
|
-
return new (0,
|
|
3277
|
+
return new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
3278
3278
|
"actor",
|
|
3279
3279
|
"state_transaction_conflict",
|
|
3280
3280
|
"State cannot be mutated by another action while an experimental state-aware database transaction is active.",
|
|
@@ -3282,7 +3282,7 @@ function stateTransactionConflictError() {
|
|
|
3282
3282
|
);
|
|
3283
3283
|
}
|
|
3284
3284
|
function databaseNotConfiguredError() {
|
|
3285
|
-
return new (0,
|
|
3285
|
+
return new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
3286
3286
|
"actor",
|
|
3287
3287
|
"database_not_configured",
|
|
3288
3288
|
"database is not configured for this actor",
|
|
@@ -3290,7 +3290,7 @@ function databaseNotConfiguredError() {
|
|
|
3290
3290
|
);
|
|
3291
3291
|
}
|
|
3292
3292
|
function databaseClientNotReadyError() {
|
|
3293
|
-
return new (0,
|
|
3293
|
+
return new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
3294
3294
|
"actor",
|
|
3295
3295
|
"database_client_not_ready",
|
|
3296
3296
|
"actor database client was not initialized before user code ran. this is an internal lifecycle error; the migration callback should have pre-warmed the client. file an issue if you can reproduce.",
|
|
@@ -3298,7 +3298,7 @@ function databaseClientNotReadyError() {
|
|
|
3298
3298
|
);
|
|
3299
3299
|
}
|
|
3300
3300
|
function runHandlerNotConfiguredError() {
|
|
3301
|
-
return new (0,
|
|
3301
|
+
return new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
3302
3302
|
"actor",
|
|
3303
3303
|
"run_handler_unavailable",
|
|
3304
3304
|
"Cannot schedule a run wake because this actor does not define a run handler.",
|
|
@@ -3306,7 +3306,7 @@ function runHandlerNotConfiguredError() {
|
|
|
3306
3306
|
);
|
|
3307
3307
|
}
|
|
3308
3308
|
function stateNotEnabledError() {
|
|
3309
|
-
return new (0,
|
|
3309
|
+
return new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
3310
3310
|
"actor",
|
|
3311
3311
|
"state_not_enabled",
|
|
3312
3312
|
"State not enabled. Must implement `createState` or `state` to use state. (https://www.rivet.dev/docs/actors/state/#initializing-state)",
|
|
@@ -3314,7 +3314,7 @@ function stateNotEnabledError() {
|
|
|
3314
3314
|
);
|
|
3315
3315
|
}
|
|
3316
3316
|
function nativeClientNotConfiguredError() {
|
|
3317
|
-
return new (0,
|
|
3317
|
+
return new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
3318
3318
|
"native",
|
|
3319
3319
|
"client_not_configured",
|
|
3320
3320
|
"native actor client is not configured",
|
|
@@ -3322,7 +3322,7 @@ function nativeClientNotConfiguredError() {
|
|
|
3322
3322
|
);
|
|
3323
3323
|
}
|
|
3324
3324
|
function nativeEndpointNotConfiguredError() {
|
|
3325
|
-
return new (0,
|
|
3325
|
+
return new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
3326
3326
|
"native",
|
|
3327
3327
|
"endpoint_not_configured",
|
|
3328
3328
|
"registry endpoint is required for native envoy startup",
|
|
@@ -3367,7 +3367,7 @@ async function cleanupNativeSleepRuntimeState(runtime, ctx, afterTrackedWorkDrai
|
|
|
3367
3367
|
}).catch((error) => {
|
|
3368
3368
|
logger2().warn({
|
|
3369
3369
|
msg: "deferred native sleep cleanup failed",
|
|
3370
|
-
error:
|
|
3370
|
+
error: _chunkAPQQFCPRcjs.stringifyError.call(void 0, error)
|
|
3371
3371
|
});
|
|
3372
3372
|
});
|
|
3373
3373
|
return;
|
|
@@ -3527,10 +3527,10 @@ function decodeValue(value) {
|
|
|
3527
3527
|
if (!value || value.length === 0) {
|
|
3528
3528
|
return void 0;
|
|
3529
3529
|
}
|
|
3530
|
-
return
|
|
3530
|
+
return _chunkAPQQFCPRcjs.decodeCborCompat.call(void 0, value);
|
|
3531
3531
|
}
|
|
3532
3532
|
function encodeValue(value) {
|
|
3533
|
-
return
|
|
3533
|
+
return _chunkAPQQFCPRcjs.encodeCborCompat.call(void 0, value);
|
|
3534
3534
|
}
|
|
3535
3535
|
function normalizeArgs(value) {
|
|
3536
3536
|
return Array.isArray(value) ? value : value === void 0 || value === null ? [] : [value];
|
|
@@ -3543,16 +3543,16 @@ function unwrapTsfnPayload(error, payload) {
|
|
|
3543
3543
|
}
|
|
3544
3544
|
function normalizeNativeBridgeError(error) {
|
|
3545
3545
|
if (typeof error === "string") {
|
|
3546
|
-
return _nullishCoalesce(
|
|
3546
|
+
return _nullishCoalesce(_chunkSPJORZMMcjs.decodeBridgeRivetError.call(void 0, error), () => ( error));
|
|
3547
3547
|
}
|
|
3548
3548
|
if (error instanceof Error) {
|
|
3549
|
-
const bridged =
|
|
3549
|
+
const bridged = _chunkSPJORZMMcjs.decodeBridgeRivetError.call(void 0, error.message);
|
|
3550
3550
|
if (bridged) {
|
|
3551
3551
|
return bridged;
|
|
3552
3552
|
}
|
|
3553
3553
|
}
|
|
3554
3554
|
if (typeof error === "object" && error !== null && "reason" in error && typeof error.reason === "string") {
|
|
3555
|
-
const bridged =
|
|
3555
|
+
const bridged = _chunkSPJORZMMcjs.decodeBridgeRivetError.call(void 0, error.reason);
|
|
3556
3556
|
if (bridged) {
|
|
3557
3557
|
return bridged;
|
|
3558
3558
|
}
|
|
@@ -3560,20 +3560,21 @@ function normalizeNativeBridgeError(error) {
|
|
|
3560
3560
|
return error;
|
|
3561
3561
|
}
|
|
3562
3562
|
function isStructuredBridgeError(error) {
|
|
3563
|
-
if (error instanceof
|
|
3563
|
+
if (error instanceof _chunkSPJORZMMcjs.RivetError) {
|
|
3564
3564
|
return true;
|
|
3565
3565
|
}
|
|
3566
|
-
return
|
|
3566
|
+
return _chunkSPJORZMMcjs.isRivetErrorLike.call(void 0, error) && "__type" in error && (error.__type === "RivetError" || error.__type === "ActorError");
|
|
3567
3567
|
}
|
|
3568
3568
|
function encodeNativeCallbackError(error) {
|
|
3569
|
-
const structuredError = isStructuredBridgeError(error) ? error :
|
|
3570
|
-
const bridgeError = new Error(
|
|
3569
|
+
const structuredError = isStructuredBridgeError(error) ? error : _chunkAPQQFCPRcjs.deconstructError.call(void 0, error, true);
|
|
3570
|
+
const bridgeError = new Error(_chunkSPJORZMMcjs.encodeBridgeRivetError.call(void 0, structuredError), {
|
|
3571
3571
|
cause: error instanceof Error ? error : void 0
|
|
3572
3572
|
});
|
|
3573
3573
|
return Object.assign(bridgeError, {
|
|
3574
3574
|
group: structuredError.group,
|
|
3575
3575
|
code: structuredError.code,
|
|
3576
|
-
metadata: structuredError.metadata
|
|
3576
|
+
metadata: structuredError.metadata,
|
|
3577
|
+
rayId: structuredError.rayId
|
|
3577
3578
|
});
|
|
3578
3579
|
}
|
|
3579
3580
|
async function callNative(invoke) {
|
|
@@ -3591,9 +3592,9 @@ function callNativeSync(invoke) {
|
|
|
3591
3592
|
}
|
|
3592
3593
|
}
|
|
3593
3594
|
function isClosedTaskRegistrationError(error) {
|
|
3594
|
-
const metadata = error instanceof
|
|
3595
|
+
const metadata = error instanceof _chunkSPJORZMMcjs.RivetError ? error.metadata : void 0;
|
|
3595
3596
|
const metadataError = metadata && typeof metadata === "object" && "error" in metadata ? metadata.error : void 0;
|
|
3596
|
-
return error instanceof
|
|
3597
|
+
return error instanceof _chunkSPJORZMMcjs.RivetError && error.group === "core" && error.code === _chunkSPJORZMMcjs.INTERNAL_ERROR_CODE && typeof metadataError === "string" && /actor task registration is (closed|not configured)/.test(metadataError);
|
|
3597
3598
|
}
|
|
3598
3599
|
async function createCancellationTokenHandle(runtime, signal) {
|
|
3599
3600
|
if (!signal) {
|
|
@@ -3616,7 +3617,7 @@ function decodeWorkflowCbor(data) {
|
|
|
3616
3617
|
return null;
|
|
3617
3618
|
}
|
|
3618
3619
|
try {
|
|
3619
|
-
return
|
|
3620
|
+
return _chunkAPQQFCPRcjs.decodeCborCompat.call(void 0, new Uint8Array(data));
|
|
3620
3621
|
} catch (e5) {
|
|
3621
3622
|
return null;
|
|
3622
3623
|
}
|
|
@@ -3729,7 +3730,7 @@ function serializeWorkflowHistoryForJson(data) {
|
|
|
3729
3730
|
if (data === null) {
|
|
3730
3731
|
return null;
|
|
3731
3732
|
}
|
|
3732
|
-
const history =
|
|
3733
|
+
const history = _chunkCZKQ2UR5cjs.decodeWorkflowHistoryTransport.call(void 0, data);
|
|
3733
3734
|
return jsonSafe({
|
|
3734
3735
|
nameRegistry: [...history.nameRegistry],
|
|
3735
3736
|
entries: history.entries.map((entry) => ({
|
|
@@ -3893,7 +3894,7 @@ var NativeConnAdapter = class {
|
|
|
3893
3894
|
},
|
|
3894
3895
|
(newValue) => {
|
|
3895
3896
|
assertCurrentState();
|
|
3896
|
-
|
|
3897
|
+
_chunkAPQQFCPRcjs.assertJsonCompatValue.call(void 0, newValue);
|
|
3897
3898
|
}
|
|
3898
3899
|
);
|
|
3899
3900
|
}
|
|
@@ -3901,7 +3902,7 @@ var NativeConnAdapter = class {
|
|
|
3901
3902
|
var _a;
|
|
3902
3903
|
(_a = this.#assertCanMutateState) == null ? void 0 : _a.call(this);
|
|
3903
3904
|
const nextValue = unwrapWriteThroughProxy(value);
|
|
3904
|
-
|
|
3905
|
+
_chunkAPQQFCPRcjs.assertJsonCompatValue.call(void 0, nextValue);
|
|
3905
3906
|
this.#writeState(nextValue, { writeNative: true });
|
|
3906
3907
|
}
|
|
3907
3908
|
initializeState(value) {
|
|
@@ -4284,7 +4285,7 @@ var NativeQueueAdapter = class {
|
|
|
4284
4285
|
async nextBatch(options) {
|
|
4285
4286
|
const completable = (options == null ? void 0 : options.completable) === true;
|
|
4286
4287
|
if (this.#pendingCompletableMessageIds.size > 0) {
|
|
4287
|
-
throw new (0,
|
|
4288
|
+
throw new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
4288
4289
|
"queue",
|
|
4289
4290
|
"previous_message_not_completed",
|
|
4290
4291
|
"Previous completable queue message is not completed. Call `message.complete(...)` before receiving the next message.",
|
|
@@ -4451,7 +4452,7 @@ var NativeQueueAdapter = class {
|
|
|
4451
4452
|
}
|
|
4452
4453
|
yield message;
|
|
4453
4454
|
} catch (error) {
|
|
4454
|
-
if (
|
|
4455
|
+
if (_chunkSPJORZMMcjs.isActorAbortedError.call(void 0, error)) {
|
|
4455
4456
|
return;
|
|
4456
4457
|
}
|
|
4457
4458
|
throw error;
|
|
@@ -4472,7 +4473,7 @@ var NativeQueueAdapter = class {
|
|
|
4472
4473
|
...message,
|
|
4473
4474
|
complete: async (response) => {
|
|
4474
4475
|
if (typeof message.complete !== "function") {
|
|
4475
|
-
throw new (0,
|
|
4476
|
+
throw new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
4476
4477
|
"queue",
|
|
4477
4478
|
"complete_not_configured",
|
|
4478
4479
|
`Queue '${message.name}' does not support completion responses.`,
|
|
@@ -4484,7 +4485,7 @@ var NativeQueueAdapter = class {
|
|
|
4484
4485
|
);
|
|
4485
4486
|
}
|
|
4486
4487
|
if (completed) {
|
|
4487
|
-
throw new (0,
|
|
4488
|
+
throw new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
4488
4489
|
"queue",
|
|
4489
4490
|
"already_completed",
|
|
4490
4491
|
"Queue message was already completed.",
|
|
@@ -4975,7 +4976,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4975
4976
|
},
|
|
4976
4977
|
(newValue) => {
|
|
4977
4978
|
assertCurrentState();
|
|
4978
|
-
|
|
4979
|
+
_chunkAPQQFCPRcjs.assertJsonCompatValue.call(void 0, newValue);
|
|
4979
4980
|
}
|
|
4980
4981
|
);
|
|
4981
4982
|
}
|
|
@@ -4987,7 +4988,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4987
4988
|
}
|
|
4988
4989
|
this.#assertCanMutateState();
|
|
4989
4990
|
const nextValue = unwrapWriteThroughProxy(value);
|
|
4990
|
-
|
|
4991
|
+
_chunkAPQQFCPRcjs.assertJsonCompatValue.call(void 0, nextValue);
|
|
4991
4992
|
this.#writeState(nextValue, { scheduleSave: true });
|
|
4992
4993
|
}
|
|
4993
4994
|
initializeState(value) {
|
|
@@ -5171,7 +5172,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5171
5172
|
log: {
|
|
5172
5173
|
debug: (obj) => logger2().debug(obj)
|
|
5173
5174
|
},
|
|
5174
|
-
nativeDatabaseProvider:
|
|
5175
|
+
nativeDatabaseProvider: _chunkHRJHLVHZcjs.registerNativeStateTransactionOpener.call(void 0,
|
|
5175
5176
|
{
|
|
5176
5177
|
open: async (requestedActorId) => {
|
|
5177
5178
|
void requestedActorId;
|
|
@@ -5194,7 +5195,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5194
5195
|
return this.#db;
|
|
5195
5196
|
}
|
|
5196
5197
|
#bindDatabaseClient(client) {
|
|
5197
|
-
return
|
|
5198
|
+
return _chunkHRJHLVHZcjs.bindNativeStateTransactionContext.call(void 0, client, {
|
|
5198
5199
|
enter: async () => await this.#enterStateTransaction(),
|
|
5199
5200
|
exit: (scope) => this.#exitStateTransaction(
|
|
5200
5201
|
scope
|
|
@@ -5398,7 +5399,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5398
5399
|
const trackedPromise = Promise.resolve(promise).catch((error) => {
|
|
5399
5400
|
logger2().warn({
|
|
5400
5401
|
msg: "keepAwake promise rejected",
|
|
5401
|
-
error:
|
|
5402
|
+
error: _chunkAPQQFCPRcjs.stringifyError.call(void 0, error)
|
|
5402
5403
|
});
|
|
5403
5404
|
}).then(() => null);
|
|
5404
5405
|
try {
|
|
@@ -5860,7 +5861,7 @@ function validateInspectorTabSource(tabId, resolved) {
|
|
|
5860
5861
|
function buildNativeFactory(runtime, registryConfig, definition) {
|
|
5861
5862
|
var _a;
|
|
5862
5863
|
const config = definition.config;
|
|
5863
|
-
const databaseProvider = _nullishCoalesce(config.db, () => (
|
|
5864
|
+
const databaseProvider = _nullishCoalesce(config.db, () => ( _chunkHRJHLVHZcjs.db.call(void 0, )));
|
|
5864
5865
|
const actionHandlers = _chunk4KGXFC6Mcjs.flattenActionHandlers.call(void 0, config.actions);
|
|
5865
5866
|
const schemaConfig = {
|
|
5866
5867
|
actionInputSchemas: _chunk4KGXFC6Mcjs.flattenActionInputSchemas.call(void 0,
|
|
@@ -5871,9 +5872,9 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5871
5872
|
events: config.events,
|
|
5872
5873
|
queues: config.queues
|
|
5873
5874
|
};
|
|
5874
|
-
const createClient = () =>
|
|
5875
|
-
new (0,
|
|
5876
|
-
|
|
5875
|
+
const createClient = () => _chunkDXN6RPPQcjs.createClientWithDriver.call(void 0,
|
|
5876
|
+
new (0, _chunkDXN6RPPQcjs.RemoteEngineControlClient)(
|
|
5877
|
+
_chunkDXN6RPPQcjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
|
|
5877
5878
|
),
|
|
5878
5879
|
{ encoding: "bare" }
|
|
5879
5880
|
);
|
|
@@ -5934,7 +5935,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5934
5935
|
}
|
|
5935
5936
|
});
|
|
5936
5937
|
const errorResponse = (error, status) => {
|
|
5937
|
-
const rivetError =
|
|
5938
|
+
const rivetError = _chunkSPJORZMMcjs.toRivetError.call(void 0, error);
|
|
5938
5939
|
return jsonResponse(
|
|
5939
5940
|
{
|
|
5940
5941
|
group: rivetError.group,
|
|
@@ -6034,7 +6035,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6034
6035
|
body = await jsRequest.json();
|
|
6035
6036
|
} catch (e6) {
|
|
6036
6037
|
return errorResponse(
|
|
6037
|
-
new (0,
|
|
6038
|
+
new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
6038
6039
|
"actor",
|
|
6039
6040
|
"invalid_request",
|
|
6040
6041
|
"Invalid inspector JSON body",
|
|
@@ -6046,7 +6047,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6046
6047
|
const name = _nullishCoalesce(body.name, () => ( ""));
|
|
6047
6048
|
if (name === "") {
|
|
6048
6049
|
return errorResponse(
|
|
6049
|
-
new (0,
|
|
6050
|
+
new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
6050
6051
|
"actor",
|
|
6051
6052
|
"invalid_request",
|
|
6052
6053
|
"Queue message name must not be empty",
|
|
@@ -6055,7 +6056,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6055
6056
|
400
|
|
6056
6057
|
);
|
|
6057
6058
|
}
|
|
6058
|
-
const cbor =
|
|
6059
|
+
const cbor = _chunkAPQQFCPRcjs.encodeCborCompat.call(void 0,
|
|
6059
6060
|
_nullishCoalesce(body.body, () => ( null))
|
|
6060
6061
|
);
|
|
6061
6062
|
const message = await runtime.actorQueueSend(ctx, name, cbor);
|
|
@@ -6220,7 +6221,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6220
6221
|
const action = actionHandlers[actionName];
|
|
6221
6222
|
if (!action) {
|
|
6222
6223
|
return errorResponse(
|
|
6223
|
-
new (0,
|
|
6224
|
+
new (0, _chunkSPJORZMMcjs.RivetError)(
|
|
6224
6225
|
"action",
|
|
6225
6226
|
"action_not_found",
|
|
6226
6227
|
`Action ${actionName} not found`
|
|
@@ -6593,7 +6594,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6593
6594
|
);
|
|
6594
6595
|
}
|
|
6595
6596
|
if (!result) {
|
|
6596
|
-
throw
|
|
6597
|
+
throw _chunkSPJORZMMcjs.forbiddenError.call(void 0, );
|
|
6597
6598
|
}
|
|
6598
6599
|
} finally {
|
|
6599
6600
|
await actorCtx.dispose();
|
|
@@ -6639,7 +6640,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6639
6640
|
new Response(null, { status: 404 })
|
|
6640
6641
|
);
|
|
6641
6642
|
}
|
|
6642
|
-
const rawConnParams = jsRequest.headers.get(
|
|
6643
|
+
const rawConnParams = jsRequest.headers.get(_chunkDXN6RPPQcjs.HEADER_CONN_PARAMS);
|
|
6643
6644
|
let requestCtx;
|
|
6644
6645
|
let conn;
|
|
6645
6646
|
try {
|
|
@@ -6664,7 +6665,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6664
6665
|
requestCtx,
|
|
6665
6666
|
jsRequest
|
|
6666
6667
|
);
|
|
6667
|
-
if (!
|
|
6668
|
+
if (!_chunkDXN6RPPQcjs.isResponseLike.call(void 0, response)) {
|
|
6668
6669
|
throw new Error(
|
|
6669
6670
|
"onRequest handler must return a Response"
|
|
6670
6671
|
);
|
|
@@ -6739,7 +6740,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6739
6740
|
var _a2;
|
|
6740
6741
|
const { ctx } = unwrapTsfnPayload(error, payload);
|
|
6741
6742
|
const history = (_a2 = getNativeWorkflowInspector(ctx)) == null ? void 0 : _a2.getHistory();
|
|
6742
|
-
return history == null ? void 0 :
|
|
6743
|
+
return history == null ? void 0 : _chunkAPQQFCPRcjs.toUint8Array.call(void 0, history);
|
|
6743
6744
|
}
|
|
6744
6745
|
) : void 0,
|
|
6745
6746
|
replayWorkflow: _chunk4KGXFC6Mcjs.hasRunInspectorConfig.call(void 0, config.run) ? wrapNativeCallback(
|
|
@@ -6753,7 +6754,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6753
6754
|
return void 0;
|
|
6754
6755
|
}
|
|
6755
6756
|
const history = await _asyncNullishCoalesce(await workflowInspector.replayFromStep(entryId), async () => ( null));
|
|
6756
|
-
return history == null ? void 0 :
|
|
6757
|
+
return history == null ? void 0 : _chunkAPQQFCPRcjs.toUint8Array.call(void 0, history);
|
|
6757
6758
|
}
|
|
6758
6759
|
) : void 0,
|
|
6759
6760
|
actions: Object.fromEntries(
|
|
@@ -6817,7 +6818,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6817
6818
|
name
|
|
6818
6819
|
);
|
|
6819
6820
|
if (canPublish && !await canPublish(actorCtx)) {
|
|
6820
|
-
throw
|
|
6821
|
+
throw _chunkSPJORZMMcjs.forbiddenError.call(void 0, );
|
|
6821
6822
|
}
|
|
6822
6823
|
const decodedBody = decodeValue(body);
|
|
6823
6824
|
if (wait) {
|
|
@@ -6877,7 +6878,7 @@ async function buildServeConfig(config) {
|
|
|
6877
6878
|
poolName: config.envoy.poolName,
|
|
6878
6879
|
handleInspectorHttpInRuntime: true,
|
|
6879
6880
|
serverlessBasePath: config.serverless.basePath,
|
|
6880
|
-
serverlessPackageVersion:
|
|
6881
|
+
serverlessPackageVersion: _chunkAPQQFCPRcjs.VERSION,
|
|
6881
6882
|
serverlessClientEndpoint: config.publicEndpoint,
|
|
6882
6883
|
serverlessClientNamespace: config.publicNamespace,
|
|
6883
6884
|
serverlessClientToken: config.publicToken,
|
|
@@ -6890,19 +6891,19 @@ async function buildServeConfig(config) {
|
|
|
6890
6891
|
} catch (error) {
|
|
6891
6892
|
logger2().warn({
|
|
6892
6893
|
msg: "could not resolve a local engine binary; if a local engine must be spawned it will fail with engine.binary_unavailable \u2014 set RIVET_ENGINE_BINARY_PATH or install the @rivetkit/engine-cli platform package",
|
|
6893
|
-
error:
|
|
6894
|
+
error: _chunkAPQQFCPRcjs.stringifyError.call(void 0, error)
|
|
6894
6895
|
});
|
|
6895
6896
|
}
|
|
6896
6897
|
serveConfig.engineHost = config.engineHost;
|
|
6897
6898
|
serveConfig.enginePort = config.enginePort;
|
|
6898
6899
|
if ((_a = config.test) == null ? void 0 : _a.enabled) {
|
|
6899
|
-
serveConfig.inspectorTestToken = _nullishCoalesce(
|
|
6900
|
+
serveConfig.inspectorTestToken = _nullishCoalesce(_chunkAPQQFCPRcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
|
|
6900
6901
|
}
|
|
6901
6902
|
return serveConfig;
|
|
6902
6903
|
}
|
|
6903
6904
|
async function buildRegistryWithRuntime(config, runtime) {
|
|
6904
6905
|
var _a;
|
|
6905
|
-
if (((_a = config.test) == null ? void 0 : _a.enabled) &&
|
|
6906
|
+
if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunkAPQQFCPRcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
|
|
6906
6907
|
trySetProcessEnv("_RIVET_TEST_INSPECTOR_TOKEN", "token");
|
|
6907
6908
|
}
|
|
6908
6909
|
if (runtime.kind === "napi") {
|
|
@@ -6957,7 +6958,7 @@ function createApplicationFetch(application) {
|
|
|
6957
6958
|
body
|
|
6958
6959
|
})
|
|
6959
6960
|
);
|
|
6960
|
-
if (!
|
|
6961
|
+
if (!_chunkDXN6RPPQcjs.isResponseLike.call(void 0, response)) {
|
|
6961
6962
|
throw new TypeError(
|
|
6962
6963
|
"registry.listen() application fetch must return a Response"
|
|
6963
6964
|
);
|
|
@@ -6994,7 +6995,7 @@ var Registry = class {
|
|
|
6994
6995
|
var _a;
|
|
6995
6996
|
this.#config = config;
|
|
6996
6997
|
if ((_a = config.logging) == null ? void 0 : _a.baseLogger) {
|
|
6997
|
-
|
|
6998
|
+
_chunkAPQQFCPRcjs.configureBaseLogger.call(void 0, config.logging.baseLogger);
|
|
6998
6999
|
}
|
|
6999
7000
|
this.#buildConfiguredRegistry = _nullishCoalesce((deps == null ? void 0 : deps.buildConfiguredRegistry), () => ( buildConfiguredRegistry));
|
|
7000
7001
|
this.routes = {
|
|
@@ -7220,11 +7221,11 @@ var Registry = class {
|
|
|
7220
7221
|
* ```
|
|
7221
7222
|
*/
|
|
7222
7223
|
async listen(opts = {}) {
|
|
7223
|
-
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => (
|
|
7224
|
-
const publicDir = _nullishCoalesce(opts.publicDir, () => (
|
|
7224
|
+
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => ( _chunkAPQQFCPRcjs.parsePortEnv.call(void 0, process.env.RIVET_PORT))), () => ( 3e3));
|
|
7225
|
+
const publicDir = _nullishCoalesce(opts.publicDir, () => ( _chunkAPQQFCPRcjs.getRivetkitPublicDir.call(void 0, )));
|
|
7225
7226
|
const config = this.parseConfig();
|
|
7226
7227
|
const application = opts.application ? createApplicationFetch(opts.application) : void 0;
|
|
7227
|
-
if (application &&
|
|
7228
|
+
if (application && _chunkAPQQFCPRcjs.getRivetkitRuntimeMode.call(void 0, ) !== "serverless") {
|
|
7228
7229
|
if (config.runtime === "wasm") {
|
|
7229
7230
|
throw new Error(
|
|
7230
7231
|
"registry.listen() requires the native runtime; use an application-owned HTTP server with WebAssembly"
|
|
@@ -7298,7 +7299,7 @@ var Registry = class {
|
|
|
7298
7299
|
return jsonRouteResponse(503, {
|
|
7299
7300
|
status: "not_started",
|
|
7300
7301
|
runtime: "rivetkit",
|
|
7301
|
-
version:
|
|
7302
|
+
version: _chunkAPQQFCPRcjs.VERSION
|
|
7302
7303
|
});
|
|
7303
7304
|
}
|
|
7304
7305
|
const { runtime, registry } = configured;
|
|
@@ -7306,7 +7307,7 @@ var Registry = class {
|
|
|
7306
7307
|
return jsonRouteResponse(501, {
|
|
7307
7308
|
status: "unsupported",
|
|
7308
7309
|
runtime: "rivetkit",
|
|
7309
|
-
version:
|
|
7310
|
+
version: _chunkAPQQFCPRcjs.VERSION
|
|
7310
7311
|
});
|
|
7311
7312
|
}
|
|
7312
7313
|
const response = await runtime.registryHealth(registry);
|
|
@@ -7553,7 +7554,7 @@ var Registry = class {
|
|
|
7553
7554
|
);
|
|
7554
7555
|
}
|
|
7555
7556
|
if (this.#runtimeReadyPromise) return this.#runtimeReadyPromise;
|
|
7556
|
-
if (
|
|
7557
|
+
if (_chunkAPQQFCPRcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
7557
7558
|
return Promise.reject(
|
|
7558
7559
|
new Error(
|
|
7559
7560
|
"registry.startAndWait() requires envoy runtime mode; serverless registries become ready per request"
|
|
@@ -7623,8 +7624,8 @@ var Registry = class {
|
|
|
7623
7624
|
* ```
|
|
7624
7625
|
*/
|
|
7625
7626
|
start() {
|
|
7626
|
-
if (
|
|
7627
|
-
const publicDir = _nullishCoalesce(
|
|
7627
|
+
if (_chunkAPQQFCPRcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
7628
|
+
const publicDir = _nullishCoalesce(_chunkAPQQFCPRcjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
|
|
7628
7629
|
this.listen({ publicDir }).catch((error) => {
|
|
7629
7630
|
logger2().error({ error }, "auto-listen failed; exiting");
|
|
7630
7631
|
if (typeof process !== "undefined" && typeof process.exit === "function") {
|
|
@@ -7645,7 +7646,7 @@ var Registry = class {
|
|
|
7645
7646
|
};
|
|
7646
7647
|
console.log();
|
|
7647
7648
|
console.log(
|
|
7648
|
-
` RivetKit ${
|
|
7649
|
+
` RivetKit ${_chunkAPQQFCPRcjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
|
|
7649
7650
|
);
|
|
7650
7651
|
if (config.namespace !== "default") {
|
|
7651
7652
|
logLine("Namespace", config.namespace);
|
|
@@ -7721,5 +7722,5 @@ function setup(input) {
|
|
|
7721
7722
|
|
|
7722
7723
|
|
|
7723
7724
|
|
|
7724
|
-
exports.ALLOWED_PUBLIC_HEADERS =
|
|
7725
|
+
exports.ALLOWED_PUBLIC_HEADERS = _chunkDXN6RPPQcjs.ALLOWED_PUBLIC_HEADERS; exports.ActorDefinition = ActorDefinition; exports.ActorError = _chunkSPJORZMMcjs.RivetError; exports.ActorsSchema = ActorsSchema; exports.DocConfigurePoolSchema = DocConfigurePoolSchema; exports.DocEnvoyConfigSchema = DocEnvoyConfigSchema; exports.DocRegistryConfigSchema = DocRegistryConfigSchema; exports.DocServerlessConfigSchema = DocServerlessConfigSchema; exports.DocSqliteConfigSchema = DocSqliteConfigSchema; exports.InlineWebSocketAdapter = InlineWebSocketAdapter; exports.Registry = Registry; exports.RegistryConfigSchema = RegistryConfigSchema; exports.RivetError = _chunkSPJORZMMcjs.RivetError; exports.RuntimeKindSchema = RuntimeKindSchema; exports.SqliteBackendSchema = SqliteBackendSchema; exports.SqliteConfigSchema = SqliteConfigSchema; exports.TestConfigSchema = TestConfigSchema; exports.UserError = _chunkSPJORZMMcjs.UserError; exports.WasmRuntimeConfigSchema = WasmRuntimeConfigSchema; exports.actor = actor; exports.buildActorNames = buildActorNames; exports.createClientWithDriver = _chunkDXN6RPPQcjs.createClientWithDriver; exports.defineRunHandler = _chunk4KGXFC6Mcjs.defineRunHandler; exports.event = event; exports.isStaticActorDefinition = isStaticActorDefinition; exports.isStaticActorInstance = isStaticActorInstance; exports.lookupInRegistry = lookupInRegistry; exports.noopNext = _chunkAPQQFCPRcjs.noopNext; exports.queue = queue; exports.setup = setup; exports.toUint8Array = _chunkAPQQFCPRcjs.toUint8Array;
|
|
7725
7726
|
//# sourceMappingURL=mod.cjs.map
|