rivetkit 3.0.0-preview.2 → 3.0.0-preview.4
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 +25 -10
- 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/{chunk-25MUHNWE.cjs → chunk-5IZ36V3N.cjs} +168 -153
- package/dist/tsup/chunk-5IZ36V3N.cjs.map +1 -0
- package/dist/tsup/{chunk-6IGGYL2C.js → chunk-C45DIKGB.js} +30 -15
- package/dist/tsup/chunk-C45DIKGB.js.map +1 -0
- package/dist/tsup/{chunk-WGQHG26S.js → chunk-DCUTYXIX.js} +2 -2
- package/dist/tsup/{chunk-WGKL7HMH.js → chunk-IPDSE33U.js} +2 -2
- package/dist/tsup/{chunk-442XBCAF.js → chunk-KM34T23X.js} +3 -3
- package/dist/tsup/{chunk-YZVVID47.cjs → chunk-KSQ3VVZX.cjs} +3 -3
- package/dist/tsup/{chunk-YZVVID47.cjs.map → chunk-KSQ3VVZX.cjs.map} +1 -1
- package/dist/tsup/{chunk-EPPV7WB2.cjs → chunk-LTMP7OMQ.cjs} +3 -3
- package/dist/tsup/{chunk-EPPV7WB2.cjs.map → chunk-LTMP7OMQ.cjs.map} +1 -1
- package/dist/tsup/{chunk-5F7FWAJI.js → chunk-MAUVZIXL.js} +2 -2
- package/dist/tsup/{chunk-5F7FWAJI.js.map → chunk-MAUVZIXL.js.map} +1 -1
- package/dist/tsup/{chunk-ANNVZW6B.js → chunk-OR3LWJGW.js} +2 -2
- package/dist/tsup/{chunk-3SPYZMME.cjs → chunk-S5QNPQ6K.cjs} +3 -3
- package/dist/tsup/{chunk-3SPYZMME.cjs.map → chunk-S5QNPQ6K.cjs.map} +1 -1
- package/dist/tsup/{chunk-BCG7PTBS.cjs → chunk-SLIGV2T4.cjs} +4 -4
- package/dist/tsup/{chunk-BCG7PTBS.cjs.map → chunk-SLIGV2T4.cjs.map} +1 -1
- package/dist/tsup/{chunk-XSOHGU4G.cjs → chunk-SR362FVR.cjs} +2 -2
- package/dist/tsup/{chunk-XSOHGU4G.cjs.map → chunk-SR362FVR.cjs.map} +1 -1
- package/dist/tsup/{chunk-QDRZMCX5.cjs → chunk-U2QBZJTL.cjs} +10 -10
- package/dist/tsup/{chunk-QDRZMCX5.cjs.map → chunk-U2QBZJTL.cjs.map} +1 -1
- package/dist/tsup/{chunk-CJ3MX5MI.cjs → chunk-WE5DMJFV.cjs} +7 -7
- package/dist/tsup/{chunk-CJ3MX5MI.cjs.map → chunk-WE5DMJFV.cjs.map} +1 -1
- package/dist/tsup/{chunk-OLZ4KAFL.js → chunk-WQFXPN6S.js} +4 -4
- package/dist/tsup/{chunk-3URL73AV.js → chunk-ZWBTTPP3.js} +2 -2
- 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 +93 -89
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.js +13 -9
- package/dist/tsup/mod.js.map +1 -1
- 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.js +4 -4
- package/package.json +9 -9
- package/src/client/actor-conn.ts +38 -9
- package/src/registry/config/index.ts +2 -1
- package/src/registry/index.ts +16 -3
- package/dist/tsup/chunk-25MUHNWE.cjs.map +0 -1
- package/dist/tsup/chunk-6IGGYL2C.js.map +0 -1
- /package/dist/tsup/{chunk-WGQHG26S.js.map → chunk-DCUTYXIX.js.map} +0 -0
- /package/dist/tsup/{chunk-WGKL7HMH.js.map → chunk-IPDSE33U.js.map} +0 -0
- /package/dist/tsup/{chunk-442XBCAF.js.map → chunk-KM34T23X.js.map} +0 -0
- /package/dist/tsup/{chunk-ANNVZW6B.js.map → chunk-OR3LWJGW.js.map} +0 -0
- /package/dist/tsup/{chunk-OLZ4KAFL.js.map → chunk-WQFXPN6S.js.map} +0 -0
- /package/dist/tsup/{chunk-3URL73AV.js.map → chunk-ZWBTTPP3.js.map} +0 -0
package/dist/tsup/mod.cjs
CHANGED
|
@@ -1,6 +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
|
|
3
|
+
var _chunkSLIGV2T4cjs = require('./chunk-SLIGV2T4.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -35,18 +35,18 @@ var _chunkHDVZ6YZGcjs = require('./chunk-HDVZ6YZG.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunk5IZ36V3Ncjs = require('./chunk-5IZ36V3N.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
var _chunkRTWH3AX3cjs = require('./chunk-RTWH3AX3.cjs');
|
|
43
|
+
require('./chunk-S5QNPQ6K.cjs');
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
|
|
47
|
-
var
|
|
48
|
+
var _chunkLTMP7OMQcjs = require('./chunk-LTMP7OMQ.cjs');
|
|
48
49
|
require('./chunk-KVFIONKQ.cjs');
|
|
49
|
-
require('./chunk-3SPYZMME.cjs');
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
@@ -80,7 +80,7 @@ require('./chunk-3SPYZMME.cjs');
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
var
|
|
83
|
+
var _chunkSR362FVRcjs = require('./chunk-SR362FVR.cjs');
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
|
|
@@ -98,7 +98,7 @@ var _chunkMGI2VVF6cjs = require('./chunk-MGI2VVF6.cjs');
|
|
|
98
98
|
|
|
99
99
|
// src/actor/log.ts
|
|
100
100
|
function loggerWithoutContext() {
|
|
101
|
-
return
|
|
101
|
+
return _chunkSR362FVRcjs.getLogger.call(void 0, "actor-runtime");
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
// src/actor/definition.ts
|
|
@@ -240,7 +240,7 @@ function validateSchemaSync(schemas, key, data) {
|
|
|
240
240
|
var _virtualwebsocket = require('@rivetkit/virtual-websocket');
|
|
241
241
|
var _ws = require('hono/ws');
|
|
242
242
|
function logger() {
|
|
243
|
-
return
|
|
243
|
+
return _chunkSR362FVRcjs.getLogger.call(void 0, "inline-websocket-adapter");
|
|
244
244
|
}
|
|
245
245
|
var InlineWebSocketAdapter = class {
|
|
246
246
|
#handler;
|
|
@@ -392,7 +392,7 @@ var InlineWebSocketAdapter = class {
|
|
|
392
392
|
|
|
393
393
|
// src/registry/log.ts
|
|
394
394
|
function logger2() {
|
|
395
|
-
return
|
|
395
|
+
return _chunkSR362FVRcjs.getLogger.call(void 0, "registry");
|
|
396
396
|
}
|
|
397
397
|
|
|
398
398
|
// src/serverless/configure.ts
|
|
@@ -438,8 +438,8 @@ async function configureServerlessPool(config) {
|
|
|
438
438
|
);
|
|
439
439
|
}
|
|
440
440
|
const customConfig = config.configurePool;
|
|
441
|
-
const clientConfig =
|
|
442
|
-
const dcsRes = await
|
|
441
|
+
const clientConfig = _chunk5IZ36V3Ncjs.convertRegistryConfigToClientConfig.call(void 0, config);
|
|
442
|
+
const dcsRes = await _chunk5IZ36V3Ncjs.getDatacenters.call(void 0, clientConfig);
|
|
443
443
|
const poolName = _nullishCoalesce(customConfig.name, () => ( "default"));
|
|
444
444
|
const serverlessToken = _nullishCoalesce(config.token, () => ( config.publicToken));
|
|
445
445
|
const headers = {
|
|
@@ -461,7 +461,7 @@ async function configureServerlessPool(config) {
|
|
|
461
461
|
metadata: _nullishCoalesce(customConfig.metadata, () => ( {})),
|
|
462
462
|
drain_on_version_upgrade: _nullishCoalesce(customConfig.drainOnVersionUpgrade, () => ( true))
|
|
463
463
|
};
|
|
464
|
-
await
|
|
464
|
+
await _chunk5IZ36V3Ncjs.updateRunnerConfig.call(void 0, clientConfig, poolName, {
|
|
465
465
|
datacenters: Object.fromEntries(
|
|
466
466
|
dcsRes.datacenters.map((dc) => [dc.name, serverlessConfig])
|
|
467
467
|
)
|
|
@@ -478,7 +478,7 @@ async function configureServerlessPool(config) {
|
|
|
478
478
|
logger2().warn({
|
|
479
479
|
msg: "serverless pool configuration attempt failed",
|
|
480
480
|
attempts,
|
|
481
|
-
error:
|
|
481
|
+
error: _chunkSR362FVRcjs.stringifyError.call(void 0, error)
|
|
482
482
|
});
|
|
483
483
|
await sleep(CONFIGURE_RETRY_DELAY_MS);
|
|
484
484
|
}
|
|
@@ -486,7 +486,7 @@ async function configureServerlessPool(config) {
|
|
|
486
486
|
logger2().error({
|
|
487
487
|
msg: "failed to configure serverless pool, validate endpoint is configured correctly then restart this process",
|
|
488
488
|
attempts,
|
|
489
|
-
error:
|
|
489
|
+
error: _chunkSR362FVRcjs.stringifyError.call(void 0, lastError)
|
|
490
490
|
});
|
|
491
491
|
throw lastError;
|
|
492
492
|
}
|
|
@@ -497,10 +497,10 @@ var _zod = require('zod');
|
|
|
497
497
|
// src/registry/config/envoy.ts
|
|
498
498
|
var _v4 = require('zod/v4');
|
|
499
499
|
var EnvoyConfigSchema = _v4.z.object({
|
|
500
|
-
poolName: _v4.z.string().default(() => _nullishCoalesce(
|
|
501
|
-
version: _v4.z.number().default(() => _nullishCoalesce(
|
|
500
|
+
poolName: _v4.z.string().default(() => _nullishCoalesce(_chunkSR362FVRcjs.getRivetPool.call(void 0, ), () => ( "default"))),
|
|
501
|
+
version: _v4.z.number().default(() => _nullishCoalesce(_chunkSR362FVRcjs.getRivetEnvoyVersion.call(void 0, ), () => ( 1))),
|
|
502
502
|
// Deprecated.
|
|
503
|
-
totalSlots: _v4.z.number().default(() => _nullishCoalesce(
|
|
503
|
+
totalSlots: _v4.z.number().default(() => _nullishCoalesce(_chunkSR362FVRcjs.getRivetTotalSlots.call(void 0, ), () => ( 1e5))),
|
|
504
504
|
nodeKey: _v4.z.string().optional()
|
|
505
505
|
});
|
|
506
506
|
|
|
@@ -538,7 +538,7 @@ var ServerlessConfigSchema = _v4.z.object({
|
|
|
538
538
|
*
|
|
539
539
|
* Can also be set via RIVET_PUBLIC_ENDPOINT environment variable.
|
|
540
540
|
*/
|
|
541
|
-
publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
541
|
+
publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkSR362FVRcjs.getRivetPublicEndpoint.call(void 0, )))),
|
|
542
542
|
/**
|
|
543
543
|
* Token that clients should use when connecting via the public endpoint.
|
|
544
544
|
*
|
|
@@ -546,7 +546,7 @@ var ServerlessConfigSchema = _v4.z.object({
|
|
|
546
546
|
*
|
|
547
547
|
* Can also be specified in the publicEndpoint URL as `https://namespace:token@host`.
|
|
548
548
|
*/
|
|
549
|
-
publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
549
|
+
publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkSR362FVRcjs.getRivetPublicToken.call(void 0, ))))
|
|
550
550
|
// There is no publicNamespace config option because the frontend and backend
|
|
551
551
|
// cannot use different namespaces. The namespace is extracted from the
|
|
552
552
|
// publicEndpoint URL auth syntax if provided.
|
|
@@ -600,7 +600,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
600
600
|
* Runtime binding to use for RivetKit core.
|
|
601
601
|
* */
|
|
602
602
|
runtime: RuntimeKindSchema.optional().transform((val, ctx) => {
|
|
603
|
-
const rawRuntime = _nullishCoalesce(val, () => (
|
|
603
|
+
const rawRuntime = _nullishCoalesce(val, () => ( _chunkSR362FVRcjs.getRivetkitRuntime.call(void 0, )));
|
|
604
604
|
if (rawRuntime === void 0) {
|
|
605
605
|
return "auto";
|
|
606
606
|
}
|
|
@@ -637,7 +637,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
637
637
|
* */
|
|
638
638
|
logging: _zod.z.object({
|
|
639
639
|
baseLogger: _zod.z.custom().optional(),
|
|
640
|
-
level:
|
|
640
|
+
level: _chunkSR362FVRcjs.LogLevelSchema.optional()
|
|
641
641
|
}).optional().default(() => ({})),
|
|
642
642
|
// MARK: Routing
|
|
643
643
|
// // This is a function to allow for lazy configuration of upgradeWebSocket on the
|
|
@@ -655,9 +655,9 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
655
655
|
*
|
|
656
656
|
* Can also be set via RIVET_ENDPOINT environment variables.
|
|
657
657
|
*/
|
|
658
|
-
endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => (
|
|
659
|
-
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
660
|
-
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
658
|
+
endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => ( _chunkSR362FVRcjs.getRivetEngine.call(void 0, ))), () => ( _chunkSR362FVRcjs.getRivetEndpoint.call(void 0, )))),
|
|
659
|
+
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkSR362FVRcjs.getRivetToken.call(void 0, )))),
|
|
660
|
+
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkSR362FVRcjs.getRivetNamespace.call(void 0, )))),
|
|
661
661
|
headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional().default({}),
|
|
662
662
|
// MARK: Client
|
|
663
663
|
// TODO:
|
|
@@ -697,21 +697,21 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
697
697
|
*
|
|
698
698
|
* Starts the full Rust engine process locally.
|
|
699
699
|
*/
|
|
700
|
-
startEngine: _zod.z.boolean().default(() =>
|
|
700
|
+
startEngine: _zod.z.boolean().default(() => _chunkSR362FVRcjs.getRivetRunEngine.call(void 0, )),
|
|
701
701
|
/**
|
|
702
702
|
* @experimental
|
|
703
703
|
*
|
|
704
704
|
* Host to bind the spawned local engine process to.
|
|
705
705
|
*/
|
|
706
|
-
engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
706
|
+
engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkSR362FVRcjs.getRivetRunEngineHost.call(void 0, ), () => ( _chunk5IZ36V3Ncjs.ENGINE_HOST))),
|
|
707
707
|
/**
|
|
708
708
|
* @experimental
|
|
709
709
|
*
|
|
710
710
|
* Port to bind the spawned local engine process to.
|
|
711
711
|
*/
|
|
712
|
-
enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(
|
|
712
|
+
enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(_chunkSR362FVRcjs.getRivetRunEnginePort.call(void 0, ), () => ( _chunk5IZ36V3Ncjs.ENGINE_PORT))),
|
|
713
713
|
/** @experimental */
|
|
714
|
-
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
714
|
+
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkSR362FVRcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunkSR362FVRcjs.VERSION))),
|
|
715
715
|
/**
|
|
716
716
|
* Starts the first-party Services actor host when RivetKit manages
|
|
717
717
|
* a local engine. Disabled by default. Set RIVET_RUN_SERVICES=1
|
|
@@ -751,7 +751,8 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
751
751
|
* after calling `CoreRegistry::shutdown()`. Defaults to the
|
|
752
752
|
* engine-provided actor stop threshold once the node connects. A
|
|
753
753
|
* signal-driven shutdown of a managed local development engine waits
|
|
754
|
-
*
|
|
754
|
+
* four seconds by default so actors can acknowledge stopping before
|
|
755
|
+
* a file watcher restarts the process.
|
|
755
756
|
*
|
|
756
757
|
* Set a longer period when a complete graceful node drain is required.
|
|
757
758
|
*/
|
|
@@ -767,7 +768,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
767
768
|
}))
|
|
768
769
|
}).transform((config, ctx) => {
|
|
769
770
|
var _a, _b, _c;
|
|
770
|
-
const isDevEnv =
|
|
771
|
+
const isDevEnv = _chunkSR362FVRcjs.isDev.call(void 0, );
|
|
771
772
|
const sqliteBackend = _nullishCoalesce(((_a = config.sqlite) == null ? void 0 : _a.backend), () => ( ((_b = config.test) == null ? void 0 : _b.sqliteBackend)));
|
|
772
773
|
if (config.runtime === "wasm" && sqliteBackend === "local") {
|
|
773
774
|
ctx.addIssue({
|
|
@@ -777,7 +778,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
777
778
|
});
|
|
778
779
|
}
|
|
779
780
|
const sqlite = config.runtime === "wasm" && config.sqlite === void 0 ? { backend: "remote" } : config.sqlite;
|
|
780
|
-
const parsedEndpoint = config.endpoint ?
|
|
781
|
+
const parsedEndpoint = config.endpoint ? _chunk5IZ36V3Ncjs.tryParseEndpoint.call(void 0, ctx, {
|
|
781
782
|
endpoint: config.endpoint,
|
|
782
783
|
path: ["endpoint"],
|
|
783
784
|
namespace: config.namespace,
|
|
@@ -796,18 +797,18 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
796
797
|
path: ["configurePool"]
|
|
797
798
|
});
|
|
798
799
|
}
|
|
799
|
-
const localEngineEndpoint =
|
|
800
|
+
const localEngineEndpoint = _chunk5IZ36V3Ncjs.buildEngineEndpoint.call(void 0,
|
|
800
801
|
config.engineHost,
|
|
801
802
|
config.enginePort
|
|
802
803
|
);
|
|
803
804
|
const endpoint = config.startEngine ? localEngineEndpoint : _nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.endpoint), () => ( (isDevEnv ? localEngineEndpoint : void 0)));
|
|
804
|
-
const startServices = _nullishCoalesce(config.startServices, () => (
|
|
805
|
+
const startServices = _nullishCoalesce(config.startServices, () => ( _chunkSR362FVRcjs.getRivetRunServices.call(void 0, )));
|
|
805
806
|
const validateServerlessEndpoint = Boolean(
|
|
806
807
|
config.startEngine || parsedEndpoint
|
|
807
808
|
);
|
|
808
809
|
const namespace = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.namespace), () => ( config.namespace)), () => ( "default"));
|
|
809
|
-
const token = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token)), () => ( (endpoint &&
|
|
810
|
-
const parsedPublicEndpoint = config.serverless.publicEndpoint ?
|
|
810
|
+
const token = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token)), () => ( (endpoint && _chunk5IZ36V3Ncjs.isLocalEngineEndpoint.call(void 0, endpoint) ? "default" : void 0)));
|
|
811
|
+
const parsedPublicEndpoint = config.serverless.publicEndpoint ? _chunk5IZ36V3Ncjs.tryParseEndpoint.call(void 0, ctx, {
|
|
811
812
|
endpoint: config.serverless.publicEndpoint,
|
|
812
813
|
path: ["serverless", "publicEndpoint"]
|
|
813
814
|
}) : void 0;
|
|
@@ -912,7 +913,7 @@ var DocRegistryConfigSchema = _zod.z.object({
|
|
|
912
913
|
noWelcome: _zod.z.boolean().optional().describe("Disable the welcome message on startup. Default: false"),
|
|
913
914
|
sqlite: DocSqliteConfigSchema,
|
|
914
915
|
logging: _zod.z.object({
|
|
915
|
-
level:
|
|
916
|
+
level: _chunkSR362FVRcjs.LogLevelSchema.optional().describe(
|
|
916
917
|
"Log level for RivetKit. Default: 'warn'"
|
|
917
918
|
)
|
|
918
919
|
}).optional().describe("Logging configuration."),
|
|
@@ -1552,7 +1553,7 @@ var NapiCoreRuntime = (_class = class {
|
|
|
1552
1553
|
if (!(active == null ? void 0 : active.sameActorInstance(ownerCtx))) {
|
|
1553
1554
|
return ownerCtx;
|
|
1554
1555
|
}
|
|
1555
|
-
const applicationSpan =
|
|
1556
|
+
const applicationSpan = _chunk5IZ36V3Ncjs.readActiveTraceHeaders.call(void 0, );
|
|
1556
1557
|
if (!applicationSpan) {
|
|
1557
1558
|
return active;
|
|
1558
1559
|
}
|
|
@@ -1756,7 +1757,7 @@ var NapiCoreRuntime = (_class = class {
|
|
|
1756
1757
|
const span = (_a = nativeCtx.invocationTraceContext()) == null ? void 0 : _a.span;
|
|
1757
1758
|
return this.#invocationContext.run(
|
|
1758
1759
|
nativeCtx,
|
|
1759
|
-
() =>
|
|
1760
|
+
() => _chunk5IZ36V3Ncjs.runWithActorInvocationSpan.call(void 0, span, run)
|
|
1760
1761
|
);
|
|
1761
1762
|
}
|
|
1762
1763
|
actorInvocationTraceContext(ctx) {
|
|
@@ -2131,8 +2132,8 @@ function runtimeBytesToArrayBuffer(value) {
|
|
|
2131
2132
|
function buildNativeHttpRequest(init) {
|
|
2132
2133
|
var _a;
|
|
2133
2134
|
const headers = new Headers(init.headers);
|
|
2134
|
-
const originalUrl = headers.get(
|
|
2135
|
-
headers.delete(
|
|
2135
|
+
const originalUrl = headers.get(_chunk5IZ36V3Ncjs.HEADER_ORIGINAL_REQUEST_URL);
|
|
2136
|
+
headers.delete(_chunk5IZ36V3Ncjs.HEADER_ORIGINAL_REQUEST_URL);
|
|
2136
2137
|
const url = _nullishCoalesce(originalUrl, () => ( (init.uri.startsWith("http") ? init.uri : new URL(init.uri, "http://127.0.0.1").toString())));
|
|
2137
2138
|
const method2 = init.method.toUpperCase();
|
|
2138
2139
|
const bodyForbidden = method2 === "GET" || method2 === "HEAD";
|
|
@@ -2211,7 +2212,7 @@ async function pumpResponseBody(reader, stream) {
|
|
|
2211
2212
|
}
|
|
2212
2213
|
} catch (error) {
|
|
2213
2214
|
try {
|
|
2214
|
-
await stream.error(
|
|
2215
|
+
await stream.error(_chunkSR362FVRcjs.stringifyError.call(void 0, error));
|
|
2215
2216
|
} catch (streamError) {
|
|
2216
2217
|
logger2().debug({
|
|
2217
2218
|
msg: "failed to report native http response stream error",
|
|
@@ -3450,7 +3451,7 @@ async function loadAutoRuntime(config, loaders = defaultRuntimeLoaders) {
|
|
|
3450
3451
|
nativeError = error;
|
|
3451
3452
|
logger2().warn({
|
|
3452
3453
|
msg: "native runtime failed to load; falling back to wasm",
|
|
3453
|
-
error:
|
|
3454
|
+
error: _chunkSR362FVRcjs.stringifyError.call(void 0, error)
|
|
3454
3455
|
});
|
|
3455
3456
|
}
|
|
3456
3457
|
try {
|
|
@@ -3459,7 +3460,7 @@ async function loadAutoRuntime(config, loaders = defaultRuntimeLoaders) {
|
|
|
3459
3460
|
throw new (0, _chunkMGI2VVF6cjs.RivetError)(
|
|
3460
3461
|
"config",
|
|
3461
3462
|
"runtime_unavailable",
|
|
3462
|
-
`RivetKit could not load a core runtime. Native runtime: ${
|
|
3463
|
+
`RivetKit could not load a core runtime. Native runtime: ${_chunkSR362FVRcjs.stringifyError.call(void 0, nativeError)} Wasm runtime: ${_chunkSR362FVRcjs.stringifyError.call(void 0, wasmError)}`,
|
|
3463
3464
|
{
|
|
3464
3465
|
public: true,
|
|
3465
3466
|
statusCode: 500
|
|
@@ -3667,7 +3668,7 @@ async function cleanupNativeSleepRuntimeState(runtime, ctx, afterTrackedWorkDrai
|
|
|
3667
3668
|
}).catch((error) => {
|
|
3668
3669
|
logger2().warn({
|
|
3669
3670
|
msg: "deferred native sleep cleanup failed",
|
|
3670
|
-
error:
|
|
3671
|
+
error: _chunkSR362FVRcjs.stringifyError.call(void 0, error)
|
|
3671
3672
|
});
|
|
3672
3673
|
});
|
|
3673
3674
|
return;
|
|
@@ -3839,10 +3840,10 @@ function decodeValue(value) {
|
|
|
3839
3840
|
if (!value || value.length === 0) {
|
|
3840
3841
|
return void 0;
|
|
3841
3842
|
}
|
|
3842
|
-
return
|
|
3843
|
+
return _chunkSR362FVRcjs.decodeCborCompat.call(void 0, value);
|
|
3843
3844
|
}
|
|
3844
3845
|
function encodeValue(value) {
|
|
3845
|
-
return
|
|
3846
|
+
return _chunkSR362FVRcjs.encodeCborCompat.call(void 0, value);
|
|
3846
3847
|
}
|
|
3847
3848
|
function normalizeArgs(value) {
|
|
3848
3849
|
return Array.isArray(value) ? value : value === void 0 || value === null ? [] : [value];
|
|
@@ -3878,7 +3879,7 @@ function isStructuredBridgeError(error) {
|
|
|
3878
3879
|
return _chunkMGI2VVF6cjs.isRivetErrorLike.call(void 0, error) && "__type" in error && (error.__type === "RivetError" || error.__type === "ActorError");
|
|
3879
3880
|
}
|
|
3880
3881
|
function encodeNativeCallbackError(error) {
|
|
3881
|
-
const structuredError = isStructuredBridgeError(error) ? error :
|
|
3882
|
+
const structuredError = isStructuredBridgeError(error) ? error : _chunkSR362FVRcjs.deconstructError.call(void 0, error, true);
|
|
3882
3883
|
const { encoded, droppedMetadataCause } = _chunkMGI2VVF6cjs.encodeBridgeRivetError.call(void 0, structuredError);
|
|
3883
3884
|
if (droppedMetadataCause !== void 0) {
|
|
3884
3885
|
logger2().warn(
|
|
@@ -3940,7 +3941,7 @@ function decodeWorkflowCbor(data) {
|
|
|
3940
3941
|
return null;
|
|
3941
3942
|
}
|
|
3942
3943
|
try {
|
|
3943
|
-
return
|
|
3944
|
+
return _chunkSR362FVRcjs.decodeCborCompat.call(void 0, new Uint8Array(data));
|
|
3944
3945
|
} catch (e3) {
|
|
3945
3946
|
return null;
|
|
3946
3947
|
}
|
|
@@ -4053,7 +4054,7 @@ function serializeWorkflowHistoryForJson(data) {
|
|
|
4053
4054
|
if (data === null) {
|
|
4054
4055
|
return null;
|
|
4055
4056
|
}
|
|
4056
|
-
const history =
|
|
4057
|
+
const history = _chunkSLIGV2T4cjs.decodeWorkflowHistoryTransport.call(void 0, data);
|
|
4057
4058
|
return jsonSafe({
|
|
4058
4059
|
nameRegistry: [...history.nameRegistry],
|
|
4059
4060
|
entries: history.entries.map((entry) => ({
|
|
@@ -4199,7 +4200,7 @@ var NativeConnAdapter = class {
|
|
|
4199
4200
|
},
|
|
4200
4201
|
(newValue) => {
|
|
4201
4202
|
assertCurrentState();
|
|
4202
|
-
|
|
4203
|
+
_chunkSR362FVRcjs.assertJsonCompatValue.call(void 0, newValue);
|
|
4203
4204
|
}
|
|
4204
4205
|
);
|
|
4205
4206
|
}
|
|
@@ -4207,7 +4208,7 @@ var NativeConnAdapter = class {
|
|
|
4207
4208
|
var _a;
|
|
4208
4209
|
(_a = this.#assertCanMutateState) == null ? void 0 : _a.call(this);
|
|
4209
4210
|
const nextValue = unwrapWriteThroughProxy(value);
|
|
4210
|
-
|
|
4211
|
+
_chunkSR362FVRcjs.assertJsonCompatValue.call(void 0, nextValue);
|
|
4211
4212
|
this.#writeState(nextValue, { writeNative: true });
|
|
4212
4213
|
}
|
|
4213
4214
|
initializeState(value) {
|
|
@@ -5286,7 +5287,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5286
5287
|
},
|
|
5287
5288
|
(newValue) => {
|
|
5288
5289
|
assertCurrentState();
|
|
5289
|
-
|
|
5290
|
+
_chunkSR362FVRcjs.assertJsonCompatValue.call(void 0, newValue);
|
|
5290
5291
|
}
|
|
5291
5292
|
);
|
|
5292
5293
|
}
|
|
@@ -5298,7 +5299,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5298
5299
|
}
|
|
5299
5300
|
this.#assertCanMutateState();
|
|
5300
5301
|
const nextValue = unwrapWriteThroughProxy(value);
|
|
5301
|
-
|
|
5302
|
+
_chunkSR362FVRcjs.assertJsonCompatValue.call(void 0, nextValue);
|
|
5302
5303
|
this.#writeState(nextValue, { scheduleSave: true });
|
|
5303
5304
|
}
|
|
5304
5305
|
initializeState(value) {
|
|
@@ -5512,7 +5513,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5512
5513
|
log: {
|
|
5513
5514
|
debug: (obj) => logger2().debug(obj)
|
|
5514
5515
|
},
|
|
5515
|
-
nativeDatabaseProvider:
|
|
5516
|
+
nativeDatabaseProvider: _chunkLTMP7OMQcjs.registerNativeStateTransactionOpener.call(void 0,
|
|
5516
5517
|
{
|
|
5517
5518
|
open: async (requestedActorId) => {
|
|
5518
5519
|
void requestedActorId;
|
|
@@ -5535,7 +5536,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5535
5536
|
return this.#db;
|
|
5536
5537
|
}
|
|
5537
5538
|
#bindDatabaseClient(client) {
|
|
5538
|
-
return
|
|
5539
|
+
return _chunkLTMP7OMQcjs.bindNativeStateTransactionContext.call(void 0, client, {
|
|
5539
5540
|
enter: async () => await this.#enterStateTransaction(),
|
|
5540
5541
|
exit: (scope) => this.#exitStateTransaction(
|
|
5541
5542
|
scope
|
|
@@ -5739,7 +5740,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5739
5740
|
const trackedPromise = Promise.resolve(promise).catch((error) => {
|
|
5740
5741
|
logger2().warn({
|
|
5741
5742
|
msg: "keepAwake promise rejected",
|
|
5742
|
-
error:
|
|
5743
|
+
error: _chunkSR362FVRcjs.stringifyError.call(void 0, error)
|
|
5743
5744
|
});
|
|
5744
5745
|
}).then(() => null);
|
|
5745
5746
|
try {
|
|
@@ -6237,7 +6238,7 @@ function validateInspectorTabSource(tabId, resolved) {
|
|
|
6237
6238
|
function buildNativeFactory(runtime, registryConfig, definition) {
|
|
6238
6239
|
var _a;
|
|
6239
6240
|
const config = definition.config;
|
|
6240
|
-
const databaseProvider = _nullishCoalesce(config.db, () => (
|
|
6241
|
+
const databaseProvider = _nullishCoalesce(config.db, () => ( _chunkLTMP7OMQcjs.db.call(void 0, )));
|
|
6241
6242
|
const actionHandlers = _chunkHDVZ6YZGcjs.flattenActionHandlers.call(void 0, config.actions);
|
|
6242
6243
|
const schemaConfig = {
|
|
6243
6244
|
actionInputSchemas: _chunkHDVZ6YZGcjs.flattenActionInputSchemas.call(void 0,
|
|
@@ -6248,9 +6249,9 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6248
6249
|
events: config.events,
|
|
6249
6250
|
queues: config.queues
|
|
6250
6251
|
};
|
|
6251
|
-
const createClient = (ctx) =>
|
|
6252
|
-
new (0,
|
|
6253
|
-
|
|
6252
|
+
const createClient = (ctx) => _chunk5IZ36V3Ncjs.createClientWithDriver.call(void 0,
|
|
6253
|
+
new (0, _chunk5IZ36V3Ncjs.RemoteEngineControlClient)(
|
|
6254
|
+
_chunk5IZ36V3Ncjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
|
|
6254
6255
|
),
|
|
6255
6256
|
{
|
|
6256
6257
|
encoding: "bare",
|
|
@@ -6442,7 +6443,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6442
6443
|
400
|
|
6443
6444
|
);
|
|
6444
6445
|
}
|
|
6445
|
-
const cbor =
|
|
6446
|
+
const cbor = _chunkSR362FVRcjs.encodeCborCompat.call(void 0,
|
|
6446
6447
|
_nullishCoalesce(body.body, () => ( null))
|
|
6447
6448
|
);
|
|
6448
6449
|
const message = await runtime.actorQueueSend(ctx, name, cbor);
|
|
@@ -7039,7 +7040,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
7039
7040
|
...request,
|
|
7040
7041
|
abortController: requestAbortController
|
|
7041
7042
|
});
|
|
7042
|
-
const rawConnParams = handlerRequest.headers.get(
|
|
7043
|
+
const rawConnParams = handlerRequest.headers.get(_chunk5IZ36V3Ncjs.HEADER_CONN_PARAMS);
|
|
7043
7044
|
let requestCtx;
|
|
7044
7045
|
let conn;
|
|
7045
7046
|
let removeRequestAbortListener;
|
|
@@ -7096,7 +7097,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
7096
7097
|
requestCtx,
|
|
7097
7098
|
handlerRequest
|
|
7098
7099
|
);
|
|
7099
|
-
if (!
|
|
7100
|
+
if (!_chunk5IZ36V3Ncjs.isResponseLike.call(void 0, response)) {
|
|
7100
7101
|
throw new Error(
|
|
7101
7102
|
"onRequest handler must return a Response"
|
|
7102
7103
|
);
|
|
@@ -7191,7 +7192,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
7191
7192
|
var _a2;
|
|
7192
7193
|
const { ctx } = unwrapTsfnPayload(error, payload);
|
|
7193
7194
|
const history = (_a2 = getNativeWorkflowInspector(ctx)) == null ? void 0 : _a2.getHistory();
|
|
7194
|
-
return history == null ? void 0 :
|
|
7195
|
+
return history == null ? void 0 : _chunkSR362FVRcjs.toUint8Array.call(void 0, history);
|
|
7195
7196
|
}
|
|
7196
7197
|
) : void 0,
|
|
7197
7198
|
replayWorkflow: _chunkHDVZ6YZGcjs.hasRunInspectorConfig.call(void 0, config.run) ? wrapNativeCallback(
|
|
@@ -7205,7 +7206,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
7205
7206
|
return void 0;
|
|
7206
7207
|
}
|
|
7207
7208
|
const history = await _asyncNullishCoalesce(await workflowInspector.replayFromStep(entryId), async () => ( null));
|
|
7208
|
-
return history == null ? void 0 :
|
|
7209
|
+
return history == null ? void 0 : _chunkSR362FVRcjs.toUint8Array.call(void 0, history);
|
|
7209
7210
|
}
|
|
7210
7211
|
) : void 0,
|
|
7211
7212
|
actions: Object.fromEntries(
|
|
@@ -7342,7 +7343,7 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
|
|
|
7342
7343
|
startServices: resolveServicesBinary && config.startServices,
|
|
7343
7344
|
handleInspectorHttpInRuntime: true,
|
|
7344
7345
|
serverlessBasePath: config.serverless.basePath,
|
|
7345
|
-
serverlessPackageVersion:
|
|
7346
|
+
serverlessPackageVersion: _chunkSR362FVRcjs.VERSION,
|
|
7346
7347
|
serverlessClientEndpoint: config.publicEndpoint,
|
|
7347
7348
|
serverlessClientNamespace: config.publicNamespace,
|
|
7348
7349
|
serverlessClientToken: config.publicToken,
|
|
@@ -7355,11 +7356,11 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
|
|
|
7355
7356
|
} catch (error) {
|
|
7356
7357
|
logger2().warn({
|
|
7357
7358
|
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",
|
|
7358
|
-
error:
|
|
7359
|
+
error: _chunkSR362FVRcjs.stringifyError.call(void 0, error)
|
|
7359
7360
|
});
|
|
7360
7361
|
}
|
|
7361
7362
|
if (resolveServicesBinary && config.startServices) {
|
|
7362
|
-
const servicesBinary =
|
|
7363
|
+
const servicesBinary = _chunkSR362FVRcjs.getEnvUniversal.call(void 0, "RIVET_SERVICES_BINARY");
|
|
7363
7364
|
if (servicesBinary) {
|
|
7364
7365
|
serveConfig.servicesBinaryPath = servicesBinary;
|
|
7365
7366
|
} else {
|
|
@@ -7374,13 +7375,13 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
|
|
|
7374
7375
|
serveConfig.engineHost = config.engineHost;
|
|
7375
7376
|
serveConfig.enginePort = config.enginePort;
|
|
7376
7377
|
if ((_a = config.test) == null ? void 0 : _a.enabled) {
|
|
7377
|
-
serveConfig.inspectorTestToken = _nullishCoalesce(
|
|
7378
|
+
serveConfig.inspectorTestToken = _nullishCoalesce(_chunkSR362FVRcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
|
|
7378
7379
|
}
|
|
7379
7380
|
return serveConfig;
|
|
7380
7381
|
}
|
|
7381
7382
|
async function buildRegistryWithRuntime(config, runtime) {
|
|
7382
7383
|
var _a;
|
|
7383
|
-
if (((_a = config.test) == null ? void 0 : _a.enabled) &&
|
|
7384
|
+
if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunkSR362FVRcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
|
|
7384
7385
|
trySetProcessEnv("_RIVET_TEST_INSPECTOR_TOKEN", "token");
|
|
7385
7386
|
}
|
|
7386
7387
|
if (runtime.kind === "napi") {
|
|
@@ -7410,6 +7411,8 @@ async function buildConfiguredRegistry(config) {
|
|
|
7410
7411
|
|
|
7411
7412
|
// src/registry/index.ts
|
|
7412
7413
|
var REGISTRY_READY_TIMEOUT_MS = 3e4;
|
|
7414
|
+
var LOCAL_ENGINE_READY_TIMEOUT_MS = 6e4;
|
|
7415
|
+
var LOCAL_DEV_SHUTDOWN_GRACE_PERIOD_MS = 4e3;
|
|
7413
7416
|
function rejectServerless() {
|
|
7414
7417
|
throw new Error("serverless is disabled in this version");
|
|
7415
7418
|
}
|
|
@@ -7450,7 +7453,7 @@ function createApplicationFetch(application, runtime) {
|
|
|
7450
7453
|
signal: abortController.signal
|
|
7451
7454
|
})
|
|
7452
7455
|
);
|
|
7453
|
-
if (!
|
|
7456
|
+
if (!_chunk5IZ36V3Ncjs.isResponseLike.call(void 0, response)) {
|
|
7454
7457
|
throw new TypeError(
|
|
7455
7458
|
"registry.listen() application fetch must return a Response"
|
|
7456
7459
|
);
|
|
@@ -7500,7 +7503,7 @@ var Registry = class {
|
|
|
7500
7503
|
var _a;
|
|
7501
7504
|
this.#config = config;
|
|
7502
7505
|
if ((_a = config.logging) == null ? void 0 : _a.baseLogger) {
|
|
7503
|
-
|
|
7506
|
+
_chunkSR362FVRcjs.configureBaseLogger.call(void 0, config.logging.baseLogger);
|
|
7504
7507
|
}
|
|
7505
7508
|
this.#buildConfiguredRegistry = _nullishCoalesce((deps == null ? void 0 : deps.buildConfiguredRegistry), () => ( buildConfiguredRegistry));
|
|
7506
7509
|
this.routes = {
|
|
@@ -7732,10 +7735,10 @@ var Registry = class {
|
|
|
7732
7735
|
if (!opts.application) {
|
|
7733
7736
|
rejectServerless();
|
|
7734
7737
|
}
|
|
7735
|
-
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => (
|
|
7736
|
-
const publicDir = _nullishCoalesce(opts.publicDir, () => (
|
|
7738
|
+
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => ( _chunkSR362FVRcjs.parsePortEnv.call(void 0, process.env.RIVET_PORT))), () => ( 3e3));
|
|
7739
|
+
const publicDir = _nullishCoalesce(opts.publicDir, () => ( _chunkSR362FVRcjs.getRivetkitPublicDir.call(void 0, )));
|
|
7737
7740
|
const config = this.parseConfig();
|
|
7738
|
-
if (opts.application &&
|
|
7741
|
+
if (opts.application && _chunkSR362FVRcjs.getRivetkitRuntimeMode.call(void 0, ) !== "serverless") {
|
|
7739
7742
|
if (config.runtime === "wasm") {
|
|
7740
7743
|
throw new Error(
|
|
7741
7744
|
"registry.listen() requires the native runtime; use an application-owned HTTP server with WebAssembly"
|
|
@@ -7811,7 +7814,7 @@ var Registry = class {
|
|
|
7811
7814
|
return jsonRouteResponse(503, {
|
|
7812
7815
|
status: "not_started",
|
|
7813
7816
|
runtime: "rivetkit",
|
|
7814
|
-
version:
|
|
7817
|
+
version: _chunkSR362FVRcjs.VERSION
|
|
7815
7818
|
});
|
|
7816
7819
|
}
|
|
7817
7820
|
const { runtime, registry } = configured;
|
|
@@ -7819,7 +7822,7 @@ var Registry = class {
|
|
|
7819
7822
|
return jsonRouteResponse(501, {
|
|
7820
7823
|
status: "unsupported",
|
|
7821
7824
|
runtime: "rivetkit",
|
|
7822
|
-
version:
|
|
7825
|
+
version: _chunkSR362FVRcjs.VERSION
|
|
7823
7826
|
});
|
|
7824
7827
|
}
|
|
7825
7828
|
const response = await runtime.registryHealth(registry);
|
|
@@ -7894,14 +7897,14 @@ var Registry = class {
|
|
|
7894
7897
|
var _a;
|
|
7895
7898
|
if (!this.#runtimeServePromise) {
|
|
7896
7899
|
const configuredEnvoyVersion = (_a = this.#config.node) == null ? void 0 : _a.version;
|
|
7897
|
-
const envoyVersionSource = configuredEnvoyVersion !== void 0 ? "config" :
|
|
7900
|
+
const envoyVersionSource = configuredEnvoyVersion !== void 0 ? "config" : _chunkSR362FVRcjs.getRivetEnvoyVersion.call(void 0, ) !== void 0 ? "environment" : "default";
|
|
7898
7901
|
logger2().info({
|
|
7899
7902
|
msg: "starting rivetkit envoy",
|
|
7900
|
-
rivetkitVersion:
|
|
7903
|
+
rivetkitVersion: _chunkSR362FVRcjs.VERSION,
|
|
7901
7904
|
envoyVersion: config.node.version,
|
|
7902
7905
|
envoyVersionSource
|
|
7903
7906
|
});
|
|
7904
|
-
if (envoyVersionSource === "default" &&
|
|
7907
|
+
if (envoyVersionSource === "default" && _chunkSR362FVRcjs.getNodeEnv.call(void 0, ) === "production") {
|
|
7905
7908
|
logger2().error({
|
|
7906
7909
|
msg: "node version defaulted because neither config.node.version nor RIVET_NODE_VERSION is set; actors will not drain automatically across deploys. See https://rivet.dev/docs/actors/versions",
|
|
7907
7910
|
envoyVersion: config.node.version,
|
|
@@ -7990,10 +7993,10 @@ var Registry = class {
|
|
|
7990
7993
|
const modeAPromise = this.#runtimeServeConfiguredPromise;
|
|
7991
7994
|
const modeBPromise = this.#runtimeServerlessPromise;
|
|
7992
7995
|
const runtimes = /* @__PURE__ */ new Set();
|
|
7993
|
-
const localDevSignal = signalDriven &&
|
|
7996
|
+
const localDevSignal = signalDriven && _chunkSR362FVRcjs.getNodeEnv.call(void 0, ) !== "production" && config.engineSpawn && config.endpoint !== void 0 && _chunk5IZ36V3Ncjs.isLocalEngineEndpoint.call(void 0, config.endpoint);
|
|
7994
7997
|
let gracePeriodMs = (_a = config.shutdown) == null ? void 0 : _a.gracePeriodMs;
|
|
7995
7998
|
if (gracePeriodMs === void 0) {
|
|
7996
|
-
gracePeriodMs = localDevSignal ?
|
|
7999
|
+
gracePeriodMs = localDevSignal ? LOCAL_DEV_SHUTDOWN_GRACE_PERIOD_MS : await _asyncNullishCoalesce(await this.#actorStopThresholdMs(
|
|
7997
8000
|
_nullishCoalesce(modeAPromise, () => ( modeBPromise))
|
|
7998
8001
|
), async () => ( 30 * 60 * 1e3));
|
|
7999
8002
|
}
|
|
@@ -8102,7 +8105,7 @@ var Registry = class {
|
|
|
8102
8105
|
}
|
|
8103
8106
|
if (this.#runtimeReadyPromise) return this.#runtimeReadyPromise;
|
|
8104
8107
|
try {
|
|
8105
|
-
if (
|
|
8108
|
+
if (_chunkSR362FVRcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
8106
8109
|
return Promise.reject(
|
|
8107
8110
|
new Error(
|
|
8108
8111
|
"registry.startAndWait() requires envoy runtime mode; serverless registries become ready per request"
|
|
@@ -8126,16 +8129,17 @@ var Registry = class {
|
|
|
8126
8129
|
if (!configuredRegistryPromise || !serveLifecyclePromise) {
|
|
8127
8130
|
throw new Error("registry envoy startup did not initialize");
|
|
8128
8131
|
}
|
|
8132
|
+
const readyTimeoutMs = config.engineSpawn && config.endpoint !== void 0 && _chunk5IZ36V3Ncjs.isLocalEngineEndpoint.call(void 0, config.endpoint) ? LOCAL_ENGINE_READY_TIMEOUT_MS : REGISTRY_READY_TIMEOUT_MS;
|
|
8129
8133
|
let timeout;
|
|
8130
8134
|
const timeoutPromise = new Promise((_resolve, reject) => {
|
|
8131
8135
|
var _a;
|
|
8132
8136
|
timeout = setTimeout(
|
|
8133
8137
|
() => reject(
|
|
8134
8138
|
new Error(
|
|
8135
|
-
`RivetKit registry did not register with the Engine within ${
|
|
8139
|
+
`RivetKit registry did not register with the Engine within ${readyTimeoutMs}ms`
|
|
8136
8140
|
)
|
|
8137
8141
|
),
|
|
8138
|
-
|
|
8142
|
+
readyTimeoutMs
|
|
8139
8143
|
);
|
|
8140
8144
|
(_a = timeout.unref) == null ? void 0 : _a.call(timeout);
|
|
8141
8145
|
});
|
|
@@ -8175,8 +8179,8 @@ var Registry = class {
|
|
|
8175
8179
|
* ```
|
|
8176
8180
|
*/
|
|
8177
8181
|
start() {
|
|
8178
|
-
if (
|
|
8179
|
-
const publicDir = _nullishCoalesce(
|
|
8182
|
+
if (_chunkSR362FVRcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
8183
|
+
const publicDir = _nullishCoalesce(_chunkSR362FVRcjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
|
|
8180
8184
|
this.listen({ publicDir }).catch((error) => {
|
|
8181
8185
|
logger2().error({ error }, "auto-listen failed; exiting");
|
|
8182
8186
|
if (typeof process !== "undefined" && typeof process.exit === "function") {
|
|
@@ -8197,13 +8201,13 @@ var Registry = class {
|
|
|
8197
8201
|
};
|
|
8198
8202
|
console.log();
|
|
8199
8203
|
console.log(
|
|
8200
|
-
` RivetKit ${
|
|
8204
|
+
` RivetKit ${_chunkSR362FVRcjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
|
|
8201
8205
|
);
|
|
8202
8206
|
if (config.namespace !== "default") {
|
|
8203
8207
|
logLine("Namespace", config.namespace);
|
|
8204
8208
|
}
|
|
8205
8209
|
if (config.endpoint) {
|
|
8206
|
-
const endpointType = config.startEngine ||
|
|
8210
|
+
const endpointType = config.startEngine || _chunk5IZ36V3Ncjs.isLocalEngineEndpoint.call(void 0, config.endpoint) ? "local native" : "remote";
|
|
8207
8211
|
logLine("Endpoint", `${config.endpoint} (${endpointType})`);
|
|
8208
8212
|
}
|
|
8209
8213
|
if (kind === "serverless" && config.publicEndpoint) {
|
|
@@ -8273,5 +8277,5 @@ function setup(input) {
|
|
|
8273
8277
|
|
|
8274
8278
|
|
|
8275
8279
|
|
|
8276
|
-
exports.ALLOWED_PUBLIC_HEADERS =
|
|
8280
|
+
exports.ALLOWED_PUBLIC_HEADERS = _chunk5IZ36V3Ncjs.ALLOWED_PUBLIC_HEADERS; exports.ActorDefinition = ActorDefinition; exports.ActorError = _chunkMGI2VVF6cjs.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 = _chunkMGI2VVF6cjs.RivetError; exports.RuntimeKindSchema = RuntimeKindSchema; exports.SqliteBackendSchema = SqliteBackendSchema; exports.SqliteConfigSchema = SqliteConfigSchema; exports.TestConfigSchema = TestConfigSchema; exports.UserError = _chunkMGI2VVF6cjs.UserError; exports.WasmRuntimeConfigSchema = WasmRuntimeConfigSchema; exports.actor = actor; exports.buildActorNames = buildActorNames; exports.createClientWithDriver = _chunk5IZ36V3Ncjs.createClientWithDriver; exports.defineRunHandler = _chunkHDVZ6YZGcjs.defineRunHandler; exports.event = event; exports.isStaticActorDefinition = isStaticActorDefinition; exports.isStaticActorInstance = isStaticActorInstance; exports.lookupInRegistry = lookupInRegistry; exports.noopNext = _chunkSR362FVRcjs.noopNext; exports.queue = queue; exports.setup = setup; exports.toUint8Array = _chunkSR362FVRcjs.toUint8Array;
|
|
8277
8281
|
//# sourceMappingURL=mod.cjs.map
|