rivetkit 2.3.12-rc.2 → 2.3.12-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/client.d.ts +2 -0
- package/dist/browser/client.js +52 -29
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +1 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/agent-os/index.cjs +19 -2
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +2 -0
- package/dist/tsup/agent-os/index.d.ts +2 -0
- package/dist/tsup/agent-os/index.js +19 -2
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-3JBE7REK.js → chunk-3CBQIP37.js} +4 -4
- package/dist/tsup/{chunk-HRJHLVHZ.cjs → chunk-4LRWLBTR.cjs} +3 -3
- package/dist/tsup/{chunk-HRJHLVHZ.cjs.map → chunk-4LRWLBTR.cjs.map} +1 -1
- package/dist/tsup/{chunk-YW75TS76.js → chunk-64DT44V2.js} +2 -2
- package/dist/tsup/{chunk-YW75TS76.js.map → chunk-64DT44V2.js.map} +1 -1
- package/dist/tsup/{chunk-KRQI5GXM.js → chunk-AF2VKCFA.js} +2 -2
- package/dist/tsup/{chunk-APQQFCPR.cjs → chunk-ARFTQ5HY.cjs} +2 -2
- package/dist/tsup/{chunk-APQQFCPR.cjs.map → chunk-ARFTQ5HY.cjs.map} +1 -1
- package/dist/tsup/{chunk-KPZQI3TG.js → chunk-BQ7YJ3PG.js} +2 -2
- package/dist/tsup/{chunk-6W5VGLFT.js → chunk-DLQSZ6Q7.js} +19 -2
- package/dist/tsup/chunk-DLQSZ6Q7.js.map +1 -0
- package/dist/tsup/{chunk-DXN6RPPQ.cjs → chunk-F7G5WHOD.cjs} +188 -165
- package/dist/tsup/chunk-F7G5WHOD.cjs.map +1 -0
- package/dist/tsup/{chunk-JZGMOEEI.js → chunk-GMBCKV6C.js} +3 -3
- package/dist/tsup/{chunk-4KGXFC6M.cjs → chunk-IAH47VDZ.cjs} +19 -2
- package/dist/tsup/chunk-IAH47VDZ.cjs.map +1 -0
- package/dist/tsup/{chunk-WTD54OHL.cjs → chunk-JIOLC5I2.cjs} +3 -3
- package/dist/tsup/{chunk-WTD54OHL.cjs.map → chunk-JIOLC5I2.cjs.map} +1 -1
- package/dist/tsup/{chunk-IU6TTH6L.cjs → chunk-NKLM6C5A.cjs} +10 -10
- package/dist/tsup/{chunk-IU6TTH6L.cjs.map → chunk-NKLM6C5A.cjs.map} +1 -1
- package/dist/tsup/{chunk-ZEIH7S4M.js → chunk-NVMHEG5J.js} +2 -2
- package/dist/tsup/{chunk-BK2JOGQQ.js → chunk-O74736N5.js} +57 -34
- package/dist/tsup/chunk-O74736N5.js.map +1 -0
- package/dist/tsup/{chunk-XBPOYV4E.cjs → chunk-OCXHNHGQ.cjs} +3 -3
- package/dist/tsup/{chunk-XBPOYV4E.cjs.map → chunk-OCXHNHGQ.cjs.map} +1 -1
- package/dist/tsup/{chunk-6XR7IKBZ.js → chunk-P5JJG4KY.js} +2 -2
- package/dist/tsup/{chunk-CZKQ2UR5.cjs → chunk-S3GXVCIM.cjs} +4 -4
- package/dist/tsup/{chunk-CZKQ2UR5.cjs.map → chunk-S3GXVCIM.cjs.map} +1 -1
- package/dist/tsup/{chunk-GGGZ4TN7.cjs → chunk-XDYECGCT.cjs} +7 -7
- package/dist/tsup/{chunk-GGGZ4TN7.cjs.map → chunk-XDYECGCT.cjs.map} +1 -1
- package/dist/tsup/client/mod.cjs +5 -5
- package/dist/tsup/client/mod.d.cts +2 -2
- package/dist/tsup/client/mod.d.ts +2 -2
- package/dist/tsup/client/mod.js +4 -4
- package/dist/tsup/common/log.cjs +2 -2
- package/dist/tsup/common/log.js +1 -1
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/{config-Bi1r6gI7.d.ts → config-DzaddF-j.d.ts} +8 -1
- package/dist/tsup/{config-BXSV17G7.d.cts → config-VxDc6yMu.d.cts} +8 -1
- package/dist/tsup/{context-D4sNYboo.d.ts → context-B6HYokje.d.ts} +1 -1
- package/dist/tsup/{context-4fJemY0D.d.cts → context-Cn8CIrOR.d.cts} +1 -1
- package/dist/tsup/db/drizzle.cjs +2 -2
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +3 -3
- package/dist/tsup/db/mod.js +2 -2
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.d.cts +1 -1
- package/dist/tsup/dynamic/mod.d.ts +1 -1
- package/dist/tsup/dynamic/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +5 -5
- package/dist/tsup/inspector/mod.js +4 -4
- package/dist/tsup/inspector/workflow.cjs +4 -4
- package/dist/tsup/inspector/workflow.js +3 -3
- package/dist/tsup/inspector-tab/mod.cjs +2 -2
- package/dist/tsup/inspector-tab/mod.d.cts +2 -2
- package/dist/tsup/inspector-tab/mod.d.ts +2 -2
- package/dist/tsup/inspector-tab/mod.js +1 -1
- package/dist/tsup/mod.cjs +93 -92
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +3 -3
- package/dist/tsup/mod.d.ts +3 -3
- package/dist/tsup/mod.js +9 -8
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +6 -6
- package/dist/tsup/test/mod.d.cts +1 -1
- package/dist/tsup/test/mod.d.ts +1 -1
- package/dist/tsup/test/mod.js +4 -4
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +10 -10
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +3 -3
- package/dist/tsup/workflow/mod.d.ts +3 -3
- package/dist/tsup/workflow/mod.js +5 -5
- package/package.json +8 -8
- package/src/actor/config.test.ts +8 -0
- package/src/actor/config.ts +24 -1
- package/src/client/actor-handle.ts +15 -10
- package/src/engine-client/mod.ts +51 -20
- package/src/registry/native.ts +1 -0
- package/src/registry/runtime.ts +1 -0
- package/dist/tsup/chunk-4KGXFC6M.cjs.map +0 -1
- package/dist/tsup/chunk-6W5VGLFT.js.map +0 -1
- package/dist/tsup/chunk-BK2JOGQQ.js.map +0 -1
- package/dist/tsup/chunk-DXN6RPPQ.cjs.map +0 -1
- /package/dist/tsup/{chunk-3JBE7REK.js.map → chunk-3CBQIP37.js.map} +0 -0
- /package/dist/tsup/{chunk-KRQI5GXM.js.map → chunk-AF2VKCFA.js.map} +0 -0
- /package/dist/tsup/{chunk-KPZQI3TG.js.map → chunk-BQ7YJ3PG.js.map} +0 -0
- /package/dist/tsup/{chunk-JZGMOEEI.js.map → chunk-GMBCKV6C.js.map} +0 -0
- /package/dist/tsup/{chunk-ZEIH7S4M.js.map → chunk-NVMHEG5J.js.map} +0 -0
- /package/dist/tsup/{chunk-6XR7IKBZ.js.map → chunk-P5JJG4KY.js.map} +0 -0
package/dist/tsup/mod.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } var _class; var _class2; var _class3;
|
|
2
2
|
|
|
3
|
+
var _chunkS3GXVCIMcjs = require('./chunk-S3GXVCIM.cjs');
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
|
|
@@ -13,10 +14,9 @@
|
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
|
|
16
|
-
var _chunk4KGXFC6Mcjs = require('./chunk-4KGXFC6M.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkIAH47VDZcjs = require('./chunk-IAH47VDZ.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
@@ -27,18 +27,18 @@ var _chunkCZKQ2UR5cjs = require('./chunk-CZKQ2UR5.cjs');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkF7G5WHODcjs = require('./chunk-F7G5WHOD.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
var _chunkMYWZCDMLcjs = require('./chunk-MYWZCDML.cjs');
|
|
35
|
-
require('./chunk-XBPOYV4E.cjs');
|
|
36
35
|
|
|
37
36
|
|
|
38
37
|
|
|
39
38
|
|
|
40
|
-
var
|
|
39
|
+
var _chunk4LRWLBTRcjs = require('./chunk-4LRWLBTR.cjs');
|
|
41
40
|
require('./chunk-KVFIONKQ.cjs');
|
|
41
|
+
require('./chunk-OCXHNHGQ.cjs');
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
@@ -71,7 +71,7 @@ require('./chunk-KVFIONKQ.cjs');
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
var
|
|
74
|
+
var _chunkARFTQ5HYcjs = require('./chunk-ARFTQ5HY.cjs');
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
|
|
@@ -87,7 +87,7 @@ var _chunkSPJORZMMcjs = require('./chunk-SPJORZMM.cjs');
|
|
|
87
87
|
|
|
88
88
|
// src/actor/log.ts
|
|
89
89
|
function loggerWithoutContext() {
|
|
90
|
-
return
|
|
90
|
+
return _chunkARFTQ5HYcjs.getLogger.call(void 0, "actor-runtime");
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// src/actor/definition.ts
|
|
@@ -126,9 +126,9 @@ function actor(input) {
|
|
|
126
126
|
warnDeprecatedOptionKeys(
|
|
127
127
|
input == null ? void 0 : input.options
|
|
128
128
|
);
|
|
129
|
-
const config =
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
const config = _chunkIAH47VDZcjs.ActorConfigSchema.parse(input);
|
|
130
|
+
_chunkIAH47VDZcjs.flattenActionHandlers.call(void 0, config.actions);
|
|
131
|
+
_chunkIAH47VDZcjs.flattenActionInputSchemas.call(void 0, config.actions, config.actionInputSchemas);
|
|
132
132
|
return new ActorDefinition(config);
|
|
133
133
|
}
|
|
134
134
|
function isStaticActorDefinition(definition) {
|
|
@@ -227,7 +227,7 @@ function validateSchemaSync(schemas, key, data) {
|
|
|
227
227
|
var _virtualwebsocket = require('@rivetkit/virtual-websocket');
|
|
228
228
|
var _ws = require('hono/ws');
|
|
229
229
|
function logger() {
|
|
230
|
-
return
|
|
230
|
+
return _chunkARFTQ5HYcjs.getLogger.call(void 0, "inline-websocket-adapter");
|
|
231
231
|
}
|
|
232
232
|
var InlineWebSocketAdapter = class {
|
|
233
233
|
#handler;
|
|
@@ -398,7 +398,7 @@ function isLocalEngineEndpoint(endpoint) {
|
|
|
398
398
|
|
|
399
399
|
// src/registry/log.ts
|
|
400
400
|
function logger2() {
|
|
401
|
-
return
|
|
401
|
+
return _chunkARFTQ5HYcjs.getLogger.call(void 0, "registry");
|
|
402
402
|
}
|
|
403
403
|
|
|
404
404
|
// src/serverless/configure.ts
|
|
@@ -444,8 +444,8 @@ async function configureServerlessPool(config) {
|
|
|
444
444
|
);
|
|
445
445
|
}
|
|
446
446
|
const customConfig = config.configurePool;
|
|
447
|
-
const clientConfig =
|
|
448
|
-
const dcsRes = await
|
|
447
|
+
const clientConfig = _chunkF7G5WHODcjs.convertRegistryConfigToClientConfig.call(void 0, config);
|
|
448
|
+
const dcsRes = await _chunkF7G5WHODcjs.getDatacenters.call(void 0, clientConfig);
|
|
449
449
|
const poolName = _nullishCoalesce(customConfig.name, () => ( "default"));
|
|
450
450
|
const serverlessToken = _nullishCoalesce(config.token, () => ( config.publicToken));
|
|
451
451
|
const headers = {
|
|
@@ -467,7 +467,7 @@ async function configureServerlessPool(config) {
|
|
|
467
467
|
metadata: _nullishCoalesce(customConfig.metadata, () => ( {})),
|
|
468
468
|
drain_on_version_upgrade: _nullishCoalesce(customConfig.drainOnVersionUpgrade, () => ( true))
|
|
469
469
|
};
|
|
470
|
-
await
|
|
470
|
+
await _chunkF7G5WHODcjs.updateRunnerConfig.call(void 0, clientConfig, poolName, {
|
|
471
471
|
datacenters: Object.fromEntries(
|
|
472
472
|
dcsRes.datacenters.map((dc) => [dc.name, serverlessConfig])
|
|
473
473
|
)
|
|
@@ -484,7 +484,7 @@ async function configureServerlessPool(config) {
|
|
|
484
484
|
logger2().warn({
|
|
485
485
|
msg: "serverless pool configuration attempt failed",
|
|
486
486
|
attempts,
|
|
487
|
-
error:
|
|
487
|
+
error: _chunkARFTQ5HYcjs.stringifyError.call(void 0, error)
|
|
488
488
|
});
|
|
489
489
|
await sleep(CONFIGURE_RETRY_DELAY_MS);
|
|
490
490
|
}
|
|
@@ -492,7 +492,7 @@ async function configureServerlessPool(config) {
|
|
|
492
492
|
logger2().error({
|
|
493
493
|
msg: "failed to configure serverless pool, validate endpoint is configured correctly then restart this process",
|
|
494
494
|
attempts,
|
|
495
|
-
error:
|
|
495
|
+
error: _chunkARFTQ5HYcjs.stringifyError.call(void 0, lastError)
|
|
496
496
|
});
|
|
497
497
|
throw lastError;
|
|
498
498
|
}
|
|
@@ -504,20 +504,20 @@ var _zod = require('zod');
|
|
|
504
504
|
var _v4 = require('zod/v4');
|
|
505
505
|
var warnedMissingVersion = false;
|
|
506
506
|
var EnvoyConfigSchema = _v4.z.object({
|
|
507
|
-
poolName: _v4.z.string().default(() => _nullishCoalesce(
|
|
507
|
+
poolName: _v4.z.string().default(() => _nullishCoalesce(_chunkARFTQ5HYcjs.getRivetPool.call(void 0, ), () => ( "default"))),
|
|
508
508
|
version: _v4.z.number().default(() => {
|
|
509
|
-
const version =
|
|
509
|
+
const version = _chunkARFTQ5HYcjs.getRivetEnvoyVersion.call(void 0, );
|
|
510
510
|
if (version !== void 0) return version;
|
|
511
|
-
if (
|
|
511
|
+
if (_chunkARFTQ5HYcjs.getNodeEnv.call(void 0, ) === "production" && !warnedMissingVersion) {
|
|
512
512
|
warnedMissingVersion = true;
|
|
513
|
-
|
|
513
|
+
_chunkARFTQ5HYcjs.getLogger.call(void 0, "rivetkit").error(
|
|
514
514
|
"RIVET_ENVOY_VERSION is not set. Actors will not be versioned, which means they won't be drained on deploy. This is only needed when self-hosting or using a custom envoy (not needed for Rivet Compute). Set this as a build arg in your Dockerfile. See https://rivet.dev/docs/actors/versions"
|
|
515
515
|
);
|
|
516
516
|
}
|
|
517
517
|
return 1;
|
|
518
518
|
}),
|
|
519
519
|
// Deprecated.
|
|
520
|
-
totalSlots: _v4.z.number().default(() => _nullishCoalesce(
|
|
520
|
+
totalSlots: _v4.z.number().default(() => _nullishCoalesce(_chunkARFTQ5HYcjs.getRivetTotalSlots.call(void 0, ), () => ( 1e5))),
|
|
521
521
|
envoyKey: _v4.z.string().optional()
|
|
522
522
|
});
|
|
523
523
|
|
|
@@ -555,7 +555,7 @@ var ServerlessConfigSchema = _v4.z.object({
|
|
|
555
555
|
*
|
|
556
556
|
* Can also be set via RIVET_PUBLIC_ENDPOINT environment variable.
|
|
557
557
|
*/
|
|
558
|
-
publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
558
|
+
publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkARFTQ5HYcjs.getRivetPublicEndpoint.call(void 0, )))),
|
|
559
559
|
/**
|
|
560
560
|
* Token that clients should use when connecting via the public endpoint.
|
|
561
561
|
*
|
|
@@ -563,7 +563,7 @@ var ServerlessConfigSchema = _v4.z.object({
|
|
|
563
563
|
*
|
|
564
564
|
* Can also be specified in the publicEndpoint URL as `https://namespace:token@host`.
|
|
565
565
|
*/
|
|
566
|
-
publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
566
|
+
publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkARFTQ5HYcjs.getRivetPublicToken.call(void 0, ))))
|
|
567
567
|
// There is no publicNamespace config option because the frontend and backend
|
|
568
568
|
// cannot use different namespaces. The namespace is extracted from the
|
|
569
569
|
// publicEndpoint URL auth syntax if provided.
|
|
@@ -617,7 +617,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
617
617
|
* Runtime binding to use for RivetKit core.
|
|
618
618
|
* */
|
|
619
619
|
runtime: RuntimeKindSchema.optional().transform((val, ctx) => {
|
|
620
|
-
const rawRuntime = _nullishCoalesce(val, () => (
|
|
620
|
+
const rawRuntime = _nullishCoalesce(val, () => ( _chunkARFTQ5HYcjs.getRivetkitRuntime.call(void 0, )));
|
|
621
621
|
if (rawRuntime === void 0) {
|
|
622
622
|
return "auto";
|
|
623
623
|
}
|
|
@@ -654,7 +654,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
654
654
|
* */
|
|
655
655
|
logging: _zod.z.object({
|
|
656
656
|
baseLogger: _zod.z.custom().optional(),
|
|
657
|
-
level:
|
|
657
|
+
level: _chunkARFTQ5HYcjs.LogLevelSchema.optional()
|
|
658
658
|
}).optional().default(() => ({})),
|
|
659
659
|
// MARK: Routing
|
|
660
660
|
// // This is a function to allow for lazy configuration of upgradeWebSocket on the
|
|
@@ -672,9 +672,9 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
672
672
|
*
|
|
673
673
|
* Can also be set via RIVET_ENDPOINT environment variables.
|
|
674
674
|
*/
|
|
675
|
-
endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => (
|
|
676
|
-
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
677
|
-
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
675
|
+
endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => ( _chunkARFTQ5HYcjs.getRivetEngine.call(void 0, ))), () => ( _chunkARFTQ5HYcjs.getRivetEndpoint.call(void 0, )))),
|
|
676
|
+
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkARFTQ5HYcjs.getRivetToken.call(void 0, )))),
|
|
677
|
+
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkARFTQ5HYcjs.getRivetNamespace.call(void 0, )))),
|
|
678
678
|
headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional().default({}),
|
|
679
679
|
// MARK: Client
|
|
680
680
|
// TODO:
|
|
@@ -714,21 +714,21 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
714
714
|
*
|
|
715
715
|
* Starts the full Rust engine process locally.
|
|
716
716
|
*/
|
|
717
|
-
startEngine: _zod.z.boolean().default(() =>
|
|
717
|
+
startEngine: _zod.z.boolean().default(() => _chunkARFTQ5HYcjs.getRivetRunEngine.call(void 0, )),
|
|
718
718
|
/**
|
|
719
719
|
* @experimental
|
|
720
720
|
*
|
|
721
721
|
* Host to bind the spawned local engine process to.
|
|
722
722
|
*/
|
|
723
|
-
engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
723
|
+
engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkARFTQ5HYcjs.getRivetRunEngineHost.call(void 0, ), () => ( ENGINE_HOST))),
|
|
724
724
|
/**
|
|
725
725
|
* @experimental
|
|
726
726
|
*
|
|
727
727
|
* Port to bind the spawned local engine process to.
|
|
728
728
|
*/
|
|
729
|
-
enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(
|
|
729
|
+
enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(_chunkARFTQ5HYcjs.getRivetRunEnginePort.call(void 0, ), () => ( ENGINE_PORT))),
|
|
730
730
|
/** @experimental */
|
|
731
|
-
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
731
|
+
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkARFTQ5HYcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunkARFTQ5HYcjs.VERSION))),
|
|
732
732
|
/**
|
|
733
733
|
* @experimental
|
|
734
734
|
*
|
|
@@ -776,7 +776,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
776
776
|
}))
|
|
777
777
|
}).transform((config, ctx) => {
|
|
778
778
|
var _a, _b, _c;
|
|
779
|
-
const isDevEnv =
|
|
779
|
+
const isDevEnv = _chunkARFTQ5HYcjs.isDev.call(void 0, );
|
|
780
780
|
const sqliteBackend = _nullishCoalesce(((_a = config.sqlite) == null ? void 0 : _a.backend), () => ( ((_b = config.test) == null ? void 0 : _b.sqliteBackend)));
|
|
781
781
|
if (config.runtime === "wasm" && sqliteBackend === "local") {
|
|
782
782
|
ctx.addIssue({
|
|
@@ -786,7 +786,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
788
|
const sqlite = config.runtime === "wasm" && config.sqlite === void 0 ? { backend: "remote" } : config.sqlite;
|
|
789
|
-
const parsedEndpoint = config.endpoint ?
|
|
789
|
+
const parsedEndpoint = config.endpoint ? _chunkF7G5WHODcjs.tryParseEndpoint.call(void 0, ctx, {
|
|
790
790
|
endpoint: config.endpoint,
|
|
791
791
|
path: ["endpoint"],
|
|
792
792
|
namespace: config.namespace,
|
|
@@ -814,7 +814,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
814
814
|
);
|
|
815
815
|
const namespace = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.namespace), () => ( config.namespace)), () => ( "default"));
|
|
816
816
|
const token = _nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token));
|
|
817
|
-
const parsedPublicEndpoint = config.serverless.publicEndpoint ?
|
|
817
|
+
const parsedPublicEndpoint = config.serverless.publicEndpoint ? _chunkF7G5WHODcjs.tryParseEndpoint.call(void 0, ctx, {
|
|
818
818
|
endpoint: config.serverless.publicEndpoint,
|
|
819
819
|
path: ["serverless", "publicEndpoint"]
|
|
820
820
|
}) : void 0;
|
|
@@ -849,7 +849,7 @@ function buildActorNames(config) {
|
|
|
849
849
|
Object.keys(config.use).map((actorName) => {
|
|
850
850
|
const definition = config.use[actorName];
|
|
851
851
|
const options = _nullishCoalesce(definition.config.options, () => ( {}));
|
|
852
|
-
const runMeta =
|
|
852
|
+
const runMeta = _chunkIAH47VDZcjs.getRunMetadata.call(void 0, definition.config.run);
|
|
853
853
|
const metadata = {};
|
|
854
854
|
metadata.icon = _nullishCoalesce(options.icon, () => ( runMeta.icon));
|
|
855
855
|
metadata.name = _nullishCoalesce(options.name, () => ( runMeta.name));
|
|
@@ -917,7 +917,7 @@ var DocRegistryConfigSchema = _zod.z.object({
|
|
|
917
917
|
noWelcome: _zod.z.boolean().optional().describe("Disable the welcome message on startup. Default: false"),
|
|
918
918
|
sqlite: DocSqliteConfigSchema,
|
|
919
919
|
logging: _zod.z.object({
|
|
920
|
-
level:
|
|
920
|
+
level: _chunkARFTQ5HYcjs.LogLevelSchema.optional().describe(
|
|
921
921
|
"Log level for RivetKit. Default: 'warn'"
|
|
922
922
|
)
|
|
923
923
|
}).optional().describe("Logging configuration."),
|
|
@@ -2135,7 +2135,7 @@ var RunHandlerCoordinator = class {
|
|
|
2135
2135
|
this.#run = run;
|
|
2136
2136
|
}
|
|
2137
2137
|
get inspectorKind() {
|
|
2138
|
-
return
|
|
2138
|
+
return _chunkIAH47VDZcjs.getRunInspectorKind.call(void 0, this.#run);
|
|
2139
2139
|
}
|
|
2140
2140
|
async run(actorId, restart, callback) {
|
|
2141
2141
|
const state = this.#getOrCreate(actorId);
|
|
@@ -2243,7 +2243,7 @@ var RunHandlerCoordinator = class {
|
|
|
2243
2243
|
}
|
|
2244
2244
|
#initializeInspector(actorId, state) {
|
|
2245
2245
|
if (state.inspectorInitialized) return;
|
|
2246
|
-
const inspector =
|
|
2246
|
+
const inspector = _chunkIAH47VDZcjs.createRunInspector.call(void 0, this.#run, {
|
|
2247
2247
|
actorId,
|
|
2248
2248
|
control: this.#control(actorId, state)
|
|
2249
2249
|
});
|
|
@@ -3367,7 +3367,7 @@ async function cleanupNativeSleepRuntimeState(runtime, ctx, afterTrackedWorkDrai
|
|
|
3367
3367
|
}).catch((error) => {
|
|
3368
3368
|
logger2().warn({
|
|
3369
3369
|
msg: "deferred native sleep cleanup failed",
|
|
3370
|
-
error:
|
|
3370
|
+
error: _chunkARFTQ5HYcjs.stringifyError.call(void 0, error)
|
|
3371
3371
|
});
|
|
3372
3372
|
});
|
|
3373
3373
|
return;
|
|
@@ -3527,10 +3527,10 @@ function decodeValue(value) {
|
|
|
3527
3527
|
if (!value || value.length === 0) {
|
|
3528
3528
|
return void 0;
|
|
3529
3529
|
}
|
|
3530
|
-
return
|
|
3530
|
+
return _chunkARFTQ5HYcjs.decodeCborCompat.call(void 0, value);
|
|
3531
3531
|
}
|
|
3532
3532
|
function encodeValue(value) {
|
|
3533
|
-
return
|
|
3533
|
+
return _chunkARFTQ5HYcjs.encodeCborCompat.call(void 0, value);
|
|
3534
3534
|
}
|
|
3535
3535
|
function normalizeArgs(value) {
|
|
3536
3536
|
return Array.isArray(value) ? value : value === void 0 || value === null ? [] : [value];
|
|
@@ -3566,7 +3566,7 @@ function isStructuredBridgeError(error) {
|
|
|
3566
3566
|
return _chunkSPJORZMMcjs.isRivetErrorLike.call(void 0, error) && "__type" in error && (error.__type === "RivetError" || error.__type === "ActorError");
|
|
3567
3567
|
}
|
|
3568
3568
|
function encodeNativeCallbackError(error) {
|
|
3569
|
-
const structuredError = isStructuredBridgeError(error) ? error :
|
|
3569
|
+
const structuredError = isStructuredBridgeError(error) ? error : _chunkARFTQ5HYcjs.deconstructError.call(void 0, error, true);
|
|
3570
3570
|
const bridgeError = new Error(_chunkSPJORZMMcjs.encodeBridgeRivetError.call(void 0, structuredError), {
|
|
3571
3571
|
cause: error instanceof Error ? error : void 0
|
|
3572
3572
|
});
|
|
@@ -3617,7 +3617,7 @@ function decodeWorkflowCbor(data) {
|
|
|
3617
3617
|
return null;
|
|
3618
3618
|
}
|
|
3619
3619
|
try {
|
|
3620
|
-
return
|
|
3620
|
+
return _chunkARFTQ5HYcjs.decodeCborCompat.call(void 0, new Uint8Array(data));
|
|
3621
3621
|
} catch (e5) {
|
|
3622
3622
|
return null;
|
|
3623
3623
|
}
|
|
@@ -3730,7 +3730,7 @@ function serializeWorkflowHistoryForJson(data) {
|
|
|
3730
3730
|
if (data === null) {
|
|
3731
3731
|
return null;
|
|
3732
3732
|
}
|
|
3733
|
-
const history =
|
|
3733
|
+
const history = _chunkS3GXVCIMcjs.decodeWorkflowHistoryTransport.call(void 0, data);
|
|
3734
3734
|
return jsonSafe({
|
|
3735
3735
|
nameRegistry: [...history.nameRegistry],
|
|
3736
3736
|
entries: history.entries.map((entry) => ({
|
|
@@ -3847,7 +3847,7 @@ var NativeConnAdapter = class {
|
|
|
3847
3847
|
this.#ctx = ctx;
|
|
3848
3848
|
this.#queueHibernationRemoval = queueHibernationRemoval;
|
|
3849
3849
|
this.#assertCanMutateState = assertCanMutateState;
|
|
3850
|
-
this[
|
|
3850
|
+
this[_chunkIAH47VDZcjs.CONN_STATE_MANAGER_SYMBOL] = {
|
|
3851
3851
|
stateEnabled: true,
|
|
3852
3852
|
get state() {
|
|
3853
3853
|
return thisConn.state;
|
|
@@ -3864,7 +3864,7 @@ var NativeConnAdapter = class {
|
|
|
3864
3864
|
decodeValue(this.#runtime.connParams(this.#conn))
|
|
3865
3865
|
);
|
|
3866
3866
|
}
|
|
3867
|
-
[
|
|
3867
|
+
[_chunkIAH47VDZcjs.RAW_STATE_SYMBOL]() {
|
|
3868
3868
|
return this.#readState();
|
|
3869
3869
|
}
|
|
3870
3870
|
get state() {
|
|
@@ -3894,7 +3894,7 @@ var NativeConnAdapter = class {
|
|
|
3894
3894
|
},
|
|
3895
3895
|
(newValue) => {
|
|
3896
3896
|
assertCurrentState();
|
|
3897
|
-
|
|
3897
|
+
_chunkARFTQ5HYcjs.assertJsonCompatValue.call(void 0, newValue);
|
|
3898
3898
|
}
|
|
3899
3899
|
);
|
|
3900
3900
|
}
|
|
@@ -3902,7 +3902,7 @@ var NativeConnAdapter = class {
|
|
|
3902
3902
|
var _a;
|
|
3903
3903
|
(_a = this.#assertCanMutateState) == null ? void 0 : _a.call(this);
|
|
3904
3904
|
const nextValue = unwrapWriteThroughProxy(value);
|
|
3905
|
-
|
|
3905
|
+
_chunkARFTQ5HYcjs.assertJsonCompatValue.call(void 0, nextValue);
|
|
3906
3906
|
this.#writeState(nextValue, { writeNative: true });
|
|
3907
3907
|
}
|
|
3908
3908
|
initializeState(value) {
|
|
@@ -4919,7 +4919,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4919
4919
|
this.#databaseProvider = databaseProvider;
|
|
4920
4920
|
}
|
|
4921
4921
|
this.#request = request;
|
|
4922
|
-
this[
|
|
4922
|
+
this[_chunkIAH47VDZcjs.ACTOR_CONTEXT_INTERNAL_SYMBOL] = new NativeWorkflowRuntimeAdapter(
|
|
4923
4923
|
this
|
|
4924
4924
|
);
|
|
4925
4925
|
}
|
|
@@ -4949,7 +4949,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4949
4949
|
}
|
|
4950
4950
|
throw databaseClientNotReadyError();
|
|
4951
4951
|
}
|
|
4952
|
-
[
|
|
4952
|
+
[_chunkIAH47VDZcjs.RAW_STATE_SYMBOL]() {
|
|
4953
4953
|
if (!this.#stateEnabled) {
|
|
4954
4954
|
throw stateNotEnabledError();
|
|
4955
4955
|
}
|
|
@@ -4976,7 +4976,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4976
4976
|
},
|
|
4977
4977
|
(newValue) => {
|
|
4978
4978
|
assertCurrentState();
|
|
4979
|
-
|
|
4979
|
+
_chunkARFTQ5HYcjs.assertJsonCompatValue.call(void 0, newValue);
|
|
4980
4980
|
}
|
|
4981
4981
|
);
|
|
4982
4982
|
}
|
|
@@ -4988,7 +4988,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4988
4988
|
}
|
|
4989
4989
|
this.#assertCanMutateState();
|
|
4990
4990
|
const nextValue = unwrapWriteThroughProxy(value);
|
|
4991
|
-
|
|
4991
|
+
_chunkARFTQ5HYcjs.assertJsonCompatValue.call(void 0, nextValue);
|
|
4992
4992
|
this.#writeState(nextValue, { scheduleSave: true });
|
|
4993
4993
|
}
|
|
4994
4994
|
initializeState(value) {
|
|
@@ -5172,7 +5172,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5172
5172
|
log: {
|
|
5173
5173
|
debug: (obj) => logger2().debug(obj)
|
|
5174
5174
|
},
|
|
5175
|
-
nativeDatabaseProvider:
|
|
5175
|
+
nativeDatabaseProvider: _chunk4LRWLBTRcjs.registerNativeStateTransactionOpener.call(void 0,
|
|
5176
5176
|
{
|
|
5177
5177
|
open: async (requestedActorId) => {
|
|
5178
5178
|
void requestedActorId;
|
|
@@ -5195,7 +5195,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5195
5195
|
return this.#db;
|
|
5196
5196
|
}
|
|
5197
5197
|
#bindDatabaseClient(client) {
|
|
5198
|
-
return
|
|
5198
|
+
return _chunk4LRWLBTRcjs.bindNativeStateTransactionContext.call(void 0, client, {
|
|
5199
5199
|
enter: async () => await this.#enterStateTransaction(),
|
|
5200
5200
|
exit: (scope) => this.#exitStateTransaction(
|
|
5201
5201
|
scope
|
|
@@ -5399,7 +5399,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5399
5399
|
const trackedPromise = Promise.resolve(promise).catch((error) => {
|
|
5400
5400
|
logger2().warn({
|
|
5401
5401
|
msg: "keepAwake promise rejected",
|
|
5402
|
-
error:
|
|
5402
|
+
error: _chunkARFTQ5HYcjs.stringifyError.call(void 0, error)
|
|
5403
5403
|
});
|
|
5404
5404
|
}).then(() => null);
|
|
5405
5405
|
try {
|
|
@@ -5760,6 +5760,7 @@ function buildActorConfig(definition, registryConfig, runtimeKind) {
|
|
|
5760
5760
|
return {
|
|
5761
5761
|
name: options.name,
|
|
5762
5762
|
icon: options.icon,
|
|
5763
|
+
maxActions: options.maxActions,
|
|
5763
5764
|
hasDatabase: true,
|
|
5764
5765
|
remoteSqlite: usesRemoteSqlite,
|
|
5765
5766
|
sqliteProfiling,
|
|
@@ -5785,7 +5786,7 @@ function buildActorConfig(definition, registryConfig, runtimeKind) {
|
|
|
5785
5786
|
maxOutgoingMessageSize: registryConfig.maxOutgoingMessageSize,
|
|
5786
5787
|
preloadMaxWorkflowBytes: options.preloadMaxWorkflowBytes,
|
|
5787
5788
|
preloadMaxConnectionsBytes: options.preloadMaxConnectionsBytes,
|
|
5788
|
-
actions: Object.keys(
|
|
5789
|
+
actions: Object.keys(_chunkIAH47VDZcjs.flattenActionHandlers.call(void 0, config.actions)).sort().map((name) => ({ name })),
|
|
5789
5790
|
inspectorTabs: buildInspectorTabs(config.inspector, runtimeKind)
|
|
5790
5791
|
};
|
|
5791
5792
|
}
|
|
@@ -5861,10 +5862,10 @@ function validateInspectorTabSource(tabId, resolved) {
|
|
|
5861
5862
|
function buildNativeFactory(runtime, registryConfig, definition) {
|
|
5862
5863
|
var _a;
|
|
5863
5864
|
const config = definition.config;
|
|
5864
|
-
const databaseProvider = _nullishCoalesce(config.db, () => (
|
|
5865
|
-
const actionHandlers =
|
|
5865
|
+
const databaseProvider = _nullishCoalesce(config.db, () => ( _chunk4LRWLBTRcjs.db.call(void 0, )));
|
|
5866
|
+
const actionHandlers = _chunkIAH47VDZcjs.flattenActionHandlers.call(void 0, config.actions);
|
|
5866
5867
|
const schemaConfig = {
|
|
5867
|
-
actionInputSchemas:
|
|
5868
|
+
actionInputSchemas: _chunkIAH47VDZcjs.flattenActionInputSchemas.call(void 0,
|
|
5868
5869
|
config.actions,
|
|
5869
5870
|
config.actionInputSchemas
|
|
5870
5871
|
),
|
|
@@ -5872,19 +5873,19 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5872
5873
|
events: config.events,
|
|
5873
5874
|
queues: config.queues
|
|
5874
5875
|
};
|
|
5875
|
-
const createClient = () =>
|
|
5876
|
-
new (0,
|
|
5877
|
-
|
|
5876
|
+
const createClient = () => _chunkF7G5WHODcjs.createClientWithDriver.call(void 0,
|
|
5877
|
+
new (0, _chunkF7G5WHODcjs.RemoteEngineControlClient)(
|
|
5878
|
+
_chunkF7G5WHODcjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
|
|
5878
5879
|
),
|
|
5879
5880
|
{ encoding: "bare" }
|
|
5880
5881
|
);
|
|
5881
|
-
const run =
|
|
5882
|
-
const runHandlerCoordinator =
|
|
5882
|
+
const run = _chunkIAH47VDZcjs.getRunFunction.call(void 0, config.run);
|
|
5883
|
+
const runHandlerCoordinator = _chunkIAH47VDZcjs.getRunInspectorKind.call(void 0, config.run) === "workflow" ? new RunHandlerCoordinator(config.run) : void 0;
|
|
5883
5884
|
const getNativeWorkflowInspector = (ctx) => {
|
|
5884
5885
|
var _a2, _b;
|
|
5885
5886
|
const actorId = callNativeSync(() => runtime.actorId(ctx));
|
|
5886
5887
|
const restart = () => callNativeSync(() => runtime.actorRestartRunHandler(ctx));
|
|
5887
|
-
return _nullishCoalesce(((_a2 = runHandlerCoordinator == null ? void 0 : runHandlerCoordinator.getInspector(actorId, restart)) == null ? void 0 : _a2.workflow), () => ( ((_b =
|
|
5888
|
+
return _nullishCoalesce(((_a2 = runHandlerCoordinator == null ? void 0 : runHandlerCoordinator.getInspector(actorId, restart)) == null ? void 0 : _a2.workflow), () => ( ((_b = _chunkIAH47VDZcjs.getRunInspectorConfig.call(void 0, config.run, actorId)) == null ? void 0 : _b.workflow)));
|
|
5888
5889
|
};
|
|
5889
5890
|
const onStateChange = typeof config.onStateChange === "function" ? (actorCtx, nextState) => {
|
|
5890
5891
|
config.onStateChange(actorCtx, nextState);
|
|
@@ -6056,7 +6057,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6056
6057
|
400
|
|
6057
6058
|
);
|
|
6058
6059
|
}
|
|
6059
|
-
const cbor =
|
|
6060
|
+
const cbor = _chunkARFTQ5HYcjs.encodeCborCompat.call(void 0,
|
|
6060
6061
|
_nullishCoalesce(body.body, () => ( null))
|
|
6061
6062
|
);
|
|
6062
6063
|
const message = await runtime.actorQueueSend(ctx, name, cbor);
|
|
@@ -6424,7 +6425,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6424
6425
|
);
|
|
6425
6426
|
} finally {
|
|
6426
6427
|
runHandlerCoordinator == null ? void 0 : runHandlerCoordinator.destroy(actorId);
|
|
6427
|
-
|
|
6428
|
+
_chunkIAH47VDZcjs.disposeRunInspector.call(void 0, config.run, actorId);
|
|
6428
6429
|
await actorCtx.dispose();
|
|
6429
6430
|
}
|
|
6430
6431
|
}
|
|
@@ -6436,7 +6437,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6436
6437
|
const actorCtx = makeActorCtx(ctx);
|
|
6437
6438
|
const actorId = callNativeSync(() => runtime.actorId(ctx));
|
|
6438
6439
|
runHandlerCoordinator == null ? void 0 : runHandlerCoordinator.destroy(actorId);
|
|
6439
|
-
|
|
6440
|
+
_chunkIAH47VDZcjs.disposeRunInspector.call(void 0, config.run, actorId);
|
|
6440
6441
|
try {
|
|
6441
6442
|
if (typeof config.onDestroy === "function") {
|
|
6442
6443
|
await config.onDestroy(actorCtx);
|
|
@@ -6640,7 +6641,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6640
6641
|
new Response(null, { status: 404 })
|
|
6641
6642
|
);
|
|
6642
6643
|
}
|
|
6643
|
-
const rawConnParams = jsRequest.headers.get(
|
|
6644
|
+
const rawConnParams = jsRequest.headers.get(_chunkF7G5WHODcjs.HEADER_CONN_PARAMS);
|
|
6644
6645
|
let requestCtx;
|
|
6645
6646
|
let conn;
|
|
6646
6647
|
try {
|
|
@@ -6665,7 +6666,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6665
6666
|
requestCtx,
|
|
6666
6667
|
jsRequest
|
|
6667
6668
|
);
|
|
6668
|
-
if (!
|
|
6669
|
+
if (!_chunkF7G5WHODcjs.isResponseLike.call(void 0, response)) {
|
|
6669
6670
|
throw new Error(
|
|
6670
6671
|
"onRequest handler must return a Response"
|
|
6671
6672
|
);
|
|
@@ -6735,15 +6736,15 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6735
6736
|
}
|
|
6736
6737
|
);
|
|
6737
6738
|
})(),
|
|
6738
|
-
getWorkflowHistory:
|
|
6739
|
+
getWorkflowHistory: _chunkIAH47VDZcjs.hasRunInspectorConfig.call(void 0, config.run) ? wrapNativeCallback(
|
|
6739
6740
|
async (error, payload) => {
|
|
6740
6741
|
var _a2;
|
|
6741
6742
|
const { ctx } = unwrapTsfnPayload(error, payload);
|
|
6742
6743
|
const history = (_a2 = getNativeWorkflowInspector(ctx)) == null ? void 0 : _a2.getHistory();
|
|
6743
|
-
return history == null ? void 0 :
|
|
6744
|
+
return history == null ? void 0 : _chunkARFTQ5HYcjs.toUint8Array.call(void 0, history);
|
|
6744
6745
|
}
|
|
6745
6746
|
) : void 0,
|
|
6746
|
-
replayWorkflow:
|
|
6747
|
+
replayWorkflow: _chunkIAH47VDZcjs.hasRunInspectorConfig.call(void 0, config.run) ? wrapNativeCallback(
|
|
6747
6748
|
async (error, payload) => {
|
|
6748
6749
|
const { ctx, entryId } = unwrapTsfnPayload(
|
|
6749
6750
|
error,
|
|
@@ -6754,7 +6755,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6754
6755
|
return void 0;
|
|
6755
6756
|
}
|
|
6756
6757
|
const history = await _asyncNullishCoalesce(await workflowInspector.replayFromStep(entryId), async () => ( null));
|
|
6757
|
-
return history == null ? void 0 :
|
|
6758
|
+
return history == null ? void 0 : _chunkARFTQ5HYcjs.toUint8Array.call(void 0, history);
|
|
6758
6759
|
}
|
|
6759
6760
|
) : void 0,
|
|
6760
6761
|
actions: Object.fromEntries(
|
|
@@ -6878,7 +6879,7 @@ async function buildServeConfig(config) {
|
|
|
6878
6879
|
poolName: config.envoy.poolName,
|
|
6879
6880
|
handleInspectorHttpInRuntime: true,
|
|
6880
6881
|
serverlessBasePath: config.serverless.basePath,
|
|
6881
|
-
serverlessPackageVersion:
|
|
6882
|
+
serverlessPackageVersion: _chunkARFTQ5HYcjs.VERSION,
|
|
6882
6883
|
serverlessClientEndpoint: config.publicEndpoint,
|
|
6883
6884
|
serverlessClientNamespace: config.publicNamespace,
|
|
6884
6885
|
serverlessClientToken: config.publicToken,
|
|
@@ -6891,19 +6892,19 @@ async function buildServeConfig(config) {
|
|
|
6891
6892
|
} catch (error) {
|
|
6892
6893
|
logger2().warn({
|
|
6893
6894
|
msg: "could not resolve a local engine binary; if a local engine must be spawned it will fail with engine.binary_unavailable \u2014 set RIVET_ENGINE_BINARY_PATH or install the @rivetkit/engine-cli platform package",
|
|
6894
|
-
error:
|
|
6895
|
+
error: _chunkARFTQ5HYcjs.stringifyError.call(void 0, error)
|
|
6895
6896
|
});
|
|
6896
6897
|
}
|
|
6897
6898
|
serveConfig.engineHost = config.engineHost;
|
|
6898
6899
|
serveConfig.enginePort = config.enginePort;
|
|
6899
6900
|
if ((_a = config.test) == null ? void 0 : _a.enabled) {
|
|
6900
|
-
serveConfig.inspectorTestToken = _nullishCoalesce(
|
|
6901
|
+
serveConfig.inspectorTestToken = _nullishCoalesce(_chunkARFTQ5HYcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
|
|
6901
6902
|
}
|
|
6902
6903
|
return serveConfig;
|
|
6903
6904
|
}
|
|
6904
6905
|
async function buildRegistryWithRuntime(config, runtime) {
|
|
6905
6906
|
var _a;
|
|
6906
|
-
if (((_a = config.test) == null ? void 0 : _a.enabled) &&
|
|
6907
|
+
if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunkARFTQ5HYcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
|
|
6907
6908
|
trySetProcessEnv("_RIVET_TEST_INSPECTOR_TOKEN", "token");
|
|
6908
6909
|
}
|
|
6909
6910
|
if (runtime.kind === "napi") {
|
|
@@ -6958,7 +6959,7 @@ function createApplicationFetch(application) {
|
|
|
6958
6959
|
body
|
|
6959
6960
|
})
|
|
6960
6961
|
);
|
|
6961
|
-
if (!
|
|
6962
|
+
if (!_chunkF7G5WHODcjs.isResponseLike.call(void 0, response)) {
|
|
6962
6963
|
throw new TypeError(
|
|
6963
6964
|
"registry.listen() application fetch must return a Response"
|
|
6964
6965
|
);
|
|
@@ -6995,7 +6996,7 @@ var Registry = class {
|
|
|
6995
6996
|
var _a;
|
|
6996
6997
|
this.#config = config;
|
|
6997
6998
|
if ((_a = config.logging) == null ? void 0 : _a.baseLogger) {
|
|
6998
|
-
|
|
6999
|
+
_chunkARFTQ5HYcjs.configureBaseLogger.call(void 0, config.logging.baseLogger);
|
|
6999
7000
|
}
|
|
7000
7001
|
this.#buildConfiguredRegistry = _nullishCoalesce((deps == null ? void 0 : deps.buildConfiguredRegistry), () => ( buildConfiguredRegistry));
|
|
7001
7002
|
this.routes = {
|
|
@@ -7221,11 +7222,11 @@ var Registry = class {
|
|
|
7221
7222
|
* ```
|
|
7222
7223
|
*/
|
|
7223
7224
|
async listen(opts = {}) {
|
|
7224
|
-
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => (
|
|
7225
|
-
const publicDir = _nullishCoalesce(opts.publicDir, () => (
|
|
7225
|
+
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => ( _chunkARFTQ5HYcjs.parsePortEnv.call(void 0, process.env.RIVET_PORT))), () => ( 3e3));
|
|
7226
|
+
const publicDir = _nullishCoalesce(opts.publicDir, () => ( _chunkARFTQ5HYcjs.getRivetkitPublicDir.call(void 0, )));
|
|
7226
7227
|
const config = this.parseConfig();
|
|
7227
7228
|
const application = opts.application ? createApplicationFetch(opts.application) : void 0;
|
|
7228
|
-
if (application &&
|
|
7229
|
+
if (application && _chunkARFTQ5HYcjs.getRivetkitRuntimeMode.call(void 0, ) !== "serverless") {
|
|
7229
7230
|
if (config.runtime === "wasm") {
|
|
7230
7231
|
throw new Error(
|
|
7231
7232
|
"registry.listen() requires the native runtime; use an application-owned HTTP server with WebAssembly"
|
|
@@ -7299,7 +7300,7 @@ var Registry = class {
|
|
|
7299
7300
|
return jsonRouteResponse(503, {
|
|
7300
7301
|
status: "not_started",
|
|
7301
7302
|
runtime: "rivetkit",
|
|
7302
|
-
version:
|
|
7303
|
+
version: _chunkARFTQ5HYcjs.VERSION
|
|
7303
7304
|
});
|
|
7304
7305
|
}
|
|
7305
7306
|
const { runtime, registry } = configured;
|
|
@@ -7307,7 +7308,7 @@ var Registry = class {
|
|
|
7307
7308
|
return jsonRouteResponse(501, {
|
|
7308
7309
|
status: "unsupported",
|
|
7309
7310
|
runtime: "rivetkit",
|
|
7310
|
-
version:
|
|
7311
|
+
version: _chunkARFTQ5HYcjs.VERSION
|
|
7311
7312
|
});
|
|
7312
7313
|
}
|
|
7313
7314
|
const response = await runtime.registryHealth(registry);
|
|
@@ -7554,7 +7555,7 @@ var Registry = class {
|
|
|
7554
7555
|
);
|
|
7555
7556
|
}
|
|
7556
7557
|
if (this.#runtimeReadyPromise) return this.#runtimeReadyPromise;
|
|
7557
|
-
if (
|
|
7558
|
+
if (_chunkARFTQ5HYcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
7558
7559
|
return Promise.reject(
|
|
7559
7560
|
new Error(
|
|
7560
7561
|
"registry.startAndWait() requires envoy runtime mode; serverless registries become ready per request"
|
|
@@ -7624,8 +7625,8 @@ var Registry = class {
|
|
|
7624
7625
|
* ```
|
|
7625
7626
|
*/
|
|
7626
7627
|
start() {
|
|
7627
|
-
if (
|
|
7628
|
-
const publicDir = _nullishCoalesce(
|
|
7628
|
+
if (_chunkARFTQ5HYcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
7629
|
+
const publicDir = _nullishCoalesce(_chunkARFTQ5HYcjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
|
|
7629
7630
|
this.listen({ publicDir }).catch((error) => {
|
|
7630
7631
|
logger2().error({ error }, "auto-listen failed; exiting");
|
|
7631
7632
|
if (typeof process !== "undefined" && typeof process.exit === "function") {
|
|
@@ -7646,7 +7647,7 @@ var Registry = class {
|
|
|
7646
7647
|
};
|
|
7647
7648
|
console.log();
|
|
7648
7649
|
console.log(
|
|
7649
|
-
` RivetKit ${
|
|
7650
|
+
` RivetKit ${_chunkARFTQ5HYcjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
|
|
7650
7651
|
);
|
|
7651
7652
|
if (config.namespace !== "default") {
|
|
7652
7653
|
logLine("Namespace", config.namespace);
|
|
@@ -7722,5 +7723,5 @@ function setup(input) {
|
|
|
7722
7723
|
|
|
7723
7724
|
|
|
7724
7725
|
|
|
7725
|
-
exports.ALLOWED_PUBLIC_HEADERS =
|
|
7726
|
+
exports.ALLOWED_PUBLIC_HEADERS = _chunkF7G5WHODcjs.ALLOWED_PUBLIC_HEADERS; exports.ActorDefinition = ActorDefinition; exports.ActorError = _chunkSPJORZMMcjs.RivetError; exports.ActorsSchema = ActorsSchema; exports.DocConfigurePoolSchema = DocConfigurePoolSchema; exports.DocEnvoyConfigSchema = DocEnvoyConfigSchema; exports.DocRegistryConfigSchema = DocRegistryConfigSchema; exports.DocServerlessConfigSchema = DocServerlessConfigSchema; exports.DocSqliteConfigSchema = DocSqliteConfigSchema; exports.InlineWebSocketAdapter = InlineWebSocketAdapter; exports.Registry = Registry; exports.RegistryConfigSchema = RegistryConfigSchema; exports.RivetError = _chunkSPJORZMMcjs.RivetError; exports.RuntimeKindSchema = RuntimeKindSchema; exports.SqliteBackendSchema = SqliteBackendSchema; exports.SqliteConfigSchema = SqliteConfigSchema; exports.TestConfigSchema = TestConfigSchema; exports.UserError = _chunkSPJORZMMcjs.UserError; exports.WasmRuntimeConfigSchema = WasmRuntimeConfigSchema; exports.actor = actor; exports.buildActorNames = buildActorNames; exports.createClientWithDriver = _chunkF7G5WHODcjs.createClientWithDriver; exports.defineRunHandler = _chunkIAH47VDZcjs.defineRunHandler; exports.event = event; exports.isStaticActorDefinition = isStaticActorDefinition; exports.isStaticActorInstance = isStaticActorInstance; exports.lookupInRegistry = lookupInRegistry; exports.noopNext = _chunkARFTQ5HYcjs.noopNext; exports.queue = queue; exports.setup = setup; exports.toUint8Array = _chunkARFTQ5HYcjs.toUint8Array;
|
|
7726
7727
|
//# sourceMappingURL=mod.cjs.map
|