rivetkit 2.3.2 → 2.3.3-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/client.js +1 -1
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +1 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/agent-os/index.cjs +1 -1
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.js +1 -1
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-VBEZ57VX.js → chunk-2ZBWR7HC.js} +2 -2
- package/dist/tsup/{chunk-2WOKGTL3.js → chunk-3UWWME7J.js} +2 -2
- package/dist/tsup/{chunk-VG6SAPWF.cjs → chunk-CFVNICL7.cjs} +7 -7
- package/dist/tsup/{chunk-VG6SAPWF.cjs.map → chunk-CFVNICL7.cjs.map} +1 -1
- package/dist/tsup/{chunk-S4ZHBMD7.cjs → chunk-CN4IAGVP.cjs} +141 -141
- package/dist/tsup/{chunk-S4ZHBMD7.cjs.map → chunk-CN4IAGVP.cjs.map} +1 -1
- package/dist/tsup/{chunk-TJVQGVTZ.js → chunk-D5KMS3WU.js} +2 -2
- package/dist/tsup/chunk-D5KMS3WU.js.map +1 -0
- package/dist/tsup/{chunk-BDXKVROD.js → chunk-EIB2XNTL.js} +4 -4
- package/dist/tsup/{chunk-4PQAFXDX.cjs → chunk-GMD47RV5.cjs} +5 -5
- package/dist/tsup/{chunk-4PQAFXDX.cjs.map → chunk-GMD47RV5.cjs.map} +1 -1
- package/dist/tsup/{chunk-2OIYUYNN.js → chunk-J7NGTEDW.js} +3 -3
- package/dist/tsup/{chunk-GFXUYXMK.cjs → chunk-KVSK67EL.cjs} +10 -10
- package/dist/tsup/{chunk-GFXUYXMK.cjs.map → chunk-KVSK67EL.cjs.map} +1 -1
- package/dist/tsup/{chunk-RUBJWXFW.cjs → chunk-MLFI5BLT.cjs} +2 -2
- package/dist/tsup/chunk-MLFI5BLT.cjs.map +1 -0
- package/dist/tsup/{chunk-MZJVAV3I.cjs → chunk-T5YE5THK.cjs} +4 -4
- package/dist/tsup/{chunk-MZJVAV3I.cjs.map → chunk-T5YE5THK.cjs.map} +1 -1
- package/dist/tsup/{chunk-HINDZOY3.js → chunk-TXO4XNNB.js} +2 -2
- package/dist/tsup/{chunk-FRVQ34UV.cjs → chunk-VEJGWALU.cjs} +3 -3
- package/dist/tsup/{chunk-FRVQ34UV.cjs.map → chunk-VEJGWALU.cjs.map} +1 -1
- package/dist/tsup/{chunk-ASKKONXG.js → chunk-VNWYKWBM.js} +7 -7
- package/dist/tsup/client/mod.cjs +7 -7
- package/dist/tsup/client/mod.cjs.map +1 -1
- package/dist/tsup/client/mod.js +6 -6
- 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/inspector/mod.cjs +5 -5
- package/dist/tsup/inspector/mod.js +4 -4
- package/dist/tsup/mod.cjs +61 -61
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.js +6 -6
- package/dist/tsup/test/mod.cjs +10 -10
- package/dist/tsup/test/mod.js +6 -6
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +7 -7
- package/dist/tsup/workflow/mod.js +4 -4
- package/package.json +8 -8
- package/dist/tsup/chunk-RUBJWXFW.cjs.map +0 -1
- package/dist/tsup/chunk-TJVQGVTZ.js.map +0 -1
- /package/dist/tsup/{chunk-VBEZ57VX.js.map → chunk-2ZBWR7HC.js.map} +0 -0
- /package/dist/tsup/{chunk-2WOKGTL3.js.map → chunk-3UWWME7J.js.map} +0 -0
- /package/dist/tsup/{chunk-BDXKVROD.js.map → chunk-EIB2XNTL.js.map} +0 -0
- /package/dist/tsup/{chunk-2OIYUYNN.js.map → chunk-J7NGTEDW.js.map} +0 -0
- /package/dist/tsup/{chunk-HINDZOY3.js.map → chunk-TXO4XNNB.js.map} +0 -0
- /package/dist/tsup/{chunk-ASKKONXG.js.map → chunk-VNWYKWBM.js.map} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWorkflowInspectorAdapter
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-EIB2XNTL.js";
|
|
4
4
|
import {
|
|
5
5
|
decodeWorkflowHistoryTransport,
|
|
6
6
|
encodeWorkflowHistoryTransport
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-3UWWME7J.js";
|
|
8
|
+
import "../chunk-2ZBWR7HC.js";
|
|
9
|
+
import "../chunk-D5KMS3WU.js";
|
|
10
10
|
import "../chunk-ZZ3WBRPD.js";
|
|
11
11
|
|
|
12
12
|
// src/common/bare/generated/inspector/v4.ts
|
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 _chunkT5YE5THKcjs = require('./chunk-T5YE5THK.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -20,7 +20,7 @@ var _chunk3MHDOUD7cjs = require('./chunk-3MHDOUD7.cjs');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkCN4IAGVPcjs = require('./chunk-CN4IAGVP.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -33,8 +33,9 @@ var _chunkVE2X4KMGcjs = require('./chunk-VE2X4KMG.cjs');
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
var
|
|
37
|
-
require('./chunk-
|
|
36
|
+
var _chunkGMD47RV5cjs = require('./chunk-GMD47RV5.cjs');
|
|
37
|
+
require('./chunk-ZA7FLHKH.cjs');
|
|
38
|
+
require('./chunk-VEJGWALU.cjs');
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
|
|
@@ -63,7 +64,7 @@ require('./chunk-FRVQ34UV.cjs');
|
|
|
63
64
|
|
|
64
65
|
|
|
65
66
|
|
|
66
|
-
var
|
|
67
|
+
var _chunkMLFI5BLTcjs = require('./chunk-MLFI5BLT.cjs');
|
|
67
68
|
|
|
68
69
|
|
|
69
70
|
|
|
@@ -76,11 +77,10 @@ var _chunkRUBJWXFWcjs = require('./chunk-RUBJWXFW.cjs');
|
|
|
76
77
|
|
|
77
78
|
|
|
78
79
|
var _chunk4FC7TVS6cjs = require('./chunk-4FC7TVS6.cjs');
|
|
79
|
-
require('./chunk-ZA7FLHKH.cjs');
|
|
80
80
|
|
|
81
81
|
// src/actor/log.ts
|
|
82
82
|
function loggerWithoutContext() {
|
|
83
|
-
return
|
|
83
|
+
return _chunkMLFI5BLTcjs.getLogger.call(void 0, "actor-runtime");
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// src/actor/definition.ts
|
|
@@ -212,7 +212,7 @@ function validateSchemaSync(schemas, key, data) {
|
|
|
212
212
|
var _virtualwebsocket = require('@rivetkit/virtual-websocket');
|
|
213
213
|
var _ws = require('hono/ws');
|
|
214
214
|
function logger() {
|
|
215
|
-
return
|
|
215
|
+
return _chunkMLFI5BLTcjs.getLogger.call(void 0, "inline-websocket-adapter");
|
|
216
216
|
}
|
|
217
217
|
var InlineWebSocketAdapter = class {
|
|
218
218
|
#handler;
|
|
@@ -383,7 +383,7 @@ function isLocalEngineEndpoint(endpoint) {
|
|
|
383
383
|
|
|
384
384
|
// src/registry/log.ts
|
|
385
385
|
function logger2() {
|
|
386
|
-
return
|
|
386
|
+
return _chunkMLFI5BLTcjs.getLogger.call(void 0, "registry");
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
// src/serverless/configure.ts
|
|
@@ -429,8 +429,8 @@ async function configureServerlessPool(config) {
|
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
431
|
const customConfig = config.configurePool;
|
|
432
|
-
const clientConfig =
|
|
433
|
-
const dcsRes = await
|
|
432
|
+
const clientConfig = _chunkCN4IAGVPcjs.convertRegistryConfigToClientConfig.call(void 0, config);
|
|
433
|
+
const dcsRes = await _chunkCN4IAGVPcjs.getDatacenters.call(void 0, clientConfig);
|
|
434
434
|
const poolName = _nullishCoalesce(customConfig.name, () => ( "default"));
|
|
435
435
|
const serverlessToken = _nullishCoalesce(config.token, () => ( config.publicToken));
|
|
436
436
|
const headers = {
|
|
@@ -452,7 +452,7 @@ async function configureServerlessPool(config) {
|
|
|
452
452
|
metadata: _nullishCoalesce(customConfig.metadata, () => ( {})),
|
|
453
453
|
drain_on_version_upgrade: _nullishCoalesce(customConfig.drainOnVersionUpgrade, () => ( true))
|
|
454
454
|
};
|
|
455
|
-
await
|
|
455
|
+
await _chunkCN4IAGVPcjs.updateRunnerConfig.call(void 0, clientConfig, poolName, {
|
|
456
456
|
datacenters: Object.fromEntries(
|
|
457
457
|
dcsRes.datacenters.map((dc) => [dc.name, serverlessConfig])
|
|
458
458
|
)
|
|
@@ -469,7 +469,7 @@ async function configureServerlessPool(config) {
|
|
|
469
469
|
logger2().warn({
|
|
470
470
|
msg: "serverless pool configuration attempt failed",
|
|
471
471
|
attempts,
|
|
472
|
-
error:
|
|
472
|
+
error: _chunkMLFI5BLTcjs.stringifyError.call(void 0, error)
|
|
473
473
|
});
|
|
474
474
|
await sleep(CONFIGURE_RETRY_DELAY_MS);
|
|
475
475
|
}
|
|
@@ -477,7 +477,7 @@ async function configureServerlessPool(config) {
|
|
|
477
477
|
logger2().error({
|
|
478
478
|
msg: "failed to configure serverless pool, validate endpoint is configured correctly then restart this process",
|
|
479
479
|
attempts,
|
|
480
|
-
error:
|
|
480
|
+
error: _chunkMLFI5BLTcjs.stringifyError.call(void 0, lastError)
|
|
481
481
|
});
|
|
482
482
|
throw lastError;
|
|
483
483
|
}
|
|
@@ -489,20 +489,20 @@ var _zod = require('zod');
|
|
|
489
489
|
var _v4 = require('zod/v4');
|
|
490
490
|
var warnedMissingVersion = false;
|
|
491
491
|
var EnvoyConfigSchema = _v4.z.object({
|
|
492
|
-
poolName: _v4.z.string().default(() => _nullishCoalesce(
|
|
492
|
+
poolName: _v4.z.string().default(() => _nullishCoalesce(_chunkMLFI5BLTcjs.getRivetPool.call(void 0, ), () => ( "default"))),
|
|
493
493
|
version: _v4.z.number().default(() => {
|
|
494
|
-
const version =
|
|
494
|
+
const version = _chunkMLFI5BLTcjs.getRivetEnvoyVersion.call(void 0, );
|
|
495
495
|
if (version !== void 0) return version;
|
|
496
|
-
if (
|
|
496
|
+
if (_chunkMLFI5BLTcjs.getNodeEnv.call(void 0, ) === "production" && !warnedMissingVersion) {
|
|
497
497
|
warnedMissingVersion = true;
|
|
498
|
-
|
|
498
|
+
_chunkMLFI5BLTcjs.getLogger.call(void 0, "rivetkit").error(
|
|
499
499
|
"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
500
|
);
|
|
501
501
|
}
|
|
502
502
|
return 1;
|
|
503
503
|
}),
|
|
504
504
|
// Deprecated.
|
|
505
|
-
totalSlots: _v4.z.number().default(() => _nullishCoalesce(
|
|
505
|
+
totalSlots: _v4.z.number().default(() => _nullishCoalesce(_chunkMLFI5BLTcjs.getRivetTotalSlots.call(void 0, ), () => ( 1e5))),
|
|
506
506
|
envoyKey: _v4.z.string().optional()
|
|
507
507
|
});
|
|
508
508
|
|
|
@@ -540,7 +540,7 @@ var ServerlessConfigSchema = _v4.z.object({
|
|
|
540
540
|
*
|
|
541
541
|
* Can also be set via RIVET_PUBLIC_ENDPOINT environment variable.
|
|
542
542
|
*/
|
|
543
|
-
publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
543
|
+
publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkMLFI5BLTcjs.getRivetPublicEndpoint.call(void 0, )))),
|
|
544
544
|
/**
|
|
545
545
|
* Token that clients should use when connecting via the public endpoint.
|
|
546
546
|
*
|
|
@@ -548,7 +548,7 @@ var ServerlessConfigSchema = _v4.z.object({
|
|
|
548
548
|
*
|
|
549
549
|
* Can also be specified in the publicEndpoint URL as `https://namespace:token@host`.
|
|
550
550
|
*/
|
|
551
|
-
publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
551
|
+
publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkMLFI5BLTcjs.getRivetPublicToken.call(void 0, ))))
|
|
552
552
|
// There is no publicNamespace config option because the frontend and backend
|
|
553
553
|
// cannot use different namespaces. The namespace is extracted from the
|
|
554
554
|
// publicEndpoint URL auth syntax if provided.
|
|
@@ -602,7 +602,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
602
602
|
* Runtime binding to use for RivetKit core.
|
|
603
603
|
* */
|
|
604
604
|
runtime: RuntimeKindSchema.optional().transform((val, ctx) => {
|
|
605
|
-
const rawRuntime = _nullishCoalesce(val, () => (
|
|
605
|
+
const rawRuntime = _nullishCoalesce(val, () => ( _chunkMLFI5BLTcjs.getRivetkitRuntime.call(void 0, )));
|
|
606
606
|
if (rawRuntime === void 0) {
|
|
607
607
|
return "auto";
|
|
608
608
|
}
|
|
@@ -639,7 +639,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
639
639
|
* */
|
|
640
640
|
logging: _zod.z.object({
|
|
641
641
|
baseLogger: _zod.z.custom().optional(),
|
|
642
|
-
level:
|
|
642
|
+
level: _chunkMLFI5BLTcjs.LogLevelSchema.optional()
|
|
643
643
|
}).optional().default(() => ({})),
|
|
644
644
|
// MARK: Routing
|
|
645
645
|
// // This is a function to allow for lazy configuration of upgradeWebSocket on the
|
|
@@ -657,9 +657,9 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
657
657
|
*
|
|
658
658
|
* Can also be set via RIVET_ENDPOINT environment variables.
|
|
659
659
|
*/
|
|
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, () => (
|
|
660
|
+
endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => ( _chunkMLFI5BLTcjs.getRivetEngine.call(void 0, ))), () => ( _chunkMLFI5BLTcjs.getRivetEndpoint.call(void 0, )))),
|
|
661
|
+
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkMLFI5BLTcjs.getRivetToken.call(void 0, )))),
|
|
662
|
+
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkMLFI5BLTcjs.getRivetNamespace.call(void 0, )))),
|
|
663
663
|
headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional().default({}),
|
|
664
664
|
// MARK: Client
|
|
665
665
|
// TODO:
|
|
@@ -699,21 +699,21 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
699
699
|
*
|
|
700
700
|
* Starts the full Rust engine process locally.
|
|
701
701
|
*/
|
|
702
|
-
startEngine: _zod.z.boolean().default(() =>
|
|
702
|
+
startEngine: _zod.z.boolean().default(() => _chunkMLFI5BLTcjs.getRivetRunEngine.call(void 0, )),
|
|
703
703
|
/**
|
|
704
704
|
* @experimental
|
|
705
705
|
*
|
|
706
706
|
* Host to bind the spawned local engine process to.
|
|
707
707
|
*/
|
|
708
|
-
engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
708
|
+
engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkMLFI5BLTcjs.getRivetRunEngineHost.call(void 0, ), () => ( ENGINE_HOST))),
|
|
709
709
|
/**
|
|
710
710
|
* @experimental
|
|
711
711
|
*
|
|
712
712
|
* Port to bind the spawned local engine process to.
|
|
713
713
|
*/
|
|
714
|
-
enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(
|
|
714
|
+
enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(_chunkMLFI5BLTcjs.getRivetRunEnginePort.call(void 0, ), () => ( ENGINE_PORT))),
|
|
715
715
|
/** @experimental */
|
|
716
|
-
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
716
|
+
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkMLFI5BLTcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunkMLFI5BLTcjs.VERSION))),
|
|
717
717
|
/**
|
|
718
718
|
* @experimental
|
|
719
719
|
*
|
|
@@ -761,7 +761,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
761
761
|
}))
|
|
762
762
|
}).transform((config, ctx) => {
|
|
763
763
|
var _a, _b, _c;
|
|
764
|
-
const isDevEnv =
|
|
764
|
+
const isDevEnv = _chunkMLFI5BLTcjs.isDev.call(void 0, );
|
|
765
765
|
const sqliteBackend = _nullishCoalesce(((_a = config.sqlite) == null ? void 0 : _a.backend), () => ( ((_b = config.test) == null ? void 0 : _b.sqliteBackend)));
|
|
766
766
|
if (config.runtime === "wasm" && sqliteBackend === "local") {
|
|
767
767
|
ctx.addIssue({
|
|
@@ -771,7 +771,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
771
771
|
});
|
|
772
772
|
}
|
|
773
773
|
const sqlite = config.runtime === "wasm" && config.sqlite === void 0 ? { backend: "remote" } : config.sqlite;
|
|
774
|
-
const parsedEndpoint = config.endpoint ?
|
|
774
|
+
const parsedEndpoint = config.endpoint ? _chunkCN4IAGVPcjs.tryParseEndpoint.call(void 0, ctx, {
|
|
775
775
|
endpoint: config.endpoint,
|
|
776
776
|
path: ["endpoint"],
|
|
777
777
|
namespace: config.namespace,
|
|
@@ -799,7 +799,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
799
799
|
);
|
|
800
800
|
const namespace = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.namespace), () => ( config.namespace)), () => ( "default"));
|
|
801
801
|
const token = _nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token));
|
|
802
|
-
const parsedPublicEndpoint = config.serverless.publicEndpoint ?
|
|
802
|
+
const parsedPublicEndpoint = config.serverless.publicEndpoint ? _chunkCN4IAGVPcjs.tryParseEndpoint.call(void 0, ctx, {
|
|
803
803
|
endpoint: config.serverless.publicEndpoint,
|
|
804
804
|
path: ["serverless", "publicEndpoint"]
|
|
805
805
|
}) : void 0;
|
|
@@ -927,7 +927,7 @@ var DocRegistryConfigSchema = _zod.z.object({
|
|
|
927
927
|
noWelcome: _zod.z.boolean().optional().describe("Disable the welcome message on startup. Default: false"),
|
|
928
928
|
sqlite: DocSqliteConfigSchema,
|
|
929
929
|
logging: _zod.z.object({
|
|
930
|
-
level:
|
|
930
|
+
level: _chunkMLFI5BLTcjs.LogLevelSchema.optional().describe(
|
|
931
931
|
"Log level for RivetKit. Default: 'warn'"
|
|
932
932
|
)
|
|
933
933
|
}).optional().describe("Logging configuration."),
|
|
@@ -2650,7 +2650,7 @@ async function cleanupNativeSleepRuntimeState(runtime, ctx, afterTrackedWorkDrai
|
|
|
2650
2650
|
}).catch((error) => {
|
|
2651
2651
|
logger2().warn({
|
|
2652
2652
|
msg: "deferred native sleep cleanup failed",
|
|
2653
|
-
error:
|
|
2653
|
+
error: _chunkMLFI5BLTcjs.stringifyError.call(void 0, error)
|
|
2654
2654
|
});
|
|
2655
2655
|
});
|
|
2656
2656
|
return;
|
|
@@ -2760,10 +2760,10 @@ function decodeValue(value) {
|
|
|
2760
2760
|
if (!value || value.length === 0) {
|
|
2761
2761
|
return void 0;
|
|
2762
2762
|
}
|
|
2763
|
-
return
|
|
2763
|
+
return _chunkGMD47RV5cjs.decodeCborCompat.call(void 0, value);
|
|
2764
2764
|
}
|
|
2765
2765
|
function encodeValue(value) {
|
|
2766
|
-
return
|
|
2766
|
+
return _chunkGMD47RV5cjs.encodeCborCompat.call(void 0, value);
|
|
2767
2767
|
}
|
|
2768
2768
|
function normalizeArgs(value) {
|
|
2769
2769
|
return Array.isArray(value) ? value : value === void 0 || value === null ? [] : [value];
|
|
@@ -2799,7 +2799,7 @@ function isStructuredBridgeError(error) {
|
|
|
2799
2799
|
return _chunk4FC7TVS6cjs.isRivetErrorLike.call(void 0, error) && "__type" in error && (error.__type === "RivetError" || error.__type === "ActorError");
|
|
2800
2800
|
}
|
|
2801
2801
|
function encodeNativeCallbackError(error) {
|
|
2802
|
-
const structuredError = isStructuredBridgeError(error) ? error :
|
|
2802
|
+
const structuredError = isStructuredBridgeError(error) ? error : _chunkMLFI5BLTcjs.deconstructError.call(void 0, error, true);
|
|
2803
2803
|
const bridgeError = new Error(_chunk4FC7TVS6cjs.encodeBridgeRivetError.call(void 0, structuredError), {
|
|
2804
2804
|
cause: error instanceof Error ? error : void 0
|
|
2805
2805
|
});
|
|
@@ -2849,7 +2849,7 @@ function decodeWorkflowCbor(data) {
|
|
|
2849
2849
|
return null;
|
|
2850
2850
|
}
|
|
2851
2851
|
try {
|
|
2852
|
-
return
|
|
2852
|
+
return _chunkGMD47RV5cjs.decodeCborCompat.call(void 0, new Uint8Array(data));
|
|
2853
2853
|
} catch (e4) {
|
|
2854
2854
|
return null;
|
|
2855
2855
|
}
|
|
@@ -2954,7 +2954,7 @@ function serializeWorkflowHistoryForJson(data) {
|
|
|
2954
2954
|
if (data === null) {
|
|
2955
2955
|
return null;
|
|
2956
2956
|
}
|
|
2957
|
-
const history =
|
|
2957
|
+
const history = _chunkT5YE5THKcjs.decodeWorkflowHistoryTransport.call(void 0, data);
|
|
2958
2958
|
return jsonSafe({
|
|
2959
2959
|
nameRegistry: [...history.nameRegistry],
|
|
2960
2960
|
entries: history.entries.map((entry) => ({
|
|
@@ -3095,12 +3095,12 @@ var NativeConnAdapter = class {
|
|
|
3095
3095
|
this.#writeState(nextValue, { writeNative: true });
|
|
3096
3096
|
},
|
|
3097
3097
|
(newValue) => {
|
|
3098
|
-
|
|
3098
|
+
_chunkGMD47RV5cjs.assertJsonCompatValue.call(void 0, newValue);
|
|
3099
3099
|
}
|
|
3100
3100
|
);
|
|
3101
3101
|
}
|
|
3102
3102
|
set state(value) {
|
|
3103
|
-
|
|
3103
|
+
_chunkGMD47RV5cjs.assertJsonCompatValue.call(void 0, value);
|
|
3104
3104
|
this.#writeState(value, { writeNative: true });
|
|
3105
3105
|
}
|
|
3106
3106
|
initializeState(value) {
|
|
@@ -4050,7 +4050,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4050
4050
|
},
|
|
4051
4051
|
(newValue) => {
|
|
4052
4052
|
this.#assertCanMutateState();
|
|
4053
|
-
|
|
4053
|
+
_chunkGMD47RV5cjs.assertJsonCompatValue.call(void 0, newValue);
|
|
4054
4054
|
}
|
|
4055
4055
|
);
|
|
4056
4056
|
}
|
|
@@ -4061,7 +4061,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4061
4061
|
throw stateNotEnabledError();
|
|
4062
4062
|
}
|
|
4063
4063
|
this.#assertCanMutateState();
|
|
4064
|
-
|
|
4064
|
+
_chunkGMD47RV5cjs.assertJsonCompatValue.call(void 0, value);
|
|
4065
4065
|
this.#writeState(value, { scheduleSave: true });
|
|
4066
4066
|
}
|
|
4067
4067
|
initializeState(value) {
|
|
@@ -4326,7 +4326,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4326
4326
|
const trackedPromise = Promise.resolve(promise).catch((error) => {
|
|
4327
4327
|
logger2().warn({
|
|
4328
4328
|
msg: "keepAwake promise rejected",
|
|
4329
|
-
error:
|
|
4329
|
+
error: _chunkMLFI5BLTcjs.stringifyError.call(void 0, error)
|
|
4330
4330
|
});
|
|
4331
4331
|
}).then(() => null);
|
|
4332
4332
|
try {
|
|
@@ -4781,9 +4781,9 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
4781
4781
|
const actionHandlers = Object.fromEntries(
|
|
4782
4782
|
Object.entries(_nullishCoalesce(config.actions, () => ( {}))).map(([name, handler]) => [name, handler])
|
|
4783
4783
|
);
|
|
4784
|
-
const createClient = () =>
|
|
4785
|
-
new (0,
|
|
4786
|
-
|
|
4784
|
+
const createClient = () => _chunkCN4IAGVPcjs.createClientWithDriver.call(void 0,
|
|
4785
|
+
new (0, _chunkCN4IAGVPcjs.RemoteEngineControlClient)(
|
|
4786
|
+
_chunkCN4IAGVPcjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
|
|
4787
4787
|
),
|
|
4788
4788
|
{ encoding: "bare" }
|
|
4789
4789
|
);
|
|
@@ -5507,7 +5507,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5507
5507
|
new Response(null, { status: 404 })
|
|
5508
5508
|
);
|
|
5509
5509
|
}
|
|
5510
|
-
const rawConnParams = jsRequest.headers.get(
|
|
5510
|
+
const rawConnParams = jsRequest.headers.get(_chunkCN4IAGVPcjs.HEADER_CONN_PARAMS);
|
|
5511
5511
|
let requestCtx;
|
|
5512
5512
|
let conn;
|
|
5513
5513
|
try {
|
|
@@ -5734,7 +5734,7 @@ async function buildServeConfig(config) {
|
|
|
5734
5734
|
poolName: config.envoy.poolName,
|
|
5735
5735
|
handleInspectorHttpInRuntime: true,
|
|
5736
5736
|
serverlessBasePath: config.serverless.basePath,
|
|
5737
|
-
serverlessPackageVersion:
|
|
5737
|
+
serverlessPackageVersion: _chunkMLFI5BLTcjs.VERSION,
|
|
5738
5738
|
serverlessClientEndpoint: config.publicEndpoint,
|
|
5739
5739
|
serverlessClientNamespace: config.publicNamespace,
|
|
5740
5740
|
serverlessClientToken: config.publicToken,
|
|
@@ -5747,19 +5747,19 @@ async function buildServeConfig(config) {
|
|
|
5747
5747
|
} catch (error) {
|
|
5748
5748
|
logger2().warn({
|
|
5749
5749
|
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:
|
|
5750
|
+
error: _chunkMLFI5BLTcjs.stringifyError.call(void 0, error)
|
|
5751
5751
|
});
|
|
5752
5752
|
}
|
|
5753
5753
|
serveConfig.engineHost = config.engineHost;
|
|
5754
5754
|
serveConfig.enginePort = config.enginePort;
|
|
5755
5755
|
if ((_a = config.test) == null ? void 0 : _a.enabled) {
|
|
5756
|
-
serveConfig.inspectorTestToken = _nullishCoalesce(
|
|
5756
|
+
serveConfig.inspectorTestToken = _nullishCoalesce(_chunkMLFI5BLTcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
|
|
5757
5757
|
}
|
|
5758
5758
|
return serveConfig;
|
|
5759
5759
|
}
|
|
5760
5760
|
async function buildRegistryWithRuntime(config, runtime) {
|
|
5761
5761
|
var _a;
|
|
5762
|
-
if (((_a = config.test) == null ? void 0 : _a.enabled) &&
|
|
5762
|
+
if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunkMLFI5BLTcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
|
|
5763
5763
|
trySetProcessEnv("_RIVET_TEST_INSPECTOR_TOKEN", "token");
|
|
5764
5764
|
}
|
|
5765
5765
|
if (runtime.kind === "napi") {
|
|
@@ -6044,8 +6044,8 @@ var Registry = class {
|
|
|
6044
6044
|
* ```
|
|
6045
6045
|
*/
|
|
6046
6046
|
async listen(opts = {}) {
|
|
6047
|
-
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => (
|
|
6048
|
-
const publicDir = _nullishCoalesce(opts.publicDir, () => (
|
|
6047
|
+
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => ( _chunkMLFI5BLTcjs.parsePortEnv.call(void 0, process.env.RIVET_PORT))), () => ( 3e3));
|
|
6048
|
+
const publicDir = _nullishCoalesce(opts.publicDir, () => ( _chunkMLFI5BLTcjs.getRivetkitPublicDir.call(void 0, )));
|
|
6049
6049
|
const config = this.parseConfig();
|
|
6050
6050
|
const configuredRegistryPromise = buildConfiguredRegistry(config);
|
|
6051
6051
|
this.#runtimeServeConfiguredPromise = configuredRegistryPromise;
|
|
@@ -6073,7 +6073,7 @@ var Registry = class {
|
|
|
6073
6073
|
return jsonRouteResponse(503, {
|
|
6074
6074
|
status: "not_started",
|
|
6075
6075
|
runtime: "rivetkit",
|
|
6076
|
-
version:
|
|
6076
|
+
version: _chunkMLFI5BLTcjs.VERSION
|
|
6077
6077
|
});
|
|
6078
6078
|
}
|
|
6079
6079
|
const { runtime, registry } = configured;
|
|
@@ -6081,7 +6081,7 @@ var Registry = class {
|
|
|
6081
6081
|
return jsonRouteResponse(501, {
|
|
6082
6082
|
status: "unsupported",
|
|
6083
6083
|
runtime: "rivetkit",
|
|
6084
|
-
version:
|
|
6084
|
+
version: _chunkMLFI5BLTcjs.VERSION
|
|
6085
6085
|
});
|
|
6086
6086
|
}
|
|
6087
6087
|
const response = await runtime.registryHealth(registry);
|
|
@@ -6319,8 +6319,8 @@ var Registry = class {
|
|
|
6319
6319
|
* ```
|
|
6320
6320
|
*/
|
|
6321
6321
|
start() {
|
|
6322
|
-
if (
|
|
6323
|
-
const publicDir = _nullishCoalesce(
|
|
6322
|
+
if (_chunkMLFI5BLTcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
6323
|
+
const publicDir = _nullishCoalesce(_chunkMLFI5BLTcjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
|
|
6324
6324
|
this.listen({ publicDir }).catch((error) => {
|
|
6325
6325
|
logger2().error({ error }, "auto-listen failed; exiting");
|
|
6326
6326
|
if (typeof process !== "undefined" && typeof process.exit === "function") {
|
|
@@ -6341,7 +6341,7 @@ var Registry = class {
|
|
|
6341
6341
|
};
|
|
6342
6342
|
console.log();
|
|
6343
6343
|
console.log(
|
|
6344
|
-
` RivetKit ${
|
|
6344
|
+
` RivetKit ${_chunkMLFI5BLTcjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
|
|
6345
6345
|
);
|
|
6346
6346
|
if (config.namespace !== "default") {
|
|
6347
6347
|
logLine("Namespace", config.namespace);
|
|
@@ -6416,5 +6416,5 @@ function setup(input) {
|
|
|
6416
6416
|
|
|
6417
6417
|
|
|
6418
6418
|
|
|
6419
|
-
exports.ALLOWED_PUBLIC_HEADERS =
|
|
6419
|
+
exports.ALLOWED_PUBLIC_HEADERS = _chunkCN4IAGVPcjs.ALLOWED_PUBLIC_HEADERS; exports.ActorDefinition = ActorDefinition; exports.ActorError = _chunk4FC7TVS6cjs.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 = _chunk4FC7TVS6cjs.RivetError; exports.RuntimeKindSchema = RuntimeKindSchema; exports.SqliteBackendSchema = SqliteBackendSchema; exports.SqliteConfigSchema = SqliteConfigSchema; exports.TestConfigSchema = TestConfigSchema; exports.UserError = _chunk4FC7TVS6cjs.UserError; exports.WasmRuntimeConfigSchema = WasmRuntimeConfigSchema; exports.actor = actor; exports.buildActorNames = buildActorNames; exports.createClientWithDriver = _chunkCN4IAGVPcjs.createClientWithDriver; exports.event = event; exports.isStaticActorDefinition = isStaticActorDefinition; exports.isStaticActorInstance = isStaticActorInstance; exports.lookupInRegistry = lookupInRegistry; exports.noopNext = _chunkMLFI5BLTcjs.noopNext; exports.queue = queue; exports.setup = setup; exports.toUint8Array = _chunkMLFI5BLTcjs.toUint8Array;
|
|
6420
6420
|
//# sourceMappingURL=mod.cjs.map
|