rivetkit 3.0.0-preview.4 → 3.0.0-preview.6
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 -19
- 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-ZWBTTPP3.js → chunk-3UT27Z2Z.js} +2 -2
- package/dist/tsup/{chunk-IPDSE33U.js → chunk-45UKEIKT.js} +2 -2
- package/dist/tsup/{chunk-MAUVZIXL.js → chunk-6AECHZCH.js} +2 -2
- package/dist/tsup/{chunk-MAUVZIXL.js.map → chunk-6AECHZCH.js.map} +1 -1
- package/dist/tsup/{chunk-OR3LWJGW.js → chunk-6HNQ7EHR.js} +2 -2
- package/dist/tsup/{chunk-C45DIKGB.js → chunk-DBKL7LCY.js} +27 -21
- package/dist/tsup/chunk-DBKL7LCY.js.map +1 -0
- package/dist/tsup/{chunk-LTMP7OMQ.cjs → chunk-DRNZBNII.cjs} +3 -3
- package/dist/tsup/{chunk-LTMP7OMQ.cjs.map → chunk-DRNZBNII.cjs.map} +1 -1
- package/dist/tsup/{chunk-5IZ36V3N.cjs → chunk-ENUONGNH.cjs} +166 -160
- package/dist/tsup/chunk-ENUONGNH.cjs.map +1 -0
- package/dist/tsup/{chunk-KM34T23X.js → chunk-KKIWVL2H.js} +3 -3
- package/dist/tsup/{chunk-KSQ3VVZX.cjs → chunk-KOLH4CTU.cjs} +3 -3
- package/dist/tsup/{chunk-KSQ3VVZX.cjs.map → chunk-KOLH4CTU.cjs.map} +1 -1
- package/dist/tsup/{chunk-S5QNPQ6K.cjs → chunk-LJNYWEYG.cjs} +3 -3
- package/dist/tsup/{chunk-S5QNPQ6K.cjs.map → chunk-LJNYWEYG.cjs.map} +1 -1
- package/dist/tsup/{chunk-WQFXPN6S.js → chunk-M5QFGINP.js} +4 -4
- package/dist/tsup/{chunk-WE5DMJFV.cjs → chunk-M6KOBS77.cjs} +7 -7
- package/dist/tsup/{chunk-WE5DMJFV.cjs.map → chunk-M6KOBS77.cjs.map} +1 -1
- package/dist/tsup/{chunk-U2QBZJTL.cjs → chunk-MJGSJEQS.cjs} +10 -10
- package/dist/tsup/{chunk-U2QBZJTL.cjs.map → chunk-MJGSJEQS.cjs.map} +1 -1
- package/dist/tsup/{chunk-DCUTYXIX.js → chunk-MQKJ6DPU.js} +2 -2
- package/dist/tsup/{chunk-SR362FVR.cjs → chunk-QZHR7FM2.cjs} +2 -2
- package/dist/tsup/{chunk-SR362FVR.cjs.map → chunk-QZHR7FM2.cjs.map} +1 -1
- package/dist/tsup/{chunk-SLIGV2T4.cjs → chunk-ZEEDB2GK.cjs} +4 -4
- package/dist/tsup/{chunk-SLIGV2T4.cjs.map → chunk-ZEEDB2GK.cjs.map} +1 -1
- 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 +86 -86
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.js +5 -5
- 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 +21 -24
- package/src/client/lifecycle-errors.ts +13 -0
- package/src/registry/napi-runtime.ts +1 -1
- package/src/registry/native.ts +1 -1
- package/dist/tsup/chunk-5IZ36V3N.cjs.map +0 -1
- package/dist/tsup/chunk-C45DIKGB.js.map +0 -1
- /package/dist/tsup/{chunk-ZWBTTPP3.js.map → chunk-3UT27Z2Z.js.map} +0 -0
- /package/dist/tsup/{chunk-IPDSE33U.js.map → chunk-45UKEIKT.js.map} +0 -0
- /package/dist/tsup/{chunk-OR3LWJGW.js.map → chunk-6HNQ7EHR.js.map} +0 -0
- /package/dist/tsup/{chunk-KM34T23X.js.map → chunk-KKIWVL2H.js.map} +0 -0
- /package/dist/tsup/{chunk-WQFXPN6S.js.map → chunk-M5QFGINP.js.map} +0 -0
- /package/dist/tsup/{chunk-DCUTYXIX.js.map → chunk-MQKJ6DPU.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 _chunkZEEDB2GKcjs = require('./chunk-ZEEDB2GK.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -35,17 +35,17 @@ var _chunkHDVZ6YZGcjs = require('./chunk-HDVZ6YZG.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunkENUONGNHcjs = require('./chunk-ENUONGNH.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
var _chunkRTWH3AX3cjs = require('./chunk-RTWH3AX3.cjs');
|
|
43
|
-
require('./chunk-
|
|
43
|
+
require('./chunk-LJNYWEYG.cjs');
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunkDRNZBNIIcjs = require('./chunk-DRNZBNII.cjs');
|
|
49
49
|
require('./chunk-KVFIONKQ.cjs');
|
|
50
50
|
|
|
51
51
|
|
|
@@ -80,7 +80,7 @@ require('./chunk-KVFIONKQ.cjs');
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
var
|
|
83
|
+
var _chunkQZHR7FM2cjs = require('./chunk-QZHR7FM2.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 _chunkQZHR7FM2cjs.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 _chunkQZHR7FM2cjs.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 _chunkQZHR7FM2cjs.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 = _chunkENUONGNHcjs.convertRegistryConfigToClientConfig.call(void 0, config);
|
|
442
|
+
const dcsRes = await _chunkENUONGNHcjs.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 _chunkENUONGNHcjs.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: _chunkQZHR7FM2cjs.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: _chunkQZHR7FM2cjs.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(_chunkQZHR7FM2cjs.getRivetPool.call(void 0, ), () => ( "default"))),
|
|
501
|
+
version: _v4.z.number().default(() => _nullishCoalesce(_chunkQZHR7FM2cjs.getRivetEnvoyVersion.call(void 0, ), () => ( 1))),
|
|
502
502
|
// Deprecated.
|
|
503
|
-
totalSlots: _v4.z.number().default(() => _nullishCoalesce(
|
|
503
|
+
totalSlots: _v4.z.number().default(() => _nullishCoalesce(_chunkQZHR7FM2cjs.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, () => ( _chunkQZHR7FM2cjs.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, () => ( _chunkQZHR7FM2cjs.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, () => ( _chunkQZHR7FM2cjs.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: _chunkQZHR7FM2cjs.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, () => ( _chunkQZHR7FM2cjs.getRivetEngine.call(void 0, ))), () => ( _chunkQZHR7FM2cjs.getRivetEndpoint.call(void 0, )))),
|
|
659
|
+
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkQZHR7FM2cjs.getRivetToken.call(void 0, )))),
|
|
660
|
+
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkQZHR7FM2cjs.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(() => _chunkQZHR7FM2cjs.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(_chunkQZHR7FM2cjs.getRivetRunEngineHost.call(void 0, ), () => ( _chunkENUONGNHcjs.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(_chunkQZHR7FM2cjs.getRivetRunEnginePort.call(void 0, ), () => ( _chunkENUONGNHcjs.ENGINE_PORT))),
|
|
713
713
|
/** @experimental */
|
|
714
|
-
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
714
|
+
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkQZHR7FM2cjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunkQZHR7FM2cjs.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
|
|
@@ -768,7 +768,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
768
768
|
}))
|
|
769
769
|
}).transform((config, ctx) => {
|
|
770
770
|
var _a, _b, _c;
|
|
771
|
-
const isDevEnv =
|
|
771
|
+
const isDevEnv = _chunkQZHR7FM2cjs.isDev.call(void 0, );
|
|
772
772
|
const sqliteBackend = _nullishCoalesce(((_a = config.sqlite) == null ? void 0 : _a.backend), () => ( ((_b = config.test) == null ? void 0 : _b.sqliteBackend)));
|
|
773
773
|
if (config.runtime === "wasm" && sqliteBackend === "local") {
|
|
774
774
|
ctx.addIssue({
|
|
@@ -778,7 +778,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
778
778
|
});
|
|
779
779
|
}
|
|
780
780
|
const sqlite = config.runtime === "wasm" && config.sqlite === void 0 ? { backend: "remote" } : config.sqlite;
|
|
781
|
-
const parsedEndpoint = config.endpoint ?
|
|
781
|
+
const parsedEndpoint = config.endpoint ? _chunkENUONGNHcjs.tryParseEndpoint.call(void 0, ctx, {
|
|
782
782
|
endpoint: config.endpoint,
|
|
783
783
|
path: ["endpoint"],
|
|
784
784
|
namespace: config.namespace,
|
|
@@ -797,18 +797,18 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
797
797
|
path: ["configurePool"]
|
|
798
798
|
});
|
|
799
799
|
}
|
|
800
|
-
const localEngineEndpoint =
|
|
800
|
+
const localEngineEndpoint = _chunkENUONGNHcjs.buildEngineEndpoint.call(void 0,
|
|
801
801
|
config.engineHost,
|
|
802
802
|
config.enginePort
|
|
803
803
|
);
|
|
804
804
|
const endpoint = config.startEngine ? localEngineEndpoint : _nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.endpoint), () => ( (isDevEnv ? localEngineEndpoint : void 0)));
|
|
805
|
-
const startServices = _nullishCoalesce(config.startServices, () => (
|
|
805
|
+
const startServices = _nullishCoalesce(config.startServices, () => ( _chunkQZHR7FM2cjs.getRivetRunServices.call(void 0, )));
|
|
806
806
|
const validateServerlessEndpoint = Boolean(
|
|
807
807
|
config.startEngine || parsedEndpoint
|
|
808
808
|
);
|
|
809
809
|
const namespace = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.namespace), () => ( config.namespace)), () => ( "default"));
|
|
810
|
-
const token = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token)), () => ( (endpoint &&
|
|
811
|
-
const parsedPublicEndpoint = config.serverless.publicEndpoint ?
|
|
810
|
+
const token = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token)), () => ( (endpoint && _chunkENUONGNHcjs.isLocalEngineEndpoint.call(void 0, endpoint) ? "default" : void 0)));
|
|
811
|
+
const parsedPublicEndpoint = config.serverless.publicEndpoint ? _chunkENUONGNHcjs.tryParseEndpoint.call(void 0, ctx, {
|
|
812
812
|
endpoint: config.serverless.publicEndpoint,
|
|
813
813
|
path: ["serverless", "publicEndpoint"]
|
|
814
814
|
}) : void 0;
|
|
@@ -913,7 +913,7 @@ var DocRegistryConfigSchema = _zod.z.object({
|
|
|
913
913
|
noWelcome: _zod.z.boolean().optional().describe("Disable the welcome message on startup. Default: false"),
|
|
914
914
|
sqlite: DocSqliteConfigSchema,
|
|
915
915
|
logging: _zod.z.object({
|
|
916
|
-
level:
|
|
916
|
+
level: _chunkQZHR7FM2cjs.LogLevelSchema.optional().describe(
|
|
917
917
|
"Log level for RivetKit. Default: 'warn'"
|
|
918
918
|
)
|
|
919
919
|
}).optional().describe("Logging configuration."),
|
|
@@ -1553,7 +1553,7 @@ var NapiCoreRuntime = (_class = class {
|
|
|
1553
1553
|
if (!(active == null ? void 0 : active.sameActorInstance(ownerCtx))) {
|
|
1554
1554
|
return ownerCtx;
|
|
1555
1555
|
}
|
|
1556
|
-
const applicationSpan =
|
|
1556
|
+
const applicationSpan = _chunkENUONGNHcjs.readActiveTraceHeaders.call(void 0, );
|
|
1557
1557
|
if (!applicationSpan) {
|
|
1558
1558
|
return active;
|
|
1559
1559
|
}
|
|
@@ -1757,7 +1757,7 @@ var NapiCoreRuntime = (_class = class {
|
|
|
1757
1757
|
const span = (_a = nativeCtx.invocationTraceContext()) == null ? void 0 : _a.span;
|
|
1758
1758
|
return this.#invocationContext.run(
|
|
1759
1759
|
nativeCtx,
|
|
1760
|
-
() =>
|
|
1760
|
+
() => _chunkENUONGNHcjs.runWithActorInvocationSpan.call(void 0, span, run)
|
|
1761
1761
|
);
|
|
1762
1762
|
}
|
|
1763
1763
|
actorInvocationTraceContext(ctx) {
|
|
@@ -2132,8 +2132,8 @@ function runtimeBytesToArrayBuffer(value) {
|
|
|
2132
2132
|
function buildNativeHttpRequest(init) {
|
|
2133
2133
|
var _a;
|
|
2134
2134
|
const headers = new Headers(init.headers);
|
|
2135
|
-
const originalUrl = headers.get(
|
|
2136
|
-
headers.delete(
|
|
2135
|
+
const originalUrl = headers.get(_chunkENUONGNHcjs.HEADER_ORIGINAL_REQUEST_URL);
|
|
2136
|
+
headers.delete(_chunkENUONGNHcjs.HEADER_ORIGINAL_REQUEST_URL);
|
|
2137
2137
|
const url = _nullishCoalesce(originalUrl, () => ( (init.uri.startsWith("http") ? init.uri : new URL(init.uri, "http://127.0.0.1").toString())));
|
|
2138
2138
|
const method2 = init.method.toUpperCase();
|
|
2139
2139
|
const bodyForbidden = method2 === "GET" || method2 === "HEAD";
|
|
@@ -2212,7 +2212,7 @@ async function pumpResponseBody(reader, stream) {
|
|
|
2212
2212
|
}
|
|
2213
2213
|
} catch (error) {
|
|
2214
2214
|
try {
|
|
2215
|
-
await stream.error(
|
|
2215
|
+
await stream.error(_chunkQZHR7FM2cjs.stringifyError.call(void 0, error));
|
|
2216
2216
|
} catch (streamError) {
|
|
2217
2217
|
logger2().debug({
|
|
2218
2218
|
msg: "failed to report native http response stream error",
|
|
@@ -3451,7 +3451,7 @@ async function loadAutoRuntime(config, loaders = defaultRuntimeLoaders) {
|
|
|
3451
3451
|
nativeError = error;
|
|
3452
3452
|
logger2().warn({
|
|
3453
3453
|
msg: "native runtime failed to load; falling back to wasm",
|
|
3454
|
-
error:
|
|
3454
|
+
error: _chunkQZHR7FM2cjs.stringifyError.call(void 0, error)
|
|
3455
3455
|
});
|
|
3456
3456
|
}
|
|
3457
3457
|
try {
|
|
@@ -3460,7 +3460,7 @@ async function loadAutoRuntime(config, loaders = defaultRuntimeLoaders) {
|
|
|
3460
3460
|
throw new (0, _chunkMGI2VVF6cjs.RivetError)(
|
|
3461
3461
|
"config",
|
|
3462
3462
|
"runtime_unavailable",
|
|
3463
|
-
`RivetKit could not load a core runtime. Native runtime: ${
|
|
3463
|
+
`RivetKit could not load a core runtime. Native runtime: ${_chunkQZHR7FM2cjs.stringifyError.call(void 0, nativeError)} Wasm runtime: ${_chunkQZHR7FM2cjs.stringifyError.call(void 0, wasmError)}`,
|
|
3464
3464
|
{
|
|
3465
3465
|
public: true,
|
|
3466
3466
|
statusCode: 500
|
|
@@ -3668,7 +3668,7 @@ async function cleanupNativeSleepRuntimeState(runtime, ctx, afterTrackedWorkDrai
|
|
|
3668
3668
|
}).catch((error) => {
|
|
3669
3669
|
logger2().warn({
|
|
3670
3670
|
msg: "deferred native sleep cleanup failed",
|
|
3671
|
-
error:
|
|
3671
|
+
error: _chunkQZHR7FM2cjs.stringifyError.call(void 0, error)
|
|
3672
3672
|
});
|
|
3673
3673
|
});
|
|
3674
3674
|
return;
|
|
@@ -3840,10 +3840,10 @@ function decodeValue(value) {
|
|
|
3840
3840
|
if (!value || value.length === 0) {
|
|
3841
3841
|
return void 0;
|
|
3842
3842
|
}
|
|
3843
|
-
return
|
|
3843
|
+
return _chunkQZHR7FM2cjs.decodeCborCompat.call(void 0, value);
|
|
3844
3844
|
}
|
|
3845
3845
|
function encodeValue(value) {
|
|
3846
|
-
return
|
|
3846
|
+
return _chunkQZHR7FM2cjs.encodeCborCompat.call(void 0, value);
|
|
3847
3847
|
}
|
|
3848
3848
|
function normalizeArgs(value) {
|
|
3849
3849
|
return Array.isArray(value) ? value : value === void 0 || value === null ? [] : [value];
|
|
@@ -3879,7 +3879,7 @@ function isStructuredBridgeError(error) {
|
|
|
3879
3879
|
return _chunkMGI2VVF6cjs.isRivetErrorLike.call(void 0, error) && "__type" in error && (error.__type === "RivetError" || error.__type === "ActorError");
|
|
3880
3880
|
}
|
|
3881
3881
|
function encodeNativeCallbackError(error) {
|
|
3882
|
-
const structuredError = isStructuredBridgeError(error) ? error :
|
|
3882
|
+
const structuredError = isStructuredBridgeError(error) ? error : _chunkQZHR7FM2cjs.deconstructError.call(void 0, error, true);
|
|
3883
3883
|
const { encoded, droppedMetadataCause } = _chunkMGI2VVF6cjs.encodeBridgeRivetError.call(void 0, structuredError);
|
|
3884
3884
|
if (droppedMetadataCause !== void 0) {
|
|
3885
3885
|
logger2().warn(
|
|
@@ -3941,7 +3941,7 @@ function decodeWorkflowCbor(data) {
|
|
|
3941
3941
|
return null;
|
|
3942
3942
|
}
|
|
3943
3943
|
try {
|
|
3944
|
-
return
|
|
3944
|
+
return _chunkQZHR7FM2cjs.decodeCborCompat.call(void 0, new Uint8Array(data));
|
|
3945
3945
|
} catch (e3) {
|
|
3946
3946
|
return null;
|
|
3947
3947
|
}
|
|
@@ -4054,7 +4054,7 @@ function serializeWorkflowHistoryForJson(data) {
|
|
|
4054
4054
|
if (data === null) {
|
|
4055
4055
|
return null;
|
|
4056
4056
|
}
|
|
4057
|
-
const history =
|
|
4057
|
+
const history = _chunkZEEDB2GKcjs.decodeWorkflowHistoryTransport.call(void 0, data);
|
|
4058
4058
|
return jsonSafe({
|
|
4059
4059
|
nameRegistry: [...history.nameRegistry],
|
|
4060
4060
|
entries: history.entries.map((entry) => ({
|
|
@@ -4200,7 +4200,7 @@ var NativeConnAdapter = class {
|
|
|
4200
4200
|
},
|
|
4201
4201
|
(newValue) => {
|
|
4202
4202
|
assertCurrentState();
|
|
4203
|
-
|
|
4203
|
+
_chunkQZHR7FM2cjs.assertJsonCompatValue.call(void 0, newValue);
|
|
4204
4204
|
}
|
|
4205
4205
|
);
|
|
4206
4206
|
}
|
|
@@ -4208,7 +4208,7 @@ var NativeConnAdapter = class {
|
|
|
4208
4208
|
var _a;
|
|
4209
4209
|
(_a = this.#assertCanMutateState) == null ? void 0 : _a.call(this);
|
|
4210
4210
|
const nextValue = unwrapWriteThroughProxy(value);
|
|
4211
|
-
|
|
4211
|
+
_chunkQZHR7FM2cjs.assertJsonCompatValue.call(void 0, nextValue);
|
|
4212
4212
|
this.#writeState(nextValue, { writeNative: true });
|
|
4213
4213
|
}
|
|
4214
4214
|
initializeState(value) {
|
|
@@ -5287,7 +5287,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5287
5287
|
},
|
|
5288
5288
|
(newValue) => {
|
|
5289
5289
|
assertCurrentState();
|
|
5290
|
-
|
|
5290
|
+
_chunkQZHR7FM2cjs.assertJsonCompatValue.call(void 0, newValue);
|
|
5291
5291
|
}
|
|
5292
5292
|
);
|
|
5293
5293
|
}
|
|
@@ -5299,7 +5299,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5299
5299
|
}
|
|
5300
5300
|
this.#assertCanMutateState();
|
|
5301
5301
|
const nextValue = unwrapWriteThroughProxy(value);
|
|
5302
|
-
|
|
5302
|
+
_chunkQZHR7FM2cjs.assertJsonCompatValue.call(void 0, nextValue);
|
|
5303
5303
|
this.#writeState(nextValue, { scheduleSave: true });
|
|
5304
5304
|
}
|
|
5305
5305
|
initializeState(value) {
|
|
@@ -5513,7 +5513,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5513
5513
|
log: {
|
|
5514
5514
|
debug: (obj) => logger2().debug(obj)
|
|
5515
5515
|
},
|
|
5516
|
-
nativeDatabaseProvider:
|
|
5516
|
+
nativeDatabaseProvider: _chunkDRNZBNIIcjs.registerNativeStateTransactionOpener.call(void 0,
|
|
5517
5517
|
{
|
|
5518
5518
|
open: async (requestedActorId) => {
|
|
5519
5519
|
void requestedActorId;
|
|
@@ -5536,7 +5536,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5536
5536
|
return this.#db;
|
|
5537
5537
|
}
|
|
5538
5538
|
#bindDatabaseClient(client) {
|
|
5539
|
-
return
|
|
5539
|
+
return _chunkDRNZBNIIcjs.bindNativeStateTransactionContext.call(void 0, client, {
|
|
5540
5540
|
enter: async () => await this.#enterStateTransaction(),
|
|
5541
5541
|
exit: (scope) => this.#exitStateTransaction(
|
|
5542
5542
|
scope
|
|
@@ -5740,7 +5740,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5740
5740
|
const trackedPromise = Promise.resolve(promise).catch((error) => {
|
|
5741
5741
|
logger2().warn({
|
|
5742
5742
|
msg: "keepAwake promise rejected",
|
|
5743
|
-
error:
|
|
5743
|
+
error: _chunkQZHR7FM2cjs.stringifyError.call(void 0, error)
|
|
5744
5744
|
});
|
|
5745
5745
|
}).then(() => null);
|
|
5746
5746
|
try {
|
|
@@ -6238,7 +6238,7 @@ function validateInspectorTabSource(tabId, resolved) {
|
|
|
6238
6238
|
function buildNativeFactory(runtime, registryConfig, definition) {
|
|
6239
6239
|
var _a;
|
|
6240
6240
|
const config = definition.config;
|
|
6241
|
-
const databaseProvider = _nullishCoalesce(config.db, () => (
|
|
6241
|
+
const databaseProvider = _nullishCoalesce(config.db, () => ( _chunkDRNZBNIIcjs.db.call(void 0, )));
|
|
6242
6242
|
const actionHandlers = _chunkHDVZ6YZGcjs.flattenActionHandlers.call(void 0, config.actions);
|
|
6243
6243
|
const schemaConfig = {
|
|
6244
6244
|
actionInputSchemas: _chunkHDVZ6YZGcjs.flattenActionInputSchemas.call(void 0,
|
|
@@ -6249,9 +6249,9 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6249
6249
|
events: config.events,
|
|
6250
6250
|
queues: config.queues
|
|
6251
6251
|
};
|
|
6252
|
-
const createClient = (ctx) =>
|
|
6253
|
-
new (0,
|
|
6254
|
-
|
|
6252
|
+
const createClient = (ctx) => _chunkENUONGNHcjs.createClientWithDriver.call(void 0,
|
|
6253
|
+
new (0, _chunkENUONGNHcjs.RemoteEngineControlClient)(
|
|
6254
|
+
_chunkENUONGNHcjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
|
|
6255
6255
|
),
|
|
6256
6256
|
{
|
|
6257
6257
|
encoding: "bare",
|
|
@@ -6443,7 +6443,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6443
6443
|
400
|
|
6444
6444
|
);
|
|
6445
6445
|
}
|
|
6446
|
-
const cbor =
|
|
6446
|
+
const cbor = _chunkQZHR7FM2cjs.encodeCborCompat.call(void 0,
|
|
6447
6447
|
_nullishCoalesce(body.body, () => ( null))
|
|
6448
6448
|
);
|
|
6449
6449
|
const message = await runtime.actorQueueSend(ctx, name, cbor);
|
|
@@ -7040,7 +7040,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
7040
7040
|
...request,
|
|
7041
7041
|
abortController: requestAbortController
|
|
7042
7042
|
});
|
|
7043
|
-
const rawConnParams = handlerRequest.headers.get(
|
|
7043
|
+
const rawConnParams = handlerRequest.headers.get(_chunkENUONGNHcjs.HEADER_CONN_PARAMS);
|
|
7044
7044
|
let requestCtx;
|
|
7045
7045
|
let conn;
|
|
7046
7046
|
let removeRequestAbortListener;
|
|
@@ -7097,7 +7097,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
7097
7097
|
requestCtx,
|
|
7098
7098
|
handlerRequest
|
|
7099
7099
|
);
|
|
7100
|
-
if (!
|
|
7100
|
+
if (!_chunkENUONGNHcjs.isResponseLike.call(void 0, response)) {
|
|
7101
7101
|
throw new Error(
|
|
7102
7102
|
"onRequest handler must return a Response"
|
|
7103
7103
|
);
|
|
@@ -7192,7 +7192,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
7192
7192
|
var _a2;
|
|
7193
7193
|
const { ctx } = unwrapTsfnPayload(error, payload);
|
|
7194
7194
|
const history = (_a2 = getNativeWorkflowInspector(ctx)) == null ? void 0 : _a2.getHistory();
|
|
7195
|
-
return history == null ? void 0 :
|
|
7195
|
+
return history == null ? void 0 : _chunkQZHR7FM2cjs.toUint8Array.call(void 0, history);
|
|
7196
7196
|
}
|
|
7197
7197
|
) : void 0,
|
|
7198
7198
|
replayWorkflow: _chunkHDVZ6YZGcjs.hasRunInspectorConfig.call(void 0, config.run) ? wrapNativeCallback(
|
|
@@ -7206,7 +7206,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
7206
7206
|
return void 0;
|
|
7207
7207
|
}
|
|
7208
7208
|
const history = await _asyncNullishCoalesce(await workflowInspector.replayFromStep(entryId), async () => ( null));
|
|
7209
|
-
return history == null ? void 0 :
|
|
7209
|
+
return history == null ? void 0 : _chunkQZHR7FM2cjs.toUint8Array.call(void 0, history);
|
|
7210
7210
|
}
|
|
7211
7211
|
) : void 0,
|
|
7212
7212
|
actions: Object.fromEntries(
|
|
@@ -7343,7 +7343,7 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
|
|
|
7343
7343
|
startServices: resolveServicesBinary && config.startServices,
|
|
7344
7344
|
handleInspectorHttpInRuntime: true,
|
|
7345
7345
|
serverlessBasePath: config.serverless.basePath,
|
|
7346
|
-
serverlessPackageVersion:
|
|
7346
|
+
serverlessPackageVersion: _chunkQZHR7FM2cjs.VERSION,
|
|
7347
7347
|
serverlessClientEndpoint: config.publicEndpoint,
|
|
7348
7348
|
serverlessClientNamespace: config.publicNamespace,
|
|
7349
7349
|
serverlessClientToken: config.publicToken,
|
|
@@ -7356,11 +7356,11 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
|
|
|
7356
7356
|
} catch (error) {
|
|
7357
7357
|
logger2().warn({
|
|
7358
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",
|
|
7359
|
-
error:
|
|
7359
|
+
error: _chunkQZHR7FM2cjs.stringifyError.call(void 0, error)
|
|
7360
7360
|
});
|
|
7361
7361
|
}
|
|
7362
7362
|
if (resolveServicesBinary && config.startServices) {
|
|
7363
|
-
const servicesBinary =
|
|
7363
|
+
const servicesBinary = _chunkQZHR7FM2cjs.getEnvUniversal.call(void 0, "RIVET_SERVICES_BINARY");
|
|
7364
7364
|
if (servicesBinary) {
|
|
7365
7365
|
serveConfig.servicesBinaryPath = servicesBinary;
|
|
7366
7366
|
} else {
|
|
@@ -7375,13 +7375,13 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
|
|
|
7375
7375
|
serveConfig.engineHost = config.engineHost;
|
|
7376
7376
|
serveConfig.enginePort = config.enginePort;
|
|
7377
7377
|
if ((_a = config.test) == null ? void 0 : _a.enabled) {
|
|
7378
|
-
serveConfig.inspectorTestToken = _nullishCoalesce(
|
|
7378
|
+
serveConfig.inspectorTestToken = _nullishCoalesce(_chunkQZHR7FM2cjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
|
|
7379
7379
|
}
|
|
7380
7380
|
return serveConfig;
|
|
7381
7381
|
}
|
|
7382
7382
|
async function buildRegistryWithRuntime(config, runtime) {
|
|
7383
7383
|
var _a;
|
|
7384
|
-
if (((_a = config.test) == null ? void 0 : _a.enabled) &&
|
|
7384
|
+
if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunkQZHR7FM2cjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
|
|
7385
7385
|
trySetProcessEnv("_RIVET_TEST_INSPECTOR_TOKEN", "token");
|
|
7386
7386
|
}
|
|
7387
7387
|
if (runtime.kind === "napi") {
|
|
@@ -7453,7 +7453,7 @@ function createApplicationFetch(application, runtime) {
|
|
|
7453
7453
|
signal: abortController.signal
|
|
7454
7454
|
})
|
|
7455
7455
|
);
|
|
7456
|
-
if (!
|
|
7456
|
+
if (!_chunkENUONGNHcjs.isResponseLike.call(void 0, response)) {
|
|
7457
7457
|
throw new TypeError(
|
|
7458
7458
|
"registry.listen() application fetch must return a Response"
|
|
7459
7459
|
);
|
|
@@ -7503,7 +7503,7 @@ var Registry = class {
|
|
|
7503
7503
|
var _a;
|
|
7504
7504
|
this.#config = config;
|
|
7505
7505
|
if ((_a = config.logging) == null ? void 0 : _a.baseLogger) {
|
|
7506
|
-
|
|
7506
|
+
_chunkQZHR7FM2cjs.configureBaseLogger.call(void 0, config.logging.baseLogger);
|
|
7507
7507
|
}
|
|
7508
7508
|
this.#buildConfiguredRegistry = _nullishCoalesce((deps == null ? void 0 : deps.buildConfiguredRegistry), () => ( buildConfiguredRegistry));
|
|
7509
7509
|
this.routes = {
|
|
@@ -7735,10 +7735,10 @@ var Registry = class {
|
|
|
7735
7735
|
if (!opts.application) {
|
|
7736
7736
|
rejectServerless();
|
|
7737
7737
|
}
|
|
7738
|
-
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => (
|
|
7739
|
-
const publicDir = _nullishCoalesce(opts.publicDir, () => (
|
|
7738
|
+
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => ( _chunkQZHR7FM2cjs.parsePortEnv.call(void 0, process.env.RIVET_PORT))), () => ( 3e3));
|
|
7739
|
+
const publicDir = _nullishCoalesce(opts.publicDir, () => ( _chunkQZHR7FM2cjs.getRivetkitPublicDir.call(void 0, )));
|
|
7740
7740
|
const config = this.parseConfig();
|
|
7741
|
-
if (opts.application &&
|
|
7741
|
+
if (opts.application && _chunkQZHR7FM2cjs.getRivetkitRuntimeMode.call(void 0, ) !== "serverless") {
|
|
7742
7742
|
if (config.runtime === "wasm") {
|
|
7743
7743
|
throw new Error(
|
|
7744
7744
|
"registry.listen() requires the native runtime; use an application-owned HTTP server with WebAssembly"
|
|
@@ -7814,7 +7814,7 @@ var Registry = class {
|
|
|
7814
7814
|
return jsonRouteResponse(503, {
|
|
7815
7815
|
status: "not_started",
|
|
7816
7816
|
runtime: "rivetkit",
|
|
7817
|
-
version:
|
|
7817
|
+
version: _chunkQZHR7FM2cjs.VERSION
|
|
7818
7818
|
});
|
|
7819
7819
|
}
|
|
7820
7820
|
const { runtime, registry } = configured;
|
|
@@ -7822,7 +7822,7 @@ var Registry = class {
|
|
|
7822
7822
|
return jsonRouteResponse(501, {
|
|
7823
7823
|
status: "unsupported",
|
|
7824
7824
|
runtime: "rivetkit",
|
|
7825
|
-
version:
|
|
7825
|
+
version: _chunkQZHR7FM2cjs.VERSION
|
|
7826
7826
|
});
|
|
7827
7827
|
}
|
|
7828
7828
|
const response = await runtime.registryHealth(registry);
|
|
@@ -7897,14 +7897,14 @@ var Registry = class {
|
|
|
7897
7897
|
var _a;
|
|
7898
7898
|
if (!this.#runtimeServePromise) {
|
|
7899
7899
|
const configuredEnvoyVersion = (_a = this.#config.node) == null ? void 0 : _a.version;
|
|
7900
|
-
const envoyVersionSource = configuredEnvoyVersion !== void 0 ? "config" :
|
|
7900
|
+
const envoyVersionSource = configuredEnvoyVersion !== void 0 ? "config" : _chunkQZHR7FM2cjs.getRivetEnvoyVersion.call(void 0, ) !== void 0 ? "environment" : "default";
|
|
7901
7901
|
logger2().info({
|
|
7902
7902
|
msg: "starting rivetkit envoy",
|
|
7903
|
-
rivetkitVersion:
|
|
7903
|
+
rivetkitVersion: _chunkQZHR7FM2cjs.VERSION,
|
|
7904
7904
|
envoyVersion: config.node.version,
|
|
7905
7905
|
envoyVersionSource
|
|
7906
7906
|
});
|
|
7907
|
-
if (envoyVersionSource === "default" &&
|
|
7907
|
+
if (envoyVersionSource === "default" && _chunkQZHR7FM2cjs.getNodeEnv.call(void 0, ) === "production") {
|
|
7908
7908
|
logger2().error({
|
|
7909
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",
|
|
7910
7910
|
envoyVersion: config.node.version,
|
|
@@ -7993,7 +7993,7 @@ var Registry = class {
|
|
|
7993
7993
|
const modeAPromise = this.#runtimeServeConfiguredPromise;
|
|
7994
7994
|
const modeBPromise = this.#runtimeServerlessPromise;
|
|
7995
7995
|
const runtimes = /* @__PURE__ */ new Set();
|
|
7996
|
-
const localDevSignal = signalDriven &&
|
|
7996
|
+
const localDevSignal = signalDriven && _chunkQZHR7FM2cjs.getNodeEnv.call(void 0, ) !== "production" && config.engineSpawn && config.endpoint !== void 0 && _chunkENUONGNHcjs.isLocalEngineEndpoint.call(void 0, config.endpoint);
|
|
7997
7997
|
let gracePeriodMs = (_a = config.shutdown) == null ? void 0 : _a.gracePeriodMs;
|
|
7998
7998
|
if (gracePeriodMs === void 0) {
|
|
7999
7999
|
gracePeriodMs = localDevSignal ? LOCAL_DEV_SHUTDOWN_GRACE_PERIOD_MS : await _asyncNullishCoalesce(await this.#actorStopThresholdMs(
|
|
@@ -8105,7 +8105,7 @@ var Registry = class {
|
|
|
8105
8105
|
}
|
|
8106
8106
|
if (this.#runtimeReadyPromise) return this.#runtimeReadyPromise;
|
|
8107
8107
|
try {
|
|
8108
|
-
if (
|
|
8108
|
+
if (_chunkQZHR7FM2cjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
8109
8109
|
return Promise.reject(
|
|
8110
8110
|
new Error(
|
|
8111
8111
|
"registry.startAndWait() requires envoy runtime mode; serverless registries become ready per request"
|
|
@@ -8129,7 +8129,7 @@ var Registry = class {
|
|
|
8129
8129
|
if (!configuredRegistryPromise || !serveLifecyclePromise) {
|
|
8130
8130
|
throw new Error("registry envoy startup did not initialize");
|
|
8131
8131
|
}
|
|
8132
|
-
const readyTimeoutMs = config.engineSpawn && config.endpoint !== void 0 &&
|
|
8132
|
+
const readyTimeoutMs = config.engineSpawn && config.endpoint !== void 0 && _chunkENUONGNHcjs.isLocalEngineEndpoint.call(void 0, config.endpoint) ? LOCAL_ENGINE_READY_TIMEOUT_MS : REGISTRY_READY_TIMEOUT_MS;
|
|
8133
8133
|
let timeout;
|
|
8134
8134
|
const timeoutPromise = new Promise((_resolve, reject) => {
|
|
8135
8135
|
var _a;
|
|
@@ -8179,8 +8179,8 @@ var Registry = class {
|
|
|
8179
8179
|
* ```
|
|
8180
8180
|
*/
|
|
8181
8181
|
start() {
|
|
8182
|
-
if (
|
|
8183
|
-
const publicDir = _nullishCoalesce(
|
|
8182
|
+
if (_chunkQZHR7FM2cjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
8183
|
+
const publicDir = _nullishCoalesce(_chunkQZHR7FM2cjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
|
|
8184
8184
|
this.listen({ publicDir }).catch((error) => {
|
|
8185
8185
|
logger2().error({ error }, "auto-listen failed; exiting");
|
|
8186
8186
|
if (typeof process !== "undefined" && typeof process.exit === "function") {
|
|
@@ -8201,13 +8201,13 @@ var Registry = class {
|
|
|
8201
8201
|
};
|
|
8202
8202
|
console.log();
|
|
8203
8203
|
console.log(
|
|
8204
|
-
` RivetKit ${
|
|
8204
|
+
` RivetKit ${_chunkQZHR7FM2cjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
|
|
8205
8205
|
);
|
|
8206
8206
|
if (config.namespace !== "default") {
|
|
8207
8207
|
logLine("Namespace", config.namespace);
|
|
8208
8208
|
}
|
|
8209
8209
|
if (config.endpoint) {
|
|
8210
|
-
const endpointType = config.startEngine ||
|
|
8210
|
+
const endpointType = config.startEngine || _chunkENUONGNHcjs.isLocalEngineEndpoint.call(void 0, config.endpoint) ? "local native" : "remote";
|
|
8211
8211
|
logLine("Endpoint", `${config.endpoint} (${endpointType})`);
|
|
8212
8212
|
}
|
|
8213
8213
|
if (kind === "serverless" && config.publicEndpoint) {
|
|
@@ -8277,5 +8277,5 @@ function setup(input) {
|
|
|
8277
8277
|
|
|
8278
8278
|
|
|
8279
8279
|
|
|
8280
|
-
exports.ALLOWED_PUBLIC_HEADERS =
|
|
8280
|
+
exports.ALLOWED_PUBLIC_HEADERS = _chunkENUONGNHcjs.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 = _chunkENUONGNHcjs.createClientWithDriver; exports.defineRunHandler = _chunkHDVZ6YZGcjs.defineRunHandler; exports.event = event; exports.isStaticActorDefinition = isStaticActorDefinition; exports.isStaticActorInstance = isStaticActorInstance; exports.lookupInRegistry = lookupInRegistry; exports.noopNext = _chunkQZHR7FM2cjs.noopNext; exports.queue = queue; exports.setup = setup; exports.toUint8Array = _chunkQZHR7FM2cjs.toUint8Array;
|
|
8281
8281
|
//# sourceMappingURL=mod.cjs.map
|