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