rivetkit 2.3.3-rc.1 → 2.3.3
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 +1 -0
- package/dist/browser/client.js +9 -6
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.d.ts +22 -2
- package/dist/browser/inspector/client.js +996 -222
- package/dist/browser/inspector/client.js.map +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.d.cts +1 -0
- package/dist/tsup/agent-os/index.d.ts +1 -0
- package/dist/tsup/agent-os/index.js +9 -6
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-CN4IAGVP.cjs → chunk-34P567PO.cjs} +139 -139
- package/dist/tsup/{chunk-CN4IAGVP.cjs.map → chunk-34P567PO.cjs.map} +1 -1
- package/dist/tsup/{chunk-GMD47RV5.cjs → chunk-APW73HCH.cjs} +5 -5
- package/dist/tsup/{chunk-GMD47RV5.cjs.map → chunk-APW73HCH.cjs.map} +1 -1
- package/dist/tsup/{chunk-D5KMS3WU.js → chunk-BLDO2FKO.js} +11 -7
- package/dist/tsup/chunk-BLDO2FKO.js.map +1 -0
- package/dist/tsup/{chunk-EIB2XNTL.js → chunk-BZM4PMFS.js} +12 -4
- package/dist/tsup/chunk-BZM4PMFS.js.map +1 -0
- package/dist/tsup/{chunk-VNWYKWBM.js → chunk-CXRPENO3.js} +4 -4
- package/dist/tsup/{chunk-J7NGTEDW.js → chunk-DFA7SYSW.js} +3 -3
- package/dist/tsup/{chunk-2ZBWR7HC.js → chunk-DHXWD4DF.js} +2 -2
- package/dist/tsup/{chunk-3UWWME7J.js → chunk-KEKWJECX.js} +22 -2
- package/dist/tsup/chunk-KEKWJECX.js.map +1 -0
- package/dist/tsup/{chunk-TXO4XNNB.js → chunk-NT2NK3VT.js} +2 -2
- package/dist/tsup/{chunk-MLFI5BLT.cjs → chunk-PYO2U53V.cjs} +12 -8
- package/dist/tsup/chunk-PYO2U53V.cjs.map +1 -0
- package/dist/tsup/{chunk-T5YE5THK.cjs → chunk-S644FL73.cjs} +24 -4
- package/dist/tsup/chunk-S644FL73.cjs.map +1 -0
- package/dist/tsup/{chunk-KVSK67EL.cjs → chunk-TYLP3U4Y.cjs} +18 -10
- package/dist/tsup/chunk-TYLP3U4Y.cjs.map +1 -0
- package/dist/tsup/{chunk-CFVNICL7.cjs → chunk-X63ROSOG.cjs} +7 -7
- package/dist/tsup/{chunk-CFVNICL7.cjs.map → chunk-X63ROSOG.cjs.map} +1 -1
- package/dist/tsup/{chunk-VEJGWALU.cjs → chunk-YUEC5SEY.cjs} +3 -3
- package/dist/tsup/{chunk-VEJGWALU.cjs.map → chunk-YUEC5SEY.cjs.map} +1 -1
- package/dist/tsup/client/mod.cjs +6 -6
- package/dist/tsup/client/mod.d.cts +2 -2
- package/dist/tsup/client/mod.d.ts +2 -2
- package/dist/tsup/client/mod.js +5 -5
- package/dist/tsup/common/log.cjs +4 -2
- 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 +5 -3
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/{config-CzvopP5m.d.cts → config-BfBhjEbk.d.cts} +1 -0
- package/dist/tsup/{config-DZuT7tcp.d.ts → config-ZkIsRFsN.d.ts} +1 -0
- package/dist/tsup/{context-CyAdY-aA.d.ts → context-B7-84u9K.d.ts} +2 -1
- package/dist/tsup/{context-sNB28g0N.d.cts → context-sZ9GlaBK.d.cts} +2 -1
- package/dist/tsup/dynamic/mod.d.cts +1 -1
- package/dist/tsup/dynamic/mod.d.ts +1 -1
- package/dist/tsup/inspector/mod.cjs +46 -11
- package/dist/tsup/inspector/mod.cjs.map +1 -1
- package/dist/tsup/inspector/mod.d.cts +37 -15
- package/dist/tsup/inspector/mod.d.ts +37 -15
- package/dist/tsup/inspector/mod.js +45 -10
- package/dist/tsup/inspector/mod.js.map +1 -1
- package/dist/tsup/inspector-tab/mod.cjs +1 -12
- package/dist/tsup/inspector-tab/mod.cjs.map +1 -1
- package/dist/tsup/inspector-tab/mod.d.cts +3 -13
- package/dist/tsup/inspector-tab/mod.d.ts +3 -13
- package/dist/tsup/inspector-tab/mod.js +0 -11
- package/dist/tsup/inspector-tab/mod.js.map +1 -1
- package/dist/tsup/mod.cjs +120 -61
- 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 +65 -6
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +9 -9
- package/dist/tsup/test/mod.d.cts +1 -1
- package/dist/tsup/test/mod.d.ts +1 -1
- package/dist/tsup/test/mod.js +5 -5
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +10 -7
- 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 +7 -4
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +8 -8
- package/src/common/bare/generated/inspector/v5.ts +1016 -0
- package/src/common/bare/transport/v1.ts +36 -0
- package/src/common/log.ts +14 -8
- package/src/inspector/client.browser.ts +73 -16
- package/src/inspector/mod.ts +1 -1
- package/src/inspector-tab/mod.ts +0 -15
- package/src/registry/index.ts +4 -0
- package/src/registry/napi-runtime.ts +11 -0
- package/src/registry/native.ts +70 -2
- package/src/registry/runtime.ts +1 -0
- package/src/registry/wasm-runtime.ts +5 -0
- package/src/workflow/context.ts +4 -0
- package/src/workflow/inspector.ts +8 -0
- package/dist/tsup/chunk-3UWWME7J.js.map +0 -1
- package/dist/tsup/chunk-D5KMS3WU.js.map +0 -1
- package/dist/tsup/chunk-EIB2XNTL.js.map +0 -1
- package/dist/tsup/chunk-KVSK67EL.cjs.map +0 -1
- package/dist/tsup/chunk-MLFI5BLT.cjs.map +0 -1
- package/dist/tsup/chunk-T5YE5THK.cjs.map +0 -1
- /package/dist/tsup/{chunk-VNWYKWBM.js.map → chunk-CXRPENO3.js.map} +0 -0
- /package/dist/tsup/{chunk-J7NGTEDW.js.map → chunk-DFA7SYSW.js.map} +0 -0
- /package/dist/tsup/{chunk-2ZBWR7HC.js.map → chunk-DHXWD4DF.js.map} +0 -0
- /package/dist/tsup/{chunk-TXO4XNNB.js.map → chunk-NT2NK3VT.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 _chunkS644FL73cjs = require('./chunk-S644FL73.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 _chunk34P567POcjs = require('./chunk-34P567PO.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -33,9 +33,9 @@ var _chunkVE2X4KMGcjs = require('./chunk-VE2X4KMG.cjs');
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var _chunkAPW73HCHcjs = require('./chunk-APW73HCH.cjs');
|
|
37
37
|
require('./chunk-ZA7FLHKH.cjs');
|
|
38
|
-
require('./chunk-
|
|
38
|
+
require('./chunk-YUEC5SEY.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -64,7 +64,8 @@ require('./chunk-VEJGWALU.cjs');
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
|
|
68
|
+
var _chunkPYO2U53Vcjs = require('./chunk-PYO2U53V.cjs');
|
|
68
69
|
|
|
69
70
|
|
|
70
71
|
|
|
@@ -80,7 +81,7 @@ var _chunk4FC7TVS6cjs = require('./chunk-4FC7TVS6.cjs');
|
|
|
80
81
|
|
|
81
82
|
// src/actor/log.ts
|
|
82
83
|
function loggerWithoutContext() {
|
|
83
|
-
return
|
|
84
|
+
return _chunkPYO2U53Vcjs.getLogger.call(void 0, "actor-runtime");
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
// src/actor/definition.ts
|
|
@@ -212,7 +213,7 @@ function validateSchemaSync(schemas, key, data) {
|
|
|
212
213
|
var _virtualwebsocket = require('@rivetkit/virtual-websocket');
|
|
213
214
|
var _ws = require('hono/ws');
|
|
214
215
|
function logger() {
|
|
215
|
-
return
|
|
216
|
+
return _chunkPYO2U53Vcjs.getLogger.call(void 0, "inline-websocket-adapter");
|
|
216
217
|
}
|
|
217
218
|
var InlineWebSocketAdapter = class {
|
|
218
219
|
#handler;
|
|
@@ -383,7 +384,7 @@ function isLocalEngineEndpoint(endpoint) {
|
|
|
383
384
|
|
|
384
385
|
// src/registry/log.ts
|
|
385
386
|
function logger2() {
|
|
386
|
-
return
|
|
387
|
+
return _chunkPYO2U53Vcjs.getLogger.call(void 0, "registry");
|
|
387
388
|
}
|
|
388
389
|
|
|
389
390
|
// src/serverless/configure.ts
|
|
@@ -429,8 +430,8 @@ async function configureServerlessPool(config) {
|
|
|
429
430
|
);
|
|
430
431
|
}
|
|
431
432
|
const customConfig = config.configurePool;
|
|
432
|
-
const clientConfig =
|
|
433
|
-
const dcsRes = await
|
|
433
|
+
const clientConfig = _chunk34P567POcjs.convertRegistryConfigToClientConfig.call(void 0, config);
|
|
434
|
+
const dcsRes = await _chunk34P567POcjs.getDatacenters.call(void 0, clientConfig);
|
|
434
435
|
const poolName = _nullishCoalesce(customConfig.name, () => ( "default"));
|
|
435
436
|
const serverlessToken = _nullishCoalesce(config.token, () => ( config.publicToken));
|
|
436
437
|
const headers = {
|
|
@@ -452,7 +453,7 @@ async function configureServerlessPool(config) {
|
|
|
452
453
|
metadata: _nullishCoalesce(customConfig.metadata, () => ( {})),
|
|
453
454
|
drain_on_version_upgrade: _nullishCoalesce(customConfig.drainOnVersionUpgrade, () => ( true))
|
|
454
455
|
};
|
|
455
|
-
await
|
|
456
|
+
await _chunk34P567POcjs.updateRunnerConfig.call(void 0, clientConfig, poolName, {
|
|
456
457
|
datacenters: Object.fromEntries(
|
|
457
458
|
dcsRes.datacenters.map((dc) => [dc.name, serverlessConfig])
|
|
458
459
|
)
|
|
@@ -469,7 +470,7 @@ async function configureServerlessPool(config) {
|
|
|
469
470
|
logger2().warn({
|
|
470
471
|
msg: "serverless pool configuration attempt failed",
|
|
471
472
|
attempts,
|
|
472
|
-
error:
|
|
473
|
+
error: _chunkPYO2U53Vcjs.stringifyError.call(void 0, error)
|
|
473
474
|
});
|
|
474
475
|
await sleep(CONFIGURE_RETRY_DELAY_MS);
|
|
475
476
|
}
|
|
@@ -477,7 +478,7 @@ async function configureServerlessPool(config) {
|
|
|
477
478
|
logger2().error({
|
|
478
479
|
msg: "failed to configure serverless pool, validate endpoint is configured correctly then restart this process",
|
|
479
480
|
attempts,
|
|
480
|
-
error:
|
|
481
|
+
error: _chunkPYO2U53Vcjs.stringifyError.call(void 0, lastError)
|
|
481
482
|
});
|
|
482
483
|
throw lastError;
|
|
483
484
|
}
|
|
@@ -489,20 +490,20 @@ var _zod = require('zod');
|
|
|
489
490
|
var _v4 = require('zod/v4');
|
|
490
491
|
var warnedMissingVersion = false;
|
|
491
492
|
var EnvoyConfigSchema = _v4.z.object({
|
|
492
|
-
poolName: _v4.z.string().default(() => _nullishCoalesce(
|
|
493
|
+
poolName: _v4.z.string().default(() => _nullishCoalesce(_chunkPYO2U53Vcjs.getRivetPool.call(void 0, ), () => ( "default"))),
|
|
493
494
|
version: _v4.z.number().default(() => {
|
|
494
|
-
const version =
|
|
495
|
+
const version = _chunkPYO2U53Vcjs.getRivetEnvoyVersion.call(void 0, );
|
|
495
496
|
if (version !== void 0) return version;
|
|
496
|
-
if (
|
|
497
|
+
if (_chunkPYO2U53Vcjs.getNodeEnv.call(void 0, ) === "production" && !warnedMissingVersion) {
|
|
497
498
|
warnedMissingVersion = true;
|
|
498
|
-
|
|
499
|
+
_chunkPYO2U53Vcjs.getLogger.call(void 0, "rivetkit").error(
|
|
499
500
|
"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
501
|
);
|
|
501
502
|
}
|
|
502
503
|
return 1;
|
|
503
504
|
}),
|
|
504
505
|
// Deprecated.
|
|
505
|
-
totalSlots: _v4.z.number().default(() => _nullishCoalesce(
|
|
506
|
+
totalSlots: _v4.z.number().default(() => _nullishCoalesce(_chunkPYO2U53Vcjs.getRivetTotalSlots.call(void 0, ), () => ( 1e5))),
|
|
506
507
|
envoyKey: _v4.z.string().optional()
|
|
507
508
|
});
|
|
508
509
|
|
|
@@ -540,7 +541,7 @@ var ServerlessConfigSchema = _v4.z.object({
|
|
|
540
541
|
*
|
|
541
542
|
* Can also be set via RIVET_PUBLIC_ENDPOINT environment variable.
|
|
542
543
|
*/
|
|
543
|
-
publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
544
|
+
publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkPYO2U53Vcjs.getRivetPublicEndpoint.call(void 0, )))),
|
|
544
545
|
/**
|
|
545
546
|
* Token that clients should use when connecting via the public endpoint.
|
|
546
547
|
*
|
|
@@ -548,7 +549,7 @@ var ServerlessConfigSchema = _v4.z.object({
|
|
|
548
549
|
*
|
|
549
550
|
* Can also be specified in the publicEndpoint URL as `https://namespace:token@host`.
|
|
550
551
|
*/
|
|
551
|
-
publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
552
|
+
publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkPYO2U53Vcjs.getRivetPublicToken.call(void 0, ))))
|
|
552
553
|
// There is no publicNamespace config option because the frontend and backend
|
|
553
554
|
// cannot use different namespaces. The namespace is extracted from the
|
|
554
555
|
// publicEndpoint URL auth syntax if provided.
|
|
@@ -602,7 +603,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
602
603
|
* Runtime binding to use for RivetKit core.
|
|
603
604
|
* */
|
|
604
605
|
runtime: RuntimeKindSchema.optional().transform((val, ctx) => {
|
|
605
|
-
const rawRuntime = _nullishCoalesce(val, () => (
|
|
606
|
+
const rawRuntime = _nullishCoalesce(val, () => ( _chunkPYO2U53Vcjs.getRivetkitRuntime.call(void 0, )));
|
|
606
607
|
if (rawRuntime === void 0) {
|
|
607
608
|
return "auto";
|
|
608
609
|
}
|
|
@@ -639,7 +640,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
639
640
|
* */
|
|
640
641
|
logging: _zod.z.object({
|
|
641
642
|
baseLogger: _zod.z.custom().optional(),
|
|
642
|
-
level:
|
|
643
|
+
level: _chunkPYO2U53Vcjs.LogLevelSchema.optional()
|
|
643
644
|
}).optional().default(() => ({})),
|
|
644
645
|
// MARK: Routing
|
|
645
646
|
// // This is a function to allow for lazy configuration of upgradeWebSocket on the
|
|
@@ -657,9 +658,9 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
657
658
|
*
|
|
658
659
|
* Can also be set via RIVET_ENDPOINT environment variables.
|
|
659
660
|
*/
|
|
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, () => (
|
|
661
|
+
endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => ( _chunkPYO2U53Vcjs.getRivetEngine.call(void 0, ))), () => ( _chunkPYO2U53Vcjs.getRivetEndpoint.call(void 0, )))),
|
|
662
|
+
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkPYO2U53Vcjs.getRivetToken.call(void 0, )))),
|
|
663
|
+
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkPYO2U53Vcjs.getRivetNamespace.call(void 0, )))),
|
|
663
664
|
headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional().default({}),
|
|
664
665
|
// MARK: Client
|
|
665
666
|
// TODO:
|
|
@@ -699,21 +700,21 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
699
700
|
*
|
|
700
701
|
* Starts the full Rust engine process locally.
|
|
701
702
|
*/
|
|
702
|
-
startEngine: _zod.z.boolean().default(() =>
|
|
703
|
+
startEngine: _zod.z.boolean().default(() => _chunkPYO2U53Vcjs.getRivetRunEngine.call(void 0, )),
|
|
703
704
|
/**
|
|
704
705
|
* @experimental
|
|
705
706
|
*
|
|
706
707
|
* Host to bind the spawned local engine process to.
|
|
707
708
|
*/
|
|
708
|
-
engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
709
|
+
engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkPYO2U53Vcjs.getRivetRunEngineHost.call(void 0, ), () => ( ENGINE_HOST))),
|
|
709
710
|
/**
|
|
710
711
|
* @experimental
|
|
711
712
|
*
|
|
712
713
|
* Port to bind the spawned local engine process to.
|
|
713
714
|
*/
|
|
714
|
-
enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(
|
|
715
|
+
enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(_chunkPYO2U53Vcjs.getRivetRunEnginePort.call(void 0, ), () => ( ENGINE_PORT))),
|
|
715
716
|
/** @experimental */
|
|
716
|
-
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
717
|
+
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkPYO2U53Vcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunkPYO2U53Vcjs.VERSION))),
|
|
717
718
|
/**
|
|
718
719
|
* @experimental
|
|
719
720
|
*
|
|
@@ -761,7 +762,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
761
762
|
}))
|
|
762
763
|
}).transform((config, ctx) => {
|
|
763
764
|
var _a, _b, _c;
|
|
764
|
-
const isDevEnv =
|
|
765
|
+
const isDevEnv = _chunkPYO2U53Vcjs.isDev.call(void 0, );
|
|
765
766
|
const sqliteBackend = _nullishCoalesce(((_a = config.sqlite) == null ? void 0 : _a.backend), () => ( ((_b = config.test) == null ? void 0 : _b.sqliteBackend)));
|
|
766
767
|
if (config.runtime === "wasm" && sqliteBackend === "local") {
|
|
767
768
|
ctx.addIssue({
|
|
@@ -771,7 +772,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
771
772
|
});
|
|
772
773
|
}
|
|
773
774
|
const sqlite = config.runtime === "wasm" && config.sqlite === void 0 ? { backend: "remote" } : config.sqlite;
|
|
774
|
-
const parsedEndpoint = config.endpoint ?
|
|
775
|
+
const parsedEndpoint = config.endpoint ? _chunk34P567POcjs.tryParseEndpoint.call(void 0, ctx, {
|
|
775
776
|
endpoint: config.endpoint,
|
|
776
777
|
path: ["endpoint"],
|
|
777
778
|
namespace: config.namespace,
|
|
@@ -799,7 +800,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
799
800
|
);
|
|
800
801
|
const namespace = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.namespace), () => ( config.namespace)), () => ( "default"));
|
|
801
802
|
const token = _nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token));
|
|
802
|
-
const parsedPublicEndpoint = config.serverless.publicEndpoint ?
|
|
803
|
+
const parsedPublicEndpoint = config.serverless.publicEndpoint ? _chunk34P567POcjs.tryParseEndpoint.call(void 0, ctx, {
|
|
803
804
|
endpoint: config.serverless.publicEndpoint,
|
|
804
805
|
path: ["serverless", "publicEndpoint"]
|
|
805
806
|
}) : void 0;
|
|
@@ -927,7 +928,7 @@ var DocRegistryConfigSchema = _zod.z.object({
|
|
|
927
928
|
noWelcome: _zod.z.boolean().optional().describe("Disable the welcome message on startup. Default: false"),
|
|
928
929
|
sqlite: DocSqliteConfigSchema,
|
|
929
930
|
logging: _zod.z.object({
|
|
930
|
-
level:
|
|
931
|
+
level: _chunkPYO2U53Vcjs.LogLevelSchema.optional().describe(
|
|
931
932
|
"Log level for RivetKit. Default: 'warn'"
|
|
932
933
|
)
|
|
933
934
|
}).optional().describe("Logging configuration."),
|
|
@@ -1696,6 +1697,9 @@ var NapiCoreRuntime = (_class = class {
|
|
|
1696
1697
|
async actorQueueInspectMessages(ctx) {
|
|
1697
1698
|
return await asNativeActorContext(ctx).queue().inspectMessages();
|
|
1698
1699
|
}
|
|
1700
|
+
async actorQueueReset(ctx) {
|
|
1701
|
+
await asNativeActorContext(ctx).queue().reset();
|
|
1702
|
+
}
|
|
1699
1703
|
actorScheduleAfter(ctx, durationMs, actionName, args) {
|
|
1700
1704
|
asNativeActorContext(ctx).schedule().after(durationMs, actionName, toNapiBuffer(args));
|
|
1701
1705
|
}
|
|
@@ -2343,6 +2347,10 @@ var WasmCoreRuntime = (_class2 = class {
|
|
|
2343
2347
|
const queue2 = childHandle(asWasmActorContext(ctx), "queue");
|
|
2344
2348
|
return await callHandleAsync(queue2, "inspectMessages");
|
|
2345
2349
|
}
|
|
2350
|
+
async actorQueueReset(ctx) {
|
|
2351
|
+
const queue2 = childHandle(asWasmActorContext(ctx), "queue");
|
|
2352
|
+
await callHandleAsync(queue2, "reset");
|
|
2353
|
+
}
|
|
2346
2354
|
actorScheduleAfter(ctx, durationMs, actionName, args) {
|
|
2347
2355
|
const schedule = childHandle(asWasmActorContext(ctx), "schedule");
|
|
2348
2356
|
callHandle(schedule, "after", wasmNumber(durationMs), actionName, args);
|
|
@@ -2650,7 +2658,7 @@ async function cleanupNativeSleepRuntimeState(runtime, ctx, afterTrackedWorkDrai
|
|
|
2650
2658
|
}).catch((error) => {
|
|
2651
2659
|
logger2().warn({
|
|
2652
2660
|
msg: "deferred native sleep cleanup failed",
|
|
2653
|
-
error:
|
|
2661
|
+
error: _chunkPYO2U53Vcjs.stringifyError.call(void 0, error)
|
|
2654
2662
|
});
|
|
2655
2663
|
});
|
|
2656
2664
|
return;
|
|
@@ -2760,10 +2768,10 @@ function decodeValue(value) {
|
|
|
2760
2768
|
if (!value || value.length === 0) {
|
|
2761
2769
|
return void 0;
|
|
2762
2770
|
}
|
|
2763
|
-
return
|
|
2771
|
+
return _chunkAPW73HCHcjs.decodeCborCompat.call(void 0, value);
|
|
2764
2772
|
}
|
|
2765
2773
|
function encodeValue(value) {
|
|
2766
|
-
return
|
|
2774
|
+
return _chunkAPW73HCHcjs.encodeCborCompat.call(void 0, value);
|
|
2767
2775
|
}
|
|
2768
2776
|
function normalizeArgs(value) {
|
|
2769
2777
|
return Array.isArray(value) ? value : value === void 0 || value === null ? [] : [value];
|
|
@@ -2799,7 +2807,7 @@ function isStructuredBridgeError(error) {
|
|
|
2799
2807
|
return _chunk4FC7TVS6cjs.isRivetErrorLike.call(void 0, error) && "__type" in error && (error.__type === "RivetError" || error.__type === "ActorError");
|
|
2800
2808
|
}
|
|
2801
2809
|
function encodeNativeCallbackError(error) {
|
|
2802
|
-
const structuredError = isStructuredBridgeError(error) ? error :
|
|
2810
|
+
const structuredError = isStructuredBridgeError(error) ? error : _chunkPYO2U53Vcjs.deconstructError.call(void 0, error, true);
|
|
2803
2811
|
const bridgeError = new Error(_chunk4FC7TVS6cjs.encodeBridgeRivetError.call(void 0, structuredError), {
|
|
2804
2812
|
cause: error instanceof Error ? error : void 0
|
|
2805
2813
|
});
|
|
@@ -2849,7 +2857,7 @@ function decodeWorkflowCbor(data) {
|
|
|
2849
2857
|
return null;
|
|
2850
2858
|
}
|
|
2851
2859
|
try {
|
|
2852
|
-
return
|
|
2860
|
+
return _chunkAPW73HCHcjs.decodeCborCompat.call(void 0, new Uint8Array(data));
|
|
2853
2861
|
} catch (e4) {
|
|
2854
2862
|
return null;
|
|
2855
2863
|
}
|
|
@@ -2948,13 +2956,21 @@ function serializeWorkflowEntryKind(kind) {
|
|
|
2948
2956
|
originalName: kind.val.originalName
|
|
2949
2957
|
}
|
|
2950
2958
|
};
|
|
2959
|
+
case "WorkflowVersionCheckEntry":
|
|
2960
|
+
return {
|
|
2961
|
+
tag: kind.tag,
|
|
2962
|
+
val: {
|
|
2963
|
+
resolved: kind.val.resolved,
|
|
2964
|
+
latest: kind.val.latest
|
|
2965
|
+
}
|
|
2966
|
+
};
|
|
2951
2967
|
}
|
|
2952
2968
|
}
|
|
2953
2969
|
function serializeWorkflowHistoryForJson(data) {
|
|
2954
2970
|
if (data === null) {
|
|
2955
2971
|
return null;
|
|
2956
2972
|
}
|
|
2957
|
-
const history =
|
|
2973
|
+
const history = _chunkS644FL73cjs.decodeWorkflowHistoryTransport.call(void 0, data);
|
|
2958
2974
|
return jsonSafe({
|
|
2959
2975
|
nameRegistry: [...history.nameRegistry],
|
|
2960
2976
|
entries: history.entries.map((entry) => ({
|
|
@@ -3095,12 +3111,12 @@ var NativeConnAdapter = class {
|
|
|
3095
3111
|
this.#writeState(nextValue, { writeNative: true });
|
|
3096
3112
|
},
|
|
3097
3113
|
(newValue) => {
|
|
3098
|
-
|
|
3114
|
+
_chunkAPW73HCHcjs.assertJsonCompatValue.call(void 0, newValue);
|
|
3099
3115
|
}
|
|
3100
3116
|
);
|
|
3101
3117
|
}
|
|
3102
3118
|
set state(value) {
|
|
3103
|
-
|
|
3119
|
+
_chunkAPW73HCHcjs.assertJsonCompatValue.call(void 0, value);
|
|
3104
3120
|
this.#writeState(value, { writeNative: true });
|
|
3105
3121
|
}
|
|
3106
3122
|
initializeState(value) {
|
|
@@ -4050,7 +4066,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4050
4066
|
},
|
|
4051
4067
|
(newValue) => {
|
|
4052
4068
|
this.#assertCanMutateState();
|
|
4053
|
-
|
|
4069
|
+
_chunkAPW73HCHcjs.assertJsonCompatValue.call(void 0, newValue);
|
|
4054
4070
|
}
|
|
4055
4071
|
);
|
|
4056
4072
|
}
|
|
@@ -4061,7 +4077,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4061
4077
|
throw stateNotEnabledError();
|
|
4062
4078
|
}
|
|
4063
4079
|
this.#assertCanMutateState();
|
|
4064
|
-
|
|
4080
|
+
_chunkAPW73HCHcjs.assertJsonCompatValue.call(void 0, value);
|
|
4065
4081
|
this.#writeState(value, { scheduleSave: true });
|
|
4066
4082
|
}
|
|
4067
4083
|
initializeState(value) {
|
|
@@ -4326,7 +4342,7 @@ var ActorContextHandleAdapter = class {
|
|
|
4326
4342
|
const trackedPromise = Promise.resolve(promise).catch((error) => {
|
|
4327
4343
|
logger2().warn({
|
|
4328
4344
|
msg: "keepAwake promise rejected",
|
|
4329
|
-
error:
|
|
4345
|
+
error: _chunkPYO2U53Vcjs.stringifyError.call(void 0, error)
|
|
4330
4346
|
});
|
|
4331
4347
|
}).then(() => null);
|
|
4332
4348
|
try {
|
|
@@ -4781,9 +4797,9 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
4781
4797
|
const actionHandlers = Object.fromEntries(
|
|
4782
4798
|
Object.entries(_nullishCoalesce(config.actions, () => ( {}))).map(([name, handler]) => [name, handler])
|
|
4783
4799
|
);
|
|
4784
|
-
const createClient = () =>
|
|
4785
|
-
new (0,
|
|
4786
|
-
|
|
4800
|
+
const createClient = () => _chunk34P567POcjs.createClientWithDriver.call(void 0,
|
|
4801
|
+
new (0, _chunk34P567POcjs.RemoteEngineControlClient)(
|
|
4802
|
+
_chunk34P567POcjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
|
|
4787
4803
|
),
|
|
4788
4804
|
{ encoding: "bare" }
|
|
4789
4805
|
);
|
|
@@ -4859,7 +4875,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
4859
4875
|
}
|
|
4860
4876
|
);
|
|
4861
4877
|
};
|
|
4862
|
-
const isPublicPerActorPath = jsRequest.method === "GET" &&
|
|
4878
|
+
const isPublicPerActorPath = jsRequest.method === "GET" && url.pathname.startsWith("/inspector/custom-tabs/");
|
|
4863
4879
|
if (!isPublicPerActorPath) {
|
|
4864
4880
|
try {
|
|
4865
4881
|
await runtime.actorVerifyInspectorAuth(
|
|
@@ -4935,6 +4951,45 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
4935
4951
|
messages
|
|
4936
4952
|
});
|
|
4937
4953
|
}
|
|
4954
|
+
if (url.pathname === "/inspector/queue" && jsRequest.method === "DELETE") {
|
|
4955
|
+
await runtime.actorQueueReset(ctx);
|
|
4956
|
+
return jsonResponse({});
|
|
4957
|
+
}
|
|
4958
|
+
if (url.pathname === "/inspector/queue" && jsRequest.method === "POST") {
|
|
4959
|
+
let body;
|
|
4960
|
+
try {
|
|
4961
|
+
body = await jsRequest.json();
|
|
4962
|
+
} catch (e5) {
|
|
4963
|
+
return errorResponse(
|
|
4964
|
+
new (0, _chunk4FC7TVS6cjs.RivetError)(
|
|
4965
|
+
"actor",
|
|
4966
|
+
"invalid_request",
|
|
4967
|
+
"Invalid inspector JSON body",
|
|
4968
|
+
{ public: true }
|
|
4969
|
+
),
|
|
4970
|
+
400
|
|
4971
|
+
);
|
|
4972
|
+
}
|
|
4973
|
+
const name = _nullishCoalesce(body.name, () => ( ""));
|
|
4974
|
+
if (name === "") {
|
|
4975
|
+
return errorResponse(
|
|
4976
|
+
new (0, _chunk4FC7TVS6cjs.RivetError)(
|
|
4977
|
+
"actor",
|
|
4978
|
+
"invalid_request",
|
|
4979
|
+
"Queue message name must not be empty",
|
|
4980
|
+
{ public: true }
|
|
4981
|
+
),
|
|
4982
|
+
400
|
|
4983
|
+
);
|
|
4984
|
+
}
|
|
4985
|
+
const cbor = _chunkAPW73HCHcjs.encodeCborCompat.call(void 0, _nullishCoalesce(body.body, () => ( null)));
|
|
4986
|
+
const message = await runtime.actorQueueSend(ctx, name, cbor);
|
|
4987
|
+
return jsonResponse({
|
|
4988
|
+
id: message.id().toString(),
|
|
4989
|
+
name: message.name(),
|
|
4990
|
+
createdAtMs: message.createdAt()
|
|
4991
|
+
});
|
|
4992
|
+
}
|
|
4938
4993
|
if (url.pathname === "/inspector/traces" && jsRequest.method === "GET") {
|
|
4939
4994
|
return jsonResponse({ otlp: [], clamped: false });
|
|
4940
4995
|
}
|
|
@@ -5507,7 +5562,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5507
5562
|
new Response(null, { status: 404 })
|
|
5508
5563
|
);
|
|
5509
5564
|
}
|
|
5510
|
-
const rawConnParams = jsRequest.headers.get(
|
|
5565
|
+
const rawConnParams = jsRequest.headers.get(_chunk34P567POcjs.HEADER_CONN_PARAMS);
|
|
5511
5566
|
let requestCtx;
|
|
5512
5567
|
let conn;
|
|
5513
5568
|
try {
|
|
@@ -5734,7 +5789,7 @@ async function buildServeConfig(config) {
|
|
|
5734
5789
|
poolName: config.envoy.poolName,
|
|
5735
5790
|
handleInspectorHttpInRuntime: true,
|
|
5736
5791
|
serverlessBasePath: config.serverless.basePath,
|
|
5737
|
-
serverlessPackageVersion:
|
|
5792
|
+
serverlessPackageVersion: _chunkPYO2U53Vcjs.VERSION,
|
|
5738
5793
|
serverlessClientEndpoint: config.publicEndpoint,
|
|
5739
5794
|
serverlessClientNamespace: config.publicNamespace,
|
|
5740
5795
|
serverlessClientToken: config.publicToken,
|
|
@@ -5747,19 +5802,19 @@ async function buildServeConfig(config) {
|
|
|
5747
5802
|
} catch (error) {
|
|
5748
5803
|
logger2().warn({
|
|
5749
5804
|
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:
|
|
5805
|
+
error: _chunkPYO2U53Vcjs.stringifyError.call(void 0, error)
|
|
5751
5806
|
});
|
|
5752
5807
|
}
|
|
5753
5808
|
serveConfig.engineHost = config.engineHost;
|
|
5754
5809
|
serveConfig.enginePort = config.enginePort;
|
|
5755
5810
|
if ((_a = config.test) == null ? void 0 : _a.enabled) {
|
|
5756
|
-
serveConfig.inspectorTestToken = _nullishCoalesce(
|
|
5811
|
+
serveConfig.inspectorTestToken = _nullishCoalesce(_chunkPYO2U53Vcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
|
|
5757
5812
|
}
|
|
5758
5813
|
return serveConfig;
|
|
5759
5814
|
}
|
|
5760
5815
|
async function buildRegistryWithRuntime(config, runtime) {
|
|
5761
5816
|
var _a;
|
|
5762
|
-
if (((_a = config.test) == null ? void 0 : _a.enabled) &&
|
|
5817
|
+
if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunkPYO2U53Vcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
|
|
5763
5818
|
trySetProcessEnv("_RIVET_TEST_INSPECTOR_TOKEN", "token");
|
|
5764
5819
|
}
|
|
5765
5820
|
if (runtime.kind === "napi") {
|
|
@@ -5821,7 +5876,11 @@ var Registry = class {
|
|
|
5821
5876
|
#shutdownInFlight = null;
|
|
5822
5877
|
#signalHandlers = {};
|
|
5823
5878
|
constructor(config, deps) {
|
|
5879
|
+
var _a;
|
|
5824
5880
|
this.#config = config;
|
|
5881
|
+
if ((_a = config.logging) == null ? void 0 : _a.baseLogger) {
|
|
5882
|
+
_chunkPYO2U53Vcjs.configureBaseLogger.call(void 0, config.logging.baseLogger);
|
|
5883
|
+
}
|
|
5825
5884
|
this.#buildConfiguredRegistry = _nullishCoalesce((deps == null ? void 0 : deps.buildConfiguredRegistry), () => ( buildConfiguredRegistry));
|
|
5826
5885
|
this.routes = {
|
|
5827
5886
|
health: () => this.#healthRoute(),
|
|
@@ -6044,8 +6103,8 @@ var Registry = class {
|
|
|
6044
6103
|
* ```
|
|
6045
6104
|
*/
|
|
6046
6105
|
async listen(opts = {}) {
|
|
6047
|
-
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => (
|
|
6048
|
-
const publicDir = _nullishCoalesce(opts.publicDir, () => (
|
|
6106
|
+
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => ( _chunkPYO2U53Vcjs.parsePortEnv.call(void 0, process.env.RIVET_PORT))), () => ( 3e3));
|
|
6107
|
+
const publicDir = _nullishCoalesce(opts.publicDir, () => ( _chunkPYO2U53Vcjs.getRivetkitPublicDir.call(void 0, )));
|
|
6049
6108
|
const config = this.parseConfig();
|
|
6050
6109
|
const configuredRegistryPromise = buildConfiguredRegistry(config);
|
|
6051
6110
|
this.#runtimeServeConfiguredPromise = configuredRegistryPromise;
|
|
@@ -6073,7 +6132,7 @@ var Registry = class {
|
|
|
6073
6132
|
return jsonRouteResponse(503, {
|
|
6074
6133
|
status: "not_started",
|
|
6075
6134
|
runtime: "rivetkit",
|
|
6076
|
-
version:
|
|
6135
|
+
version: _chunkPYO2U53Vcjs.VERSION
|
|
6077
6136
|
});
|
|
6078
6137
|
}
|
|
6079
6138
|
const { runtime, registry } = configured;
|
|
@@ -6081,7 +6140,7 @@ var Registry = class {
|
|
|
6081
6140
|
return jsonRouteResponse(501, {
|
|
6082
6141
|
status: "unsupported",
|
|
6083
6142
|
runtime: "rivetkit",
|
|
6084
|
-
version:
|
|
6143
|
+
version: _chunkPYO2U53Vcjs.VERSION
|
|
6085
6144
|
});
|
|
6086
6145
|
}
|
|
6087
6146
|
const response = await runtime.registryHealth(registry);
|
|
@@ -6319,8 +6378,8 @@ var Registry = class {
|
|
|
6319
6378
|
* ```
|
|
6320
6379
|
*/
|
|
6321
6380
|
start() {
|
|
6322
|
-
if (
|
|
6323
|
-
const publicDir = _nullishCoalesce(
|
|
6381
|
+
if (_chunkPYO2U53Vcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
6382
|
+
const publicDir = _nullishCoalesce(_chunkPYO2U53Vcjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
|
|
6324
6383
|
this.listen({ publicDir }).catch((error) => {
|
|
6325
6384
|
logger2().error({ error }, "auto-listen failed; exiting");
|
|
6326
6385
|
if (typeof process !== "undefined" && typeof process.exit === "function") {
|
|
@@ -6341,7 +6400,7 @@ var Registry = class {
|
|
|
6341
6400
|
};
|
|
6342
6401
|
console.log();
|
|
6343
6402
|
console.log(
|
|
6344
|
-
` RivetKit ${
|
|
6403
|
+
` RivetKit ${_chunkPYO2U53Vcjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
|
|
6345
6404
|
);
|
|
6346
6405
|
if (config.namespace !== "default") {
|
|
6347
6406
|
logLine("Namespace", config.namespace);
|
|
@@ -6416,5 +6475,5 @@ function setup(input) {
|
|
|
6416
6475
|
|
|
6417
6476
|
|
|
6418
6477
|
|
|
6419
|
-
exports.ALLOWED_PUBLIC_HEADERS =
|
|
6478
|
+
exports.ALLOWED_PUBLIC_HEADERS = _chunk34P567POcjs.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 = _chunk34P567POcjs.createClientWithDriver; exports.event = event; exports.isStaticActorDefinition = isStaticActorDefinition; exports.isStaticActorInstance = isStaticActorInstance; exports.lookupInRegistry = lookupInRegistry; exports.noopNext = _chunkPYO2U53Vcjs.noopNext; exports.queue = queue; exports.setup = setup; exports.toUint8Array = _chunkPYO2U53Vcjs.toUint8Array;
|
|
6420
6479
|
//# sourceMappingURL=mod.cjs.map
|