rivetkit 2.3.12-rc.2 → 2.3.12-rc.3
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.js +52 -29
- 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/agent-os/index.cjs +1 -1
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.js +1 -1
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-6XR7IKBZ.js → chunk-34Q4YVCX.js} +2 -2
- package/dist/tsup/{chunk-APQQFCPR.cjs → chunk-4ESGNS3Z.cjs} +2 -2
- package/dist/tsup/{chunk-APQQFCPR.cjs.map → chunk-4ESGNS3Z.cjs.map} +1 -1
- package/dist/tsup/{chunk-XBPOYV4E.cjs → chunk-EQKSWDIH.cjs} +3 -3
- package/dist/tsup/{chunk-XBPOYV4E.cjs.map → chunk-EQKSWDIH.cjs.map} +1 -1
- package/dist/tsup/{chunk-WTD54OHL.cjs → chunk-IJWTHKH6.cjs} +3 -3
- package/dist/tsup/{chunk-WTD54OHL.cjs.map → chunk-IJWTHKH6.cjs.map} +1 -1
- package/dist/tsup/{chunk-JZGMOEEI.js → chunk-NHI5L7C7.js} +3 -3
- package/dist/tsup/{chunk-HRJHLVHZ.cjs → chunk-O6H3BUN4.cjs} +3 -3
- package/dist/tsup/{chunk-HRJHLVHZ.cjs.map → chunk-O6H3BUN4.cjs.map} +1 -1
- package/dist/tsup/{chunk-YW75TS76.js → chunk-OLGQYFUW.js} +2 -2
- package/dist/tsup/{chunk-YW75TS76.js.map → chunk-OLGQYFUW.js.map} +1 -1
- package/dist/tsup/{chunk-IU6TTH6L.cjs → chunk-OX6WVQE6.cjs} +10 -10
- package/dist/tsup/{chunk-IU6TTH6L.cjs.map → chunk-OX6WVQE6.cjs.map} +1 -1
- package/dist/tsup/{chunk-KRQI5GXM.js → chunk-PSXMESQJ.js} +2 -2
- package/dist/tsup/{chunk-DXN6RPPQ.cjs → chunk-PZBWSCQR.cjs} +188 -165
- package/dist/tsup/chunk-PZBWSCQR.cjs.map +1 -0
- package/dist/tsup/{chunk-CZKQ2UR5.cjs → chunk-QLOBB27M.cjs} +4 -4
- package/dist/tsup/{chunk-CZKQ2UR5.cjs.map → chunk-QLOBB27M.cjs.map} +1 -1
- package/dist/tsup/{chunk-GGGZ4TN7.cjs → chunk-UBB32UOG.cjs} +7 -7
- package/dist/tsup/{chunk-GGGZ4TN7.cjs.map → chunk-UBB32UOG.cjs.map} +1 -1
- package/dist/tsup/{chunk-3JBE7REK.js → chunk-UN5JNDBT.js} +4 -4
- package/dist/tsup/{chunk-KPZQI3TG.js → chunk-WVFTFWJL.js} +2 -2
- package/dist/tsup/{chunk-ZEIH7S4M.js → chunk-XI4MEUUI.js} +2 -2
- package/dist/tsup/{chunk-BK2JOGQQ.js → chunk-YYIDQBBM.js} +57 -34
- package/dist/tsup/chunk-YYIDQBBM.js.map +1 -0
- package/dist/tsup/client/mod.cjs +5 -5
- package/dist/tsup/client/mod.js +4 -4
- package/dist/tsup/common/log.cjs +2 -2
- package/dist/tsup/common/log.js +1 -1
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/db/drizzle.cjs +2 -2
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +3 -3
- package/dist/tsup/db/mod.js +2 -2
- package/dist/tsup/inspector/mod.cjs +5 -5
- package/dist/tsup/inspector/mod.js +4 -4
- package/dist/tsup/inspector/workflow.cjs +4 -4
- package/dist/tsup/inspector/workflow.js +3 -3
- package/dist/tsup/mod.cjs +72 -72
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.js +7 -7
- package/dist/tsup/test/mod.cjs +6 -6
- package/dist/tsup/test/mod.js +4 -4
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +7 -7
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.js +4 -4
- package/package.json +8 -8
- package/src/client/actor-handle.ts +15 -10
- package/src/engine-client/mod.ts +51 -20
- package/dist/tsup/chunk-BK2JOGQQ.js.map +0 -1
- package/dist/tsup/chunk-DXN6RPPQ.cjs.map +0 -1
- /package/dist/tsup/{chunk-6XR7IKBZ.js.map → chunk-34Q4YVCX.js.map} +0 -0
- /package/dist/tsup/{chunk-JZGMOEEI.js.map → chunk-NHI5L7C7.js.map} +0 -0
- /package/dist/tsup/{chunk-KRQI5GXM.js.map → chunk-PSXMESQJ.js.map} +0 -0
- /package/dist/tsup/{chunk-3JBE7REK.js.map → chunk-UN5JNDBT.js.map} +0 -0
- /package/dist/tsup/{chunk-KPZQI3TG.js.map → chunk-WVFTFWJL.js.map} +0 -0
- /package/dist/tsup/{chunk-ZEIH7S4M.js.map → chunk-XI4MEUUI.js.map} +0 -0
package/dist/tsup/mod.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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 _chunkQLOBB27Mcjs = require('./chunk-QLOBB27M.cjs');
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
|
|
@@ -13,10 +14,9 @@
|
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
|
|
16
|
-
var _chunk4KGXFC6Mcjs = require('./chunk-4KGXFC6M.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunk4KGXFC6Mcjs = require('./chunk-4KGXFC6M.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
@@ -27,18 +27,18 @@ var _chunkCZKQ2UR5cjs = require('./chunk-CZKQ2UR5.cjs');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkPZBWSCQRcjs = require('./chunk-PZBWSCQR.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
var _chunkMYWZCDMLcjs = require('./chunk-MYWZCDML.cjs');
|
|
35
|
-
require('./chunk-XBPOYV4E.cjs');
|
|
36
35
|
|
|
37
36
|
|
|
38
37
|
|
|
39
38
|
|
|
40
|
-
var
|
|
39
|
+
var _chunkO6H3BUN4cjs = require('./chunk-O6H3BUN4.cjs');
|
|
41
40
|
require('./chunk-KVFIONKQ.cjs');
|
|
41
|
+
require('./chunk-EQKSWDIH.cjs');
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
@@ -71,7 +71,7 @@ require('./chunk-KVFIONKQ.cjs');
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
var
|
|
74
|
+
var _chunk4ESGNS3Zcjs = require('./chunk-4ESGNS3Z.cjs');
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
|
|
@@ -87,7 +87,7 @@ var _chunkSPJORZMMcjs = require('./chunk-SPJORZMM.cjs');
|
|
|
87
87
|
|
|
88
88
|
// src/actor/log.ts
|
|
89
89
|
function loggerWithoutContext() {
|
|
90
|
-
return
|
|
90
|
+
return _chunk4ESGNS3Zcjs.getLogger.call(void 0, "actor-runtime");
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// src/actor/definition.ts
|
|
@@ -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 _chunk4ESGNS3Zcjs.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 _chunk4ESGNS3Zcjs.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 = _chunkPZBWSCQRcjs.convertRegistryConfigToClientConfig.call(void 0, config);
|
|
448
|
+
const dcsRes = await _chunkPZBWSCQRcjs.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 _chunkPZBWSCQRcjs.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: _chunk4ESGNS3Zcjs.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: _chunk4ESGNS3Zcjs.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(_chunk4ESGNS3Zcjs.getRivetPool.call(void 0, ), () => ( "default"))),
|
|
508
508
|
version: _v4.z.number().default(() => {
|
|
509
|
-
const version =
|
|
509
|
+
const version = _chunk4ESGNS3Zcjs.getRivetEnvoyVersion.call(void 0, );
|
|
510
510
|
if (version !== void 0) return version;
|
|
511
|
-
if (
|
|
511
|
+
if (_chunk4ESGNS3Zcjs.getNodeEnv.call(void 0, ) === "production" && !warnedMissingVersion) {
|
|
512
512
|
warnedMissingVersion = true;
|
|
513
|
-
|
|
513
|
+
_chunk4ESGNS3Zcjs.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(_chunk4ESGNS3Zcjs.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, () => ( _chunk4ESGNS3Zcjs.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, () => ( _chunk4ESGNS3Zcjs.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, () => ( _chunk4ESGNS3Zcjs.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: _chunk4ESGNS3Zcjs.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, () => ( _chunk4ESGNS3Zcjs.getRivetEngine.call(void 0, ))), () => ( _chunk4ESGNS3Zcjs.getRivetEndpoint.call(void 0, )))),
|
|
676
|
+
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk4ESGNS3Zcjs.getRivetToken.call(void 0, )))),
|
|
677
|
+
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk4ESGNS3Zcjs.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(() => _chunk4ESGNS3Zcjs.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(_chunk4ESGNS3Zcjs.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(_chunk4ESGNS3Zcjs.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(_chunk4ESGNS3Zcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunk4ESGNS3Zcjs.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 = _chunk4ESGNS3Zcjs.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 ? _chunkPZBWSCQRcjs.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 ? _chunkPZBWSCQRcjs.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: _chunk4ESGNS3Zcjs.LogLevelSchema.optional().describe(
|
|
921
921
|
"Log level for RivetKit. Default: 'warn'"
|
|
922
922
|
)
|
|
923
923
|
}).optional().describe("Logging configuration."),
|
|
@@ -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: _chunk4ESGNS3Zcjs.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 _chunk4ESGNS3Zcjs.decodeCborCompat.call(void 0, value);
|
|
3531
3531
|
}
|
|
3532
3532
|
function encodeValue(value) {
|
|
3533
|
-
return
|
|
3533
|
+
return _chunk4ESGNS3Zcjs.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];
|
|
@@ -3566,7 +3566,7 @@ function isStructuredBridgeError(error) {
|
|
|
3566
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 :
|
|
3569
|
+
const structuredError = isStructuredBridgeError(error) ? error : _chunk4ESGNS3Zcjs.deconstructError.call(void 0, error, true);
|
|
3570
3570
|
const bridgeError = new Error(_chunkSPJORZMMcjs.encodeBridgeRivetError.call(void 0, structuredError), {
|
|
3571
3571
|
cause: error instanceof Error ? error : void 0
|
|
3572
3572
|
});
|
|
@@ -3617,7 +3617,7 @@ function decodeWorkflowCbor(data) {
|
|
|
3617
3617
|
return null;
|
|
3618
3618
|
}
|
|
3619
3619
|
try {
|
|
3620
|
-
return
|
|
3620
|
+
return _chunk4ESGNS3Zcjs.decodeCborCompat.call(void 0, new Uint8Array(data));
|
|
3621
3621
|
} catch (e5) {
|
|
3622
3622
|
return null;
|
|
3623
3623
|
}
|
|
@@ -3730,7 +3730,7 @@ function serializeWorkflowHistoryForJson(data) {
|
|
|
3730
3730
|
if (data === null) {
|
|
3731
3731
|
return null;
|
|
3732
3732
|
}
|
|
3733
|
-
const history =
|
|
3733
|
+
const history = _chunkQLOBB27Mcjs.decodeWorkflowHistoryTransport.call(void 0, data);
|
|
3734
3734
|
return jsonSafe({
|
|
3735
3735
|
nameRegistry: [...history.nameRegistry],
|
|
3736
3736
|
entries: history.entries.map((entry) => ({
|
|
@@ -3894,7 +3894,7 @@ var NativeConnAdapter = class {
|
|
|
3894
3894
|
},
|
|
3895
3895
|
(newValue) => {
|
|
3896
3896
|
assertCurrentState();
|
|
3897
|
-
|
|
3897
|
+
_chunk4ESGNS3Zcjs.assertJsonCompatValue.call(void 0, newValue);
|
|
3898
3898
|
}
|
|
3899
3899
|
);
|
|
3900
3900
|
}
|
|
@@ -3902,7 +3902,7 @@ var NativeConnAdapter = class {
|
|
|
3902
3902
|
var _a;
|
|
3903
3903
|
(_a = this.#assertCanMutateState) == null ? void 0 : _a.call(this);
|
|
3904
3904
|
const nextValue = unwrapWriteThroughProxy(value);
|
|
3905
|
-
|
|
3905
|
+
_chunk4ESGNS3Zcjs.assertJsonCompatValue.call(void 0, nextValue);
|
|
3906
3906
|
this.#writeState(nextValue, { writeNative: true });
|
|
3907
3907
|
}
|
|
3908
3908
|
initializeState(value) {
|
|
@@ -4976,7 +4976,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4976
4976
|
},
|
|
4977
4977
|
(newValue) => {
|
|
4978
4978
|
assertCurrentState();
|
|
4979
|
-
|
|
4979
|
+
_chunk4ESGNS3Zcjs.assertJsonCompatValue.call(void 0, newValue);
|
|
4980
4980
|
}
|
|
4981
4981
|
);
|
|
4982
4982
|
}
|
|
@@ -4988,7 +4988,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4988
4988
|
}
|
|
4989
4989
|
this.#assertCanMutateState();
|
|
4990
4990
|
const nextValue = unwrapWriteThroughProxy(value);
|
|
4991
|
-
|
|
4991
|
+
_chunk4ESGNS3Zcjs.assertJsonCompatValue.call(void 0, nextValue);
|
|
4992
4992
|
this.#writeState(nextValue, { scheduleSave: true });
|
|
4993
4993
|
}
|
|
4994
4994
|
initializeState(value) {
|
|
@@ -5172,7 +5172,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5172
5172
|
log: {
|
|
5173
5173
|
debug: (obj) => logger2().debug(obj)
|
|
5174
5174
|
},
|
|
5175
|
-
nativeDatabaseProvider:
|
|
5175
|
+
nativeDatabaseProvider: _chunkO6H3BUN4cjs.registerNativeStateTransactionOpener.call(void 0,
|
|
5176
5176
|
{
|
|
5177
5177
|
open: async (requestedActorId) => {
|
|
5178
5178
|
void requestedActorId;
|
|
@@ -5195,7 +5195,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5195
5195
|
return this.#db;
|
|
5196
5196
|
}
|
|
5197
5197
|
#bindDatabaseClient(client) {
|
|
5198
|
-
return
|
|
5198
|
+
return _chunkO6H3BUN4cjs.bindNativeStateTransactionContext.call(void 0, client, {
|
|
5199
5199
|
enter: async () => await this.#enterStateTransaction(),
|
|
5200
5200
|
exit: (scope) => this.#exitStateTransaction(
|
|
5201
5201
|
scope
|
|
@@ -5399,7 +5399,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5399
5399
|
const trackedPromise = Promise.resolve(promise).catch((error) => {
|
|
5400
5400
|
logger2().warn({
|
|
5401
5401
|
msg: "keepAwake promise rejected",
|
|
5402
|
-
error:
|
|
5402
|
+
error: _chunk4ESGNS3Zcjs.stringifyError.call(void 0, error)
|
|
5403
5403
|
});
|
|
5404
5404
|
}).then(() => null);
|
|
5405
5405
|
try {
|
|
@@ -5861,7 +5861,7 @@ function validateInspectorTabSource(tabId, resolved) {
|
|
|
5861
5861
|
function buildNativeFactory(runtime, registryConfig, definition) {
|
|
5862
5862
|
var _a;
|
|
5863
5863
|
const config = definition.config;
|
|
5864
|
-
const databaseProvider = _nullishCoalesce(config.db, () => (
|
|
5864
|
+
const databaseProvider = _nullishCoalesce(config.db, () => ( _chunkO6H3BUN4cjs.db.call(void 0, )));
|
|
5865
5865
|
const actionHandlers = _chunk4KGXFC6Mcjs.flattenActionHandlers.call(void 0, config.actions);
|
|
5866
5866
|
const schemaConfig = {
|
|
5867
5867
|
actionInputSchemas: _chunk4KGXFC6Mcjs.flattenActionInputSchemas.call(void 0,
|
|
@@ -5872,9 +5872,9 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5872
5872
|
events: config.events,
|
|
5873
5873
|
queues: config.queues
|
|
5874
5874
|
};
|
|
5875
|
-
const createClient = () =>
|
|
5876
|
-
new (0,
|
|
5877
|
-
|
|
5875
|
+
const createClient = () => _chunkPZBWSCQRcjs.createClientWithDriver.call(void 0,
|
|
5876
|
+
new (0, _chunkPZBWSCQRcjs.RemoteEngineControlClient)(
|
|
5877
|
+
_chunkPZBWSCQRcjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
|
|
5878
5878
|
),
|
|
5879
5879
|
{ encoding: "bare" }
|
|
5880
5880
|
);
|
|
@@ -6056,7 +6056,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6056
6056
|
400
|
|
6057
6057
|
);
|
|
6058
6058
|
}
|
|
6059
|
-
const cbor =
|
|
6059
|
+
const cbor = _chunk4ESGNS3Zcjs.encodeCborCompat.call(void 0,
|
|
6060
6060
|
_nullishCoalesce(body.body, () => ( null))
|
|
6061
6061
|
);
|
|
6062
6062
|
const message = await runtime.actorQueueSend(ctx, name, cbor);
|
|
@@ -6640,7 +6640,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6640
6640
|
new Response(null, { status: 404 })
|
|
6641
6641
|
);
|
|
6642
6642
|
}
|
|
6643
|
-
const rawConnParams = jsRequest.headers.get(
|
|
6643
|
+
const rawConnParams = jsRequest.headers.get(_chunkPZBWSCQRcjs.HEADER_CONN_PARAMS);
|
|
6644
6644
|
let requestCtx;
|
|
6645
6645
|
let conn;
|
|
6646
6646
|
try {
|
|
@@ -6665,7 +6665,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6665
6665
|
requestCtx,
|
|
6666
6666
|
jsRequest
|
|
6667
6667
|
);
|
|
6668
|
-
if (!
|
|
6668
|
+
if (!_chunkPZBWSCQRcjs.isResponseLike.call(void 0, response)) {
|
|
6669
6669
|
throw new Error(
|
|
6670
6670
|
"onRequest handler must return a Response"
|
|
6671
6671
|
);
|
|
@@ -6740,7 +6740,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6740
6740
|
var _a2;
|
|
6741
6741
|
const { ctx } = unwrapTsfnPayload(error, payload);
|
|
6742
6742
|
const history = (_a2 = getNativeWorkflowInspector(ctx)) == null ? void 0 : _a2.getHistory();
|
|
6743
|
-
return history == null ? void 0 :
|
|
6743
|
+
return history == null ? void 0 : _chunk4ESGNS3Zcjs.toUint8Array.call(void 0, history);
|
|
6744
6744
|
}
|
|
6745
6745
|
) : void 0,
|
|
6746
6746
|
replayWorkflow: _chunk4KGXFC6Mcjs.hasRunInspectorConfig.call(void 0, config.run) ? wrapNativeCallback(
|
|
@@ -6754,7 +6754,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6754
6754
|
return void 0;
|
|
6755
6755
|
}
|
|
6756
6756
|
const history = await _asyncNullishCoalesce(await workflowInspector.replayFromStep(entryId), async () => ( null));
|
|
6757
|
-
return history == null ? void 0 :
|
|
6757
|
+
return history == null ? void 0 : _chunk4ESGNS3Zcjs.toUint8Array.call(void 0, history);
|
|
6758
6758
|
}
|
|
6759
6759
|
) : void 0,
|
|
6760
6760
|
actions: Object.fromEntries(
|
|
@@ -6878,7 +6878,7 @@ async function buildServeConfig(config) {
|
|
|
6878
6878
|
poolName: config.envoy.poolName,
|
|
6879
6879
|
handleInspectorHttpInRuntime: true,
|
|
6880
6880
|
serverlessBasePath: config.serverless.basePath,
|
|
6881
|
-
serverlessPackageVersion:
|
|
6881
|
+
serverlessPackageVersion: _chunk4ESGNS3Zcjs.VERSION,
|
|
6882
6882
|
serverlessClientEndpoint: config.publicEndpoint,
|
|
6883
6883
|
serverlessClientNamespace: config.publicNamespace,
|
|
6884
6884
|
serverlessClientToken: config.publicToken,
|
|
@@ -6891,19 +6891,19 @@ async function buildServeConfig(config) {
|
|
|
6891
6891
|
} catch (error) {
|
|
6892
6892
|
logger2().warn({
|
|
6893
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",
|
|
6894
|
-
error:
|
|
6894
|
+
error: _chunk4ESGNS3Zcjs.stringifyError.call(void 0, error)
|
|
6895
6895
|
});
|
|
6896
6896
|
}
|
|
6897
6897
|
serveConfig.engineHost = config.engineHost;
|
|
6898
6898
|
serveConfig.enginePort = config.enginePort;
|
|
6899
6899
|
if ((_a = config.test) == null ? void 0 : _a.enabled) {
|
|
6900
|
-
serveConfig.inspectorTestToken = _nullishCoalesce(
|
|
6900
|
+
serveConfig.inspectorTestToken = _nullishCoalesce(_chunk4ESGNS3Zcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
|
|
6901
6901
|
}
|
|
6902
6902
|
return serveConfig;
|
|
6903
6903
|
}
|
|
6904
6904
|
async function buildRegistryWithRuntime(config, runtime) {
|
|
6905
6905
|
var _a;
|
|
6906
|
-
if (((_a = config.test) == null ? void 0 : _a.enabled) &&
|
|
6906
|
+
if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunk4ESGNS3Zcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
|
|
6907
6907
|
trySetProcessEnv("_RIVET_TEST_INSPECTOR_TOKEN", "token");
|
|
6908
6908
|
}
|
|
6909
6909
|
if (runtime.kind === "napi") {
|
|
@@ -6958,7 +6958,7 @@ function createApplicationFetch(application) {
|
|
|
6958
6958
|
body
|
|
6959
6959
|
})
|
|
6960
6960
|
);
|
|
6961
|
-
if (!
|
|
6961
|
+
if (!_chunkPZBWSCQRcjs.isResponseLike.call(void 0, response)) {
|
|
6962
6962
|
throw new TypeError(
|
|
6963
6963
|
"registry.listen() application fetch must return a Response"
|
|
6964
6964
|
);
|
|
@@ -6995,7 +6995,7 @@ var Registry = class {
|
|
|
6995
6995
|
var _a;
|
|
6996
6996
|
this.#config = config;
|
|
6997
6997
|
if ((_a = config.logging) == null ? void 0 : _a.baseLogger) {
|
|
6998
|
-
|
|
6998
|
+
_chunk4ESGNS3Zcjs.configureBaseLogger.call(void 0, config.logging.baseLogger);
|
|
6999
6999
|
}
|
|
7000
7000
|
this.#buildConfiguredRegistry = _nullishCoalesce((deps == null ? void 0 : deps.buildConfiguredRegistry), () => ( buildConfiguredRegistry));
|
|
7001
7001
|
this.routes = {
|
|
@@ -7221,11 +7221,11 @@ var Registry = class {
|
|
|
7221
7221
|
* ```
|
|
7222
7222
|
*/
|
|
7223
7223
|
async listen(opts = {}) {
|
|
7224
|
-
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => (
|
|
7225
|
-
const publicDir = _nullishCoalesce(opts.publicDir, () => (
|
|
7224
|
+
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => ( _chunk4ESGNS3Zcjs.parsePortEnv.call(void 0, process.env.RIVET_PORT))), () => ( 3e3));
|
|
7225
|
+
const publicDir = _nullishCoalesce(opts.publicDir, () => ( _chunk4ESGNS3Zcjs.getRivetkitPublicDir.call(void 0, )));
|
|
7226
7226
|
const config = this.parseConfig();
|
|
7227
7227
|
const application = opts.application ? createApplicationFetch(opts.application) : void 0;
|
|
7228
|
-
if (application &&
|
|
7228
|
+
if (application && _chunk4ESGNS3Zcjs.getRivetkitRuntimeMode.call(void 0, ) !== "serverless") {
|
|
7229
7229
|
if (config.runtime === "wasm") {
|
|
7230
7230
|
throw new Error(
|
|
7231
7231
|
"registry.listen() requires the native runtime; use an application-owned HTTP server with WebAssembly"
|
|
@@ -7299,7 +7299,7 @@ var Registry = class {
|
|
|
7299
7299
|
return jsonRouteResponse(503, {
|
|
7300
7300
|
status: "not_started",
|
|
7301
7301
|
runtime: "rivetkit",
|
|
7302
|
-
version:
|
|
7302
|
+
version: _chunk4ESGNS3Zcjs.VERSION
|
|
7303
7303
|
});
|
|
7304
7304
|
}
|
|
7305
7305
|
const { runtime, registry } = configured;
|
|
@@ -7307,7 +7307,7 @@ var Registry = class {
|
|
|
7307
7307
|
return jsonRouteResponse(501, {
|
|
7308
7308
|
status: "unsupported",
|
|
7309
7309
|
runtime: "rivetkit",
|
|
7310
|
-
version:
|
|
7310
|
+
version: _chunk4ESGNS3Zcjs.VERSION
|
|
7311
7311
|
});
|
|
7312
7312
|
}
|
|
7313
7313
|
const response = await runtime.registryHealth(registry);
|
|
@@ -7554,7 +7554,7 @@ var Registry = class {
|
|
|
7554
7554
|
);
|
|
7555
7555
|
}
|
|
7556
7556
|
if (this.#runtimeReadyPromise) return this.#runtimeReadyPromise;
|
|
7557
|
-
if (
|
|
7557
|
+
if (_chunk4ESGNS3Zcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
7558
7558
|
return Promise.reject(
|
|
7559
7559
|
new Error(
|
|
7560
7560
|
"registry.startAndWait() requires envoy runtime mode; serverless registries become ready per request"
|
|
@@ -7624,8 +7624,8 @@ var Registry = class {
|
|
|
7624
7624
|
* ```
|
|
7625
7625
|
*/
|
|
7626
7626
|
start() {
|
|
7627
|
-
if (
|
|
7628
|
-
const publicDir = _nullishCoalesce(
|
|
7627
|
+
if (_chunk4ESGNS3Zcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
7628
|
+
const publicDir = _nullishCoalesce(_chunk4ESGNS3Zcjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
|
|
7629
7629
|
this.listen({ publicDir }).catch((error) => {
|
|
7630
7630
|
logger2().error({ error }, "auto-listen failed; exiting");
|
|
7631
7631
|
if (typeof process !== "undefined" && typeof process.exit === "function") {
|
|
@@ -7646,7 +7646,7 @@ var Registry = class {
|
|
|
7646
7646
|
};
|
|
7647
7647
|
console.log();
|
|
7648
7648
|
console.log(
|
|
7649
|
-
` RivetKit ${
|
|
7649
|
+
` RivetKit ${_chunk4ESGNS3Zcjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
|
|
7650
7650
|
);
|
|
7651
7651
|
if (config.namespace !== "default") {
|
|
7652
7652
|
logLine("Namespace", config.namespace);
|
|
@@ -7722,5 +7722,5 @@ function setup(input) {
|
|
|
7722
7722
|
|
|
7723
7723
|
|
|
7724
7724
|
|
|
7725
|
-
exports.ALLOWED_PUBLIC_HEADERS =
|
|
7725
|
+
exports.ALLOWED_PUBLIC_HEADERS = _chunkPZBWSCQRcjs.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 = _chunkPZBWSCQRcjs.createClientWithDriver; exports.defineRunHandler = _chunk4KGXFC6Mcjs.defineRunHandler; exports.event = event; exports.isStaticActorDefinition = isStaticActorDefinition; exports.isStaticActorInstance = isStaticActorInstance; exports.lookupInRegistry = lookupInRegistry; exports.noopNext = _chunk4ESGNS3Zcjs.noopNext; exports.queue = queue; exports.setup = setup; exports.toUint8Array = _chunk4ESGNS3Zcjs.toUint8Array;
|
|
7726
7726
|
//# sourceMappingURL=mod.cjs.map
|