rivetkit 0.0.0-codex-docsrs-rivetkit-build.45929bf → 0.0.0-codex-rivetkit-quickstart-preview.7e0cd02
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 +1 -1
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +1 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/actor/errors.cjs +3 -2
- package/dist/tsup/actor/errors.cjs.map +1 -1
- package/dist/tsup/actor/errors.js +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-FK2P424N.js → chunk-477CG44O.js} +3 -3
- package/dist/tsup/{chunk-BPZEWU2M.cjs → chunk-6BV4OZDA.cjs} +7 -7
- package/dist/tsup/{chunk-BPZEWU2M.cjs.map → chunk-6BV4OZDA.cjs.map} +1 -1
- package/dist/tsup/{chunk-DJ4RUPK4.js → chunk-7HJD6OOC.js} +2 -2
- package/dist/tsup/{chunk-ZO4OHZGI.js → chunk-7JCRVCLG.js} +2 -2
- package/dist/tsup/{chunk-VK5INEX2.cjs → chunk-7SCJUVRH.cjs} +10 -10
- package/dist/tsup/{chunk-VK5INEX2.cjs.map → chunk-7SCJUVRH.cjs.map} +1 -1
- package/dist/tsup/{chunk-VE2X4KMG.cjs → chunk-DLX4NOQR.cjs} +1 -1
- package/dist/tsup/{chunk-VE2X4KMG.cjs.map → chunk-DLX4NOQR.cjs.map} +1 -1
- package/dist/tsup/{chunk-RKFXYXAU.cjs → chunk-EIQ7RY24.cjs} +4 -4
- package/dist/tsup/{chunk-RKFXYXAU.cjs.map → chunk-EIQ7RY24.cjs.map} +1 -1
- package/dist/tsup/{chunk-4CBCDH3Z.js → chunk-EXOFMCDL.js} +7 -7
- package/dist/tsup/{chunk-HQ46VETO.cjs → chunk-FDEQTWHW.cjs} +174 -174
- package/dist/tsup/{chunk-HQ46VETO.cjs.map → chunk-FDEQTWHW.cjs.map} +1 -1
- package/dist/tsup/{chunk-ZZ3WBRPD.js → chunk-FLWADOST.js} +1 -1
- package/dist/tsup/{chunk-ZA7FLHKH.cjs → chunk-FP2IVSEW.cjs} +1 -1
- package/dist/tsup/{chunk-ZA7FLHKH.cjs.map → chunk-FP2IVSEW.cjs.map} +1 -1
- package/dist/tsup/{chunk-6BXIWI4D.cjs → chunk-H5CY23OP.cjs} +10 -10
- package/dist/tsup/chunk-H5CY23OP.cjs.map +1 -0
- package/dist/tsup/{chunk-KDJO6HTM.cjs → chunk-JBKNLGTL.cjs} +3 -3
- package/dist/tsup/{chunk-KDJO6HTM.cjs.map → chunk-JBKNLGTL.cjs.map} +1 -1
- package/dist/tsup/{chunk-WIHB6O7P.js → chunk-M4DPCXYN.js} +4 -4
- package/dist/tsup/{chunk-JZ7TWV65.js → chunk-MYP3D75W.js} +1 -1
- package/dist/tsup/{chunk-KY5BWMTK.js → chunk-NOOZB3MF.js} +2 -2
- package/dist/tsup/{chunk-3MHDOUD7.cjs → chunk-QILCFULW.cjs} +1 -1
- package/dist/tsup/{chunk-3MHDOUD7.cjs.map → chunk-QILCFULW.cjs.map} +1 -1
- package/dist/tsup/{chunk-XIX5DOZN.js → chunk-RQFXU6US.js} +1 -1
- package/dist/tsup/chunk-S3ZELDAP.cjs +8 -0
- package/dist/tsup/chunk-S3ZELDAP.cjs.map +1 -0
- package/dist/tsup/{chunk-HXUEHHJF.js → chunk-VXO53AYC.js} +1 -1
- package/dist/tsup/{chunk-B7RZGQNC.cjs → chunk-XLHSCH3T.cjs} +5 -5
- package/dist/tsup/{chunk-B7RZGQNC.cjs.map → chunk-XLHSCH3T.cjs.map} +1 -1
- package/dist/tsup/{chunk-G5HDCKP4.js → chunk-XUPYQVCI.js} +3 -3
- package/dist/tsup/chunk-XUPYQVCI.js.map +1 -0
- package/dist/tsup/{chunk-4FC7TVS6.cjs → chunk-ZXMKVBQ6.cjs} +1 -1
- package/dist/tsup/{chunk-4FC7TVS6.cjs.map → chunk-ZXMKVBQ6.cjs.map} +1 -1
- package/dist/tsup/client/mod.cjs +10 -9
- package/dist/tsup/client/mod.cjs.map +1 -1
- package/dist/tsup/client/mod.js +8 -8
- package/dist/tsup/common/log.cjs +4 -3
- package/dist/tsup/common/log.cjs.map +1 -1
- package/dist/tsup/common/log.js +2 -2
- package/dist/tsup/common/websocket.cjs +5 -4
- package/dist/tsup/common/websocket.cjs.map +1 -1
- package/dist/tsup/common/websocket.js +3 -3
- package/dist/tsup/db/drizzle.cjs +4 -3
- package/dist/tsup/db/drizzle.cjs.map +1 -1
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +3 -2
- package/dist/tsup/db/mod.cjs.map +1 -1
- package/dist/tsup/db/mod.js +1 -1
- package/dist/tsup/dynamic/mod.cjs +3 -2
- package/dist/tsup/dynamic/mod.cjs.map +1 -1
- package/dist/tsup/dynamic/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +7 -6
- package/dist/tsup/inspector/mod.cjs.map +1 -1
- package/dist/tsup/inspector/mod.js +5 -5
- package/dist/tsup/inspector-tab/mod.cjs +3 -2
- package/dist/tsup/inspector-tab/mod.cjs.map +1 -1
- package/dist/tsup/inspector-tab/mod.js +1 -1
- package/dist/tsup/mod.cjs +149 -129
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.js +31 -14
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +13 -12
- package/dist/tsup/test/mod.cjs.map +1 -1
- package/dist/tsup/test/mod.js +8 -8
- package/dist/tsup/utils.cjs +4 -3
- package/dist/tsup/utils.cjs.map +1 -1
- package/dist/tsup/utils.js +2 -2
- package/dist/tsup/workflow/mod.cjs +33 -32
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.js +7 -7
- package/package.json +8 -8
- package/src/registry/napi-runtime.ts +1 -1
- package/src/registry/native.ts +1 -1
- package/src/registry/wasm-runtime.ts +1 -2
- package/src/serverless/configure.test.ts +22 -0
- package/src/serverless/configure.ts +25 -2
- package/dist/tsup/chunk-6BXIWI4D.cjs.map +0 -1
- package/dist/tsup/chunk-G5HDCKP4.js.map +0 -1
- /package/dist/tsup/{chunk-FK2P424N.js.map → chunk-477CG44O.js.map} +0 -0
- /package/dist/tsup/{chunk-DJ4RUPK4.js.map → chunk-7HJD6OOC.js.map} +0 -0
- /package/dist/tsup/{chunk-ZO4OHZGI.js.map → chunk-7JCRVCLG.js.map} +0 -0
- /package/dist/tsup/{chunk-4CBCDH3Z.js.map → chunk-EXOFMCDL.js.map} +0 -0
- /package/dist/tsup/{chunk-ZZ3WBRPD.js.map → chunk-FLWADOST.js.map} +0 -0
- /package/dist/tsup/{chunk-WIHB6O7P.js.map → chunk-M4DPCXYN.js.map} +0 -0
- /package/dist/tsup/{chunk-JZ7TWV65.js.map → chunk-MYP3D75W.js.map} +0 -0
- /package/dist/tsup/{chunk-KY5BWMTK.js.map → chunk-NOOZB3MF.js.map} +0 -0
- /package/dist/tsup/{chunk-XIX5DOZN.js.map → chunk-RQFXU6US.js.map} +0 -0
- /package/dist/tsup/{chunk-HXUEHHJF.js.map → chunk-VXO53AYC.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 _chunkEIQ7RY24cjs = require('./chunk-EIQ7RY24.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ var _chunkRKFXYXAUcjs = require('./chunk-RKFXYXAU.cjs');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkQILCFULWcjs = require('./chunk-QILCFULW.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -20,7 +20,7 @@ var _chunk3MHDOUD7cjs = require('./chunk-3MHDOUD7.cjs');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkFDEQTWHWcjs = require('./chunk-FDEQTWHW.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -28,14 +28,14 @@ var _chunkHQ46VETOcjs = require('./chunk-HQ46VETO.cjs');
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunkDLX4NOQRcjs = require('./chunk-DLX4NOQR.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
var
|
|
37
|
-
require('./chunk-
|
|
38
|
-
require('./chunk-
|
|
36
|
+
var _chunkXLHSCH3Tcjs = require('./chunk-XLHSCH3T.cjs');
|
|
37
|
+
require('./chunk-FP2IVSEW.cjs');
|
|
38
|
+
require('./chunk-JBKNLGTL.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -64,7 +64,7 @@ require('./chunk-KDJO6HTM.cjs');
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
var
|
|
67
|
+
var _chunkH5CY23OPcjs = require('./chunk-H5CY23OP.cjs');
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
|
|
@@ -76,11 +76,14 @@ var _chunk6BXIWI4Dcjs = require('./chunk-6BXIWI4D.cjs');
|
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
|
|
79
|
-
var
|
|
79
|
+
var _chunkZXMKVBQ6cjs = require('./chunk-ZXMKVBQ6.cjs');
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
var _chunkS3ZELDAPcjs = require('./chunk-S3ZELDAP.cjs');
|
|
80
83
|
|
|
81
84
|
// src/actor/log.ts
|
|
82
85
|
function loggerWithoutContext() {
|
|
83
|
-
return
|
|
86
|
+
return _chunkH5CY23OPcjs.getLogger.call(void 0, "actor-runtime");
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
// src/actor/definition.ts
|
|
@@ -113,7 +116,7 @@ function actor(input) {
|
|
|
113
116
|
warnDeprecatedShutdownTimeoutKeys(
|
|
114
117
|
input == null ? void 0 : input.options
|
|
115
118
|
);
|
|
116
|
-
const config =
|
|
119
|
+
const config = _chunkQILCFULWcjs.ActorConfigSchema.parse(input);
|
|
117
120
|
return new ActorDefinition(config);
|
|
118
121
|
}
|
|
119
122
|
function isStaticActorDefinition(definition) {
|
|
@@ -195,7 +198,7 @@ function validateSchemaSync(schemas, key, data) {
|
|
|
195
198
|
if (isStandardSchema(schema)) {
|
|
196
199
|
const result = schema["~standard"].validate(data);
|
|
197
200
|
if (isPromiseLike(result)) {
|
|
198
|
-
throw
|
|
201
|
+
throw _chunkZXMKVBQ6cjs.unsupportedFeature.call(void 0, "async schema validation");
|
|
199
202
|
}
|
|
200
203
|
if (result.issues) {
|
|
201
204
|
return { success: false, issues: [...result.issues] };
|
|
@@ -212,7 +215,7 @@ function validateSchemaSync(schemas, key, data) {
|
|
|
212
215
|
var _virtualwebsocket = require('@rivetkit/virtual-websocket');
|
|
213
216
|
var _ws = require('hono/ws');
|
|
214
217
|
function logger() {
|
|
215
|
-
return
|
|
218
|
+
return _chunkH5CY23OPcjs.getLogger.call(void 0, "inline-websocket-adapter");
|
|
216
219
|
}
|
|
217
220
|
var InlineWebSocketAdapter = class {
|
|
218
221
|
#handler;
|
|
@@ -383,12 +386,15 @@ function isLocalEngineEndpoint(endpoint) {
|
|
|
383
386
|
|
|
384
387
|
// src/registry/log.ts
|
|
385
388
|
function logger2() {
|
|
386
|
-
return
|
|
389
|
+
return _chunkH5CY23OPcjs.getLogger.call(void 0, "registry");
|
|
387
390
|
}
|
|
388
391
|
|
|
389
392
|
// src/serverless/configure.ts
|
|
390
393
|
var DEFAULT_CONFIGURE_TIMEOUT_MS = 6e4;
|
|
391
394
|
var CONFIGURE_RETRY_DELAY_MS = 1e3;
|
|
395
|
+
var DEFAULT_REQUEST_LIFESPAN_SECONDS = 60 * 60;
|
|
396
|
+
var DEFAULT_DRAIN_GRACE_PERIOD_SECONDS = 30 * 60;
|
|
397
|
+
var SHORT_REQUEST_DRAIN_GRACE_PERIOD_SECONDS = 30;
|
|
392
398
|
function sleep(ms) {
|
|
393
399
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
394
400
|
}
|
|
@@ -404,6 +410,16 @@ function configureTimeoutMs() {
|
|
|
404
410
|
}
|
|
405
411
|
return parsed;
|
|
406
412
|
}
|
|
413
|
+
function resolveServerlessDrainGracePeriod(requestLifespan, drainGracePeriod) {
|
|
414
|
+
if (drainGracePeriod !== void 0) return drainGracePeriod;
|
|
415
|
+
if (requestLifespan > DEFAULT_DRAIN_GRACE_PERIOD_SECONDS) {
|
|
416
|
+
return DEFAULT_DRAIN_GRACE_PERIOD_SECONDS;
|
|
417
|
+
}
|
|
418
|
+
return Math.max(
|
|
419
|
+
0,
|
|
420
|
+
Math.min(SHORT_REQUEST_DRAIN_GRACE_PERIOD_SECONDS, requestLifespan - 1)
|
|
421
|
+
);
|
|
422
|
+
}
|
|
407
423
|
async function configureServerlessPool(config) {
|
|
408
424
|
logger2().debug({ msg: "configuring serverless pool" });
|
|
409
425
|
const startedAt = Date.now();
|
|
@@ -429,20 +445,24 @@ async function configureServerlessPool(config) {
|
|
|
429
445
|
);
|
|
430
446
|
}
|
|
431
447
|
const customConfig = config.configurePool;
|
|
432
|
-
const clientConfig =
|
|
433
|
-
const dcsRes = await
|
|
448
|
+
const clientConfig = _chunkFDEQTWHWcjs.convertRegistryConfigToClientConfig.call(void 0, config);
|
|
449
|
+
const dcsRes = await _chunkFDEQTWHWcjs.getDatacenters.call(void 0, clientConfig);
|
|
434
450
|
const poolName = _nullishCoalesce(customConfig.name, () => ( "default"));
|
|
435
451
|
const serverlessToken = _nullishCoalesce(config.token, () => ( config.publicToken));
|
|
436
452
|
const headers = {
|
|
437
453
|
...serverlessToken ? { "x-rivet-token": serverlessToken } : {},
|
|
438
454
|
..._nullishCoalesce(customConfig.headers, () => ( {}))
|
|
439
455
|
};
|
|
456
|
+
const requestLifespan = _nullishCoalesce(customConfig.requestLifespan, () => ( DEFAULT_REQUEST_LIFESPAN_SECONDS));
|
|
440
457
|
const serverlessConfig = {
|
|
441
458
|
serverless: {
|
|
442
459
|
url: customConfig.url,
|
|
443
460
|
headers,
|
|
444
|
-
request_lifespan:
|
|
445
|
-
drain_grace_period:
|
|
461
|
+
request_lifespan: requestLifespan,
|
|
462
|
+
drain_grace_period: resolveServerlessDrainGracePeriod(
|
|
463
|
+
requestLifespan,
|
|
464
|
+
customConfig.drainGracePeriod
|
|
465
|
+
),
|
|
446
466
|
metadata_poll_interval: _nullishCoalesce(customConfig.metadataPollInterval, () => ( 1e3)),
|
|
447
467
|
max_runners: 1e5,
|
|
448
468
|
min_runners: 0,
|
|
@@ -452,7 +472,7 @@ async function configureServerlessPool(config) {
|
|
|
452
472
|
metadata: _nullishCoalesce(customConfig.metadata, () => ( {})),
|
|
453
473
|
drain_on_version_upgrade: _nullishCoalesce(customConfig.drainOnVersionUpgrade, () => ( true))
|
|
454
474
|
};
|
|
455
|
-
await
|
|
475
|
+
await _chunkFDEQTWHWcjs.updateRunnerConfig.call(void 0, clientConfig, poolName, {
|
|
456
476
|
datacenters: Object.fromEntries(
|
|
457
477
|
dcsRes.datacenters.map((dc) => [dc.name, serverlessConfig])
|
|
458
478
|
)
|
|
@@ -469,7 +489,7 @@ async function configureServerlessPool(config) {
|
|
|
469
489
|
logger2().warn({
|
|
470
490
|
msg: "serverless pool configuration attempt failed",
|
|
471
491
|
attempts,
|
|
472
|
-
error:
|
|
492
|
+
error: _chunkH5CY23OPcjs.stringifyError.call(void 0, error)
|
|
473
493
|
});
|
|
474
494
|
await sleep(CONFIGURE_RETRY_DELAY_MS);
|
|
475
495
|
}
|
|
@@ -477,7 +497,7 @@ async function configureServerlessPool(config) {
|
|
|
477
497
|
logger2().error({
|
|
478
498
|
msg: "failed to configure serverless pool, validate endpoint is configured correctly then restart this process",
|
|
479
499
|
attempts,
|
|
480
|
-
error:
|
|
500
|
+
error: _chunkH5CY23OPcjs.stringifyError.call(void 0, lastError)
|
|
481
501
|
});
|
|
482
502
|
throw lastError;
|
|
483
503
|
}
|
|
@@ -489,20 +509,20 @@ var _zod = require('zod');
|
|
|
489
509
|
var _v4 = require('zod/v4');
|
|
490
510
|
var warnedMissingVersion = false;
|
|
491
511
|
var EnvoyConfigSchema = _v4.z.object({
|
|
492
|
-
poolName: _v4.z.string().default(() => _nullishCoalesce(
|
|
512
|
+
poolName: _v4.z.string().default(() => _nullishCoalesce(_chunkH5CY23OPcjs.getRivetPool.call(void 0, ), () => ( "default"))),
|
|
493
513
|
version: _v4.z.number().default(() => {
|
|
494
|
-
const version =
|
|
514
|
+
const version = _chunkH5CY23OPcjs.getRivetEnvoyVersion.call(void 0, );
|
|
495
515
|
if (version !== void 0) return version;
|
|
496
|
-
if (
|
|
516
|
+
if (_chunkH5CY23OPcjs.getNodeEnv.call(void 0, ) === "production" && !warnedMissingVersion) {
|
|
497
517
|
warnedMissingVersion = true;
|
|
498
|
-
|
|
518
|
+
_chunkH5CY23OPcjs.getLogger.call(void 0, "rivetkit").error(
|
|
499
519
|
"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"
|
|
500
520
|
);
|
|
501
521
|
}
|
|
502
522
|
return 1;
|
|
503
523
|
}),
|
|
504
524
|
// Deprecated.
|
|
505
|
-
totalSlots: _v4.z.number().default(() => _nullishCoalesce(
|
|
525
|
+
totalSlots: _v4.z.number().default(() => _nullishCoalesce(_chunkH5CY23OPcjs.getRivetTotalSlots.call(void 0, ), () => ( 1e5))),
|
|
506
526
|
envoyKey: _v4.z.string().optional()
|
|
507
527
|
});
|
|
508
528
|
|
|
@@ -540,7 +560,7 @@ var ServerlessConfigSchema = _v4.z.object({
|
|
|
540
560
|
*
|
|
541
561
|
* Can also be set via RIVET_PUBLIC_ENDPOINT environment variable.
|
|
542
562
|
*/
|
|
543
|
-
publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
563
|
+
publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkH5CY23OPcjs.getRivetPublicEndpoint.call(void 0, )))),
|
|
544
564
|
/**
|
|
545
565
|
* Token that clients should use when connecting via the public endpoint.
|
|
546
566
|
*
|
|
@@ -548,7 +568,7 @@ var ServerlessConfigSchema = _v4.z.object({
|
|
|
548
568
|
*
|
|
549
569
|
* Can also be specified in the publicEndpoint URL as `https://namespace:token@host`.
|
|
550
570
|
*/
|
|
551
|
-
publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
571
|
+
publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkH5CY23OPcjs.getRivetPublicToken.call(void 0, ))))
|
|
552
572
|
// There is no publicNamespace config option because the frontend and backend
|
|
553
573
|
// cannot use different namespaces. The namespace is extracted from the
|
|
554
574
|
// publicEndpoint URL auth syntax if provided.
|
|
@@ -602,7 +622,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
602
622
|
* Runtime binding to use for RivetKit core.
|
|
603
623
|
* */
|
|
604
624
|
runtime: RuntimeKindSchema.optional().transform((val, ctx) => {
|
|
605
|
-
const rawRuntime = _nullishCoalesce(val, () => (
|
|
625
|
+
const rawRuntime = _nullishCoalesce(val, () => ( _chunkH5CY23OPcjs.getRivetkitRuntime.call(void 0, )));
|
|
606
626
|
if (rawRuntime === void 0) {
|
|
607
627
|
return "auto";
|
|
608
628
|
}
|
|
@@ -639,7 +659,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
639
659
|
* */
|
|
640
660
|
logging: _zod.z.object({
|
|
641
661
|
baseLogger: _zod.z.custom().optional(),
|
|
642
|
-
level:
|
|
662
|
+
level: _chunkH5CY23OPcjs.LogLevelSchema.optional()
|
|
643
663
|
}).optional().default(() => ({})),
|
|
644
664
|
// MARK: Routing
|
|
645
665
|
// // This is a function to allow for lazy configuration of upgradeWebSocket on the
|
|
@@ -657,9 +677,9 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
657
677
|
*
|
|
658
678
|
* Can also be set via RIVET_ENDPOINT environment variables.
|
|
659
679
|
*/
|
|
660
|
-
endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => (
|
|
661
|
-
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
662
|
-
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
680
|
+
endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => ( _chunkH5CY23OPcjs.getRivetEngine.call(void 0, ))), () => ( _chunkH5CY23OPcjs.getRivetEndpoint.call(void 0, )))),
|
|
681
|
+
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkH5CY23OPcjs.getRivetToken.call(void 0, )))),
|
|
682
|
+
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkH5CY23OPcjs.getRivetNamespace.call(void 0, )))),
|
|
663
683
|
headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional().default({}),
|
|
664
684
|
// MARK: Client
|
|
665
685
|
// TODO:
|
|
@@ -699,21 +719,21 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
699
719
|
*
|
|
700
720
|
* Starts the full Rust engine process locally.
|
|
701
721
|
*/
|
|
702
|
-
startEngine: _zod.z.boolean().default(() =>
|
|
722
|
+
startEngine: _zod.z.boolean().default(() => _chunkH5CY23OPcjs.getRivetRunEngine.call(void 0, )),
|
|
703
723
|
/**
|
|
704
724
|
* @experimental
|
|
705
725
|
*
|
|
706
726
|
* Host to bind the spawned local engine process to.
|
|
707
727
|
*/
|
|
708
|
-
engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
728
|
+
engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkH5CY23OPcjs.getRivetRunEngineHost.call(void 0, ), () => ( ENGINE_HOST))),
|
|
709
729
|
/**
|
|
710
730
|
* @experimental
|
|
711
731
|
*
|
|
712
732
|
* Port to bind the spawned local engine process to.
|
|
713
733
|
*/
|
|
714
|
-
enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(
|
|
734
|
+
enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(_chunkH5CY23OPcjs.getRivetRunEnginePort.call(void 0, ), () => ( ENGINE_PORT))),
|
|
715
735
|
/** @experimental */
|
|
716
|
-
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
736
|
+
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkH5CY23OPcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunkH5CY23OPcjs.VERSION))),
|
|
717
737
|
/**
|
|
718
738
|
* @experimental
|
|
719
739
|
*
|
|
@@ -761,7 +781,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
761
781
|
}))
|
|
762
782
|
}).transform((config, ctx) => {
|
|
763
783
|
var _a, _b, _c;
|
|
764
|
-
const isDevEnv =
|
|
784
|
+
const isDevEnv = _chunkH5CY23OPcjs.isDev.call(void 0, );
|
|
765
785
|
const sqliteBackend = _nullishCoalesce(((_a = config.sqlite) == null ? void 0 : _a.backend), () => ( ((_b = config.test) == null ? void 0 : _b.sqliteBackend)));
|
|
766
786
|
if (config.runtime === "wasm" && sqliteBackend === "local") {
|
|
767
787
|
ctx.addIssue({
|
|
@@ -771,7 +791,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
771
791
|
});
|
|
772
792
|
}
|
|
773
793
|
const sqlite = config.runtime === "wasm" && config.sqlite === void 0 ? { backend: "remote" } : config.sqlite;
|
|
774
|
-
const parsedEndpoint = config.endpoint ?
|
|
794
|
+
const parsedEndpoint = config.endpoint ? _chunkFDEQTWHWcjs.tryParseEndpoint.call(void 0, ctx, {
|
|
775
795
|
endpoint: config.endpoint,
|
|
776
796
|
path: ["endpoint"],
|
|
777
797
|
namespace: config.namespace,
|
|
@@ -799,7 +819,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
799
819
|
);
|
|
800
820
|
const namespace = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.namespace), () => ( config.namespace)), () => ( "default"));
|
|
801
821
|
const token = _nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token));
|
|
802
|
-
const parsedPublicEndpoint = config.serverless.publicEndpoint ?
|
|
822
|
+
const parsedPublicEndpoint = config.serverless.publicEndpoint ? _chunkFDEQTWHWcjs.tryParseEndpoint.call(void 0, ctx, {
|
|
803
823
|
endpoint: config.serverless.publicEndpoint,
|
|
804
824
|
path: ["serverless", "publicEndpoint"]
|
|
805
825
|
}) : void 0;
|
|
@@ -834,30 +854,30 @@ function buildActorNames(config) {
|
|
|
834
854
|
Object.keys(config.use).map((actorName) => {
|
|
835
855
|
const definition = config.use[actorName];
|
|
836
856
|
const options = _nullishCoalesce(definition.config.options, () => ( {}));
|
|
837
|
-
const runMeta =
|
|
857
|
+
const runMeta = _chunkQILCFULWcjs.getRunMetadata.call(void 0, definition.config.run);
|
|
838
858
|
const metadata = {};
|
|
839
859
|
metadata.icon = _nullishCoalesce(options.icon, () => ( runMeta.icon));
|
|
840
860
|
metadata.name = _nullishCoalesce(options.name, () => ( runMeta.name));
|
|
841
861
|
metadata.preload = {
|
|
842
862
|
keys: [
|
|
843
|
-
Array.from(
|
|
844
|
-
Array.from(
|
|
845
|
-
Array.from(
|
|
846
|
-
Array.from(
|
|
863
|
+
Array.from(_chunkDLX4NOQRcjs.KEYS.PERSIST_DATA),
|
|
864
|
+
Array.from(_chunkDLX4NOQRcjs.KEYS.INSPECTOR_TOKEN),
|
|
865
|
+
Array.from(_chunkDLX4NOQRcjs.queueMetadataKey.call(void 0, )),
|
|
866
|
+
Array.from(_chunkDLX4NOQRcjs.KEYS.LAST_PUSHED_ALARM)
|
|
847
867
|
],
|
|
848
868
|
prefixes: [
|
|
849
869
|
{
|
|
850
|
-
prefix: Array.from(
|
|
870
|
+
prefix: Array.from(_chunkDLX4NOQRcjs.workflowStoragePrefix.call(void 0, )),
|
|
851
871
|
maxBytes: _nullishCoalesce(options.preloadMaxWorkflowBytes, () => ( 131072)),
|
|
852
872
|
partial: false
|
|
853
873
|
},
|
|
854
874
|
{
|
|
855
|
-
prefix: Array.from(
|
|
875
|
+
prefix: Array.from(_chunkDLX4NOQRcjs.KEYS.CONN_PREFIX),
|
|
856
876
|
maxBytes: _nullishCoalesce(options.preloadMaxConnectionsBytes, () => ( 65536)),
|
|
857
877
|
partial: false
|
|
858
878
|
},
|
|
859
879
|
{
|
|
860
|
-
prefix: Array.from(
|
|
880
|
+
prefix: Array.from(_chunkDLX4NOQRcjs.queueMessagesPrefix.call(void 0, )),
|
|
861
881
|
maxBytes: 65536,
|
|
862
882
|
partial: false
|
|
863
883
|
}
|
|
@@ -927,7 +947,7 @@ var DocRegistryConfigSchema = _zod.z.object({
|
|
|
927
947
|
noWelcome: _zod.z.boolean().optional().describe("Disable the welcome message on startup. Default: false"),
|
|
928
948
|
sqlite: DocSqliteConfigSchema,
|
|
929
949
|
logging: _zod.z.object({
|
|
930
|
-
level:
|
|
950
|
+
level: _chunkH5CY23OPcjs.LogLevelSchema.optional().describe(
|
|
931
951
|
"Log level for RivetKit. Default: 'warn'"
|
|
932
952
|
)
|
|
933
953
|
}).optional().describe("Logging configuration."),
|
|
@@ -972,7 +992,7 @@ function shouldAttachNativeKvError(message) {
|
|
|
972
992
|
function enrichNativeDatabaseError(database, error) {
|
|
973
993
|
var _a;
|
|
974
994
|
const bridgeReason = typeof error === "string" ? error : error instanceof Error ? error.message : void 0;
|
|
975
|
-
const bridged = bridgeReason === void 0 ? void 0 :
|
|
995
|
+
const bridged = bridgeReason === void 0 ? void 0 : _chunkZXMKVBQ6cjs.decodeBridgeRivetError.call(void 0, bridgeReason);
|
|
976
996
|
if (bridged) {
|
|
977
997
|
throw bridged;
|
|
978
998
|
}
|
|
@@ -1214,7 +1234,7 @@ var nodeStream;
|
|
|
1214
1234
|
var nodeUrl;
|
|
1215
1235
|
var hasImportedDependencies = false;
|
|
1216
1236
|
function getRequireFn() {
|
|
1217
|
-
return _module.createRequire.call(void 0,
|
|
1237
|
+
return _module.createRequire.call(void 0, _chunkS3ZELDAPcjs.importMetaUrl);
|
|
1218
1238
|
}
|
|
1219
1239
|
function importNodeDependencies() {
|
|
1220
1240
|
if (hasImportedDependencies) return;
|
|
@@ -1734,7 +1754,7 @@ var NapiCoreRuntime = (_class = class {
|
|
|
1734
1754
|
}
|
|
1735
1755
|
}, _class);
|
|
1736
1756
|
async function loadNapiRuntime() {
|
|
1737
|
-
const bindings = await Promise.resolve().then(() => _interopRequireWildcard(require(
|
|
1757
|
+
const bindings = await Promise.resolve().then(() => _interopRequireWildcard(require("@rivetkit/rivetkit-napi")));
|
|
1738
1758
|
return {
|
|
1739
1759
|
bindings,
|
|
1740
1760
|
runtime: new NapiCoreRuntime(bindings)
|
|
@@ -1819,7 +1839,7 @@ function validateQueueComplete(schemas, name, response) {
|
|
|
1819
1839
|
return result.data;
|
|
1820
1840
|
}
|
|
1821
1841
|
function validationError(target, issues) {
|
|
1822
|
-
return new (0,
|
|
1842
|
+
return new (0, _chunkZXMKVBQ6cjs.RivetError)("actor", "validation_error", `Invalid ${target}`, {
|
|
1823
1843
|
public: true,
|
|
1824
1844
|
metadata: { issues }
|
|
1825
1845
|
});
|
|
@@ -1888,16 +1908,16 @@ function normalizeQueueMessage(message) {
|
|
|
1888
1908
|
}
|
|
1889
1909
|
function normalizeWasmBridgeError(error) {
|
|
1890
1910
|
if (typeof error === "string") {
|
|
1891
|
-
return _nullishCoalesce(
|
|
1911
|
+
return _nullishCoalesce(_chunkZXMKVBQ6cjs.decodeBridgeRivetError.call(void 0, error), () => ( error));
|
|
1892
1912
|
}
|
|
1893
1913
|
if (error instanceof Error) {
|
|
1894
|
-
const bridged =
|
|
1914
|
+
const bridged = _chunkZXMKVBQ6cjs.decodeBridgeRivetError.call(void 0, error.message);
|
|
1895
1915
|
if (bridged) {
|
|
1896
1916
|
return bridged;
|
|
1897
1917
|
}
|
|
1898
1918
|
}
|
|
1899
1919
|
if (typeof error === "object" && error !== null && "reason" in error && typeof error.reason === "string") {
|
|
1900
|
-
const bridged =
|
|
1920
|
+
const bridged = _chunkZXMKVBQ6cjs.decodeBridgeRivetError.call(void 0, error.reason);
|
|
1901
1921
|
if (bridged) {
|
|
1902
1922
|
return bridged;
|
|
1903
1923
|
}
|
|
@@ -1919,7 +1939,7 @@ function callWasmSync(invoke) {
|
|
|
1919
1939
|
}
|
|
1920
1940
|
}
|
|
1921
1941
|
function unsupportedWasmMethod(method2) {
|
|
1922
|
-
throw new (0,
|
|
1942
|
+
throw new (0, _chunkZXMKVBQ6cjs.RivetError)(
|
|
1923
1943
|
"runtime",
|
|
1924
1944
|
"unsupported",
|
|
1925
1945
|
`Unsupported wasm runtime method: ${method2}`,
|
|
@@ -2396,7 +2416,7 @@ var WasmCoreRuntime = (_class2 = class {
|
|
|
2396
2416
|
}
|
|
2397
2417
|
}, _class2);
|
|
2398
2418
|
async function loadWasmRuntime(config) {
|
|
2399
|
-
const bindings = await _asyncNullishCoalesce((config == null ? void 0 : config.bindings), async () => ( await Promise.resolve().then(() => _interopRequireWildcard(require(
|
|
2419
|
+
const bindings = await _asyncNullishCoalesce((config == null ? void 0 : config.bindings), async () => ( await Promise.resolve().then(() => _interopRequireWildcard(require("@rivetkit/rivetkit-wasm")))));
|
|
2400
2420
|
await bindings.default(config == null ? void 0 : config.initInput);
|
|
2401
2421
|
return {
|
|
2402
2422
|
bindings,
|
|
@@ -2460,7 +2480,7 @@ function loadedRuntimeKind(runtime) {
|
|
|
2460
2480
|
case "wasm":
|
|
2461
2481
|
return "wasm";
|
|
2462
2482
|
}
|
|
2463
|
-
throw new (0,
|
|
2483
|
+
throw new (0, _chunkZXMKVBQ6cjs.RivetError)(
|
|
2464
2484
|
"config",
|
|
2465
2485
|
"unknown_runtime",
|
|
2466
2486
|
"RivetKit runtime must be NAPI or wasm.",
|
|
@@ -2500,7 +2520,7 @@ function normalizeRuntimeConfigForKind(config, runtimeKind) {
|
|
|
2500
2520
|
return config;
|
|
2501
2521
|
}
|
|
2502
2522
|
if (sqliteBackendForConfig(config) === "local") {
|
|
2503
|
-
throw new (0,
|
|
2523
|
+
throw new (0, _chunkZXMKVBQ6cjs.RivetError)(
|
|
2504
2524
|
"config",
|
|
2505
2525
|
"wasm_local_sqlite",
|
|
2506
2526
|
"WebAssembly runtime cannot use local SQLite. Use remote SQLite instead.",
|
|
@@ -2566,14 +2586,14 @@ function getNativeConnPersistState(runtime, ctx, conn) {
|
|
|
2566
2586
|
return connState;
|
|
2567
2587
|
}
|
|
2568
2588
|
function stateMutationReentrantError() {
|
|
2569
|
-
return new (0,
|
|
2589
|
+
return new (0, _chunkZXMKVBQ6cjs.RivetError)(
|
|
2570
2590
|
"actor",
|
|
2571
2591
|
"state_mutation_reentrant",
|
|
2572
2592
|
"State mutations are not allowed inside onStateChange."
|
|
2573
2593
|
);
|
|
2574
2594
|
}
|
|
2575
2595
|
function databaseNotConfiguredError() {
|
|
2576
|
-
return new (0,
|
|
2596
|
+
return new (0, _chunkZXMKVBQ6cjs.RivetError)(
|
|
2577
2597
|
"actor",
|
|
2578
2598
|
"database_not_configured",
|
|
2579
2599
|
"database is not configured for this actor",
|
|
@@ -2581,7 +2601,7 @@ function databaseNotConfiguredError() {
|
|
|
2581
2601
|
);
|
|
2582
2602
|
}
|
|
2583
2603
|
function databaseClientNotReadyError() {
|
|
2584
|
-
return new (0,
|
|
2604
|
+
return new (0, _chunkZXMKVBQ6cjs.RivetError)(
|
|
2585
2605
|
"actor",
|
|
2586
2606
|
"database_client_not_ready",
|
|
2587
2607
|
"actor database client was not initialized before user code ran. this is an internal lifecycle error; the migration callback should have pre-warmed the client. file an issue if you can reproduce.",
|
|
@@ -2589,7 +2609,7 @@ function databaseClientNotReadyError() {
|
|
|
2589
2609
|
);
|
|
2590
2610
|
}
|
|
2591
2611
|
function stateNotEnabledError() {
|
|
2592
|
-
return new (0,
|
|
2612
|
+
return new (0, _chunkZXMKVBQ6cjs.RivetError)(
|
|
2593
2613
|
"actor",
|
|
2594
2614
|
"state_not_enabled",
|
|
2595
2615
|
"State not enabled. Must implement `createState` or `state` to use state. (https://www.rivet.dev/docs/actors/state/#initializing-state)",
|
|
@@ -2597,7 +2617,7 @@ function stateNotEnabledError() {
|
|
|
2597
2617
|
);
|
|
2598
2618
|
}
|
|
2599
2619
|
function nativeClientNotConfiguredError() {
|
|
2600
|
-
return new (0,
|
|
2620
|
+
return new (0, _chunkZXMKVBQ6cjs.RivetError)(
|
|
2601
2621
|
"native",
|
|
2602
2622
|
"client_not_configured",
|
|
2603
2623
|
"native actor client is not configured",
|
|
@@ -2605,7 +2625,7 @@ function nativeClientNotConfiguredError() {
|
|
|
2605
2625
|
);
|
|
2606
2626
|
}
|
|
2607
2627
|
function nativeEndpointNotConfiguredError() {
|
|
2608
|
-
return new (0,
|
|
2628
|
+
return new (0, _chunkZXMKVBQ6cjs.RivetError)(
|
|
2609
2629
|
"native",
|
|
2610
2630
|
"endpoint_not_configured",
|
|
2611
2631
|
"registry endpoint is required for native envoy startup",
|
|
@@ -2650,7 +2670,7 @@ async function cleanupNativeSleepRuntimeState(runtime, ctx, afterTrackedWorkDrai
|
|
|
2650
2670
|
}).catch((error) => {
|
|
2651
2671
|
logger2().warn({
|
|
2652
2672
|
msg: "deferred native sleep cleanup failed",
|
|
2653
|
-
error:
|
|
2673
|
+
error: _chunkH5CY23OPcjs.stringifyError.call(void 0, error)
|
|
2654
2674
|
});
|
|
2655
2675
|
});
|
|
2656
2676
|
return;
|
|
@@ -2754,16 +2774,16 @@ function decodeNativeKvValue(value, options) {
|
|
|
2754
2774
|
}
|
|
2755
2775
|
}
|
|
2756
2776
|
async function loadEngineCli() {
|
|
2757
|
-
return Promise.resolve().then(() => _interopRequireWildcard(require(
|
|
2777
|
+
return Promise.resolve().then(() => _interopRequireWildcard(require("@rivetkit/engine-cli")));
|
|
2758
2778
|
}
|
|
2759
2779
|
function decodeValue(value) {
|
|
2760
2780
|
if (!value || value.length === 0) {
|
|
2761
2781
|
return void 0;
|
|
2762
2782
|
}
|
|
2763
|
-
return
|
|
2783
|
+
return _chunkXLHSCH3Tcjs.decodeCborCompat.call(void 0, value);
|
|
2764
2784
|
}
|
|
2765
2785
|
function encodeValue(value) {
|
|
2766
|
-
return
|
|
2786
|
+
return _chunkXLHSCH3Tcjs.encodeCborCompat.call(void 0, value);
|
|
2767
2787
|
}
|
|
2768
2788
|
function normalizeArgs(value) {
|
|
2769
2789
|
return Array.isArray(value) ? value : value === void 0 || value === null ? [] : [value];
|
|
@@ -2776,16 +2796,16 @@ function unwrapTsfnPayload(error, payload) {
|
|
|
2776
2796
|
}
|
|
2777
2797
|
function normalizeNativeBridgeError(error) {
|
|
2778
2798
|
if (typeof error === "string") {
|
|
2779
|
-
return _nullishCoalesce(
|
|
2799
|
+
return _nullishCoalesce(_chunkZXMKVBQ6cjs.decodeBridgeRivetError.call(void 0, error), () => ( error));
|
|
2780
2800
|
}
|
|
2781
2801
|
if (error instanceof Error) {
|
|
2782
|
-
const bridged =
|
|
2802
|
+
const bridged = _chunkZXMKVBQ6cjs.decodeBridgeRivetError.call(void 0, error.message);
|
|
2783
2803
|
if (bridged) {
|
|
2784
2804
|
return bridged;
|
|
2785
2805
|
}
|
|
2786
2806
|
}
|
|
2787
2807
|
if (typeof error === "object" && error !== null && "reason" in error && typeof error.reason === "string") {
|
|
2788
|
-
const bridged =
|
|
2808
|
+
const bridged = _chunkZXMKVBQ6cjs.decodeBridgeRivetError.call(void 0, error.reason);
|
|
2789
2809
|
if (bridged) {
|
|
2790
2810
|
return bridged;
|
|
2791
2811
|
}
|
|
@@ -2793,14 +2813,14 @@ function normalizeNativeBridgeError(error) {
|
|
|
2793
2813
|
return error;
|
|
2794
2814
|
}
|
|
2795
2815
|
function isStructuredBridgeError(error) {
|
|
2796
|
-
if (error instanceof
|
|
2816
|
+
if (error instanceof _chunkZXMKVBQ6cjs.RivetError) {
|
|
2797
2817
|
return true;
|
|
2798
2818
|
}
|
|
2799
|
-
return
|
|
2819
|
+
return _chunkZXMKVBQ6cjs.isRivetErrorLike.call(void 0, error) && "__type" in error && (error.__type === "RivetError" || error.__type === "ActorError");
|
|
2800
2820
|
}
|
|
2801
2821
|
function encodeNativeCallbackError(error) {
|
|
2802
|
-
const structuredError = isStructuredBridgeError(error) ? error :
|
|
2803
|
-
const bridgeError = new Error(
|
|
2822
|
+
const structuredError = isStructuredBridgeError(error) ? error : _chunkH5CY23OPcjs.deconstructError.call(void 0, error, true);
|
|
2823
|
+
const bridgeError = new Error(_chunkZXMKVBQ6cjs.encodeBridgeRivetError.call(void 0, structuredError), {
|
|
2804
2824
|
cause: error instanceof Error ? error : void 0
|
|
2805
2825
|
});
|
|
2806
2826
|
return Object.assign(bridgeError, {
|
|
@@ -2824,9 +2844,9 @@ function callNativeSync(invoke) {
|
|
|
2824
2844
|
}
|
|
2825
2845
|
}
|
|
2826
2846
|
function isClosedTaskRegistrationError(error) {
|
|
2827
|
-
const metadata = error instanceof
|
|
2847
|
+
const metadata = error instanceof _chunkZXMKVBQ6cjs.RivetError ? error.metadata : void 0;
|
|
2828
2848
|
const metadataError = metadata && typeof metadata === "object" && "error" in metadata ? metadata.error : void 0;
|
|
2829
|
-
return error instanceof
|
|
2849
|
+
return error instanceof _chunkZXMKVBQ6cjs.RivetError && error.group === "core" && error.code === _chunkZXMKVBQ6cjs.INTERNAL_ERROR_CODE && typeof metadataError === "string" && /actor task registration is (closed|not configured)/.test(metadataError);
|
|
2830
2850
|
}
|
|
2831
2851
|
async function createCancellationTokenHandle(runtime, signal) {
|
|
2832
2852
|
if (!signal) {
|
|
@@ -2849,7 +2869,7 @@ function decodeWorkflowCbor(data) {
|
|
|
2849
2869
|
return null;
|
|
2850
2870
|
}
|
|
2851
2871
|
try {
|
|
2852
|
-
return
|
|
2872
|
+
return _chunkXLHSCH3Tcjs.decodeCborCompat.call(void 0, new Uint8Array(data));
|
|
2853
2873
|
} catch (e4) {
|
|
2854
2874
|
return null;
|
|
2855
2875
|
}
|
|
@@ -2954,7 +2974,7 @@ function serializeWorkflowHistoryForJson(data) {
|
|
|
2954
2974
|
if (data === null) {
|
|
2955
2975
|
return null;
|
|
2956
2976
|
}
|
|
2957
|
-
const history =
|
|
2977
|
+
const history = _chunkEIQ7RY24cjs.decodeWorkflowHistoryTransport.call(void 0, data);
|
|
2958
2978
|
return jsonSafe({
|
|
2959
2979
|
nameRegistry: [...history.nameRegistry],
|
|
2960
2980
|
entries: history.entries.map((entry) => ({
|
|
@@ -3067,7 +3087,7 @@ var NativeConnAdapter = class {
|
|
|
3067
3087
|
this.#schemas = schemas;
|
|
3068
3088
|
this.#ctx = ctx;
|
|
3069
3089
|
this.#queueHibernationRemoval = queueHibernationRemoval;
|
|
3070
|
-
this[
|
|
3090
|
+
this[_chunkQILCFULWcjs.CONN_STATE_MANAGER_SYMBOL] = {
|
|
3071
3091
|
stateEnabled: true,
|
|
3072
3092
|
get state() {
|
|
3073
3093
|
return thisConn.state;
|
|
@@ -3084,7 +3104,7 @@ var NativeConnAdapter = class {
|
|
|
3084
3104
|
decodeValue(this.#runtime.connParams(this.#conn))
|
|
3085
3105
|
);
|
|
3086
3106
|
}
|
|
3087
|
-
[
|
|
3107
|
+
[_chunkQILCFULWcjs.RAW_STATE_SYMBOL]() {
|
|
3088
3108
|
return this.#readState();
|
|
3089
3109
|
}
|
|
3090
3110
|
get state() {
|
|
@@ -3095,12 +3115,12 @@ var NativeConnAdapter = class {
|
|
|
3095
3115
|
this.#writeState(nextValue, { writeNative: true });
|
|
3096
3116
|
},
|
|
3097
3117
|
(newValue) => {
|
|
3098
|
-
|
|
3118
|
+
_chunkXLHSCH3Tcjs.assertJsonCompatValue.call(void 0, newValue);
|
|
3099
3119
|
}
|
|
3100
3120
|
);
|
|
3101
3121
|
}
|
|
3102
3122
|
set state(value) {
|
|
3103
|
-
|
|
3123
|
+
_chunkXLHSCH3Tcjs.assertJsonCompatValue.call(void 0, value);
|
|
3104
3124
|
this.#writeState(value, { writeNative: true });
|
|
3105
3125
|
}
|
|
3106
3126
|
initializeState(value) {
|
|
@@ -3205,7 +3225,7 @@ var NativeKvAdapter = class {
|
|
|
3205
3225
|
const value = await callNative(
|
|
3206
3226
|
() => this.#runtime.actorKvGet(
|
|
3207
3227
|
this.#ctx,
|
|
3208
|
-
|
|
3228
|
+
_chunkDLX4NOQRcjs.makePrefixedKey.call(void 0, encodeNativeKvUserKey(key))
|
|
3209
3229
|
)
|
|
3210
3230
|
);
|
|
3211
3231
|
return value ? decodeNativeKvValue(new Uint8Array(value), options) : null;
|
|
@@ -3214,7 +3234,7 @@ var NativeKvAdapter = class {
|
|
|
3214
3234
|
await callNative(
|
|
3215
3235
|
() => this.#runtime.actorKvPut(
|
|
3216
3236
|
this.#ctx,
|
|
3217
|
-
|
|
3237
|
+
_chunkDLX4NOQRcjs.makePrefixedKey.call(void 0, encodeNativeKvUserKey(key)),
|
|
3218
3238
|
toRuntimeBytes(value)
|
|
3219
3239
|
)
|
|
3220
3240
|
);
|
|
@@ -3223,7 +3243,7 @@ var NativeKvAdapter = class {
|
|
|
3223
3243
|
await callNative(
|
|
3224
3244
|
() => this.#runtime.actorKvDelete(
|
|
3225
3245
|
this.#ctx,
|
|
3226
|
-
|
|
3246
|
+
_chunkDLX4NOQRcjs.makePrefixedKey.call(void 0, encodeNativeKvUserKey(key))
|
|
3227
3247
|
)
|
|
3228
3248
|
);
|
|
3229
3249
|
}
|
|
@@ -3231,8 +3251,8 @@ var NativeKvAdapter = class {
|
|
|
3231
3251
|
await callNative(
|
|
3232
3252
|
() => this.#runtime.actorKvDeleteRange(
|
|
3233
3253
|
this.#ctx,
|
|
3234
|
-
|
|
3235
|
-
|
|
3254
|
+
_chunkDLX4NOQRcjs.makePrefixedKey.call(void 0, encodeNativeKvUserKey(start)),
|
|
3255
|
+
_chunkDLX4NOQRcjs.makePrefixedKey.call(void 0, encodeNativeKvUserKey(end))
|
|
3236
3256
|
)
|
|
3237
3257
|
);
|
|
3238
3258
|
}
|
|
@@ -3245,7 +3265,7 @@ var NativeKvAdapter = class {
|
|
|
3245
3265
|
const entries = await callNative(
|
|
3246
3266
|
() => this.#runtime.actorKvListPrefix(
|
|
3247
3267
|
this.#ctx,
|
|
3248
|
-
|
|
3268
|
+
_chunkDLX4NOQRcjs.makePrefixedKey.call(void 0,
|
|
3249
3269
|
encodeNativeKvUserKey(
|
|
3250
3270
|
prefix,
|
|
3251
3271
|
options == null ? void 0 : options.keyType
|
|
@@ -3259,7 +3279,7 @@ var NativeKvAdapter = class {
|
|
|
3259
3279
|
);
|
|
3260
3280
|
return entries.map((entry) => [
|
|
3261
3281
|
decodeNativeKvKey(
|
|
3262
|
-
|
|
3282
|
+
_chunkDLX4NOQRcjs.removePrefixFromKey.call(void 0, new Uint8Array(entry.key)),
|
|
3263
3283
|
options == null ? void 0 : options.keyType
|
|
3264
3284
|
),
|
|
3265
3285
|
decodeNativeKvValue(new Uint8Array(entry.value), options)
|
|
@@ -3278,13 +3298,13 @@ var NativeKvAdapter = class {
|
|
|
3278
3298
|
const entries = await callNative(
|
|
3279
3299
|
() => this.#runtime.actorKvListRange(
|
|
3280
3300
|
this.#ctx,
|
|
3281
|
-
|
|
3301
|
+
_chunkDLX4NOQRcjs.makePrefixedKey.call(void 0,
|
|
3282
3302
|
encodeNativeKvUserKey(
|
|
3283
3303
|
start,
|
|
3284
3304
|
options == null ? void 0 : options.keyType
|
|
3285
3305
|
)
|
|
3286
3306
|
),
|
|
3287
|
-
|
|
3307
|
+
_chunkDLX4NOQRcjs.makePrefixedKey.call(void 0,
|
|
3288
3308
|
encodeNativeKvUserKey(
|
|
3289
3309
|
end,
|
|
3290
3310
|
options == null ? void 0 : options.keyType
|
|
@@ -3298,7 +3318,7 @@ var NativeKvAdapter = class {
|
|
|
3298
3318
|
);
|
|
3299
3319
|
return entries.map((entry) => [
|
|
3300
3320
|
decodeNativeKvKey(
|
|
3301
|
-
|
|
3321
|
+
_chunkDLX4NOQRcjs.removePrefixFromKey.call(void 0, new Uint8Array(entry.key)),
|
|
3302
3322
|
options == null ? void 0 : options.keyType
|
|
3303
3323
|
),
|
|
3304
3324
|
decodeNativeKvValue(new Uint8Array(entry.value), options)
|
|
@@ -3390,7 +3410,7 @@ var NativeQueueAdapter = class {
|
|
|
3390
3410
|
async nextBatch(options) {
|
|
3391
3411
|
const completable = (options == null ? void 0 : options.completable) === true;
|
|
3392
3412
|
if (this.#pendingCompletableMessageIds.size > 0) {
|
|
3393
|
-
throw new (0,
|
|
3413
|
+
throw new (0, _chunkZXMKVBQ6cjs.RivetError)(
|
|
3394
3414
|
"queue",
|
|
3395
3415
|
"previous_message_not_completed",
|
|
3396
3416
|
"Previous completable queue message is not completed. Call `message.complete(...)` before receiving the next message.",
|
|
@@ -3538,7 +3558,7 @@ var NativeQueueAdapter = class {
|
|
|
3538
3558
|
}
|
|
3539
3559
|
yield message;
|
|
3540
3560
|
} catch (error) {
|
|
3541
|
-
if (
|
|
3561
|
+
if (_chunkZXMKVBQ6cjs.isActorAbortedError.call(void 0, error)) {
|
|
3542
3562
|
return;
|
|
3543
3563
|
}
|
|
3544
3564
|
throw error;
|
|
@@ -3559,7 +3579,7 @@ var NativeQueueAdapter = class {
|
|
|
3559
3579
|
...message,
|
|
3560
3580
|
complete: async (response) => {
|
|
3561
3581
|
if (typeof message.complete !== "function") {
|
|
3562
|
-
throw new (0,
|
|
3582
|
+
throw new (0, _chunkZXMKVBQ6cjs.RivetError)(
|
|
3563
3583
|
"queue",
|
|
3564
3584
|
"complete_not_configured",
|
|
3565
3585
|
`Queue '${message.name}' does not support completion responses.`,
|
|
@@ -3571,7 +3591,7 @@ var NativeQueueAdapter = class {
|
|
|
3571
3591
|
);
|
|
3572
3592
|
}
|
|
3573
3593
|
if (completed) {
|
|
3574
|
-
throw new (0,
|
|
3594
|
+
throw new (0, _chunkZXMKVBQ6cjs.RivetError)(
|
|
3575
3595
|
"queue",
|
|
3576
3596
|
"already_completed",
|
|
3577
3597
|
"Queue message was already completed.",
|
|
@@ -3998,7 +4018,7 @@ var ActorContextHandleAdapter = class {
|
|
|
3998
4018
|
this.#databaseProvider = databaseProvider;
|
|
3999
4019
|
}
|
|
4000
4020
|
this.#request = request;
|
|
4001
|
-
this[
|
|
4021
|
+
this[_chunkQILCFULWcjs.ACTOR_CONTEXT_INTERNAL_SYMBOL] = new NativeWorkflowRuntimeAdapter(
|
|
4002
4022
|
this
|
|
4003
4023
|
);
|
|
4004
4024
|
}
|
|
@@ -4029,7 +4049,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4029
4049
|
}
|
|
4030
4050
|
throw databaseClientNotReadyError();
|
|
4031
4051
|
}
|
|
4032
|
-
[
|
|
4052
|
+
[_chunkQILCFULWcjs.RAW_STATE_SYMBOL]() {
|
|
4033
4053
|
if (!this.#stateEnabled) {
|
|
4034
4054
|
throw stateNotEnabledError();
|
|
4035
4055
|
}
|
|
@@ -4050,7 +4070,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4050
4070
|
},
|
|
4051
4071
|
(newValue) => {
|
|
4052
4072
|
this.#assertCanMutateState();
|
|
4053
|
-
|
|
4073
|
+
_chunkXLHSCH3Tcjs.assertJsonCompatValue.call(void 0, newValue);
|
|
4054
4074
|
}
|
|
4055
4075
|
);
|
|
4056
4076
|
}
|
|
@@ -4061,7 +4081,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4061
4081
|
throw stateNotEnabledError();
|
|
4062
4082
|
}
|
|
4063
4083
|
this.#assertCanMutateState();
|
|
4064
|
-
|
|
4084
|
+
_chunkXLHSCH3Tcjs.assertJsonCompatValue.call(void 0, value);
|
|
4065
4085
|
this.#writeState(value, { scheduleSave: true });
|
|
4066
4086
|
}
|
|
4067
4087
|
initializeState(value) {
|
|
@@ -4326,7 +4346,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4326
4346
|
const trackedPromise = Promise.resolve(promise).catch((error) => {
|
|
4327
4347
|
logger2().warn({
|
|
4328
4348
|
msg: "keepAwake promise rejected",
|
|
4329
|
-
error:
|
|
4349
|
+
error: _chunkH5CY23OPcjs.stringifyError.call(void 0, error)
|
|
4330
4350
|
});
|
|
4331
4351
|
}).then(() => null);
|
|
4332
4352
|
try {
|
|
@@ -4781,9 +4801,9 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
4781
4801
|
const actionHandlers = Object.fromEntries(
|
|
4782
4802
|
Object.entries(_nullishCoalesce(config.actions, () => ( {}))).map(([name, handler]) => [name, handler])
|
|
4783
4803
|
);
|
|
4784
|
-
const createClient = () =>
|
|
4785
|
-
new (0,
|
|
4786
|
-
|
|
4804
|
+
const createClient = () => _chunkFDEQTWHWcjs.createClientWithDriver.call(void 0,
|
|
4805
|
+
new (0, _chunkFDEQTWHWcjs.RemoteEngineControlClient)(
|
|
4806
|
+
_chunkFDEQTWHWcjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
|
|
4787
4807
|
),
|
|
4788
4808
|
{ encoding: "bare" }
|
|
4789
4809
|
);
|
|
@@ -4793,7 +4813,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
4793
4813
|
), () => ( false));
|
|
4794
4814
|
const getNativeWorkflowInspector = (ctx) => {
|
|
4795
4815
|
var _a2;
|
|
4796
|
-
return (_a2 =
|
|
4816
|
+
return (_a2 = _chunkQILCFULWcjs.getRunInspectorConfig.call(void 0,
|
|
4797
4817
|
config.run,
|
|
4798
4818
|
callNativeSync(() => runtime.actorId(ctx))
|
|
4799
4819
|
)) == null ? void 0 : _a2.workflow;
|
|
@@ -4846,7 +4866,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
4846
4866
|
}
|
|
4847
4867
|
});
|
|
4848
4868
|
const errorResponse = (error, status) => {
|
|
4849
|
-
const rivetError =
|
|
4869
|
+
const rivetError = _chunkZXMKVBQ6cjs.toRivetError.call(void 0, error);
|
|
4850
4870
|
return jsonResponse(
|
|
4851
4871
|
{
|
|
4852
4872
|
group: rivetError.group,
|
|
@@ -5094,7 +5114,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5094
5114
|
const action = actionHandlers[actionName];
|
|
5095
5115
|
if (!action) {
|
|
5096
5116
|
return errorResponse(
|
|
5097
|
-
new (0,
|
|
5117
|
+
new (0, _chunkZXMKVBQ6cjs.RivetError)(
|
|
5098
5118
|
"action",
|
|
5099
5119
|
"action_not_found",
|
|
5100
5120
|
`Action ${actionName} not found`
|
|
@@ -5311,7 +5331,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5311
5331
|
} finally {
|
|
5312
5332
|
const actorId = callNativeSync(() => runtime.actorId(ctx));
|
|
5313
5333
|
nativeRunHandlerActiveByActorId.delete(actorId);
|
|
5314
|
-
|
|
5334
|
+
_chunkQILCFULWcjs.disposeRunInspector.call(void 0, config.run, actorId);
|
|
5315
5335
|
resolveNativeDestroy(runtime, ctx);
|
|
5316
5336
|
await actorCtx.closeDatabase();
|
|
5317
5337
|
clearNativeRuntimeState(runtime, ctx);
|
|
@@ -5461,7 +5481,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5461
5481
|
);
|
|
5462
5482
|
}
|
|
5463
5483
|
if (!result) {
|
|
5464
|
-
throw
|
|
5484
|
+
throw _chunkZXMKVBQ6cjs.forbiddenError.call(void 0, );
|
|
5465
5485
|
}
|
|
5466
5486
|
} finally {
|
|
5467
5487
|
await actorCtx.dispose();
|
|
@@ -5507,7 +5527,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5507
5527
|
new Response(null, { status: 404 })
|
|
5508
5528
|
);
|
|
5509
5529
|
}
|
|
5510
|
-
const rawConnParams = jsRequest.headers.get(
|
|
5530
|
+
const rawConnParams = jsRequest.headers.get(_chunkFDEQTWHWcjs.HEADER_CONN_PARAMS);
|
|
5511
5531
|
let requestCtx;
|
|
5512
5532
|
let conn;
|
|
5513
5533
|
try {
|
|
@@ -5572,7 +5592,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5572
5592
|
}
|
|
5573
5593
|
) : void 0,
|
|
5574
5594
|
run: (() => {
|
|
5575
|
-
const run =
|
|
5595
|
+
const run = _chunkQILCFULWcjs.getRunFunction.call(void 0, config.run);
|
|
5576
5596
|
if (!run) {
|
|
5577
5597
|
return void 0;
|
|
5578
5598
|
}
|
|
@@ -5591,7 +5611,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5591
5611
|
}
|
|
5592
5612
|
);
|
|
5593
5613
|
})(),
|
|
5594
|
-
getWorkflowHistory:
|
|
5614
|
+
getWorkflowHistory: _chunkQILCFULWcjs.getRunInspectorConfig.call(void 0, config.run) !== void 0 ? wrapNativeCallback(
|
|
5595
5615
|
async (error, payload) => {
|
|
5596
5616
|
var _a2;
|
|
5597
5617
|
const { ctx } = unwrapTsfnPayload(error, payload);
|
|
@@ -5599,7 +5619,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5599
5619
|
return history == null ? void 0 : encodeValue(history);
|
|
5600
5620
|
}
|
|
5601
5621
|
) : void 0,
|
|
5602
|
-
replayWorkflow:
|
|
5622
|
+
replayWorkflow: _chunkQILCFULWcjs.getRunInspectorConfig.call(void 0, config.run) !== void 0 ? wrapNativeCallback(
|
|
5603
5623
|
async (error, payload) => {
|
|
5604
5624
|
const { ctx, entryId } = unwrapTsfnPayload(
|
|
5605
5625
|
error,
|
|
@@ -5674,7 +5694,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5674
5694
|
name
|
|
5675
5695
|
);
|
|
5676
5696
|
if (canPublish && !await canPublish(actorCtx)) {
|
|
5677
|
-
throw
|
|
5697
|
+
throw _chunkZXMKVBQ6cjs.forbiddenError.call(void 0, );
|
|
5678
5698
|
}
|
|
5679
5699
|
const decodedBody = decodeValue(body);
|
|
5680
5700
|
if (wait) {
|
|
@@ -5734,7 +5754,7 @@ async function buildServeConfig(config) {
|
|
|
5734
5754
|
poolName: config.envoy.poolName,
|
|
5735
5755
|
handleInspectorHttpInRuntime: true,
|
|
5736
5756
|
serverlessBasePath: config.serverless.basePath,
|
|
5737
|
-
serverlessPackageVersion:
|
|
5757
|
+
serverlessPackageVersion: _chunkH5CY23OPcjs.VERSION,
|
|
5738
5758
|
serverlessClientEndpoint: config.publicEndpoint,
|
|
5739
5759
|
serverlessClientNamespace: config.publicNamespace,
|
|
5740
5760
|
serverlessClientToken: config.publicToken,
|
|
@@ -5747,19 +5767,19 @@ async function buildServeConfig(config) {
|
|
|
5747
5767
|
} catch (error) {
|
|
5748
5768
|
logger2().warn({
|
|
5749
5769
|
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",
|
|
5750
|
-
error:
|
|
5770
|
+
error: _chunkH5CY23OPcjs.stringifyError.call(void 0, error)
|
|
5751
5771
|
});
|
|
5752
5772
|
}
|
|
5753
5773
|
serveConfig.engineHost = config.engineHost;
|
|
5754
5774
|
serveConfig.enginePort = config.enginePort;
|
|
5755
5775
|
if ((_a = config.test) == null ? void 0 : _a.enabled) {
|
|
5756
|
-
serveConfig.inspectorTestToken = _nullishCoalesce(
|
|
5776
|
+
serveConfig.inspectorTestToken = _nullishCoalesce(_chunkH5CY23OPcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
|
|
5757
5777
|
}
|
|
5758
5778
|
return serveConfig;
|
|
5759
5779
|
}
|
|
5760
5780
|
async function buildRegistryWithRuntime(config, runtime) {
|
|
5761
5781
|
var _a;
|
|
5762
|
-
if (((_a = config.test) == null ? void 0 : _a.enabled) &&
|
|
5782
|
+
if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunkH5CY23OPcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
|
|
5763
5783
|
trySetProcessEnv("_RIVET_TEST_INSPECTOR_TOKEN", "token");
|
|
5764
5784
|
}
|
|
5765
5785
|
if (runtime.kind === "napi") {
|
|
@@ -6044,8 +6064,8 @@ var Registry = class {
|
|
|
6044
6064
|
* ```
|
|
6045
6065
|
*/
|
|
6046
6066
|
async listen(opts = {}) {
|
|
6047
|
-
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => (
|
|
6048
|
-
const publicDir = _nullishCoalesce(opts.publicDir, () => (
|
|
6067
|
+
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => ( _chunkH5CY23OPcjs.parsePortEnv.call(void 0, process.env.RIVET_PORT))), () => ( 3e3));
|
|
6068
|
+
const publicDir = _nullishCoalesce(opts.publicDir, () => ( _chunkH5CY23OPcjs.getRivetkitPublicDir.call(void 0, )));
|
|
6049
6069
|
const config = this.parseConfig();
|
|
6050
6070
|
const configuredRegistryPromise = buildConfiguredRegistry(config);
|
|
6051
6071
|
this.#runtimeServeConfiguredPromise = configuredRegistryPromise;
|
|
@@ -6073,7 +6093,7 @@ var Registry = class {
|
|
|
6073
6093
|
return jsonRouteResponse(503, {
|
|
6074
6094
|
status: "not_started",
|
|
6075
6095
|
runtime: "rivetkit",
|
|
6076
|
-
version:
|
|
6096
|
+
version: _chunkH5CY23OPcjs.VERSION
|
|
6077
6097
|
});
|
|
6078
6098
|
}
|
|
6079
6099
|
const { runtime, registry } = configured;
|
|
@@ -6081,7 +6101,7 @@ var Registry = class {
|
|
|
6081
6101
|
return jsonRouteResponse(501, {
|
|
6082
6102
|
status: "unsupported",
|
|
6083
6103
|
runtime: "rivetkit",
|
|
6084
|
-
version:
|
|
6104
|
+
version: _chunkH5CY23OPcjs.VERSION
|
|
6085
6105
|
});
|
|
6086
6106
|
}
|
|
6087
6107
|
const response = await runtime.registryHealth(registry);
|
|
@@ -6319,8 +6339,8 @@ var Registry = class {
|
|
|
6319
6339
|
* ```
|
|
6320
6340
|
*/
|
|
6321
6341
|
start() {
|
|
6322
|
-
if (
|
|
6323
|
-
const publicDir = _nullishCoalesce(
|
|
6342
|
+
if (_chunkH5CY23OPcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
6343
|
+
const publicDir = _nullishCoalesce(_chunkH5CY23OPcjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
|
|
6324
6344
|
this.listen({ publicDir }).catch((error) => {
|
|
6325
6345
|
logger2().error({ error }, "auto-listen failed; exiting");
|
|
6326
6346
|
if (typeof process !== "undefined" && typeof process.exit === "function") {
|
|
@@ -6341,7 +6361,7 @@ var Registry = class {
|
|
|
6341
6361
|
};
|
|
6342
6362
|
console.log();
|
|
6343
6363
|
console.log(
|
|
6344
|
-
` RivetKit ${
|
|
6364
|
+
` RivetKit ${_chunkH5CY23OPcjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
|
|
6345
6365
|
);
|
|
6346
6366
|
if (config.namespace !== "default") {
|
|
6347
6367
|
logLine("Namespace", config.namespace);
|
|
@@ -6416,5 +6436,5 @@ function setup(input) {
|
|
|
6416
6436
|
|
|
6417
6437
|
|
|
6418
6438
|
|
|
6419
|
-
exports.ALLOWED_PUBLIC_HEADERS =
|
|
6439
|
+
exports.ALLOWED_PUBLIC_HEADERS = _chunkFDEQTWHWcjs.ALLOWED_PUBLIC_HEADERS; exports.ActorDefinition = ActorDefinition; exports.ActorError = _chunkZXMKVBQ6cjs.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 = _chunkZXMKVBQ6cjs.RivetError; exports.RuntimeKindSchema = RuntimeKindSchema; exports.SqliteBackendSchema = SqliteBackendSchema; exports.SqliteConfigSchema = SqliteConfigSchema; exports.TestConfigSchema = TestConfigSchema; exports.UserError = _chunkZXMKVBQ6cjs.UserError; exports.WasmRuntimeConfigSchema = WasmRuntimeConfigSchema; exports.actor = actor; exports.buildActorNames = buildActorNames; exports.createClientWithDriver = _chunkFDEQTWHWcjs.createClientWithDriver; exports.event = event; exports.isStaticActorDefinition = isStaticActorDefinition; exports.isStaticActorInstance = isStaticActorInstance; exports.lookupInRegistry = lookupInRegistry; exports.noopNext = _chunkH5CY23OPcjs.noopNext; exports.queue = queue; exports.setup = setup; exports.toUint8Array = _chunkH5CY23OPcjs.toUint8Array;
|
|
6420
6440
|
//# sourceMappingURL=mod.cjs.map
|