rivetkit 3.1.0-rc.1 → 3.1.0
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 +4 -1
- 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/{chunk-R4VUGJNR.js → chunk-AOBZYPOQ.js} +4 -4
- package/dist/tsup/{chunk-OKLZYDQB.cjs → chunk-AQJFKHBK.cjs} +1 -1
- package/dist/tsup/chunk-AQJFKHBK.cjs.map +1 -0
- package/dist/tsup/{chunk-6LQ23TJA.cjs → chunk-BADLJ4CM.cjs} +3 -3
- package/dist/tsup/{chunk-6LQ23TJA.cjs.map → chunk-BADLJ4CM.cjs.map} +1 -1
- package/dist/tsup/{chunk-VOGVBK5O.cjs → chunk-CUM3GALQ.cjs} +10 -10
- package/dist/tsup/{chunk-VOGVBK5O.cjs.map → chunk-CUM3GALQ.cjs.map} +1 -1
- package/dist/tsup/{chunk-TDHEMJHH.js → chunk-CVTQX3MI.js} +2 -2
- package/dist/tsup/{chunk-SVWVXVV7.js → chunk-F5FZ6NI4.js} +2 -2
- package/dist/tsup/{chunk-5NNDJCH7.js → chunk-G3KFGH3I.js} +3 -3
- package/dist/tsup/{chunk-MT3ZLU7U.cjs → chunk-HFE4VBQU.cjs} +2 -2
- package/dist/tsup/chunk-HFE4VBQU.cjs.map +1 -0
- package/dist/tsup/{chunk-CRC7NMU3.js → chunk-IDJSGBVA.js} +2 -2
- package/dist/tsup/{chunk-UFHGMXXV.js → chunk-IHEO5OT3.js} +1 -1
- package/dist/tsup/chunk-IHEO5OT3.js.map +1 -0
- package/dist/tsup/{chunk-SXEIT5DF.cjs → chunk-QM5MJLVC.cjs} +3 -3
- package/dist/tsup/{chunk-SXEIT5DF.cjs.map → chunk-QM5MJLVC.cjs.map} +1 -1
- package/dist/tsup/{chunk-ECLJJGV6.js → chunk-RYGXJQWL.js} +2 -2
- package/dist/tsup/{chunk-MUCEIMJW.cjs → chunk-T5YMCOWY.cjs} +147 -147
- package/dist/tsup/{chunk-MUCEIMJW.cjs.map → chunk-T5YMCOWY.cjs.map} +1 -1
- package/dist/tsup/{chunk-UYCRHJY2.js → chunk-TY25ZHJV.js} +2 -2
- package/dist/tsup/chunk-TY25ZHJV.js.map +1 -0
- package/dist/tsup/{chunk-I3YW5B3I.cjs → chunk-UJNHLIIG.cjs} +7 -7
- package/dist/tsup/{chunk-I3YW5B3I.cjs.map → chunk-UJNHLIIG.cjs.map} +1 -1
- package/dist/tsup/{chunk-76FFOINJ.js → chunk-VCORVUP2.js} +6 -6
- package/dist/tsup/{chunk-K6O7IE7P.cjs → chunk-VGJXSQMF.cjs} +4 -4
- package/dist/tsup/{chunk-K6O7IE7P.cjs.map → chunk-VGJXSQMF.cjs.map} +1 -1
- package/dist/tsup/{chunk-YTSSP6NX.cjs → chunk-YWWIVWBR.cjs} +3 -3
- package/dist/tsup/{chunk-YTSSP6NX.cjs.map → chunk-YWWIVWBR.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-DFAysGOK.d.cts → config-BDdeBoxX.d.cts} +4 -1
- package/dist/tsup/{config-Dn8SZJF8.d.ts → config-Ch-SMJ-n.d.ts} +4 -1
- package/dist/tsup/{context-D_c2ERjO.d.ts → context-B-wRuYrf.d.ts} +1 -1
- package/dist/tsup/{context-fSkMTO5w.d.cts → context-NzsxAAoN.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 +110 -110
- 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 +6 -6
- 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.d.cts +3 -3
- package/dist/tsup/workflow/mod.d.ts +3 -3
- package/dist/tsup/workflow/mod.js +5 -5
- package/package.json +9 -9
- package/src/actor/config.ts +4 -1
- package/dist/tsup/chunk-MT3ZLU7U.cjs.map +0 -1
- package/dist/tsup/chunk-OKLZYDQB.cjs.map +0 -1
- package/dist/tsup/chunk-UFHGMXXV.js.map +0 -1
- package/dist/tsup/chunk-UYCRHJY2.js.map +0 -1
- /package/dist/tsup/{chunk-R4VUGJNR.js.map → chunk-AOBZYPOQ.js.map} +0 -0
- /package/dist/tsup/{chunk-TDHEMJHH.js.map → chunk-CVTQX3MI.js.map} +0 -0
- /package/dist/tsup/{chunk-SVWVXVV7.js.map → chunk-F5FZ6NI4.js.map} +0 -0
- /package/dist/tsup/{chunk-5NNDJCH7.js.map → chunk-G3KFGH3I.js.map} +0 -0
- /package/dist/tsup/{chunk-CRC7NMU3.js.map → chunk-IDJSGBVA.js.map} +0 -0
- /package/dist/tsup/{chunk-ECLJJGV6.js.map → chunk-RYGXJQWL.js.map} +0 -0
- /package/dist/tsup/{chunk-76FFOINJ.js.map → chunk-VCORVUP2.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 _chunkVGJXSQMFcjs = require('./chunk-VGJXSQMF.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -17,7 +17,7 @@ var _chunkK6O7IE7Pcjs = require('./chunk-K6O7IE7P.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkAQJFKHBKcjs = require('./chunk-AQJFKHBK.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -35,18 +35,18 @@ var _chunkOKLZYDQBcjs = require('./chunk-OKLZYDQB.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunkT5YMCOWYcjs = require('./chunk-T5YMCOWY.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
var _chunkRTWH3AX3cjs = require('./chunk-RTWH3AX3.cjs');
|
|
43
|
-
require('./chunk-SXEIT5DF.cjs');
|
|
44
43
|
|
|
45
44
|
|
|
46
45
|
|
|
47
46
|
|
|
48
|
-
var
|
|
47
|
+
var _chunkYWWIVWBRcjs = require('./chunk-YWWIVWBR.cjs');
|
|
49
48
|
require('./chunk-KVFIONKQ.cjs');
|
|
49
|
+
require('./chunk-QM5MJLVC.cjs');
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
@@ -80,7 +80,7 @@ require('./chunk-KVFIONKQ.cjs');
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
var
|
|
83
|
+
var _chunkHFE4VBQUcjs = require('./chunk-HFE4VBQU.cjs');
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
|
|
@@ -98,7 +98,7 @@ var _chunkMGI2VVF6cjs = require('./chunk-MGI2VVF6.cjs');
|
|
|
98
98
|
|
|
99
99
|
// src/actor/log.ts
|
|
100
100
|
function loggerWithoutContext() {
|
|
101
|
-
return
|
|
101
|
+
return _chunkHFE4VBQUcjs.getLogger.call(void 0, "actor-runtime");
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
// src/actor/definition.ts
|
|
@@ -127,7 +127,7 @@ function warnDeprecatedRun(input) {
|
|
|
127
127
|
const run = input.run;
|
|
128
128
|
if (run === void 0) return;
|
|
129
129
|
const runFunction = typeof run === "object" && run !== null ? run.run : run;
|
|
130
|
-
if (typeof runFunction === "function" &&
|
|
130
|
+
if (typeof runFunction === "function" && _chunkAQJFKHBKcjs.getRunInspectorKind.call(void 0, runFunction) === "workflow") {
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
warnedDeprecatedRun = true;
|
|
@@ -153,10 +153,10 @@ function actor(input) {
|
|
|
153
153
|
input == null ? void 0 : input.options
|
|
154
154
|
);
|
|
155
155
|
warnDeprecatedRun(input);
|
|
156
|
-
const config =
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
const config = _chunkAQJFKHBKcjs.ActorConfigSchema.parse(input);
|
|
157
|
+
_chunkAQJFKHBKcjs.flattenActionHandlers.call(void 0, config.actions);
|
|
158
|
+
_chunkAQJFKHBKcjs.flattenActionInputSchemas.call(void 0, config.actions, config.actionInputSchemas);
|
|
159
|
+
_chunkAQJFKHBKcjs.flattenActionTraceSamplers.call(void 0, config.actions, (_a = config.tracing) == null ? void 0 : _a.actions);
|
|
160
160
|
return new ActorDefinition(config);
|
|
161
161
|
}
|
|
162
162
|
function isStaticActorDefinition(definition) {
|
|
@@ -255,7 +255,7 @@ function validateSchemaSync(schemas, key, data) {
|
|
|
255
255
|
var _virtualwebsocket = require('@rivetkit/virtual-websocket');
|
|
256
256
|
var _ws = require('hono/ws');
|
|
257
257
|
function logger() {
|
|
258
|
-
return
|
|
258
|
+
return _chunkHFE4VBQUcjs.getLogger.call(void 0, "inline-websocket-adapter");
|
|
259
259
|
}
|
|
260
260
|
var InlineWebSocketAdapter = class {
|
|
261
261
|
#handler;
|
|
@@ -407,7 +407,7 @@ var InlineWebSocketAdapter = class {
|
|
|
407
407
|
|
|
408
408
|
// src/registry/log.ts
|
|
409
409
|
function logger2() {
|
|
410
|
-
return
|
|
410
|
+
return _chunkHFE4VBQUcjs.getLogger.call(void 0, "registry");
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
// src/serverless/configure.ts
|
|
@@ -453,8 +453,8 @@ async function configureServerlessPool(config) {
|
|
|
453
453
|
);
|
|
454
454
|
}
|
|
455
455
|
const customConfig = config.configurePool;
|
|
456
|
-
const clientConfig =
|
|
457
|
-
const dcsRes = await
|
|
456
|
+
const clientConfig = _chunkT5YMCOWYcjs.convertRegistryConfigToClientConfig.call(void 0, config);
|
|
457
|
+
const dcsRes = await _chunkT5YMCOWYcjs.getDatacenters.call(void 0, clientConfig);
|
|
458
458
|
const poolName = _nullishCoalesce(customConfig.name, () => ( "default"));
|
|
459
459
|
const serverlessToken = _nullishCoalesce(config.token, () => ( config.publicToken));
|
|
460
460
|
const headers = {
|
|
@@ -476,7 +476,7 @@ async function configureServerlessPool(config) {
|
|
|
476
476
|
metadata: _nullishCoalesce(customConfig.metadata, () => ( {})),
|
|
477
477
|
drain_on_version_upgrade: _nullishCoalesce(customConfig.drainOnVersionUpgrade, () => ( true))
|
|
478
478
|
};
|
|
479
|
-
await
|
|
479
|
+
await _chunkT5YMCOWYcjs.updateRunnerConfig.call(void 0, clientConfig, poolName, {
|
|
480
480
|
datacenters: Object.fromEntries(
|
|
481
481
|
dcsRes.datacenters.map((dc) => [dc.name, serverlessConfig])
|
|
482
482
|
)
|
|
@@ -493,7 +493,7 @@ async function configureServerlessPool(config) {
|
|
|
493
493
|
logger2().warn({
|
|
494
494
|
msg: "serverless pool configuration attempt failed",
|
|
495
495
|
attempts,
|
|
496
|
-
error:
|
|
496
|
+
error: _chunkHFE4VBQUcjs.stringifyError.call(void 0, error)
|
|
497
497
|
});
|
|
498
498
|
await sleep(CONFIGURE_RETRY_DELAY_MS);
|
|
499
499
|
}
|
|
@@ -501,7 +501,7 @@ async function configureServerlessPool(config) {
|
|
|
501
501
|
logger2().error({
|
|
502
502
|
msg: "failed to configure serverless pool, validate endpoint is configured correctly then restart this process",
|
|
503
503
|
attempts,
|
|
504
|
-
error:
|
|
504
|
+
error: _chunkHFE4VBQUcjs.stringifyError.call(void 0, lastError)
|
|
505
505
|
});
|
|
506
506
|
throw lastError;
|
|
507
507
|
}
|
|
@@ -512,10 +512,10 @@ var _zod = require('zod');
|
|
|
512
512
|
// src/registry/config/envoy.ts
|
|
513
513
|
var _v4 = require('zod/v4');
|
|
514
514
|
var EnvoyConfigSchema = _v4.z.object({
|
|
515
|
-
poolName: _v4.z.string().default(() => _nullishCoalesce(
|
|
516
|
-
version: _v4.z.number().default(() => _nullishCoalesce(
|
|
515
|
+
poolName: _v4.z.string().default(() => _nullishCoalesce(_chunkHFE4VBQUcjs.getRivetPool.call(void 0, ), () => ( "default"))),
|
|
516
|
+
version: _v4.z.number().default(() => _nullishCoalesce(_chunkHFE4VBQUcjs.getRivetEnvoyVersion.call(void 0, ), () => ( 1))),
|
|
517
517
|
// Deprecated.
|
|
518
|
-
totalSlots: _v4.z.number().default(() => _nullishCoalesce(
|
|
518
|
+
totalSlots: _v4.z.number().default(() => _nullishCoalesce(_chunkHFE4VBQUcjs.getRivetTotalSlots.call(void 0, ), () => ( 1e5))),
|
|
519
519
|
nodeKey: _v4.z.string().optional()
|
|
520
520
|
});
|
|
521
521
|
|
|
@@ -553,7 +553,7 @@ var ServerlessConfigSchema = _v4.z.object({
|
|
|
553
553
|
*
|
|
554
554
|
* Can also be set via RIVET_PUBLIC_ENDPOINT environment variable.
|
|
555
555
|
*/
|
|
556
|
-
publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
556
|
+
publicEndpoint: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkHFE4VBQUcjs.getRivetPublicEndpoint.call(void 0, )))),
|
|
557
557
|
/**
|
|
558
558
|
* Token that clients should use when connecting via the public endpoint.
|
|
559
559
|
*
|
|
@@ -561,7 +561,7 @@ var ServerlessConfigSchema = _v4.z.object({
|
|
|
561
561
|
*
|
|
562
562
|
* Can also be specified in the publicEndpoint URL as `https://namespace:token@host`.
|
|
563
563
|
*/
|
|
564
|
-
publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
564
|
+
publicToken: _v4.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkHFE4VBQUcjs.getRivetPublicToken.call(void 0, ))))
|
|
565
565
|
// There is no publicNamespace config option because the frontend and backend
|
|
566
566
|
// cannot use different namespaces. The namespace is extracted from the
|
|
567
567
|
// publicEndpoint URL auth syntax if provided.
|
|
@@ -615,7 +615,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
615
615
|
* Runtime binding to use for RivetKit core.
|
|
616
616
|
* */
|
|
617
617
|
runtime: RuntimeKindSchema.optional().transform((val, ctx) => {
|
|
618
|
-
const rawRuntime = _nullishCoalesce(val, () => (
|
|
618
|
+
const rawRuntime = _nullishCoalesce(val, () => ( _chunkHFE4VBQUcjs.getRivetkitRuntime.call(void 0, )));
|
|
619
619
|
if (rawRuntime === void 0) {
|
|
620
620
|
return "auto";
|
|
621
621
|
}
|
|
@@ -652,7 +652,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
652
652
|
* */
|
|
653
653
|
logging: _zod.z.object({
|
|
654
654
|
baseLogger: _zod.z.custom().optional(),
|
|
655
|
-
level:
|
|
655
|
+
level: _chunkHFE4VBQUcjs.LogLevelSchema.optional()
|
|
656
656
|
}).optional().default(() => ({})),
|
|
657
657
|
// MARK: Routing
|
|
658
658
|
// // This is a function to allow for lazy configuration of upgradeWebSocket on the
|
|
@@ -670,9 +670,9 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
670
670
|
*
|
|
671
671
|
* Can also be set via RIVET_ENDPOINT environment variables.
|
|
672
672
|
*/
|
|
673
|
-
endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => (
|
|
674
|
-
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
675
|
-
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
673
|
+
endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => ( _chunkHFE4VBQUcjs.getRivetEngine.call(void 0, ))), () => ( _chunkHFE4VBQUcjs.getRivetEndpoint.call(void 0, )))),
|
|
674
|
+
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkHFE4VBQUcjs.getRivetToken.call(void 0, )))),
|
|
675
|
+
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkHFE4VBQUcjs.getRivetNamespace.call(void 0, )))),
|
|
676
676
|
headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional().default({}),
|
|
677
677
|
// MARK: Client
|
|
678
678
|
// TODO:
|
|
@@ -712,21 +712,21 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
712
712
|
*
|
|
713
713
|
* Starts the full Rust engine process locally.
|
|
714
714
|
*/
|
|
715
|
-
startEngine: _zod.z.boolean().default(() =>
|
|
715
|
+
startEngine: _zod.z.boolean().default(() => _chunkHFE4VBQUcjs.getRivetRunEngine.call(void 0, )),
|
|
716
716
|
/**
|
|
717
717
|
* @experimental
|
|
718
718
|
*
|
|
719
719
|
* Host to bind the spawned local engine process to.
|
|
720
720
|
*/
|
|
721
|
-
engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
721
|
+
engineHost: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkHFE4VBQUcjs.getRivetRunEngineHost.call(void 0, ), () => ( _chunkT5YMCOWYcjs.ENGINE_HOST))),
|
|
722
722
|
/**
|
|
723
723
|
* @experimental
|
|
724
724
|
*
|
|
725
725
|
* Port to bind the spawned local engine process to.
|
|
726
726
|
*/
|
|
727
|
-
enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(
|
|
727
|
+
enginePort: _zod.z.number().int().min(1).max(65535).optional().default(() => _nullishCoalesce(_chunkHFE4VBQUcjs.getRivetRunEnginePort.call(void 0, ), () => ( _chunkT5YMCOWYcjs.ENGINE_PORT))),
|
|
728
728
|
/** @experimental */
|
|
729
|
-
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
729
|
+
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkHFE4VBQUcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunkHFE4VBQUcjs.VERSION))),
|
|
730
730
|
/**
|
|
731
731
|
* Starts the first-party Services actor host when RivetKit manages
|
|
732
732
|
* a local engine. Enabled by default for a managed local Engine. Set
|
|
@@ -783,7 +783,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
783
783
|
}))
|
|
784
784
|
}).transform((config, ctx) => {
|
|
785
785
|
var _a, _b, _c;
|
|
786
|
-
const isDevEnv =
|
|
786
|
+
const isDevEnv = _chunkHFE4VBQUcjs.isDev.call(void 0, );
|
|
787
787
|
const sqliteBackend = _nullishCoalesce(((_a = config.sqlite) == null ? void 0 : _a.backend), () => ( ((_b = config.test) == null ? void 0 : _b.sqliteBackend)));
|
|
788
788
|
if (config.runtime === "wasm" && sqliteBackend === "local") {
|
|
789
789
|
ctx.addIssue({
|
|
@@ -793,7 +793,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
793
793
|
});
|
|
794
794
|
}
|
|
795
795
|
const sqlite = config.runtime === "wasm" && config.sqlite === void 0 ? { backend: "remote" } : config.sqlite;
|
|
796
|
-
const parsedEndpoint = config.endpoint ?
|
|
796
|
+
const parsedEndpoint = config.endpoint ? _chunkT5YMCOWYcjs.tryParseEndpoint.call(void 0, ctx, {
|
|
797
797
|
endpoint: config.endpoint,
|
|
798
798
|
path: ["endpoint"],
|
|
799
799
|
namespace: config.namespace,
|
|
@@ -812,19 +812,19 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
812
812
|
path: ["configurePool"]
|
|
813
813
|
});
|
|
814
814
|
}
|
|
815
|
-
const localEngineEndpoint =
|
|
815
|
+
const localEngineEndpoint = _chunkT5YMCOWYcjs.buildEngineEndpoint.call(void 0,
|
|
816
816
|
config.engineHost,
|
|
817
817
|
config.enginePort
|
|
818
818
|
);
|
|
819
819
|
const endpoint = config.startEngine ? localEngineEndpoint : _nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.endpoint), () => ( (isDevEnv ? localEngineEndpoint : void 0)));
|
|
820
820
|
const engineSpawn = !parsedEndpoint && Boolean(endpoint);
|
|
821
|
-
const startServices = _nullishCoalesce(_nullishCoalesce(config.startServices, () => (
|
|
821
|
+
const startServices = _nullishCoalesce(_nullishCoalesce(config.startServices, () => ( _chunkHFE4VBQUcjs.getRivetRunServices.call(void 0, ))), () => ( engineSpawn));
|
|
822
822
|
const validateServerlessEndpoint = Boolean(
|
|
823
823
|
config.startEngine || parsedEndpoint
|
|
824
824
|
);
|
|
825
825
|
const namespace = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.namespace), () => ( config.namespace)), () => ( "default"));
|
|
826
|
-
const token = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token)), () => ( (endpoint &&
|
|
827
|
-
const parsedPublicEndpoint = config.serverless.publicEndpoint ?
|
|
826
|
+
const token = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config.token)), () => ( (endpoint && _chunkT5YMCOWYcjs.isLocalEngineEndpoint.call(void 0, endpoint) ? "default" : void 0)));
|
|
827
|
+
const parsedPublicEndpoint = config.serverless.publicEndpoint ? _chunkT5YMCOWYcjs.tryParseEndpoint.call(void 0, ctx, {
|
|
828
828
|
endpoint: config.serverless.publicEndpoint,
|
|
829
829
|
path: ["serverless", "publicEndpoint"]
|
|
830
830
|
}) : void 0;
|
|
@@ -861,7 +861,7 @@ function buildActorNames(config) {
|
|
|
861
861
|
Object.keys(config.use).map((actorName) => {
|
|
862
862
|
const definition = config.use[actorName];
|
|
863
863
|
const options = _nullishCoalesce(definition.config.options, () => ( {}));
|
|
864
|
-
const runMeta =
|
|
864
|
+
const runMeta = _chunkAQJFKHBKcjs.getRunMetadata.call(void 0, definition.config.run);
|
|
865
865
|
const metadata = {};
|
|
866
866
|
metadata.icon = _nullishCoalesce(options.icon, () => ( runMeta.icon));
|
|
867
867
|
metadata.name = _nullishCoalesce(options.name, () => ( runMeta.name));
|
|
@@ -929,7 +929,7 @@ var DocRegistryConfigSchema = _zod.z.object({
|
|
|
929
929
|
noWelcome: _zod.z.boolean().optional().describe("Disable the welcome message on startup. Default: false"),
|
|
930
930
|
sqlite: DocSqliteConfigSchema,
|
|
931
931
|
logging: _zod.z.object({
|
|
932
|
-
level:
|
|
932
|
+
level: _chunkHFE4VBQUcjs.LogLevelSchema.optional().describe(
|
|
933
933
|
"Log level for RivetKit. Default: 'warn'"
|
|
934
934
|
)
|
|
935
935
|
}).optional().describe("Logging configuration."),
|
|
@@ -1569,7 +1569,7 @@ var NapiCoreRuntime = (_class = class {
|
|
|
1569
1569
|
if (!(active == null ? void 0 : active.sameActorInstance(ownerCtx))) {
|
|
1570
1570
|
return ownerCtx;
|
|
1571
1571
|
}
|
|
1572
|
-
const applicationSpan =
|
|
1572
|
+
const applicationSpan = _chunkT5YMCOWYcjs.readActiveTraceHeaders.call(void 0, );
|
|
1573
1573
|
if (!applicationSpan) {
|
|
1574
1574
|
return active;
|
|
1575
1575
|
}
|
|
@@ -1782,7 +1782,7 @@ var NapiCoreRuntime = (_class = class {
|
|
|
1782
1782
|
const span = (_a = nativeCtx.invocationTraceContext()) == null ? void 0 : _a.span;
|
|
1783
1783
|
return this.#invocationContext.run(
|
|
1784
1784
|
nativeCtx,
|
|
1785
|
-
() =>
|
|
1785
|
+
() => _chunkT5YMCOWYcjs.runWithActorInvocationSpan.call(void 0, span, run)
|
|
1786
1786
|
);
|
|
1787
1787
|
}
|
|
1788
1788
|
actorInvocationTraceContext(ctx) {
|
|
@@ -2160,8 +2160,8 @@ function runtimeBytesToArrayBuffer(value) {
|
|
|
2160
2160
|
function buildNativeHttpRequest(init) {
|
|
2161
2161
|
var _a;
|
|
2162
2162
|
const headers = new Headers(init.headers);
|
|
2163
|
-
const originalUrl = headers.get(
|
|
2164
|
-
headers.delete(
|
|
2163
|
+
const originalUrl = headers.get(_chunkT5YMCOWYcjs.HEADER_ORIGINAL_REQUEST_URL);
|
|
2164
|
+
headers.delete(_chunkT5YMCOWYcjs.HEADER_ORIGINAL_REQUEST_URL);
|
|
2165
2165
|
const url = _nullishCoalesce(originalUrl, () => ( (init.uri.startsWith("http") ? init.uri : new URL(init.uri, "http://127.0.0.1").toString())));
|
|
2166
2166
|
const method2 = init.method.toUpperCase();
|
|
2167
2167
|
const bodyForbidden = method2 === "GET" || method2 === "HEAD";
|
|
@@ -2240,7 +2240,7 @@ async function pumpResponseBody(reader, stream) {
|
|
|
2240
2240
|
}
|
|
2241
2241
|
} catch (error) {
|
|
2242
2242
|
try {
|
|
2243
|
-
await stream.error(
|
|
2243
|
+
await stream.error(_chunkHFE4VBQUcjs.stringifyError.call(void 0, error));
|
|
2244
2244
|
} catch (streamError) {
|
|
2245
2245
|
logger2().debug({
|
|
2246
2246
|
msg: "failed to report native http response stream error",
|
|
@@ -2408,7 +2408,7 @@ var RunHandlerCoordinator = class {
|
|
|
2408
2408
|
this.#run = run;
|
|
2409
2409
|
}
|
|
2410
2410
|
get inspectorKind() {
|
|
2411
|
-
return
|
|
2411
|
+
return _chunkAQJFKHBKcjs.getRunInspectorKind.call(void 0, this.#run);
|
|
2412
2412
|
}
|
|
2413
2413
|
async run(actorId, restart, callback) {
|
|
2414
2414
|
const state = this.#getOrCreate(actorId);
|
|
@@ -2516,7 +2516,7 @@ var RunHandlerCoordinator = class {
|
|
|
2516
2516
|
}
|
|
2517
2517
|
#initializeInspector(actorId, state) {
|
|
2518
2518
|
if (state.inspectorInitialized) return;
|
|
2519
|
-
const inspector =
|
|
2519
|
+
const inspector = _chunkAQJFKHBKcjs.createRunInspector.call(void 0, this.#run, {
|
|
2520
2520
|
actorId,
|
|
2521
2521
|
control: this.#control(actorId, state)
|
|
2522
2522
|
});
|
|
@@ -3474,7 +3474,7 @@ async function loadAutoRuntime(config, loaders = defaultRuntimeLoaders) {
|
|
|
3474
3474
|
nativeError = error;
|
|
3475
3475
|
logger2().warn({
|
|
3476
3476
|
msg: "native runtime failed to load; falling back to wasm",
|
|
3477
|
-
error:
|
|
3477
|
+
error: _chunkHFE4VBQUcjs.stringifyError.call(void 0, error)
|
|
3478
3478
|
});
|
|
3479
3479
|
}
|
|
3480
3480
|
try {
|
|
@@ -3483,7 +3483,7 @@ async function loadAutoRuntime(config, loaders = defaultRuntimeLoaders) {
|
|
|
3483
3483
|
throw new (0, _chunkMGI2VVF6cjs.RivetError)(
|
|
3484
3484
|
"config",
|
|
3485
3485
|
"runtime_unavailable",
|
|
3486
|
-
`RivetKit could not load a core runtime. Native runtime: ${
|
|
3486
|
+
`RivetKit could not load a core runtime. Native runtime: ${_chunkHFE4VBQUcjs.stringifyError.call(void 0, nativeError)} Wasm runtime: ${_chunkHFE4VBQUcjs.stringifyError.call(void 0, wasmError)}`,
|
|
3487
3487
|
{
|
|
3488
3488
|
public: true,
|
|
3489
3489
|
statusCode: 500
|
|
@@ -3691,7 +3691,7 @@ async function cleanupNativeSleepRuntimeState(runtime, ctx, afterTrackedWorkDrai
|
|
|
3691
3691
|
}).catch((error) => {
|
|
3692
3692
|
logger2().warn({
|
|
3693
3693
|
msg: "deferred native sleep cleanup failed",
|
|
3694
|
-
error:
|
|
3694
|
+
error: _chunkHFE4VBQUcjs.stringifyError.call(void 0, error)
|
|
3695
3695
|
});
|
|
3696
3696
|
});
|
|
3697
3697
|
return;
|
|
@@ -3863,10 +3863,10 @@ function decodeValue(value) {
|
|
|
3863
3863
|
if (!value || value.length === 0) {
|
|
3864
3864
|
return void 0;
|
|
3865
3865
|
}
|
|
3866
|
-
return
|
|
3866
|
+
return _chunkHFE4VBQUcjs.decodeCborCompat.call(void 0, value);
|
|
3867
3867
|
}
|
|
3868
3868
|
function encodeValue(value) {
|
|
3869
|
-
return
|
|
3869
|
+
return _chunkHFE4VBQUcjs.encodeCborCompat.call(void 0, value);
|
|
3870
3870
|
}
|
|
3871
3871
|
function normalizeArgs(value) {
|
|
3872
3872
|
return Array.isArray(value) ? value : value === void 0 || value === null ? [] : [value];
|
|
@@ -3902,7 +3902,7 @@ function isStructuredBridgeError(error) {
|
|
|
3902
3902
|
return _chunkMGI2VVF6cjs.isRivetErrorLike.call(void 0, error) && "__type" in error && (error.__type === "RivetError" || error.__type === "ActorError");
|
|
3903
3903
|
}
|
|
3904
3904
|
function encodeNativeCallbackError(error) {
|
|
3905
|
-
const structuredError = isStructuredBridgeError(error) ? error :
|
|
3905
|
+
const structuredError = isStructuredBridgeError(error) ? error : _chunkHFE4VBQUcjs.deconstructError.call(void 0, error, true);
|
|
3906
3906
|
const { encoded, droppedMetadataCause } = _chunkMGI2VVF6cjs.encodeBridgeRivetError.call(void 0, structuredError);
|
|
3907
3907
|
if (droppedMetadataCause !== void 0) {
|
|
3908
3908
|
logger2().warn(
|
|
@@ -3964,7 +3964,7 @@ function decodeWorkflowCbor(data) {
|
|
|
3964
3964
|
return null;
|
|
3965
3965
|
}
|
|
3966
3966
|
try {
|
|
3967
|
-
return
|
|
3967
|
+
return _chunkHFE4VBQUcjs.decodeCborCompat.call(void 0, new Uint8Array(data));
|
|
3968
3968
|
} catch (e3) {
|
|
3969
3969
|
return null;
|
|
3970
3970
|
}
|
|
@@ -4077,7 +4077,7 @@ function serializeWorkflowHistoryForJson(data) {
|
|
|
4077
4077
|
if (data === null) {
|
|
4078
4078
|
return null;
|
|
4079
4079
|
}
|
|
4080
|
-
const history =
|
|
4080
|
+
const history = _chunkVGJXSQMFcjs.decodeWorkflowHistoryTransport.call(void 0, data);
|
|
4081
4081
|
return jsonSafe({
|
|
4082
4082
|
nameRegistry: [...history.nameRegistry],
|
|
4083
4083
|
entries: history.entries.map((entry) => ({
|
|
@@ -4176,7 +4176,7 @@ var NativeConnAdapter = class {
|
|
|
4176
4176
|
this.#ctx = ctx;
|
|
4177
4177
|
this.#queueHibernationRemoval = queueHibernationRemoval;
|
|
4178
4178
|
this.#assertCanMutateState = assertCanMutateState;
|
|
4179
|
-
this[
|
|
4179
|
+
this[_chunkAQJFKHBKcjs.CONN_STATE_MANAGER_SYMBOL] = {
|
|
4180
4180
|
stateEnabled: true,
|
|
4181
4181
|
get state() {
|
|
4182
4182
|
return thisConn.state;
|
|
@@ -4193,7 +4193,7 @@ var NativeConnAdapter = class {
|
|
|
4193
4193
|
decodeValue(this.#runtime.connParams(this.#conn))
|
|
4194
4194
|
);
|
|
4195
4195
|
}
|
|
4196
|
-
[
|
|
4196
|
+
[_chunkAQJFKHBKcjs.RAW_STATE_SYMBOL]() {
|
|
4197
4197
|
return this.#readState();
|
|
4198
4198
|
}
|
|
4199
4199
|
get state() {
|
|
@@ -4223,7 +4223,7 @@ var NativeConnAdapter = class {
|
|
|
4223
4223
|
},
|
|
4224
4224
|
(newValue) => {
|
|
4225
4225
|
assertCurrentState();
|
|
4226
|
-
|
|
4226
|
+
_chunkHFE4VBQUcjs.assertJsonCompatValue.call(void 0, newValue);
|
|
4227
4227
|
}
|
|
4228
4228
|
);
|
|
4229
4229
|
}
|
|
@@ -4231,7 +4231,7 @@ var NativeConnAdapter = class {
|
|
|
4231
4231
|
var _a;
|
|
4232
4232
|
(_a = this.#assertCanMutateState) == null ? void 0 : _a.call(this);
|
|
4233
4233
|
const nextValue = unwrapWriteThroughProxy(value);
|
|
4234
|
-
|
|
4234
|
+
_chunkHFE4VBQUcjs.assertJsonCompatValue.call(void 0, nextValue);
|
|
4235
4235
|
this.#writeState(nextValue, { writeNative: true });
|
|
4236
4236
|
}
|
|
4237
4237
|
initializeState(value) {
|
|
@@ -5250,7 +5250,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5250
5250
|
this.#databaseProvider = databaseProvider;
|
|
5251
5251
|
}
|
|
5252
5252
|
this.#request = request;
|
|
5253
|
-
this[
|
|
5253
|
+
this[_chunkAQJFKHBKcjs.ACTOR_CONTEXT_INTERNAL_SYMBOL] = new NativeWorkflowRuntimeAdapter(
|
|
5254
5254
|
this,
|
|
5255
5255
|
() => this.#logByInvocationScope.delete(
|
|
5256
5256
|
_nullishCoalesce(this.#runtime.currentInvocationScope(), () => ( NO_INVOCATION_SCOPE))
|
|
@@ -5278,7 +5278,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5278
5278
|
}
|
|
5279
5279
|
throw databaseClientNotReadyError();
|
|
5280
5280
|
}
|
|
5281
|
-
[
|
|
5281
|
+
[_chunkAQJFKHBKcjs.RAW_STATE_SYMBOL]() {
|
|
5282
5282
|
if (!this.#stateEnabled) {
|
|
5283
5283
|
throw stateNotEnabledError();
|
|
5284
5284
|
}
|
|
@@ -5305,7 +5305,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5305
5305
|
},
|
|
5306
5306
|
(newValue) => {
|
|
5307
5307
|
assertCurrentState();
|
|
5308
|
-
|
|
5308
|
+
_chunkHFE4VBQUcjs.assertJsonCompatValue.call(void 0, newValue);
|
|
5309
5309
|
}
|
|
5310
5310
|
);
|
|
5311
5311
|
}
|
|
@@ -5317,7 +5317,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5317
5317
|
}
|
|
5318
5318
|
this.#assertCanMutateState();
|
|
5319
5319
|
const nextValue = unwrapWriteThroughProxy(value);
|
|
5320
|
-
|
|
5320
|
+
_chunkHFE4VBQUcjs.assertJsonCompatValue.call(void 0, nextValue);
|
|
5321
5321
|
this.#writeState(nextValue, { scheduleSave: true });
|
|
5322
5322
|
}
|
|
5323
5323
|
initializeState(value) {
|
|
@@ -5543,7 +5543,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5543
5543
|
log: {
|
|
5544
5544
|
debug: (obj) => logger2().debug(obj)
|
|
5545
5545
|
},
|
|
5546
|
-
nativeDatabaseProvider:
|
|
5546
|
+
nativeDatabaseProvider: _chunkYWWIVWBRcjs.registerNativeStateTransactionOpener.call(void 0,
|
|
5547
5547
|
{
|
|
5548
5548
|
open: async (requestedActorId) => {
|
|
5549
5549
|
void requestedActorId;
|
|
@@ -5566,7 +5566,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5566
5566
|
return this.#db;
|
|
5567
5567
|
}
|
|
5568
5568
|
#bindDatabaseClient(client) {
|
|
5569
|
-
return
|
|
5569
|
+
return _chunkYWWIVWBRcjs.bindNativeStateTransactionContext.call(void 0, client, {
|
|
5570
5570
|
enter: async () => await this.#enterStateTransaction(),
|
|
5571
5571
|
exit: (scope) => this.#exitStateTransaction(
|
|
5572
5572
|
scope
|
|
@@ -5770,7 +5770,7 @@ var ActorContextHandleAdapter = class {
|
|
|
5770
5770
|
const trackedPromise = Promise.resolve(promise).catch((error) => {
|
|
5771
5771
|
logger2().warn({
|
|
5772
5772
|
msg: "keepAwake promise rejected",
|
|
5773
|
-
error:
|
|
5773
|
+
error: _chunkHFE4VBQUcjs.stringifyError.call(void 0, error)
|
|
5774
5774
|
});
|
|
5775
5775
|
}).then(() => null);
|
|
5776
5776
|
try {
|
|
@@ -6150,7 +6150,7 @@ function buildActorTracingConfig(actions, tracing) {
|
|
|
6150
6150
|
if (tracing === void 0) return void 0;
|
|
6151
6151
|
return {
|
|
6152
6152
|
sampler: tracing.sampler,
|
|
6153
|
-
actions:
|
|
6153
|
+
actions: _chunkAQJFKHBKcjs.flattenActionTraceSamplers.call(void 0, actions, tracing.actions)
|
|
6154
6154
|
};
|
|
6155
6155
|
}
|
|
6156
6156
|
function buildActorConfig(definition, registryConfig, runtimeKind) {
|
|
@@ -6191,7 +6191,7 @@ function buildActorConfig(definition, registryConfig, runtimeKind) {
|
|
|
6191
6191
|
maxOutgoingMessageSize: registryConfig.maxOutgoingMessageSize,
|
|
6192
6192
|
preloadMaxWorkflowBytes: options.preloadMaxWorkflowBytes,
|
|
6193
6193
|
preloadMaxConnectionsBytes: options.preloadMaxConnectionsBytes,
|
|
6194
|
-
actions: Object.keys(
|
|
6194
|
+
actions: Object.keys(_chunkAQJFKHBKcjs.flattenActionHandlers.call(void 0, config.actions)).sort().map((name) => ({ name })),
|
|
6195
6195
|
inspectorTabs: buildInspectorTabs(config.inspector, runtimeKind)
|
|
6196
6196
|
};
|
|
6197
6197
|
}
|
|
@@ -6267,10 +6267,10 @@ function validateInspectorTabSource(tabId, resolved) {
|
|
|
6267
6267
|
function buildNativeFactory(runtime, registryConfig, definition) {
|
|
6268
6268
|
var _a;
|
|
6269
6269
|
const config = definition.config;
|
|
6270
|
-
const databaseProvider = _nullishCoalesce(config.db, () => (
|
|
6271
|
-
const actionHandlers =
|
|
6270
|
+
const databaseProvider = _nullishCoalesce(config.db, () => ( _chunkYWWIVWBRcjs.db.call(void 0, )));
|
|
6271
|
+
const actionHandlers = _chunkAQJFKHBKcjs.flattenActionHandlers.call(void 0, config.actions);
|
|
6272
6272
|
const schemaConfig = {
|
|
6273
|
-
actionInputSchemas:
|
|
6273
|
+
actionInputSchemas: _chunkAQJFKHBKcjs.flattenActionInputSchemas.call(void 0,
|
|
6274
6274
|
config.actions,
|
|
6275
6275
|
config.actionInputSchemas
|
|
6276
6276
|
),
|
|
@@ -6278,9 +6278,9 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6278
6278
|
events: config.events,
|
|
6279
6279
|
queues: config.queues
|
|
6280
6280
|
};
|
|
6281
|
-
const createClient = (ctx) =>
|
|
6282
|
-
new (0,
|
|
6283
|
-
|
|
6281
|
+
const createClient = (ctx) => _chunkT5YMCOWYcjs.createClientWithDriver.call(void 0,
|
|
6282
|
+
new (0, _chunkT5YMCOWYcjs.RemoteEngineControlClient)(
|
|
6283
|
+
_chunkT5YMCOWYcjs.convertRegistryConfigToClientConfig.call(void 0, registryConfig)
|
|
6284
6284
|
),
|
|
6285
6285
|
{
|
|
6286
6286
|
encoding: "bare",
|
|
@@ -6292,13 +6292,13 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6292
6292
|
)
|
|
6293
6293
|
}
|
|
6294
6294
|
);
|
|
6295
|
-
const run =
|
|
6296
|
-
const runHandlerCoordinator =
|
|
6295
|
+
const run = _chunkAQJFKHBKcjs.getRunFunction.call(void 0, config.run);
|
|
6296
|
+
const runHandlerCoordinator = _chunkAQJFKHBKcjs.getRunInspectorKind.call(void 0, config.run) === "workflow" ? new RunHandlerCoordinator(config.run) : void 0;
|
|
6297
6297
|
const getNativeWorkflowInspector = (ctx) => {
|
|
6298
6298
|
var _a2, _b;
|
|
6299
6299
|
const actorId = callNativeSync(() => runtime.actorId(ctx));
|
|
6300
6300
|
const restart = () => callNativeSync(() => runtime.actorRestartRunHandler(ctx));
|
|
6301
|
-
return _nullishCoalesce(((_a2 = runHandlerCoordinator == null ? void 0 : runHandlerCoordinator.getInspector(actorId, restart)) == null ? void 0 : _a2.workflow), () => ( ((_b =
|
|
6301
|
+
return _nullishCoalesce(((_a2 = runHandlerCoordinator == null ? void 0 : runHandlerCoordinator.getInspector(actorId, restart)) == null ? void 0 : _a2.workflow), () => ( ((_b = _chunkAQJFKHBKcjs.getRunInspectorConfig.call(void 0, config.run, actorId)) == null ? void 0 : _b.workflow)));
|
|
6302
6302
|
};
|
|
6303
6303
|
const onStateChange = typeof config.onStateChange === "function" ? (actorCtx, nextState) => {
|
|
6304
6304
|
config.onStateChange(actorCtx, nextState);
|
|
@@ -6472,7 +6472,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6472
6472
|
400
|
|
6473
6473
|
);
|
|
6474
6474
|
}
|
|
6475
|
-
const cbor =
|
|
6475
|
+
const cbor = _chunkHFE4VBQUcjs.encodeCborCompat.call(void 0,
|
|
6476
6476
|
_nullishCoalesce(body.body, () => ( null))
|
|
6477
6477
|
);
|
|
6478
6478
|
const message = await runtime.actorQueueSend(ctx, name, cbor);
|
|
@@ -6859,7 +6859,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6859
6859
|
);
|
|
6860
6860
|
} finally {
|
|
6861
6861
|
runHandlerCoordinator == null ? void 0 : runHandlerCoordinator.destroy(actorId);
|
|
6862
|
-
|
|
6862
|
+
_chunkAQJFKHBKcjs.disposeRunInspector.call(void 0, config.run, actorId);
|
|
6863
6863
|
await actorCtx.dispose();
|
|
6864
6864
|
}
|
|
6865
6865
|
}
|
|
@@ -6871,7 +6871,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
6871
6871
|
const actorCtx = makeActorCtx(ctx);
|
|
6872
6872
|
const actorId = callNativeSync(() => runtime.actorId(ctx));
|
|
6873
6873
|
runHandlerCoordinator == null ? void 0 : runHandlerCoordinator.destroy(actorId);
|
|
6874
|
-
|
|
6874
|
+
_chunkAQJFKHBKcjs.disposeRunInspector.call(void 0, config.run, actorId);
|
|
6875
6875
|
try {
|
|
6876
6876
|
if (typeof config.onDestroy === "function") {
|
|
6877
6877
|
await config.onDestroy(actorCtx);
|
|
@@ -7088,7 +7088,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
7088
7088
|
...request,
|
|
7089
7089
|
abortController: requestAbortController
|
|
7090
7090
|
});
|
|
7091
|
-
const rawConnParams = handlerRequest.headers.get(
|
|
7091
|
+
const rawConnParams = handlerRequest.headers.get(_chunkT5YMCOWYcjs.HEADER_CONN_PARAMS);
|
|
7092
7092
|
let requestCtx;
|
|
7093
7093
|
let conn;
|
|
7094
7094
|
let removeRequestAbortListener;
|
|
@@ -7145,7 +7145,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
7145
7145
|
requestCtx,
|
|
7146
7146
|
handlerRequest
|
|
7147
7147
|
);
|
|
7148
|
-
if (!
|
|
7148
|
+
if (!_chunkT5YMCOWYcjs.isResponseLike.call(void 0, response)) {
|
|
7149
7149
|
throw new Error(
|
|
7150
7150
|
"onRequest handler must return a Response"
|
|
7151
7151
|
);
|
|
@@ -7235,15 +7235,15 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
7235
7235
|
}
|
|
7236
7236
|
);
|
|
7237
7237
|
})(),
|
|
7238
|
-
getWorkflowHistory:
|
|
7238
|
+
getWorkflowHistory: _chunkAQJFKHBKcjs.hasRunInspectorConfig.call(void 0, config.run) ? wrapNativeCallback(
|
|
7239
7239
|
async (error, payload) => {
|
|
7240
7240
|
var _a2;
|
|
7241
7241
|
const { ctx } = unwrapTsfnPayload(error, payload);
|
|
7242
7242
|
const history = (_a2 = getNativeWorkflowInspector(ctx)) == null ? void 0 : _a2.getHistory();
|
|
7243
|
-
return history == null ? void 0 :
|
|
7243
|
+
return history == null ? void 0 : _chunkHFE4VBQUcjs.toUint8Array.call(void 0, history);
|
|
7244
7244
|
}
|
|
7245
7245
|
) : void 0,
|
|
7246
|
-
replayWorkflow:
|
|
7246
|
+
replayWorkflow: _chunkAQJFKHBKcjs.hasRunInspectorConfig.call(void 0, config.run) ? wrapNativeCallback(
|
|
7247
7247
|
async (error, payload) => {
|
|
7248
7248
|
const { ctx, entryId } = unwrapTsfnPayload(
|
|
7249
7249
|
error,
|
|
@@ -7254,7 +7254,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
7254
7254
|
return void 0;
|
|
7255
7255
|
}
|
|
7256
7256
|
const history = await _asyncNullishCoalesce(await workflowInspector.replayFromStep(entryId), async () => ( null));
|
|
7257
|
-
return history == null ? void 0 :
|
|
7257
|
+
return history == null ? void 0 : _chunkHFE4VBQUcjs.toUint8Array.call(void 0, history);
|
|
7258
7258
|
}
|
|
7259
7259
|
) : void 0,
|
|
7260
7260
|
actions: Object.fromEntries(
|
|
@@ -7396,7 +7396,7 @@ async function buildServeConfig(config, resolveNativeBinaries = true) {
|
|
|
7396
7396
|
startServices: resolveNativeBinaries && config.startServices,
|
|
7397
7397
|
handleInspectorHttpInRuntime: true,
|
|
7398
7398
|
serverlessBasePath: config.serverless.basePath,
|
|
7399
|
-
serverlessPackageVersion:
|
|
7399
|
+
serverlessPackageVersion: _chunkHFE4VBQUcjs.VERSION,
|
|
7400
7400
|
serverlessClientEndpoint: config.publicEndpoint,
|
|
7401
7401
|
serverlessClientNamespace: config.publicNamespace,
|
|
7402
7402
|
serverlessClientToken: config.publicToken,
|
|
@@ -7410,12 +7410,12 @@ async function buildServeConfig(config, resolveNativeBinaries = true) {
|
|
|
7410
7410
|
} catch (error) {
|
|
7411
7411
|
logger2().warn({
|
|
7412
7412
|
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",
|
|
7413
|
-
error:
|
|
7413
|
+
error: _chunkHFE4VBQUcjs.stringifyError.call(void 0, error)
|
|
7414
7414
|
});
|
|
7415
7415
|
}
|
|
7416
7416
|
}
|
|
7417
7417
|
if (resolveNativeBinaries && config.startServices) {
|
|
7418
|
-
const servicesBinary =
|
|
7418
|
+
const servicesBinary = _chunkHFE4VBQUcjs.getEnvUniversal.call(void 0, "RIVET_SERVICES_BINARY");
|
|
7419
7419
|
if (servicesBinary) {
|
|
7420
7420
|
serveConfig.servicesBinaryPath = servicesBinary;
|
|
7421
7421
|
} else {
|
|
@@ -7430,13 +7430,13 @@ async function buildServeConfig(config, resolveNativeBinaries = true) {
|
|
|
7430
7430
|
serveConfig.engineHost = config.engineHost;
|
|
7431
7431
|
serveConfig.enginePort = config.enginePort;
|
|
7432
7432
|
if ((_a = config.test) == null ? void 0 : _a.enabled) {
|
|
7433
|
-
serveConfig.inspectorTestToken = _nullishCoalesce(
|
|
7433
|
+
serveConfig.inspectorTestToken = _nullishCoalesce(_chunkHFE4VBQUcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN"), () => ( "token"));
|
|
7434
7434
|
}
|
|
7435
7435
|
return serveConfig;
|
|
7436
7436
|
}
|
|
7437
7437
|
async function buildRegistryWithRuntime(config, runtime) {
|
|
7438
7438
|
var _a;
|
|
7439
|
-
if (((_a = config.test) == null ? void 0 : _a.enabled) &&
|
|
7439
|
+
if (((_a = config.test) == null ? void 0 : _a.enabled) && _chunkHFE4VBQUcjs.getEnvUniversal.call(void 0, "_RIVET_TEST_INSPECTOR_TOKEN") === void 0) {
|
|
7440
7440
|
trySetProcessEnv("_RIVET_TEST_INSPECTOR_TOKEN", "token");
|
|
7441
7441
|
}
|
|
7442
7442
|
if (runtime.kind === "napi") {
|
|
@@ -7509,7 +7509,7 @@ function createApplicationFetch(application, runtime) {
|
|
|
7509
7509
|
signal: abortController.signal
|
|
7510
7510
|
})
|
|
7511
7511
|
);
|
|
7512
|
-
if (!
|
|
7512
|
+
if (!_chunkT5YMCOWYcjs.isResponseLike.call(void 0, response)) {
|
|
7513
7513
|
throw new TypeError(
|
|
7514
7514
|
"registry.listen() application fetch must return a Response"
|
|
7515
7515
|
);
|
|
@@ -7564,7 +7564,7 @@ var Registry = class {
|
|
|
7564
7564
|
var _a;
|
|
7565
7565
|
this.#config = config;
|
|
7566
7566
|
if ((_a = config.logging) == null ? void 0 : _a.baseLogger) {
|
|
7567
|
-
|
|
7567
|
+
_chunkHFE4VBQUcjs.configureBaseLogger.call(void 0, config.logging.baseLogger);
|
|
7568
7568
|
}
|
|
7569
7569
|
this.#buildConfiguredRegistry = _nullishCoalesce((deps == null ? void 0 : deps.buildConfiguredRegistry), () => ( buildConfiguredRegistry));
|
|
7570
7570
|
this.routes = {
|
|
@@ -7796,10 +7796,10 @@ var Registry = class {
|
|
|
7796
7796
|
if (!opts.application) {
|
|
7797
7797
|
rejectServerless();
|
|
7798
7798
|
}
|
|
7799
|
-
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => (
|
|
7800
|
-
const publicDir = _nullishCoalesce(opts.publicDir, () => (
|
|
7799
|
+
const port = _nullishCoalesce(_nullishCoalesce(opts.port, () => ( _chunkHFE4VBQUcjs.parsePortEnv.call(void 0, process.env.RIVET_PORT))), () => ( 3e3));
|
|
7800
|
+
const publicDir = _nullishCoalesce(opts.publicDir, () => ( _chunkHFE4VBQUcjs.getRivetkitPublicDir.call(void 0, )));
|
|
7801
7801
|
const config = this.parseConfig();
|
|
7802
|
-
if (opts.application &&
|
|
7802
|
+
if (opts.application && _chunkHFE4VBQUcjs.getRivetkitRuntimeMode.call(void 0, ) !== "serverless") {
|
|
7803
7803
|
if (config.runtime === "wasm") {
|
|
7804
7804
|
throw new Error(
|
|
7805
7805
|
"registry.listen() requires the native runtime; use an application-owned HTTP server with WebAssembly"
|
|
@@ -7875,7 +7875,7 @@ var Registry = class {
|
|
|
7875
7875
|
return jsonRouteResponse(503, {
|
|
7876
7876
|
status: "not_started",
|
|
7877
7877
|
runtime: "rivetkit",
|
|
7878
|
-
version:
|
|
7878
|
+
version: _chunkHFE4VBQUcjs.VERSION
|
|
7879
7879
|
});
|
|
7880
7880
|
}
|
|
7881
7881
|
const { runtime, registry } = configured;
|
|
@@ -7883,7 +7883,7 @@ var Registry = class {
|
|
|
7883
7883
|
return jsonRouteResponse(501, {
|
|
7884
7884
|
status: "unsupported",
|
|
7885
7885
|
runtime: "rivetkit",
|
|
7886
|
-
version:
|
|
7886
|
+
version: _chunkHFE4VBQUcjs.VERSION
|
|
7887
7887
|
});
|
|
7888
7888
|
}
|
|
7889
7889
|
const response = await runtime.registryHealth(registry);
|
|
@@ -7958,14 +7958,14 @@ var Registry = class {
|
|
|
7958
7958
|
var _a;
|
|
7959
7959
|
if (!this.#runtimeServePromise) {
|
|
7960
7960
|
const configuredEnvoyVersion = (_a = this.#config.node) == null ? void 0 : _a.version;
|
|
7961
|
-
const envoyVersionSource = configuredEnvoyVersion !== void 0 ? "config" :
|
|
7961
|
+
const envoyVersionSource = configuredEnvoyVersion !== void 0 ? "config" : _chunkHFE4VBQUcjs.getRivetEnvoyVersion.call(void 0, ) !== void 0 ? "environment" : "default";
|
|
7962
7962
|
logger2().info({
|
|
7963
7963
|
msg: "starting rivetkit envoy",
|
|
7964
|
-
rivetkitVersion:
|
|
7964
|
+
rivetkitVersion: _chunkHFE4VBQUcjs.VERSION,
|
|
7965
7965
|
envoyVersion: config.node.version,
|
|
7966
7966
|
envoyVersionSource
|
|
7967
7967
|
});
|
|
7968
|
-
if (envoyVersionSource === "default" &&
|
|
7968
|
+
if (envoyVersionSource === "default" && _chunkHFE4VBQUcjs.getNodeEnv.call(void 0, ) === "production") {
|
|
7969
7969
|
logger2().error({
|
|
7970
7970
|
msg: "node version defaulted because neither config.node.version nor RIVET_NODE_VERSION is set; actors will not drain automatically across deploys. See https://rivet.dev/docs/actors/versions",
|
|
7971
7971
|
envoyVersion: config.node.version,
|
|
@@ -8069,7 +8069,7 @@ var Registry = class {
|
|
|
8069
8069
|
const modeAPromise = this.#runtimeServeConfiguredPromise;
|
|
8070
8070
|
const modeBPromise = this.#runtimeServerlessPromise;
|
|
8071
8071
|
const runtimes = /* @__PURE__ */ new Set();
|
|
8072
|
-
const localDevSignal = signalDriven &&
|
|
8072
|
+
const localDevSignal = signalDriven && _chunkHFE4VBQUcjs.getNodeEnv.call(void 0, ) !== "production" && config.engineSpawn && config.endpoint !== void 0 && _chunkT5YMCOWYcjs.isLocalEngineEndpoint.call(void 0, config.endpoint);
|
|
8073
8073
|
let gracePeriodMs = (_a = config.shutdown) == null ? void 0 : _a.gracePeriodMs;
|
|
8074
8074
|
if (gracePeriodMs === void 0) {
|
|
8075
8075
|
gracePeriodMs = localDevSignal ? LOCAL_DEV_SHUTDOWN_GRACE_PERIOD_MS : await _asyncNullishCoalesce(await this.#actorStopThresholdMs(
|
|
@@ -8181,7 +8181,7 @@ var Registry = class {
|
|
|
8181
8181
|
}
|
|
8182
8182
|
if (this.#runtimeReadyPromise) return this.#runtimeReadyPromise;
|
|
8183
8183
|
try {
|
|
8184
|
-
if (
|
|
8184
|
+
if (_chunkHFE4VBQUcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
8185
8185
|
return Promise.reject(
|
|
8186
8186
|
new Error(
|
|
8187
8187
|
"registry.startAndWait() requires envoy runtime mode; serverless registries become ready per request"
|
|
@@ -8205,7 +8205,7 @@ var Registry = class {
|
|
|
8205
8205
|
if (!configuredRegistryPromise || !serveLifecyclePromise) {
|
|
8206
8206
|
throw new Error("registry envoy startup did not initialize");
|
|
8207
8207
|
}
|
|
8208
|
-
const readyTimeoutMs = config.engineSpawn && config.endpoint !== void 0 &&
|
|
8208
|
+
const readyTimeoutMs = config.engineSpawn && config.endpoint !== void 0 && _chunkT5YMCOWYcjs.isLocalEngineEndpoint.call(void 0, config.endpoint) ? LOCAL_ENGINE_READY_TIMEOUT_MS : REGISTRY_READY_TIMEOUT_MS;
|
|
8209
8209
|
let timeout;
|
|
8210
8210
|
const timeoutPromise = new Promise((_resolve, reject) => {
|
|
8211
8211
|
var _a;
|
|
@@ -8255,8 +8255,8 @@ var Registry = class {
|
|
|
8255
8255
|
* ```
|
|
8256
8256
|
*/
|
|
8257
8257
|
start() {
|
|
8258
|
-
if (
|
|
8259
|
-
const publicDir = _nullishCoalesce(
|
|
8258
|
+
if (_chunkHFE4VBQUcjs.getRivetkitRuntimeMode.call(void 0, ) === "serverless") {
|
|
8259
|
+
const publicDir = _nullishCoalesce(_chunkHFE4VBQUcjs.getRivetkitPublicDir.call(void 0, ), () => ( "/public"));
|
|
8260
8260
|
this.listen({ publicDir }).catch((error) => {
|
|
8261
8261
|
logger2().error({ error }, "auto-listen failed; exiting");
|
|
8262
8262
|
if (typeof process !== "undefined" && typeof process.exit === "function") {
|
|
@@ -8372,13 +8372,13 @@ var Registry = class {
|
|
|
8372
8372
|
};
|
|
8373
8373
|
console.log();
|
|
8374
8374
|
console.log(
|
|
8375
|
-
` RivetKit ${
|
|
8375
|
+
` RivetKit ${_chunkHFE4VBQUcjs.VERSION} (Engine - ${kind === "serverless" ? "Serverless" : "Serverful"})`
|
|
8376
8376
|
);
|
|
8377
8377
|
if (config.namespace !== "default") {
|
|
8378
8378
|
logLine("Namespace", config.namespace);
|
|
8379
8379
|
}
|
|
8380
8380
|
if (config.endpoint) {
|
|
8381
|
-
const endpointType = config.startEngine ||
|
|
8381
|
+
const endpointType = config.startEngine || _chunkT5YMCOWYcjs.isLocalEngineEndpoint.call(void 0, config.endpoint) ? "local native" : "remote";
|
|
8382
8382
|
logLine("Endpoint", `${config.endpoint} (${endpointType})`);
|
|
8383
8383
|
}
|
|
8384
8384
|
if (kind === "serverless" && config.publicEndpoint) {
|
|
@@ -8448,5 +8448,5 @@ function setup(input) {
|
|
|
8448
8448
|
|
|
8449
8449
|
|
|
8450
8450
|
|
|
8451
|
-
exports.ALLOWED_PUBLIC_HEADERS =
|
|
8451
|
+
exports.ALLOWED_PUBLIC_HEADERS = _chunkT5YMCOWYcjs.ALLOWED_PUBLIC_HEADERS; exports.ActorDefinition = ActorDefinition; exports.ActorError = _chunkMGI2VVF6cjs.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 = _chunkMGI2VVF6cjs.RivetError; exports.RuntimeKindSchema = RuntimeKindSchema; exports.SqliteBackendSchema = SqliteBackendSchema; exports.SqliteConfigSchema = SqliteConfigSchema; exports.TestConfigSchema = TestConfigSchema; exports.UserError = _chunkMGI2VVF6cjs.UserError; exports.WasmRuntimeConfigSchema = WasmRuntimeConfigSchema; exports.actor = actor; exports.buildActorNames = buildActorNames; exports.createClientWithDriver = _chunkT5YMCOWYcjs.createClientWithDriver; exports.defineRunHandler = _chunkAQJFKHBKcjs.defineRunHandler; exports.event = event; exports.isStaticActorDefinition = isStaticActorDefinition; exports.isStaticActorInstance = isStaticActorInstance; exports.lookupInRegistry = lookupInRegistry; exports.noopNext = _chunkHFE4VBQUcjs.noopNext; exports.queue = queue; exports.setup = setup; exports.toUint8Array = _chunkHFE4VBQUcjs.toUint8Array;
|
|
8452
8452
|
//# sourceMappingURL=mod.cjs.map
|