rivetkit 2.0.36 → 2.0.37
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/tsup/{chunk-65O3MUPO.cjs → chunk-22NKW7F5.cjs} +9 -9
- package/dist/tsup/{chunk-65O3MUPO.cjs.map → chunk-22NKW7F5.cjs.map} +1 -1
- package/dist/tsup/{chunk-VIUUUBXQ.cjs → chunk-4V7MS7SO.cjs} +3 -3
- package/dist/tsup/{chunk-VIUUUBXQ.cjs.map → chunk-4V7MS7SO.cjs.map} +1 -1
- package/dist/tsup/{chunk-RTSLQIZ5.cjs → chunk-5VVIFC6M.cjs} +253 -253
- package/dist/tsup/{chunk-RTSLQIZ5.cjs.map → chunk-5VVIFC6M.cjs.map} +1 -1
- package/dist/tsup/{chunk-KJLJLNHR.js → chunk-5XGZXH74.js} +4 -4
- package/dist/tsup/chunk-5XGZXH74.js.map +1 -0
- package/dist/tsup/{chunk-6TLJAB64.cjs → chunk-B6BP74X3.cjs} +59 -59
- package/dist/tsup/{chunk-6TLJAB64.cjs.map → chunk-B6BP74X3.cjs.map} +1 -1
- package/dist/tsup/{chunk-X5GKJWTG.js → chunk-FIUSIG6J.js} +4 -4
- package/dist/tsup/{chunk-OYJU4B2I.cjs → chunk-G4N7FZMM.cjs} +114 -95
- package/dist/tsup/chunk-G4N7FZMM.cjs.map +1 -0
- package/dist/tsup/{chunk-EO5JABFU.js → chunk-J6TX5EFW.js} +27 -8
- package/dist/tsup/{chunk-EO5JABFU.js.map → chunk-J6TX5EFW.js.map} +1 -1
- package/dist/tsup/{chunk-7EGXCVJL.cjs → chunk-LYYTV7DN.cjs} +46 -46
- package/dist/tsup/{chunk-7EGXCVJL.cjs.map → chunk-LYYTV7DN.cjs.map} +1 -1
- package/dist/tsup/{chunk-Z5CSXFVY.js → chunk-RBA5AQTB.js} +5 -5
- package/dist/tsup/{chunk-D35UUQOR.js → chunk-RXA3ZMCL.js} +2 -2
- package/dist/tsup/{chunk-WRYYREBN.cjs → chunk-X5IX3YPO.cjs} +2 -2
- package/dist/tsup/{chunk-WRYYREBN.cjs.map → chunk-X5IX3YPO.cjs.map} +1 -1
- package/dist/tsup/{chunk-UDKWYSU3.js → chunk-XI335ZED.js} +2 -2
- package/dist/tsup/{chunk-UDKWYSU3.js.map → chunk-XI335ZED.js.map} +1 -1
- package/dist/tsup/{chunk-DSPZ7BZN.js → chunk-ZQBSQ6H3.js} +9 -9
- package/dist/tsup/chunk-ZQBSQ6H3.js.map +1 -0
- package/dist/tsup/client/mod.cjs +5 -5
- 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/driver-helpers/mod.cjs +3 -3
- package/dist/tsup/driver-helpers/mod.js +2 -2
- package/dist/tsup/driver-test-suite/mod.cjs +34 -34
- package/dist/tsup/driver-test-suite/mod.js +7 -7
- package/dist/tsup/mod.cjs +7 -7
- package/dist/tsup/mod.js +6 -6
- package/dist/tsup/test/mod.cjs +7 -7
- package/dist/tsup/test/mod.js +6 -6
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/package.json +3 -3
- package/src/client/config.ts +6 -4
- package/src/engine-process/constants.ts +1 -1
- package/src/engine-process/mod.ts +1 -1
- package/src/inspector/utils.ts +1 -1
- package/src/registry/config/index.ts +3 -3
- package/src/serverless/router.test.ts +133 -0
- package/src/serverless/router.ts +40 -1
- package/dist/tsup/chunk-DSPZ7BZN.js.map +0 -1
- package/dist/tsup/chunk-KJLJLNHR.js.map +0 -1
- package/dist/tsup/chunk-OYJU4B2I.cjs.map +0 -1
- /package/dist/tsup/{chunk-X5GKJWTG.js.map → chunk-FIUSIG6J.js.map} +0 -0
- /package/dist/tsup/{chunk-Z5CSXFVY.js.map → chunk-RBA5AQTB.js.map} +0 -0
- /package/dist/tsup/{chunk-D35UUQOR.js.map → chunk-RXA3ZMCL.js.map} +0 -0
|
@@ -31,7 +31,7 @@ var _chunkKDFWJKMJcjs = require('./chunk-KDFWJKMJ.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkX5IX3YPOcjs = require('./chunk-X5IX3YPO.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
@@ -385,7 +385,7 @@ function contentTypeForEncoding(encoding) {
|
|
|
385
385
|
} else if (encoding === "cbor" || encoding === "bare") {
|
|
386
386
|
return "application/octet-stream";
|
|
387
387
|
} else {
|
|
388
|
-
|
|
388
|
+
_chunkX5IX3YPOcjs.assertUnreachable.call(void 0, encoding);
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
function serializeWithEncoding(encoding, value, versionedDataHandler, version, zodSchema, toJson, toBare) {
|
|
@@ -412,7 +412,7 @@ function serializeWithEncoding(encoding, value, versionedDataHandler, version, z
|
|
|
412
412
|
version
|
|
413
413
|
);
|
|
414
414
|
} else {
|
|
415
|
-
|
|
415
|
+
_chunkX5IX3YPOcjs.assertUnreachable.call(void 0, encoding);
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
function deserializeWithEncoding(encoding, buffer, versionedDataHandler, zodSchema, fromJson, fromBare) {
|
|
@@ -448,13 +448,13 @@ function deserializeWithEncoding(encoding, buffer, versionedDataHandler, zodSche
|
|
|
448
448
|
const bareValue = versionedDataHandler.deserializeWithEmbeddedVersion(buffer);
|
|
449
449
|
return fromBare(bareValue);
|
|
450
450
|
} else {
|
|
451
|
-
|
|
451
|
+
_chunkX5IX3YPOcjs.assertUnreachable.call(void 0, encoding);
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
|
|
455
455
|
// src/actor/log.ts
|
|
456
456
|
function loggerWithoutContext() {
|
|
457
|
-
return
|
|
457
|
+
return _chunkX5IX3YPOcjs.getLogger.call(void 0, "actor-runtime");
|
|
458
458
|
}
|
|
459
459
|
|
|
460
460
|
// src/actor/utils.ts
|
|
@@ -1568,7 +1568,7 @@ async function handleAction(c, config6, actorDriver, actionName, actorId) {
|
|
|
1568
1568
|
(value) => ({ output: value }),
|
|
1569
1569
|
// BARE/CBOR: output needs to be CBOR-encoded to ArrayBuffer
|
|
1570
1570
|
(value) => ({
|
|
1571
|
-
output:
|
|
1571
|
+
output: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor2.encode(value))
|
|
1572
1572
|
})
|
|
1573
1573
|
);
|
|
1574
1574
|
const messageSize = serialized instanceof Uint8Array ? serialized.byteLength : serialized.length;
|
|
@@ -1611,7 +1611,7 @@ function getRequestEncoding(req) {
|
|
|
1611
1611
|
return result.data;
|
|
1612
1612
|
}
|
|
1613
1613
|
function getRequestExposeInternalError(_req) {
|
|
1614
|
-
return
|
|
1614
|
+
return _chunkX5IX3YPOcjs.getEnvUniversal.call(void 0, "RIVET_EXPOSE_ERRORS") === "1" || _chunkX5IX3YPOcjs.getEnvUniversal.call(void 0, "NODE_ENV") === "development";
|
|
1615
1615
|
}
|
|
1616
1616
|
function getRequestConnParams(req) {
|
|
1617
1617
|
const paramsParam = req.header(HEADER_CONN_PARAMS);
|
|
@@ -1622,7 +1622,7 @@ function getRequestConnParams(req) {
|
|
|
1622
1622
|
return JSON.parse(paramsParam);
|
|
1623
1623
|
} catch (err) {
|
|
1624
1624
|
throw new (0, _chunkSNAUKDDKcjs.InvalidParams)(
|
|
1625
|
-
`Invalid params JSON: ${
|
|
1625
|
+
`Invalid params JSON: ${_chunkX5IX3YPOcjs.stringifyError.call(void 0, err)}`
|
|
1626
1626
|
);
|
|
1627
1627
|
}
|
|
1628
1628
|
}
|
|
@@ -1632,19 +1632,19 @@ function getRequestConnParams(req) {
|
|
|
1632
1632
|
|
|
1633
1633
|
// src/engine-process/constants.ts
|
|
1634
1634
|
var ENGINE_PORT = 6420;
|
|
1635
|
-
var ENGINE_ENDPOINT = `http://
|
|
1635
|
+
var ENGINE_ENDPOINT = `http://127.0.0.1:${ENGINE_PORT}`;
|
|
1636
1636
|
|
|
1637
1637
|
// src/inspector/config.ts
|
|
1638
1638
|
|
|
1639
1639
|
var defaultTokenFn = () => {
|
|
1640
|
-
const envToken =
|
|
1640
|
+
const envToken = _chunkX5IX3YPOcjs.getRivetkitInspectorToken.call(void 0, );
|
|
1641
1641
|
if (envToken) {
|
|
1642
1642
|
return envToken;
|
|
1643
1643
|
}
|
|
1644
1644
|
return "";
|
|
1645
1645
|
};
|
|
1646
1646
|
var defaultEnabled = () => {
|
|
1647
|
-
return
|
|
1647
|
+
return _chunkX5IX3YPOcjs.isDev.call(void 0, ) || !_chunkX5IX3YPOcjs.getRivetkitInspectorDisable.call(void 0, );
|
|
1648
1648
|
};
|
|
1649
1649
|
var InspectorConfigSchema = _zod.z.object({
|
|
1650
1650
|
enabled: _zod.z.boolean().default(defaultEnabled),
|
|
@@ -1749,10 +1749,10 @@ var DriverConfigSchema = _zod.z.object({
|
|
|
1749
1749
|
|
|
1750
1750
|
var RunnerConfigSchema = _zod.z.object({
|
|
1751
1751
|
// MARK: Runner
|
|
1752
|
-
totalSlots: _zod.z.number().default(() => _nullishCoalesce(
|
|
1753
|
-
runnerName: _zod.z.string().default(() => _nullishCoalesce(
|
|
1754
|
-
runnerKey: _zod.z.string().optional().transform((x) => _nullishCoalesce(x, () => (
|
|
1755
|
-
version: _zod.z.number().default(() => _nullishCoalesce(
|
|
1752
|
+
totalSlots: _zod.z.number().default(() => _nullishCoalesce(_chunkX5IX3YPOcjs.getRivetTotalSlots.call(void 0, ), () => ( 1e5))),
|
|
1753
|
+
runnerName: _zod.z.string().default(() => _nullishCoalesce(_chunkX5IX3YPOcjs.getRivetRunner.call(void 0, ), () => ( "default"))),
|
|
1754
|
+
runnerKey: _zod.z.string().optional().transform((x) => _nullishCoalesce(x, () => ( _chunkX5IX3YPOcjs.getRivetRunnerKey.call(void 0, )))),
|
|
1755
|
+
version: _zod.z.number().default(() => _nullishCoalesce(_chunkX5IX3YPOcjs.getRivetRunnerVersion.call(void 0, ), () => ( 1)))
|
|
1756
1756
|
});
|
|
1757
1757
|
|
|
1758
1758
|
// src/registry/config/serverless.ts
|
|
@@ -1776,9 +1776,9 @@ var ServerlessConfigSchema = _zod.z.object({
|
|
|
1776
1776
|
* Downloads and starts the full Rust engine process.
|
|
1777
1777
|
* Auto-enabled in development mode when no endpoint is provided.
|
|
1778
1778
|
*/
|
|
1779
|
-
spawnEngine: _zod.z.boolean().default(() =>
|
|
1779
|
+
spawnEngine: _zod.z.boolean().default(() => _chunkX5IX3YPOcjs.getRivetRunEngine.call(void 0, )),
|
|
1780
1780
|
/** @experimental */
|
|
1781
|
-
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
1781
|
+
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkX5IX3YPOcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunkX5IX3YPOcjs.VERSION))),
|
|
1782
1782
|
/**
|
|
1783
1783
|
* @experimental
|
|
1784
1784
|
*
|
|
@@ -1807,7 +1807,7 @@ var ServerlessConfigSchema = _zod.z.object({
|
|
|
1807
1807
|
*
|
|
1808
1808
|
* Can also be set via RIVET_PUBLIC_ENDPOINT environment variable.
|
|
1809
1809
|
*/
|
|
1810
|
-
publicEndpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
1810
|
+
publicEndpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkX5IX3YPOcjs.getRivetPublicEndpoint.call(void 0, )))),
|
|
1811
1811
|
/**
|
|
1812
1812
|
* Token that clients should use when connecting via the public endpoint.
|
|
1813
1813
|
*
|
|
@@ -1815,7 +1815,7 @@ var ServerlessConfigSchema = _zod.z.object({
|
|
|
1815
1815
|
*
|
|
1816
1816
|
* Can also be specified in the publicEndpoint URL as `https://namespace:token@host`.
|
|
1817
1817
|
*/
|
|
1818
|
-
publicToken: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
1818
|
+
publicToken: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkX5IX3YPOcjs.getRivetPublicToken.call(void 0, ))))
|
|
1819
1819
|
// There is no publicNamespace config option because the frontend and backend
|
|
1820
1820
|
// cannot use different namespaces. The namespace is extracted from the
|
|
1821
1821
|
// publicEndpoint URL auth syntax if provided.
|
|
@@ -1857,7 +1857,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
1857
1857
|
* */
|
|
1858
1858
|
logging: _zod.z.object({
|
|
1859
1859
|
baseLogger: _zod.z.custom().optional(),
|
|
1860
|
-
level:
|
|
1860
|
+
level: _chunkX5IX3YPOcjs.LogLevelSchema.optional()
|
|
1861
1861
|
}).optional().default(() => ({})),
|
|
1862
1862
|
// MARK: Routing
|
|
1863
1863
|
// // This is a function to allow for lazy configuration of upgradeWebSocket on the
|
|
@@ -1875,9 +1875,9 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
1875
1875
|
*
|
|
1876
1876
|
* Can also be set via RIVET_ENDPOINT environment variables.
|
|
1877
1877
|
*/
|
|
1878
|
-
endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => (
|
|
1879
|
-
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
1880
|
-
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
1878
|
+
endpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(_nullishCoalesce(val, () => ( _chunkX5IX3YPOcjs.getRivetEngine.call(void 0, ))), () => ( _chunkX5IX3YPOcjs.getRivetEndpoint.call(void 0, )))),
|
|
1879
|
+
token: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkX5IX3YPOcjs.getRivetToken.call(void 0, )))),
|
|
1880
|
+
namespace: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkX5IX3YPOcjs.getRivetNamespace.call(void 0, )))),
|
|
1881
1881
|
headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional().default({}),
|
|
1882
1882
|
// MARK: Client
|
|
1883
1883
|
// TODO:
|
|
@@ -1912,7 +1912,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
1912
1912
|
() => RunnerConfigSchema.parse({})
|
|
1913
1913
|
)
|
|
1914
1914
|
}).transform((config6, ctx) => {
|
|
1915
|
-
const isDevEnv =
|
|
1915
|
+
const isDevEnv = _chunkX5IX3YPOcjs.isDev.call(void 0, );
|
|
1916
1916
|
const parsedEndpoint = config6.endpoint ? tryParseEndpoint(ctx, {
|
|
1917
1917
|
endpoint: config6.endpoint,
|
|
1918
1918
|
path: ["endpoint"],
|
|
@@ -1952,7 +1952,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
1952
1952
|
});
|
|
1953
1953
|
}
|
|
1954
1954
|
const serveManager = _nullishCoalesce(config6.serveManager, () => ( (isDevEnv && !endpoint)));
|
|
1955
|
-
const publicEndpoint = _nullishCoalesce((parsedPublicEndpoint == null ? void 0 : parsedPublicEndpoint.endpoint), () => ( (isDevEnv && serveManager ? `http://
|
|
1955
|
+
const publicEndpoint = _nullishCoalesce((parsedPublicEndpoint == null ? void 0 : parsedPublicEndpoint.endpoint), () => ( (isDevEnv && (serveManager || config6.serverless.spawnEngine) ? `http://127.0.0.1:${config6.managerPort}` : void 0)));
|
|
1956
1956
|
const publicNamespace = parsedPublicEndpoint == null ? void 0 : parsedPublicEndpoint.namespace;
|
|
1957
1957
|
const publicToken = _nullishCoalesce((parsedPublicEndpoint == null ? void 0 : parsedPublicEndpoint.token), () => ( config6.serverless.publicToken));
|
|
1958
1958
|
const willUseEngine = !!endpoint || config6.serverless.spawnEngine;
|
|
@@ -1984,7 +1984,7 @@ function buildActorNames(config6) {
|
|
|
1984
1984
|
|
|
1985
1985
|
// src/common/router.ts
|
|
1986
1986
|
function logger() {
|
|
1987
|
-
return
|
|
1987
|
+
return _chunkX5IX3YPOcjs.getLogger.call(void 0, "router");
|
|
1988
1988
|
}
|
|
1989
1989
|
function loggerMiddleware(logger4) {
|
|
1990
1990
|
return async (c, next) => {
|
|
@@ -2002,7 +2002,7 @@ function loggerMiddleware(logger4) {
|
|
|
2002
2002
|
reqSize: c.req.header("content-length"),
|
|
2003
2003
|
resSize: c.res.headers.get("content-length"),
|
|
2004
2004
|
userAgent: c.req.header("user-agent"),
|
|
2005
|
-
...
|
|
2005
|
+
..._chunkX5IX3YPOcjs.getLogHeaders.call(void 0, ) ? { allHeaders: JSON.stringify(c.req.header()) } : {}
|
|
2006
2006
|
});
|
|
2007
2007
|
};
|
|
2008
2008
|
}
|
|
@@ -2011,7 +2011,7 @@ function handleRouteNotFound(c) {
|
|
|
2011
2011
|
}
|
|
2012
2012
|
function handleRouteError(error, c) {
|
|
2013
2013
|
const exposeInternalError = getRequestExposeInternalError(c.req.raw);
|
|
2014
|
-
const { statusCode, group, code, message, metadata } =
|
|
2014
|
+
const { statusCode, group, code, message, metadata } = _chunkX5IX3YPOcjs.deconstructError.call(void 0,
|
|
2015
2015
|
error,
|
|
2016
2016
|
logger(),
|
|
2017
2017
|
{
|
|
@@ -2045,7 +2045,7 @@ function handleRouteError(error, c) {
|
|
|
2045
2045
|
group: value.group,
|
|
2046
2046
|
code: value.code,
|
|
2047
2047
|
message: value.message,
|
|
2048
|
-
metadata: value.metadata ?
|
|
2048
|
+
metadata: value.metadata ? _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor3.encode(value.metadata)) : null
|
|
2049
2049
|
})
|
|
2050
2050
|
);
|
|
2051
2051
|
return c.body(output, { status: statusCode });
|
|
@@ -2053,7 +2053,7 @@ function handleRouteError(error, c) {
|
|
|
2053
2053
|
function handleMetadataRequest(c, config6, runnerKind, clientEndpoint, clientNamespace, clientToken) {
|
|
2054
2054
|
const response = {
|
|
2055
2055
|
runtime: "rivetkit",
|
|
2056
|
-
version:
|
|
2056
|
+
version: _chunkX5IX3YPOcjs.VERSION,
|
|
2057
2057
|
runner: {
|
|
2058
2058
|
kind: runnerKind
|
|
2059
2059
|
},
|
|
@@ -2068,7 +2068,7 @@ function handleHealthRequest(c) {
|
|
|
2068
2068
|
return c.json({
|
|
2069
2069
|
status: "ok",
|
|
2070
2070
|
runtime: "rivetkit",
|
|
2071
|
-
version:
|
|
2071
|
+
version: _chunkX5IX3YPOcjs.VERSION
|
|
2072
2072
|
});
|
|
2073
2073
|
}
|
|
2074
2074
|
|
|
@@ -2198,7 +2198,7 @@ var cors = () => {
|
|
|
2198
2198
|
|
|
2199
2199
|
// src/utils/router.ts
|
|
2200
2200
|
function logger2() {
|
|
2201
|
-
return
|
|
2201
|
+
return _chunkX5IX3YPOcjs.getLogger.call(void 0, "router");
|
|
2202
2202
|
}
|
|
2203
2203
|
function createRouter(basePath, builder) {
|
|
2204
2204
|
const router = new (0, _zodopenapi.OpenAPIHono)({ strict: false }).basePath(basePath);
|
|
@@ -2257,7 +2257,7 @@ function buildOpenApiRequestBody(schema) {
|
|
|
2257
2257
|
|
|
2258
2258
|
// src/inspector/log.ts
|
|
2259
2259
|
function inspectorLogger() {
|
|
2260
|
-
return
|
|
2260
|
+
return _chunkX5IX3YPOcjs.getLogger.call(void 0, "inspector");
|
|
2261
2261
|
}
|
|
2262
2262
|
|
|
2263
2263
|
// src/inspector/handler.ts
|
|
@@ -2389,7 +2389,7 @@ async function handleWebSocketInspectorConnect({
|
|
|
2389
2389
|
}
|
|
2390
2390
|
});
|
|
2391
2391
|
} else {
|
|
2392
|
-
|
|
2392
|
+
_chunkX5IX3YPOcjs.assertUnreachable.call(void 0, message.body);
|
|
2393
2393
|
}
|
|
2394
2394
|
} catch (error) {
|
|
2395
2395
|
inspectorLogger().warn(
|
|
@@ -2649,7 +2649,7 @@ var StateManager = class {
|
|
|
2649
2649
|
#handleChange(path, value) {
|
|
2650
2650
|
if (path.startsWith("state")) {
|
|
2651
2651
|
let invalidPath = "";
|
|
2652
|
-
if (!
|
|
2652
|
+
if (!_chunkX5IX3YPOcjs.isCborSerializable.call(void 0,
|
|
2653
2653
|
value,
|
|
2654
2654
|
(invalidPathPart) => {
|
|
2655
2655
|
invalidPath = invalidPathPart;
|
|
@@ -2841,7 +2841,7 @@ var Conn = (_class = class {
|
|
|
2841
2841
|
tag: "Event",
|
|
2842
2842
|
val: {
|
|
2843
2843
|
name: value.name,
|
|
2844
|
-
args:
|
|
2844
|
+
args: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor4.encode(value.args))
|
|
2845
2845
|
}
|
|
2846
2846
|
}
|
|
2847
2847
|
})
|
|
@@ -2884,7 +2884,7 @@ function getValueLength(value) {
|
|
|
2884
2884
|
} else if (value instanceof ArrayBuffer || value instanceof SharedArrayBuffer || value instanceof Uint8Array) {
|
|
2885
2885
|
return value.byteLength;
|
|
2886
2886
|
} else {
|
|
2887
|
-
|
|
2887
|
+
_chunkX5IX3YPOcjs.assertUnreachable.call(void 0, value);
|
|
2888
2888
|
}
|
|
2889
2889
|
}
|
|
2890
2890
|
async function inputDataToBuffer(data) {
|
|
@@ -2989,7 +2989,7 @@ async function processMessage(message, actor, conn, handler) {
|
|
|
2989
2989
|
tag: "ActionResponse",
|
|
2990
2990
|
val: {
|
|
2991
2991
|
id,
|
|
2992
|
-
output:
|
|
2992
|
+
output: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor5.encode(value))
|
|
2993
2993
|
}
|
|
2994
2994
|
}
|
|
2995
2995
|
})
|
|
@@ -3017,10 +3017,10 @@ async function processMessage(message, actor, conn, handler) {
|
|
|
3017
3017
|
subscribe
|
|
3018
3018
|
});
|
|
3019
3019
|
} else {
|
|
3020
|
-
|
|
3020
|
+
_chunkX5IX3YPOcjs.assertUnreachable.call(void 0, message.body);
|
|
3021
3021
|
}
|
|
3022
3022
|
} catch (error) {
|
|
3023
|
-
const { group, code, message: message2, metadata } =
|
|
3023
|
+
const { group, code, message: message2, metadata } = _chunkX5IX3YPOcjs.deconstructError.call(void 0,
|
|
3024
3024
|
error,
|
|
3025
3025
|
actor.rLog,
|
|
3026
3026
|
{
|
|
@@ -3028,7 +3028,7 @@ async function processMessage(message, actor, conn, handler) {
|
|
|
3028
3028
|
actionId,
|
|
3029
3029
|
actionName
|
|
3030
3030
|
},
|
|
3031
|
-
|
|
3031
|
+
_chunkX5IX3YPOcjs.getEnvUniversal.call(void 0, "RIVET_EXPOSE_ERRORS") === "1" || _chunkX5IX3YPOcjs.getEnvUniversal.call(void 0, "NODE_ENV") === "development"
|
|
3032
3032
|
);
|
|
3033
3033
|
actor.rLog.debug({
|
|
3034
3034
|
msg: "sending error response",
|
|
@@ -3071,7 +3071,7 @@ async function processMessage(message, actor, conn, handler) {
|
|
|
3071
3071
|
group: value.group,
|
|
3072
3072
|
code: value.code,
|
|
3073
3073
|
message: value.message,
|
|
3074
|
-
metadata: value.metadata ?
|
|
3074
|
+
metadata: value.metadata ? _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0,
|
|
3075
3075
|
cbor5.encode(value.metadata)
|
|
3076
3076
|
) : null,
|
|
3077
3077
|
actionId: value.actionId !== void 0 ? value.actionId : null
|
|
@@ -3097,7 +3097,7 @@ async function routeWebSocket(request, requestPath, requestHeaders, config6, act
|
|
|
3097
3097
|
requestPath,
|
|
3098
3098
|
isHibernatable
|
|
3099
3099
|
});
|
|
3100
|
-
const closePromiseResolvers =
|
|
3100
|
+
const closePromiseResolvers = _chunkX5IX3YPOcjs.promiseWithResolvers.call(void 0, );
|
|
3101
3101
|
let handler;
|
|
3102
3102
|
let connDriver;
|
|
3103
3103
|
if (requestPath === PATH_CONNECT) {
|
|
@@ -3150,7 +3150,7 @@ async function routeWebSocket(request, requestPath, requestHeaders, config6, act
|
|
|
3150
3150
|
exposeInternalError
|
|
3151
3151
|
});
|
|
3152
3152
|
} catch (error) {
|
|
3153
|
-
const { group, code } =
|
|
3153
|
+
const { group, code } = _chunkX5IX3YPOcjs.deconstructError.call(void 0,
|
|
3154
3154
|
error,
|
|
3155
3155
|
loggerWithoutContext(),
|
|
3156
3156
|
{},
|
|
@@ -3202,7 +3202,7 @@ async function handleWebSocketConnect(setWebSocket, {
|
|
|
3202
3202
|
maxIncomingMessageSize: runConfig.maxIncomingMessageSize
|
|
3203
3203
|
}).then((message) => {
|
|
3204
3204
|
actor.processMessage(message, conn).catch((error) => {
|
|
3205
|
-
const { code } =
|
|
3205
|
+
const { code } = _chunkX5IX3YPOcjs.deconstructError.call(void 0,
|
|
3206
3206
|
error,
|
|
3207
3207
|
actor.rLog,
|
|
3208
3208
|
{
|
|
@@ -3213,7 +3213,7 @@ async function handleWebSocketConnect(setWebSocket, {
|
|
|
3213
3213
|
ws.close(1011, code);
|
|
3214
3214
|
});
|
|
3215
3215
|
}).catch((error) => {
|
|
3216
|
-
const { code } =
|
|
3216
|
+
const { code } = _chunkX5IX3YPOcjs.deconstructError.call(void 0,
|
|
3217
3217
|
error,
|
|
3218
3218
|
actor.rLog,
|
|
3219
3219
|
{
|
|
@@ -3248,7 +3248,7 @@ async function handleWebSocketConnect(setWebSocket, {
|
|
|
3248
3248
|
try {
|
|
3249
3249
|
actor.rLog.warn({ msg: "websocket error" });
|
|
3250
3250
|
} catch (error) {
|
|
3251
|
-
|
|
3251
|
+
_chunkX5IX3YPOcjs.deconstructError.call(void 0,
|
|
3252
3252
|
error,
|
|
3253
3253
|
actor.rLog,
|
|
3254
3254
|
{ wsEvent: "error" },
|
|
@@ -3317,7 +3317,7 @@ function truncateRawWebSocketPathPrefix(path) {
|
|
|
3317
3317
|
|
|
3318
3318
|
// src/manager/log.ts
|
|
3319
3319
|
function logger3() {
|
|
3320
|
-
return
|
|
3320
|
+
return _chunkX5IX3YPOcjs.getLogger.call(void 0, "actor-manager");
|
|
3321
3321
|
}
|
|
3322
3322
|
|
|
3323
3323
|
// src/manager/gateway.ts
|
|
@@ -3553,7 +3553,7 @@ async function createTestWebSocketProxy(proxyToActorWsPromise) {
|
|
|
3553
3553
|
promise: clientToProxyWsPromise,
|
|
3554
3554
|
resolve: clientToProxyWsResolve,
|
|
3555
3555
|
reject: clientToProxyWsReject
|
|
3556
|
-
} =
|
|
3556
|
+
} = _chunkX5IX3YPOcjs.promiseWithResolvers.call(void 0, );
|
|
3557
3557
|
try {
|
|
3558
3558
|
logger3().debug({ msg: "awaiting client websocket promise" });
|
|
3559
3559
|
proxyToActorWs = await proxyToActorWsPromise;
|
|
@@ -3947,12 +3947,12 @@ function buildManagerRouter(config6, managerDriver, getUpgradeWebSocket) {
|
|
|
3947
3947
|
responses: buildOpenApiResponses(ActorsKvGetResponseSchema)
|
|
3948
3948
|
});
|
|
3949
3949
|
router.openapi(route, async (c) => {
|
|
3950
|
-
if (
|
|
3950
|
+
if (_chunkX5IX3YPOcjs.getNodeEnv.call(void 0, ) === "development" && !config6.token) {
|
|
3951
3951
|
logger3().warn({
|
|
3952
3952
|
msg: "RIVET_TOKEN is not set, skipping KV store access checks in development mode. This endpoint will be disabled in production, unless you set the token."
|
|
3953
3953
|
});
|
|
3954
3954
|
}
|
|
3955
|
-
if (
|
|
3955
|
+
if (_chunkX5IX3YPOcjs.getNodeEnv.call(void 0, ) !== "development") {
|
|
3956
3956
|
if (!config6.token) {
|
|
3957
3957
|
throw new (0, _chunkSNAUKDDKcjs.RestrictedFeature)("KV store access");
|
|
3958
3958
|
}
|
|
@@ -3988,7 +3988,7 @@ function buildManagerRouter(config6, managerDriver, getUpgradeWebSocket) {
|
|
|
3988
3988
|
const output = await managerDriver[method](...args);
|
|
3989
3989
|
response = { ok: output };
|
|
3990
3990
|
} catch (rawErr) {
|
|
3991
|
-
const err =
|
|
3991
|
+
const err = _chunkX5IX3YPOcjs.deconstructError.call(void 0, rawErr, logger3(), {}, true);
|
|
3992
3992
|
response = { err };
|
|
3993
3993
|
}
|
|
3994
3994
|
return c.body(cbor6.encode(response));
|
|
@@ -4046,7 +4046,7 @@ function buildManagerRouter(config6, managerDriver, getUpgradeWebSocket) {
|
|
|
4046
4046
|
return await createTestWebSocketProxy(
|
|
4047
4047
|
clientToProxyWsPromise
|
|
4048
4048
|
);
|
|
4049
|
-
})(c,
|
|
4049
|
+
})(c, _chunkX5IX3YPOcjs.noopNext.call(void 0, ));
|
|
4050
4050
|
});
|
|
4051
4051
|
router.all(".test/inline-driver/send-request/*", async (c) => {
|
|
4052
4052
|
const actorId = c.req.header(HEADER_ACTOR_ID);
|
|
@@ -4076,9 +4076,9 @@ function buildManagerRouter(config6, managerDriver, getUpgradeWebSocket) {
|
|
|
4076
4076
|
} catch (error) {
|
|
4077
4077
|
logger3().error({
|
|
4078
4078
|
msg: "error in test inline raw http",
|
|
4079
|
-
error:
|
|
4079
|
+
error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
|
|
4080
4080
|
});
|
|
4081
|
-
const err =
|
|
4081
|
+
const err = _chunkX5IX3YPOcjs.deconstructError.call(void 0, error, logger3(), {}, true);
|
|
4082
4082
|
return c.json(
|
|
4083
4083
|
{
|
|
4084
4084
|
error: {
|
|
@@ -4126,7 +4126,7 @@ function buildManagerRouter(config6, managerDriver, getUpgradeWebSocket) {
|
|
|
4126
4126
|
} catch (error) {
|
|
4127
4127
|
logger3().error({
|
|
4128
4128
|
msg: "error forcing disconnect",
|
|
4129
|
-
error:
|
|
4129
|
+
error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
|
|
4130
4130
|
});
|
|
4131
4131
|
return c.text(`Error: ${error}`, 500);
|
|
4132
4132
|
}
|
|
@@ -4854,9 +4854,9 @@ var CONN_VERSIONED = _vbare.createVersionedDataHandler.call(void 0, {
|
|
|
4854
4854
|
// src/driver-helpers/utils.ts
|
|
4855
4855
|
function serializeEmptyPersistData(input) {
|
|
4856
4856
|
const persistData = {
|
|
4857
|
-
input: input !== void 0 ?
|
|
4857
|
+
input: input !== void 0 ? _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor7.encode(input)) : null,
|
|
4858
4858
|
hasInitialized: false,
|
|
4859
|
-
state:
|
|
4859
|
+
state: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor7.encode(void 0)),
|
|
4860
4860
|
scheduledEvents: []
|
|
4861
4861
|
};
|
|
4862
4862
|
return ACTOR_VERSIONED.serializeWithEmbeddedVersion(
|
|
@@ -4960,4 +4960,4 @@ function getInitialActorKvState(input) {
|
|
|
4960
4960
|
|
|
4961
4961
|
|
|
4962
4962
|
exports.createHttpDriver = createHttpDriver; exports.CURRENT_VERSION = CURRENT_VERSION; exports.TO_SERVER_VERSIONED = TO_SERVER_VERSIONED2; exports.TO_CLIENT_VERSIONED = TO_CLIENT_VERSIONED2; exports.HTTP_ACTION_REQUEST_VERSIONED = HTTP_ACTION_REQUEST_VERSIONED; exports.HTTP_ACTION_RESPONSE_VERSIONED = HTTP_ACTION_RESPONSE_VERSIONED; exports.HTTP_RESPONSE_ERROR_VERSIONED = HTTP_RESPONSE_ERROR_VERSIONED; exports.ToClientSchema = ToClientSchema; exports.ToServerSchema = ToServerSchema; exports.HttpActionRequestSchema = HttpActionRequestSchema; exports.HttpActionResponseSchema = HttpActionResponseSchema; exports.HttpResponseErrorSchema = HttpResponseErrorSchema; exports.uint8ArrayToBase64 = uint8ArrayToBase64; exports.contentTypeForEncoding = contentTypeForEncoding; exports.serializeWithEncoding = serializeWithEncoding; exports.deserializeWithEncoding = deserializeWithEncoding; exports.loggerWithoutContext = loggerWithoutContext; exports.assertUnreachable = assertUnreachable2; exports.DeadlineError = DeadlineError; exports.deadline = deadline; exports.generateSecureToken = generateSecureToken; exports.isStatePath = isStatePath; exports.isConnStatePath = isConnStatePath; exports.EncodingSchema = EncodingSchema; exports.CachedSerializer = CachedSerializer; exports.jsonStringifyCompat = jsonStringifyCompat; exports.CONN_CONNECTED_SYMBOL = CONN_CONNECTED_SYMBOL; exports.CONN_SPEAKS_RIVETKIT_SYMBOL = CONN_SPEAKS_RIVETKIT_SYMBOL; exports.CONN_DRIVER_SYMBOL = CONN_DRIVER_SYMBOL; exports.CONN_STATE_MANAGER_SYMBOL = CONN_STATE_MANAGER_SYMBOL; exports.CONN_SEND_MESSAGE_SYMBOL = CONN_SEND_MESSAGE_SYMBOL; exports.Conn = Conn; exports.ActorContext = ActorContext; exports.ActionContext = ActionContext; exports.CURRENT_VERSION2 = CURRENT_VERSION2; exports.ACTOR_VERSIONED = ACTOR_VERSIONED; exports.CONN_VERSIONED = CONN_VERSIONED; exports.BeforeConnectContext = BeforeConnectContext; exports.ConnectContext = ConnectContext; exports.CreateConnStateContext = CreateConnStateContext; exports.RequestContext = RequestContext; exports.WebSocketContext = WebSocketContext; exports.serializeActorKey = serializeActorKey; exports.deserializeActorKey = deserializeActorKey; exports.getValueLength = getValueLength; exports.inputDataToBuffer = inputDataToBuffer; exports.processMessage = processMessage; exports.KEYS = KEYS; exports.makeConnKey = makeConnKey; exports.PATH_CONNECT = PATH_CONNECT; exports.PATH_WEBSOCKET_BASE = PATH_WEBSOCKET_BASE; exports.PATH_WEBSOCKET_PREFIX = PATH_WEBSOCKET_PREFIX; exports.PATH_INSPECTOR_CONNECT = PATH_INSPECTOR_CONNECT; exports.HEADER_ACTOR_QUERY = HEADER_ACTOR_QUERY; exports.HEADER_ENCODING = HEADER_ENCODING; exports.HEADER_CONN_PARAMS = HEADER_CONN_PARAMS; exports.HEADER_ACTOR_ID = HEADER_ACTOR_ID; exports.HEADER_RIVET_TOKEN = HEADER_RIVET_TOKEN; exports.HEADER_RIVET_TARGET = HEADER_RIVET_TARGET; exports.HEADER_RIVET_ACTOR = HEADER_RIVET_ACTOR; exports.WS_PROTOCOL_STANDARD = WS_PROTOCOL_STANDARD; exports.WS_PROTOCOL_TARGET = WS_PROTOCOL_TARGET; exports.WS_PROTOCOL_ACTOR = WS_PROTOCOL_ACTOR; exports.WS_PROTOCOL_ENCODING = WS_PROTOCOL_ENCODING; exports.WS_PROTOCOL_CONN_PARAMS = WS_PROTOCOL_CONN_PARAMS; exports.WS_TEST_PROTOCOL_PATH = WS_TEST_PROTOCOL_PATH; exports.ALLOWED_PUBLIC_HEADERS = ALLOWED_PUBLIC_HEADERS; exports.handleAction = handleAction; exports.handleRawRequest = handleRawRequest; exports.ENGINE_PORT = ENGINE_PORT; exports.ENGINE_ENDPOINT = ENGINE_ENDPOINT; exports.InspectorConfigSchema = InspectorConfigSchema; exports.tryParseEndpoint = tryParseEndpoint; exports.DriverConfigSchema = DriverConfigSchema; exports.ActorsSchema = ActorsSchema; exports.TestConfigSchema = TestConfigSchema; exports.RegistryConfigSchema = RegistryConfigSchema; exports.buildActorNames = buildActorNames; exports.loggerMiddleware = loggerMiddleware; exports.handleRouteNotFound = handleRouteNotFound; exports.handleRouteError = handleRouteError; exports.handleMetadataRequest = handleMetadataRequest; exports.handleHealthRequest = handleHealthRequest; exports.routeWebSocket = routeWebSocket; exports.parseWebSocketProtocols = parseWebSocketProtocols; exports.truncateRawWebSocketPathPrefix = truncateRawWebSocketPathPrefix; exports.createRouter = createRouter; exports.buildManagerRouter = buildManagerRouter; exports.getInitialActorKvState = getInitialActorKvState;
|
|
4963
|
-
//# sourceMappingURL=chunk-
|
|
4963
|
+
//# sourceMappingURL=chunk-B6BP74X3.cjs.map
|