rivetkit 2.0.35 → 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/actor/errors.cjs +6 -2
- package/dist/tsup/actor/errors.cjs.map +1 -1
- package/dist/tsup/actor/errors.d.cts +7 -1
- package/dist/tsup/actor/errors.d.ts +7 -1
- package/dist/tsup/actor/errors.js +5 -1
- package/dist/tsup/{chunk-OAGIXNOC.cjs → chunk-22NKW7F5.cjs} +9 -9
- package/dist/tsup/{chunk-OAGIXNOC.cjs.map → chunk-22NKW7F5.cjs.map} +1 -1
- package/dist/tsup/{chunk-6KPMUCTX.js → chunk-2YHR67M4.js} +26 -2
- package/dist/tsup/{chunk-6KPMUCTX.js.map → chunk-2YHR67M4.js.map} +1 -1
- package/dist/tsup/{chunk-RLJYDDGJ.cjs → chunk-4V7MS7SO.cjs} +3 -3
- package/dist/tsup/{chunk-RLJYDDGJ.cjs.map → chunk-4V7MS7SO.cjs.map} +1 -1
- package/dist/tsup/{chunk-QY2XOK33.cjs → chunk-5VVIFC6M.cjs} +355 -265
- package/dist/tsup/chunk-5VVIFC6M.cjs.map +1 -0
- package/dist/tsup/{chunk-ESNM74WZ.js → chunk-5XGZXH74.js} +274 -320
- package/dist/tsup/chunk-5XGZXH74.js.map +1 -0
- package/dist/tsup/{chunk-SKOXACQD.cjs → chunk-B6BP74X3.cjs} +224 -270
- package/dist/tsup/chunk-B6BP74X3.cjs.map +1 -0
- package/dist/tsup/{chunk-W3X2CC5D.js → chunk-FIUSIG6J.js} +5 -5
- package/dist/tsup/{chunk-3BUVMAPG.cjs → chunk-G4N7FZMM.cjs} +151 -121
- package/dist/tsup/chunk-G4N7FZMM.cjs.map +1 -0
- package/dist/tsup/{chunk-UQPTBQYY.js → chunk-J6TX5EFW.js} +67 -37
- package/dist/tsup/chunk-J6TX5EFW.js.map +1 -0
- package/dist/tsup/{chunk-6N4L6DVT.cjs → chunk-LYYTV7DN.cjs} +49 -49
- package/dist/tsup/{chunk-6N4L6DVT.cjs.map → chunk-LYYTV7DN.cjs.map} +1 -1
- package/dist/tsup/{chunk-S4TG6JFA.js → chunk-RBA5AQTB.js} +5 -5
- package/dist/tsup/{chunk-2PH6FNGI.js → chunk-RXA3ZMCL.js} +2 -2
- package/dist/tsup/{chunk-FWT2BTVT.cjs → chunk-SNAUKDDK.cjs} +26 -2
- package/dist/tsup/chunk-SNAUKDDK.cjs.map +1 -0
- package/dist/tsup/{chunk-6KXKY3IE.cjs → chunk-X5IX3YPO.cjs} +13 -9
- package/dist/tsup/chunk-X5IX3YPO.cjs.map +1 -0
- package/dist/tsup/{chunk-UCUYH474.js → chunk-XI335ZED.js} +7 -3
- package/dist/tsup/chunk-XI335ZED.js.map +1 -0
- package/dist/tsup/{chunk-PSMT24GX.js → chunk-ZQBSQ6H3.js} +96 -6
- package/dist/tsup/chunk-ZQBSQ6H3.js.map +1 -0
- package/dist/tsup/client/mod.cjs +6 -6
- package/dist/tsup/client/mod.d.cts +8 -8
- package/dist/tsup/client/mod.d.ts +8 -8
- package/dist/tsup/client/mod.js +5 -5
- package/dist/tsup/common/log.cjs +3 -3
- package/dist/tsup/common/log.js +2 -2
- package/dist/tsup/common/websocket.cjs +4 -4
- package/dist/tsup/common/websocket.js +3 -3
- package/dist/tsup/{config-Qr8_jvK3.d.cts → config--NjwiYlS.d.cts} +24 -25
- package/dist/tsup/{config-DRt_4bDk.d.ts → config-CRuzI6n4.d.ts} +24 -25
- package/dist/tsup/{driver-zNEhBkiK.d.ts → driver-BcmckRaF.d.ts} +1 -1
- package/dist/tsup/driver-helpers/mod.cjs +4 -4
- package/dist/tsup/driver-helpers/mod.d.cts +2 -2
- package/dist/tsup/driver-helpers/mod.d.ts +2 -2
- package/dist/tsup/driver-helpers/mod.js +3 -3
- package/dist/tsup/driver-test-suite/mod.cjs +37 -37
- package/dist/tsup/driver-test-suite/mod.cjs.map +1 -1
- package/dist/tsup/driver-test-suite/mod.d.cts +2 -2
- package/dist/tsup/driver-test-suite/mod.d.ts +2 -2
- package/dist/tsup/driver-test-suite/mod.js +9 -9
- package/dist/tsup/{driver-D6heoKxK.d.cts → driver-yKjYx9Yy.d.cts} +1 -1
- package/dist/tsup/mod.cjs +8 -8
- package/dist/tsup/mod.d.cts +4 -4
- package/dist/tsup/mod.d.ts +4 -4
- package/dist/tsup/mod.js +7 -7
- package/dist/tsup/test/mod.cjs +8 -8
- package/dist/tsup/test/mod.d.cts +1 -1
- package/dist/tsup/test/mod.d.ts +1 -1
- package/dist/tsup/test/mod.js +7 -7
- package/dist/tsup/utils.cjs +3 -3
- package/dist/tsup/utils.js +2 -2
- package/package.json +2 -2
- package/src/actor/errors.ts +24 -0
- package/src/client/config.ts +58 -50
- package/src/common/router.ts +12 -0
- package/src/drivers/engine/config.ts +6 -3
- package/src/engine-process/constants.ts +1 -1
- package/src/engine-process/mod.ts +1 -1
- package/src/globals.d.ts +1 -0
- package/src/inspector/utils.ts +1 -1
- package/src/manager/router.ts +8 -1
- package/src/registry/config/index.ts +98 -90
- package/src/registry/config/serverless.ts +34 -3
- package/src/remote-manager-driver/api-utils.ts +3 -0
- package/src/serverless/router.test.ts +133 -0
- package/src/serverless/router.ts +63 -2
- package/src/utils/endpoint-parser.test.ts +184 -171
- package/src/utils/endpoint-parser.ts +70 -65
- package/src/utils/env-vars.ts +6 -0
- package/dist/tsup/chunk-3BUVMAPG.cjs.map +0 -1
- package/dist/tsup/chunk-6KXKY3IE.cjs.map +0 -1
- package/dist/tsup/chunk-ESNM74WZ.js.map +0 -1
- package/dist/tsup/chunk-FWT2BTVT.cjs.map +0 -1
- package/dist/tsup/chunk-PSMT24GX.js.map +0 -1
- package/dist/tsup/chunk-QY2XOK33.cjs.map +0 -1
- package/dist/tsup/chunk-SKOXACQD.cjs.map +0 -1
- package/dist/tsup/chunk-UCUYH474.js.map +0 -1
- package/dist/tsup/chunk-UQPTBQYY.js.map +0 -1
- /package/dist/tsup/{chunk-W3X2CC5D.js.map → chunk-FIUSIG6J.js.map} +0 -0
- /package/dist/tsup/{chunk-S4TG6JFA.js.map → chunk-RBA5AQTB.js.map} +0 -0
- /package/dist/tsup/{chunk-2PH6FNGI.js.map → chunk-RXA3ZMCL.js.map} +0 -0
|
@@ -29,9 +29,9 @@ var _chunkKDFWJKMJcjs = require('./chunk-KDFWJKMJ.cjs');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var _chunk6KXKY3IEcjs = require('./chunk-6KXKY3IE.cjs');
|
|
33
32
|
|
|
34
33
|
|
|
34
|
+
var _chunkX5IX3YPOcjs = require('./chunk-X5IX3YPO.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
@@ -45,7 +45,9 @@ var _chunk6KXKY3IEcjs = require('./chunk-6KXKY3IE.cjs');
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
var _chunkSNAUKDDKcjs = require('./chunk-SNAUKDDK.cjs');
|
|
49
51
|
|
|
50
52
|
// src/common/actor-router-consts.ts
|
|
51
53
|
var PATH_CONNECT = "/connect";
|
|
@@ -84,7 +86,7 @@ var ALLOWED_PUBLIC_HEADERS = [
|
|
|
84
86
|
var _zodopenapi = require('@hono/zod-openapi');
|
|
85
87
|
var _cborx = require('cbor-x'); var cbor6 = _interopRequireWildcard(_cborx); var cbor3 = _interopRequireWildcard(_cborx); var cbor2 = _interopRequireWildcard(_cborx); var cbor = _interopRequireWildcard(_cborx); var cbor5 = _interopRequireWildcard(_cborx); var cbor4 = _interopRequireWildcard(_cborx); var cbor7 = _interopRequireWildcard(_cborx);
|
|
86
88
|
var _invariant = require('invariant'); var _invariant2 = _interopRequireDefault(_invariant);
|
|
87
|
-
var _zod = require('zod');
|
|
89
|
+
var _zod = require('zod');
|
|
88
90
|
|
|
89
91
|
// src/actor/keys.ts
|
|
90
92
|
var EMPTY_KEY = "/";
|
|
@@ -383,7 +385,7 @@ function contentTypeForEncoding(encoding) {
|
|
|
383
385
|
} else if (encoding === "cbor" || encoding === "bare") {
|
|
384
386
|
return "application/octet-stream";
|
|
385
387
|
} else {
|
|
386
|
-
|
|
388
|
+
_chunkX5IX3YPOcjs.assertUnreachable.call(void 0, encoding);
|
|
387
389
|
}
|
|
388
390
|
}
|
|
389
391
|
function serializeWithEncoding(encoding, value, versionedDataHandler, version, zodSchema, toJson, toBare) {
|
|
@@ -410,7 +412,7 @@ function serializeWithEncoding(encoding, value, versionedDataHandler, version, z
|
|
|
410
412
|
version
|
|
411
413
|
);
|
|
412
414
|
} else {
|
|
413
|
-
|
|
415
|
+
_chunkX5IX3YPOcjs.assertUnreachable.call(void 0, encoding);
|
|
414
416
|
}
|
|
415
417
|
}
|
|
416
418
|
function deserializeWithEncoding(encoding, buffer, versionedDataHandler, zodSchema, fromJson, fromBare) {
|
|
@@ -446,13 +448,13 @@ function deserializeWithEncoding(encoding, buffer, versionedDataHandler, zodSche
|
|
|
446
448
|
const bareValue = versionedDataHandler.deserializeWithEmbeddedVersion(buffer);
|
|
447
449
|
return fromBare(bareValue);
|
|
448
450
|
} else {
|
|
449
|
-
|
|
451
|
+
_chunkX5IX3YPOcjs.assertUnreachable.call(void 0, encoding);
|
|
450
452
|
}
|
|
451
453
|
}
|
|
452
454
|
|
|
453
455
|
// src/actor/log.ts
|
|
454
456
|
function loggerWithoutContext() {
|
|
455
|
-
return
|
|
457
|
+
return _chunkX5IX3YPOcjs.getLogger.call(void 0, "actor-runtime");
|
|
456
458
|
}
|
|
457
459
|
|
|
458
460
|
// src/actor/utils.ts
|
|
@@ -462,7 +464,7 @@ function assertUnreachable2(x) {
|
|
|
462
464
|
value: `${x}`,
|
|
463
465
|
stack: new Error().stack
|
|
464
466
|
});
|
|
465
|
-
throw new (0,
|
|
467
|
+
throw new (0, _chunkSNAUKDDKcjs.Unreachable)(x);
|
|
466
468
|
}
|
|
467
469
|
var DeadlineError = class extends Error {
|
|
468
470
|
constructor() {
|
|
@@ -1523,7 +1525,7 @@ async function handleAction(c, config6, actorDriver, actionName, actorId) {
|
|
|
1523
1525
|
const parameters = getRequestConnParams(c.req);
|
|
1524
1526
|
const arrayBuffer = await c.req.arrayBuffer();
|
|
1525
1527
|
if (arrayBuffer.byteLength > config6.maxIncomingMessageSize) {
|
|
1526
|
-
throw new (0,
|
|
1528
|
+
throw new (0, _chunkSNAUKDDKcjs.IncomingMessageTooLong)();
|
|
1527
1529
|
}
|
|
1528
1530
|
const request = deserializeWithEncoding(
|
|
1529
1531
|
encoding,
|
|
@@ -1566,12 +1568,12 @@ async function handleAction(c, config6, actorDriver, actionName, actorId) {
|
|
|
1566
1568
|
(value) => ({ output: value }),
|
|
1567
1569
|
// BARE/CBOR: output needs to be CBOR-encoded to ArrayBuffer
|
|
1568
1570
|
(value) => ({
|
|
1569
|
-
output:
|
|
1571
|
+
output: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor2.encode(value))
|
|
1570
1572
|
})
|
|
1571
1573
|
);
|
|
1572
1574
|
const messageSize = serialized instanceof Uint8Array ? serialized.byteLength : serialized.length;
|
|
1573
1575
|
if (messageSize > config6.maxOutgoingMessageSize) {
|
|
1574
|
-
throw new (0,
|
|
1576
|
+
throw new (0, _chunkSNAUKDDKcjs.OutgoingMessageTooLong)();
|
|
1575
1577
|
}
|
|
1576
1578
|
return c.body(serialized, 200, {
|
|
1577
1579
|
"Content-Type": contentTypeForEncoding(encoding)
|
|
@@ -1604,12 +1606,12 @@ function getRequestEncoding(req) {
|
|
|
1604
1606
|
}
|
|
1605
1607
|
const result = EncodingSchema.safeParse(encodingParam);
|
|
1606
1608
|
if (!result.success) {
|
|
1607
|
-
throw new (0,
|
|
1609
|
+
throw new (0, _chunkSNAUKDDKcjs.InvalidEncoding)(encodingParam);
|
|
1608
1610
|
}
|
|
1609
1611
|
return result.data;
|
|
1610
1612
|
}
|
|
1611
1613
|
function getRequestExposeInternalError(_req) {
|
|
1612
|
-
return
|
|
1614
|
+
return _chunkX5IX3YPOcjs.getEnvUniversal.call(void 0, "RIVET_EXPOSE_ERRORS") === "1" || _chunkX5IX3YPOcjs.getEnvUniversal.call(void 0, "NODE_ENV") === "development";
|
|
1613
1615
|
}
|
|
1614
1616
|
function getRequestConnParams(req) {
|
|
1615
1617
|
const paramsParam = req.header(HEADER_CONN_PARAMS);
|
|
@@ -1619,8 +1621,8 @@ function getRequestConnParams(req) {
|
|
|
1619
1621
|
try {
|
|
1620
1622
|
return JSON.parse(paramsParam);
|
|
1621
1623
|
} catch (err) {
|
|
1622
|
-
throw new (0,
|
|
1623
|
-
`Invalid params JSON: ${
|
|
1624
|
+
throw new (0, _chunkSNAUKDDKcjs.InvalidParams)(
|
|
1625
|
+
`Invalid params JSON: ${_chunkX5IX3YPOcjs.stringifyError.call(void 0, err)}`
|
|
1624
1626
|
);
|
|
1625
1627
|
}
|
|
1626
1628
|
}
|
|
@@ -1628,160 +1630,21 @@ function getRequestConnParams(req) {
|
|
|
1628
1630
|
// src/registry/config/index.ts
|
|
1629
1631
|
|
|
1630
1632
|
|
|
1631
|
-
|
|
1632
|
-
// src/client/config.ts
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
// src/utils/endpoint-parser.ts
|
|
1636
|
-
|
|
1637
|
-
function zodParseEndpoint(endpoint) {
|
|
1638
|
-
const url = new URL(endpoint);
|
|
1639
|
-
if (url.search) {
|
|
1640
|
-
throw new _zod.z.ZodError([
|
|
1641
|
-
{
|
|
1642
|
-
code: "custom",
|
|
1643
|
-
message: "endpoint cannot contain a query string",
|
|
1644
|
-
path: ["endpoint"]
|
|
1645
|
-
}
|
|
1646
|
-
]);
|
|
1647
|
-
}
|
|
1648
|
-
if (url.hash) {
|
|
1649
|
-
throw new _zod.z.ZodError([
|
|
1650
|
-
{
|
|
1651
|
-
code: "custom",
|
|
1652
|
-
message: "endpoint cannot contain a fragment",
|
|
1653
|
-
path: ["endpoint"]
|
|
1654
|
-
}
|
|
1655
|
-
]);
|
|
1656
|
-
}
|
|
1657
|
-
const namespace = url.username ? decodeURIComponent(url.username) : void 0;
|
|
1658
|
-
const token = url.password ? decodeURIComponent(url.password) : void 0;
|
|
1659
|
-
if (token && !namespace) {
|
|
1660
|
-
throw new _zod.z.ZodError([
|
|
1661
|
-
{
|
|
1662
|
-
code: "custom",
|
|
1663
|
-
message: "endpoint cannot have a token without a namespace",
|
|
1664
|
-
path: ["endpoint"]
|
|
1665
|
-
}
|
|
1666
|
-
]);
|
|
1667
|
-
}
|
|
1668
|
-
url.username = "";
|
|
1669
|
-
url.password = "";
|
|
1670
|
-
const cleanedEndpoint = url.toString();
|
|
1671
|
-
return {
|
|
1672
|
-
endpoint: cleanedEndpoint,
|
|
1673
|
-
namespace,
|
|
1674
|
-
token
|
|
1675
|
-
};
|
|
1676
|
-
}
|
|
1677
|
-
var EndpointSchema = _zod.z.string().transform((endpoint) => {
|
|
1678
|
-
return zodParseEndpoint(endpoint);
|
|
1679
|
-
});
|
|
1680
|
-
function zodCheckDuplicateCredentials(resolvedEndpoint, config6, ctx) {
|
|
1681
|
-
if (resolvedEndpoint.namespace && config6.namespace) {
|
|
1682
|
-
ctx.addIssue({
|
|
1683
|
-
code: "custom",
|
|
1684
|
-
message: "cannot specify namespace both in endpoint URL and as a separate config option",
|
|
1685
|
-
path: ["namespace"]
|
|
1686
|
-
});
|
|
1687
|
-
}
|
|
1688
|
-
if (resolvedEndpoint.token && config6.token) {
|
|
1689
|
-
ctx.addIssue({
|
|
1690
|
-
code: "custom",
|
|
1691
|
-
message: "cannot specify token both in endpoint URL and as a separate config option",
|
|
1692
|
-
path: ["token"]
|
|
1693
|
-
});
|
|
1694
|
-
}
|
|
1695
|
-
}
|
|
1696
|
-
|
|
1697
|
-
// src/client/config.ts
|
|
1698
|
-
var ClientConfigSchemaBase = _zod2.default.object({
|
|
1699
|
-
/** Endpoint to connect to for Rivet Engine or RivetKit manager API. */
|
|
1700
|
-
endpoint: EndpointSchema.optional(),
|
|
1701
|
-
/** Token to use to authenticate with the API. */
|
|
1702
|
-
token: _zod2.default.string().optional(),
|
|
1703
|
-
/** Namespace to connect to. */
|
|
1704
|
-
namespace: _zod2.default.string().optional(),
|
|
1705
|
-
/** Name of the runner. This is used to group together runners in to different pools. */
|
|
1706
|
-
runnerName: _zod2.default.string().default(() => _nullishCoalesce(_chunk6KXKY3IEcjs.getRivetRunner.call(void 0, ), () => ( "default"))),
|
|
1707
|
-
encoding: EncodingSchema.default("bare"),
|
|
1708
|
-
headers: _zod2.default.record(_zod2.default.string(), _zod2.default.string()).optional().default(() => ({})),
|
|
1709
|
-
// See RunConfig.getUpgradeWebSocket
|
|
1710
|
-
//
|
|
1711
|
-
// This is required in the client config in order to support
|
|
1712
|
-
// `proxyWebSocket`
|
|
1713
|
-
getUpgradeWebSocket: _zod2.default.custom().optional(),
|
|
1714
|
-
/** Whether to automatically perform health checks when the client is created. */
|
|
1715
|
-
disableMetadataLookup: _zod2.default.boolean().optional().default(false),
|
|
1716
|
-
/** Whether to enable RivetKit Devtools integration. */
|
|
1717
|
-
devtools: _zod2.default.boolean().default(
|
|
1718
|
-
() => {
|
|
1719
|
-
var _a;
|
|
1720
|
-
return typeof window !== "undefined" && ((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.hostname) === "localhost";
|
|
1721
|
-
}
|
|
1722
|
-
)
|
|
1723
|
-
});
|
|
1724
|
-
var ClientConfigSchema = ClientConfigSchemaBase.transform(
|
|
1725
|
-
(config6, ctx) => transformClientConfig(config6, ctx)
|
|
1726
|
-
);
|
|
1727
|
-
function resolveEndpoint(parsedEndpoint) {
|
|
1728
|
-
if (parsedEndpoint) {
|
|
1729
|
-
return parsedEndpoint;
|
|
1730
|
-
}
|
|
1731
|
-
const envEndpoint = _nullishCoalesce(_chunk6KXKY3IEcjs.getRivetEngine.call(void 0, ), () => ( _chunk6KXKY3IEcjs.getRivetEndpoint.call(void 0, )));
|
|
1732
|
-
if (envEndpoint) {
|
|
1733
|
-
return EndpointSchema.parse(envEndpoint);
|
|
1734
|
-
}
|
|
1735
|
-
return void 0;
|
|
1736
|
-
}
|
|
1737
|
-
function validateClientConfig(resolvedEndpoint, config6, ctx) {
|
|
1738
|
-
if (resolvedEndpoint) {
|
|
1739
|
-
zodCheckDuplicateCredentials(resolvedEndpoint, config6, ctx);
|
|
1740
|
-
}
|
|
1741
|
-
}
|
|
1742
|
-
function transformClientConfig(config6, ctx) {
|
|
1743
|
-
const resolvedEndpoint = resolveEndpoint(config6.endpoint);
|
|
1744
|
-
if (ctx) {
|
|
1745
|
-
validateClientConfig(resolvedEndpoint, config6, ctx);
|
|
1746
|
-
}
|
|
1747
|
-
return {
|
|
1748
|
-
...config6,
|
|
1749
|
-
endpoint: resolvedEndpoint == null ? void 0 : resolvedEndpoint.endpoint,
|
|
1750
|
-
namespace: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce((resolvedEndpoint == null ? void 0 : resolvedEndpoint.namespace), () => ( config6.namespace)), () => ( _chunk6KXKY3IEcjs.getRivetNamespace.call(void 0, ))), () => ( "default")),
|
|
1751
|
-
token: _nullishCoalesce(_nullishCoalesce((resolvedEndpoint == null ? void 0 : resolvedEndpoint.token), () => ( config6.token)), () => ( _chunk6KXKY3IEcjs.getRivetToken.call(void 0, )))
|
|
1752
|
-
};
|
|
1753
|
-
}
|
|
1754
|
-
function convertRegistryConfigToClientConfig(config6) {
|
|
1755
|
-
var _a;
|
|
1756
|
-
return {
|
|
1757
|
-
endpoint: config6.endpoint,
|
|
1758
|
-
token: config6.token,
|
|
1759
|
-
namespace: config6.namespace,
|
|
1760
|
-
runnerName: config6.runner.runnerName,
|
|
1761
|
-
headers: config6.headers,
|
|
1762
|
-
encoding: "bare",
|
|
1763
|
-
getUpgradeWebSocket: void 0,
|
|
1764
|
-
// We don't need health checks for internal clients
|
|
1765
|
-
disableMetadataLookup: true,
|
|
1766
|
-
devtools: typeof window !== "undefined" && ((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.hostname) === "localhost"
|
|
1767
|
-
};
|
|
1768
|
-
}
|
|
1769
|
-
|
|
1770
1633
|
// src/engine-process/constants.ts
|
|
1771
1634
|
var ENGINE_PORT = 6420;
|
|
1772
|
-
var ENGINE_ENDPOINT = `http://
|
|
1635
|
+
var ENGINE_ENDPOINT = `http://127.0.0.1:${ENGINE_PORT}`;
|
|
1773
1636
|
|
|
1774
1637
|
// src/inspector/config.ts
|
|
1775
1638
|
|
|
1776
1639
|
var defaultTokenFn = () => {
|
|
1777
|
-
const envToken =
|
|
1640
|
+
const envToken = _chunkX5IX3YPOcjs.getRivetkitInspectorToken.call(void 0, );
|
|
1778
1641
|
if (envToken) {
|
|
1779
1642
|
return envToken;
|
|
1780
1643
|
}
|
|
1781
1644
|
return "";
|
|
1782
1645
|
};
|
|
1783
1646
|
var defaultEnabled = () => {
|
|
1784
|
-
return
|
|
1647
|
+
return _chunkX5IX3YPOcjs.isDev.call(void 0, ) || !_chunkX5IX3YPOcjs.getRivetkitInspectorDisable.call(void 0, );
|
|
1785
1648
|
};
|
|
1786
1649
|
var InspectorConfigSchema = _zod.z.object({
|
|
1787
1650
|
enabled: _zod.z.boolean().default(defaultEnabled),
|
|
@@ -1800,6 +1663,70 @@ var InspectorConfigSchema = _zod.z.object({
|
|
|
1800
1663
|
token: defaultTokenFn
|
|
1801
1664
|
}));
|
|
1802
1665
|
|
|
1666
|
+
// src/utils/endpoint-parser.ts
|
|
1667
|
+
function tryParseEndpoint(ctx, options) {
|
|
1668
|
+
const { endpoint, path = ["endpoint"], namespace: configNamespace, token: configToken } = options;
|
|
1669
|
+
let url;
|
|
1670
|
+
try {
|
|
1671
|
+
url = new URL(endpoint);
|
|
1672
|
+
} catch (e2) {
|
|
1673
|
+
ctx.addIssue({
|
|
1674
|
+
code: "custom",
|
|
1675
|
+
message: `invalid URL: ${endpoint}`,
|
|
1676
|
+
path
|
|
1677
|
+
});
|
|
1678
|
+
return void 0;
|
|
1679
|
+
}
|
|
1680
|
+
if (url.search) {
|
|
1681
|
+
ctx.addIssue({
|
|
1682
|
+
code: "custom",
|
|
1683
|
+
message: "endpoint cannot contain a query string",
|
|
1684
|
+
path
|
|
1685
|
+
});
|
|
1686
|
+
return void 0;
|
|
1687
|
+
}
|
|
1688
|
+
if (url.hash) {
|
|
1689
|
+
ctx.addIssue({
|
|
1690
|
+
code: "custom",
|
|
1691
|
+
message: "endpoint cannot contain a fragment",
|
|
1692
|
+
path
|
|
1693
|
+
});
|
|
1694
|
+
return void 0;
|
|
1695
|
+
}
|
|
1696
|
+
const namespace = url.username ? decodeURIComponent(url.username) : void 0;
|
|
1697
|
+
const token = url.password ? decodeURIComponent(url.password) : void 0;
|
|
1698
|
+
if (token && !namespace) {
|
|
1699
|
+
ctx.addIssue({
|
|
1700
|
+
code: "custom",
|
|
1701
|
+
message: "endpoint cannot have a token without a namespace",
|
|
1702
|
+
path
|
|
1703
|
+
});
|
|
1704
|
+
return void 0;
|
|
1705
|
+
}
|
|
1706
|
+
if (namespace && configNamespace) {
|
|
1707
|
+
ctx.addIssue({
|
|
1708
|
+
code: "custom",
|
|
1709
|
+
message: "cannot specify namespace both in endpoint URL and as a separate config option",
|
|
1710
|
+
path: ["namespace"]
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1713
|
+
if (token && configToken) {
|
|
1714
|
+
ctx.addIssue({
|
|
1715
|
+
code: "custom",
|
|
1716
|
+
message: "cannot specify token both in endpoint URL and as a separate config option",
|
|
1717
|
+
path: ["token"]
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1720
|
+
url.username = "";
|
|
1721
|
+
url.password = "";
|
|
1722
|
+
const cleanedEndpoint = url.toString();
|
|
1723
|
+
return {
|
|
1724
|
+
endpoint: cleanedEndpoint,
|
|
1725
|
+
namespace,
|
|
1726
|
+
token
|
|
1727
|
+
};
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1803
1730
|
// src/registry/config/driver.ts
|
|
1804
1731
|
|
|
1805
1732
|
var DriverConfigSchema = _zod.z.object({
|
|
@@ -1822,10 +1749,10 @@ var DriverConfigSchema = _zod.z.object({
|
|
|
1822
1749
|
|
|
1823
1750
|
var RunnerConfigSchema = _zod.z.object({
|
|
1824
1751
|
// MARK: Runner
|
|
1825
|
-
totalSlots: _zod.z.number().default(() => _nullishCoalesce(
|
|
1826
|
-
runnerName: _zod.z.string().default(() => _nullishCoalesce(
|
|
1827
|
-
runnerKey: _zod.z.string().optional().transform((x) => _nullishCoalesce(x, () => (
|
|
1828
|
-
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)))
|
|
1829
1756
|
});
|
|
1830
1757
|
|
|
1831
1758
|
// src/registry/config/serverless.ts
|
|
@@ -1849,9 +1776,9 @@ var ServerlessConfigSchema = _zod.z.object({
|
|
|
1849
1776
|
* Downloads and starts the full Rust engine process.
|
|
1850
1777
|
* Auto-enabled in development mode when no endpoint is provided.
|
|
1851
1778
|
*/
|
|
1852
|
-
spawnEngine: _zod.z.boolean().default(() =>
|
|
1779
|
+
spawnEngine: _zod.z.boolean().default(() => _chunkX5IX3YPOcjs.getRivetRunEngine.call(void 0, )),
|
|
1853
1780
|
/** @experimental */
|
|
1854
|
-
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(
|
|
1781
|
+
engineVersion: _zod.z.string().optional().default(() => _nullishCoalesce(_chunkX5IX3YPOcjs.getRivetRunEngineVersion.call(void 0, ), () => ( _chunkX5IX3YPOcjs.VERSION))),
|
|
1855
1782
|
/**
|
|
1856
1783
|
* @experimental
|
|
1857
1784
|
*
|
|
@@ -1863,17 +1790,35 @@ var ServerlessConfigSchema = _zod.z.object({
|
|
|
1863
1790
|
// MARK: Routing
|
|
1864
1791
|
// TODO: serverlessBasePath? better naming?
|
|
1865
1792
|
basePath: _zod.z.string().optional().default("/api/rivet"),
|
|
1793
|
+
// MARK: Public Endpoint Configuration
|
|
1866
1794
|
/**
|
|
1867
1795
|
* The endpoint that clients should connect to.
|
|
1868
1796
|
*
|
|
1869
1797
|
* This is useful if clients connect to serverless directly
|
|
1870
1798
|
* (e.g. `http://localhost:3000/api/rivet`), they will fetch
|
|
1871
1799
|
* `http://localhost:3000/api/rivet/metadata` and be redirected to
|
|
1872
|
-
* the
|
|
1800
|
+
* the public endpoint.
|
|
1801
|
+
*
|
|
1802
|
+
* Supports URL auth syntax for namespace and token:
|
|
1803
|
+
* - `https://namespace:token@api.rivet.dev`
|
|
1804
|
+
* - `https://namespace@api.rivet.dev`
|
|
1873
1805
|
*
|
|
1874
1806
|
* Auto-determined based on endpoint and NODE_ENV if not specified.
|
|
1807
|
+
*
|
|
1808
|
+
* Can also be set via RIVET_PUBLIC_ENDPOINT environment variable.
|
|
1809
|
+
*/
|
|
1810
|
+
publicEndpoint: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkX5IX3YPOcjs.getRivetPublicEndpoint.call(void 0, )))),
|
|
1811
|
+
/**
|
|
1812
|
+
* Token that clients should use when connecting via the public endpoint.
|
|
1813
|
+
*
|
|
1814
|
+
* Can also be set via RIVET_PUBLIC_TOKEN environment variable.
|
|
1815
|
+
*
|
|
1816
|
+
* Can also be specified in the publicEndpoint URL as `https://namespace:token@host`.
|
|
1875
1817
|
*/
|
|
1876
|
-
|
|
1818
|
+
publicToken: _zod.z.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkX5IX3YPOcjs.getRivetPublicToken.call(void 0, ))))
|
|
1819
|
+
// There is no publicNamespace config option because the frontend and backend
|
|
1820
|
+
// cannot use different namespaces. The namespace is extracted from the
|
|
1821
|
+
// publicEndpoint URL auth syntax if provided.
|
|
1877
1822
|
});
|
|
1878
1823
|
|
|
1879
1824
|
// src/registry/config/index.ts
|
|
@@ -1912,7 +1857,7 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
1912
1857
|
* */
|
|
1913
1858
|
logging: _zod.z.object({
|
|
1914
1859
|
baseLogger: _zod.z.custom().optional(),
|
|
1915
|
-
level:
|
|
1860
|
+
level: _chunkX5IX3YPOcjs.LogLevelSchema.optional()
|
|
1916
1861
|
}).optional().default(() => ({})),
|
|
1917
1862
|
// MARK: Routing
|
|
1918
1863
|
// // This is a function to allow for lazy configuration of upgradeWebSocket on the
|
|
@@ -1921,9 +1866,18 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
1921
1866
|
// // created or must be imported async using `await import(...)`
|
|
1922
1867
|
// getUpgradeWebSocket: z.custom<GetUpgradeWebSocket>().optional(),
|
|
1923
1868
|
// MARK: Runner Configuration
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1869
|
+
/**
|
|
1870
|
+
* Endpoint to connect to for Rivet Engine.
|
|
1871
|
+
*
|
|
1872
|
+
* Supports URL auth syntax for namespace and token:
|
|
1873
|
+
* - `https://namespace:token@api.rivet.dev`
|
|
1874
|
+
* - `https://namespace@api.rivet.dev`
|
|
1875
|
+
*
|
|
1876
|
+
* Can also be set via RIVET_ENDPOINT environment variables.
|
|
1877
|
+
*/
|
|
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, )))),
|
|
1927
1881
|
headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional().default({}),
|
|
1928
1882
|
// MARK: Client
|
|
1929
1883
|
// TODO:
|
|
@@ -1958,58 +1912,49 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
1958
1912
|
() => RunnerConfigSchema.parse({})
|
|
1959
1913
|
)
|
|
1960
1914
|
}).transform((config6, ctx) => {
|
|
1961
|
-
|
|
1962
|
-
const
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1915
|
+
const isDevEnv = _chunkX5IX3YPOcjs.isDev.call(void 0, );
|
|
1916
|
+
const parsedEndpoint = config6.endpoint ? tryParseEndpoint(ctx, {
|
|
1917
|
+
endpoint: config6.endpoint,
|
|
1918
|
+
path: ["endpoint"],
|
|
1919
|
+
namespace: config6.namespace,
|
|
1920
|
+
token: config6.token
|
|
1921
|
+
}) : void 0;
|
|
1922
|
+
if (parsedEndpoint && config6.serveManager) {
|
|
1968
1923
|
ctx.addIssue({
|
|
1969
1924
|
code: "custom",
|
|
1970
1925
|
message: "cannot specify both endpoint and serveManager"
|
|
1971
1926
|
});
|
|
1972
1927
|
}
|
|
1973
|
-
if (config6.serverless) {
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
});
|
|
1979
|
-
}
|
|
1980
|
-
if (config6.serverless.configureRunnerPool && !resolvedEndpoint && !config6.serverless.spawnEngine) {
|
|
1981
|
-
ctx.addIssue({
|
|
1982
|
-
code: "custom",
|
|
1983
|
-
message: "configureRunnerPool requires either endpoint or spawnEngine"
|
|
1984
|
-
});
|
|
1985
|
-
}
|
|
1986
|
-
if (!isDevEnv && !resolvedEndpoint && !config6.serverless.advertiseEndpoint) {
|
|
1987
|
-
ctx.addIssue({
|
|
1988
|
-
code: "custom",
|
|
1989
|
-
message: "must specify either endpoint or advertiseEndpoint when in production mode",
|
|
1990
|
-
path: ["advertiseEndpoint"]
|
|
1991
|
-
});
|
|
1992
|
-
}
|
|
1928
|
+
if (config6.serverless.spawnEngine && parsedEndpoint) {
|
|
1929
|
+
ctx.addIssue({
|
|
1930
|
+
code: "custom",
|
|
1931
|
+
message: "cannot specify both spawnEngine and endpoint"
|
|
1932
|
+
});
|
|
1993
1933
|
}
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
if (endpoint) {
|
|
2000
|
-
serveManager = _nullishCoalesce(config6.serveManager, () => ( false));
|
|
2001
|
-
advertiseEndpoint = _nullishCoalesce(config6.serverless.advertiseEndpoint, () => ( endpoint));
|
|
2002
|
-
} else if (isDevEnv) {
|
|
2003
|
-
serveManager = _nullishCoalesce(config6.serveManager, () => ( true));
|
|
2004
|
-
advertiseEndpoint = _nullishCoalesce(config6.serverless.advertiseEndpoint, () => ( (serveManager ? `http://localhost:${config6.managerPort}` : void 0)));
|
|
2005
|
-
} else {
|
|
2006
|
-
serveManager = _nullishCoalesce(config6.serveManager, () => ( false));
|
|
2007
|
-
_invariant2.default.call(void 0,
|
|
2008
|
-
config6.serverless.advertiseEndpoint,
|
|
2009
|
-
"advertiseEndpoint not specified in production mode"
|
|
2010
|
-
);
|
|
2011
|
-
advertiseEndpoint = config6.serverless.advertiseEndpoint;
|
|
1934
|
+
if (config6.serverless.configureRunnerPool && !parsedEndpoint && !config6.serverless.spawnEngine) {
|
|
1935
|
+
ctx.addIssue({
|
|
1936
|
+
code: "custom",
|
|
1937
|
+
message: "configureRunnerPool requires either endpoint or spawnEngine"
|
|
1938
|
+
});
|
|
2012
1939
|
}
|
|
1940
|
+
const endpoint = config6.serverless.spawnEngine ? ENGINE_ENDPOINT : parsedEndpoint == null ? void 0 : parsedEndpoint.endpoint;
|
|
1941
|
+
const namespace = _nullishCoalesce(_nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.namespace), () => ( config6.namespace)), () => ( "default"));
|
|
1942
|
+
const token = _nullishCoalesce((parsedEndpoint == null ? void 0 : parsedEndpoint.token), () => ( config6.token));
|
|
1943
|
+
const parsedPublicEndpoint = config6.serverless.publicEndpoint ? tryParseEndpoint(ctx, {
|
|
1944
|
+
endpoint: config6.serverless.publicEndpoint,
|
|
1945
|
+
path: ["serverless", "publicEndpoint"]
|
|
1946
|
+
}) : void 0;
|
|
1947
|
+
if ((parsedPublicEndpoint == null ? void 0 : parsedPublicEndpoint.namespace) && parsedPublicEndpoint.namespace !== namespace) {
|
|
1948
|
+
ctx.addIssue({
|
|
1949
|
+
code: "custom",
|
|
1950
|
+
message: `publicEndpoint namespace "${parsedPublicEndpoint.namespace}" must match backend namespace "${namespace}"`,
|
|
1951
|
+
path: ["serverless", "publicEndpoint"]
|
|
1952
|
+
});
|
|
1953
|
+
}
|
|
1954
|
+
const serveManager = _nullishCoalesce(config6.serveManager, () => ( (isDevEnv && !endpoint)));
|
|
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
|
+
const publicNamespace = parsedPublicEndpoint == null ? void 0 : parsedPublicEndpoint.namespace;
|
|
1957
|
+
const publicToken = _nullishCoalesce((parsedPublicEndpoint == null ? void 0 : parsedPublicEndpoint.token), () => ( config6.serverless.publicToken));
|
|
2013
1958
|
const willUseEngine = !!endpoint || config6.serverless.spawnEngine;
|
|
2014
1959
|
const inspector = willUseEngine ? {
|
|
2015
1960
|
...config6.inspector,
|
|
@@ -2021,11 +1966,13 @@ var RegistryConfigSchema = _zod.z.object({
|
|
|
2021
1966
|
namespace,
|
|
2022
1967
|
token,
|
|
2023
1968
|
serveManager,
|
|
2024
|
-
|
|
1969
|
+
publicEndpoint,
|
|
1970
|
+
publicNamespace,
|
|
1971
|
+
publicToken,
|
|
2025
1972
|
inspector,
|
|
2026
1973
|
serverless: {
|
|
2027
1974
|
...config6.serverless,
|
|
2028
|
-
|
|
1975
|
+
publicEndpoint
|
|
2029
1976
|
}
|
|
2030
1977
|
};
|
|
2031
1978
|
});
|
|
@@ -2037,7 +1984,7 @@ function buildActorNames(config6) {
|
|
|
2037
1984
|
|
|
2038
1985
|
// src/common/router.ts
|
|
2039
1986
|
function logger() {
|
|
2040
|
-
return
|
|
1987
|
+
return _chunkX5IX3YPOcjs.getLogger.call(void 0, "router");
|
|
2041
1988
|
}
|
|
2042
1989
|
function loggerMiddleware(logger4) {
|
|
2043
1990
|
return async (c, next) => {
|
|
@@ -2055,7 +2002,7 @@ function loggerMiddleware(logger4) {
|
|
|
2055
2002
|
reqSize: c.req.header("content-length"),
|
|
2056
2003
|
resSize: c.res.headers.get("content-length"),
|
|
2057
2004
|
userAgent: c.req.header("user-agent"),
|
|
2058
|
-
...
|
|
2005
|
+
..._chunkX5IX3YPOcjs.getLogHeaders.call(void 0, ) ? { allHeaders: JSON.stringify(c.req.header()) } : {}
|
|
2059
2006
|
});
|
|
2060
2007
|
};
|
|
2061
2008
|
}
|
|
@@ -2064,7 +2011,7 @@ function handleRouteNotFound(c) {
|
|
|
2064
2011
|
}
|
|
2065
2012
|
function handleRouteError(error, c) {
|
|
2066
2013
|
const exposeInternalError = getRequestExposeInternalError(c.req.raw);
|
|
2067
|
-
const { statusCode, group, code, message, metadata } =
|
|
2014
|
+
const { statusCode, group, code, message, metadata } = _chunkX5IX3YPOcjs.deconstructError.call(void 0,
|
|
2068
2015
|
error,
|
|
2069
2016
|
logger(),
|
|
2070
2017
|
{
|
|
@@ -2098,20 +2045,22 @@ function handleRouteError(error, c) {
|
|
|
2098
2045
|
group: value.group,
|
|
2099
2046
|
code: value.code,
|
|
2100
2047
|
message: value.message,
|
|
2101
|
-
metadata: value.metadata ?
|
|
2048
|
+
metadata: value.metadata ? _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor3.encode(value.metadata)) : null
|
|
2102
2049
|
})
|
|
2103
2050
|
);
|
|
2104
2051
|
return c.body(output, { status: statusCode });
|
|
2105
2052
|
}
|
|
2106
|
-
function handleMetadataRequest(c, config6, runnerKind, clientEndpoint) {
|
|
2053
|
+
function handleMetadataRequest(c, config6, runnerKind, clientEndpoint, clientNamespace, clientToken) {
|
|
2107
2054
|
const response = {
|
|
2108
2055
|
runtime: "rivetkit",
|
|
2109
|
-
version:
|
|
2056
|
+
version: _chunkX5IX3YPOcjs.VERSION,
|
|
2110
2057
|
runner: {
|
|
2111
2058
|
kind: runnerKind
|
|
2112
2059
|
},
|
|
2113
2060
|
actorNames: buildActorNames(config6),
|
|
2114
|
-
clientEndpoint
|
|
2061
|
+
clientEndpoint,
|
|
2062
|
+
clientNamespace,
|
|
2063
|
+
clientToken
|
|
2115
2064
|
};
|
|
2116
2065
|
return c.json(response);
|
|
2117
2066
|
}
|
|
@@ -2119,7 +2068,7 @@ function handleHealthRequest(c) {
|
|
|
2119
2068
|
return c.json({
|
|
2120
2069
|
status: "ok",
|
|
2121
2070
|
runtime: "rivetkit",
|
|
2122
|
-
version:
|
|
2071
|
+
version: _chunkX5IX3YPOcjs.VERSION
|
|
2123
2072
|
});
|
|
2124
2073
|
}
|
|
2125
2074
|
|
|
@@ -2249,7 +2198,7 @@ var cors = () => {
|
|
|
2249
2198
|
|
|
2250
2199
|
// src/utils/router.ts
|
|
2251
2200
|
function logger2() {
|
|
2252
|
-
return
|
|
2201
|
+
return _chunkX5IX3YPOcjs.getLogger.call(void 0, "router");
|
|
2253
2202
|
}
|
|
2254
2203
|
function createRouter(basePath, builder) {
|
|
2255
2204
|
const router = new (0, _zodopenapi.OpenAPIHono)({ strict: false }).basePath(basePath);
|
|
@@ -2308,7 +2257,7 @@ function buildOpenApiRequestBody(schema) {
|
|
|
2308
2257
|
|
|
2309
2258
|
// src/inspector/log.ts
|
|
2310
2259
|
function inspectorLogger() {
|
|
2311
|
-
return
|
|
2260
|
+
return _chunkX5IX3YPOcjs.getLogger.call(void 0, "inspector");
|
|
2312
2261
|
}
|
|
2313
2262
|
|
|
2314
2263
|
// src/inspector/handler.ts
|
|
@@ -2440,7 +2389,7 @@ async function handleWebSocketInspectorConnect({
|
|
|
2440
2389
|
}
|
|
2441
2390
|
});
|
|
2442
2391
|
} else {
|
|
2443
|
-
|
|
2392
|
+
_chunkX5IX3YPOcjs.assertUnreachable.call(void 0, message.body);
|
|
2444
2393
|
}
|
|
2445
2394
|
} catch (error) {
|
|
2446
2395
|
inspectorLogger().warn(
|
|
@@ -2551,7 +2500,7 @@ function createWebSocketDriver(hibernatable, encoding, closePromise, config6) {
|
|
|
2551
2500
|
messageSize,
|
|
2552
2501
|
maxOutgoingMessageSize: config6.maxOutgoingMessageSize
|
|
2553
2502
|
});
|
|
2554
|
-
throw new (0,
|
|
2503
|
+
throw new (0, _chunkSNAUKDDKcjs.OutgoingMessageTooLong)();
|
|
2555
2504
|
}
|
|
2556
2505
|
if (serialized instanceof Uint8Array) {
|
|
2557
2506
|
const buffer = serialized.buffer.slice(
|
|
@@ -2694,20 +2643,20 @@ var StateManager = class {
|
|
|
2694
2643
|
}
|
|
2695
2644
|
#validateStateEnabled() {
|
|
2696
2645
|
if (!this.#conn[CONN_ACTOR_SYMBOL].connStateEnabled) {
|
|
2697
|
-
throw new (0,
|
|
2646
|
+
throw new (0, _chunkSNAUKDDKcjs.ConnStateNotEnabled)();
|
|
2698
2647
|
}
|
|
2699
2648
|
}
|
|
2700
2649
|
#handleChange(path, value) {
|
|
2701
2650
|
if (path.startsWith("state")) {
|
|
2702
2651
|
let invalidPath = "";
|
|
2703
|
-
if (!
|
|
2652
|
+
if (!_chunkX5IX3YPOcjs.isCborSerializable.call(void 0,
|
|
2704
2653
|
value,
|
|
2705
2654
|
(invalidPathPart) => {
|
|
2706
2655
|
invalidPath = invalidPathPart;
|
|
2707
2656
|
},
|
|
2708
2657
|
""
|
|
2709
2658
|
)) {
|
|
2710
|
-
throw new (0,
|
|
2659
|
+
throw new (0, _chunkSNAUKDDKcjs.InvalidStateType)({
|
|
2711
2660
|
path: path + (invalidPath ? `.${invalidPath}` : "")
|
|
2712
2661
|
});
|
|
2713
2662
|
}
|
|
@@ -2775,7 +2724,7 @@ var Conn = (_class = class {
|
|
|
2775
2724
|
__init2() {this.subscriptions = /* @__PURE__ */ new Set()}
|
|
2776
2725
|
#assertConnected() {
|
|
2777
2726
|
if (!this[CONN_CONNECTED_SYMBOL])
|
|
2778
|
-
throw new (0,
|
|
2727
|
+
throw new (0, _chunkSNAUKDDKcjs.InternalError)(
|
|
2779
2728
|
"Connection not connected yet. This happens when trying to use the connection in onBeforeConnect or createConnState."
|
|
2780
2729
|
);
|
|
2781
2730
|
}
|
|
@@ -2892,7 +2841,7 @@ var Conn = (_class = class {
|
|
|
2892
2841
|
tag: "Event",
|
|
2893
2842
|
val: {
|
|
2894
2843
|
name: value.name,
|
|
2895
|
-
args:
|
|
2844
|
+
args: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor4.encode(value.args))
|
|
2896
2845
|
}
|
|
2897
2846
|
}
|
|
2898
2847
|
})
|
|
@@ -2935,7 +2884,7 @@ function getValueLength(value) {
|
|
|
2935
2884
|
} else if (value instanceof ArrayBuffer || value instanceof SharedArrayBuffer || value instanceof Uint8Array) {
|
|
2936
2885
|
return value.byteLength;
|
|
2937
2886
|
} else {
|
|
2938
|
-
|
|
2887
|
+
_chunkX5IX3YPOcjs.assertUnreachable.call(void 0, value);
|
|
2939
2888
|
}
|
|
2940
2889
|
}
|
|
2941
2890
|
async function inputDataToBuffer(data) {
|
|
@@ -2949,13 +2898,13 @@ async function inputDataToBuffer(data) {
|
|
|
2949
2898
|
} else if (data instanceof ArrayBuffer || data instanceof SharedArrayBuffer) {
|
|
2950
2899
|
return new Uint8Array(data);
|
|
2951
2900
|
} else {
|
|
2952
|
-
throw new (0,
|
|
2901
|
+
throw new (0, _chunkSNAUKDDKcjs.MalformedMessage)();
|
|
2953
2902
|
}
|
|
2954
2903
|
}
|
|
2955
2904
|
async function parseMessage(value, opts) {
|
|
2956
2905
|
const length = getValueLength(value);
|
|
2957
2906
|
if (length > opts.maxIncomingMessageSize) {
|
|
2958
|
-
throw new (0,
|
|
2907
|
+
throw new (0, _chunkSNAUKDDKcjs.IncomingMessageTooLong)();
|
|
2959
2908
|
}
|
|
2960
2909
|
let buffer = await inputDataToBuffer(value);
|
|
2961
2910
|
if (buffer instanceof Buffer) {
|
|
@@ -2995,7 +2944,7 @@ async function processMessage(message, actor, conn, handler) {
|
|
|
2995
2944
|
try {
|
|
2996
2945
|
if (message.body.tag === "ActionRequest") {
|
|
2997
2946
|
if (handler.onExecuteAction === void 0) {
|
|
2998
|
-
throw new (0,
|
|
2947
|
+
throw new (0, _chunkSNAUKDDKcjs.Unsupported)("Action");
|
|
2999
2948
|
}
|
|
3000
2949
|
const { id, name, args } = message.body.val;
|
|
3001
2950
|
actionId = id;
|
|
@@ -3040,7 +2989,7 @@ async function processMessage(message, actor, conn, handler) {
|
|
|
3040
2989
|
tag: "ActionResponse",
|
|
3041
2990
|
val: {
|
|
3042
2991
|
id,
|
|
3043
|
-
output:
|
|
2992
|
+
output: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor5.encode(value))
|
|
3044
2993
|
}
|
|
3045
2994
|
}
|
|
3046
2995
|
})
|
|
@@ -3049,7 +2998,7 @@ async function processMessage(message, actor, conn, handler) {
|
|
|
3049
2998
|
actor.rLog.debug({ msg: "action response sent", id, name });
|
|
3050
2999
|
} else if (message.body.tag === "SubscriptionRequest") {
|
|
3051
3000
|
if (handler.onSubscribe === void 0 || handler.onUnsubscribe === void 0) {
|
|
3052
|
-
throw new (0,
|
|
3001
|
+
throw new (0, _chunkSNAUKDDKcjs.Unsupported)("Subscriptions");
|
|
3053
3002
|
}
|
|
3054
3003
|
const { eventName, subscribe } = message.body.val;
|
|
3055
3004
|
actor.rLog.debug({
|
|
@@ -3068,10 +3017,10 @@ async function processMessage(message, actor, conn, handler) {
|
|
|
3068
3017
|
subscribe
|
|
3069
3018
|
});
|
|
3070
3019
|
} else {
|
|
3071
|
-
|
|
3020
|
+
_chunkX5IX3YPOcjs.assertUnreachable.call(void 0, message.body);
|
|
3072
3021
|
}
|
|
3073
3022
|
} catch (error) {
|
|
3074
|
-
const { group, code, message: message2, metadata } =
|
|
3023
|
+
const { group, code, message: message2, metadata } = _chunkX5IX3YPOcjs.deconstructError.call(void 0,
|
|
3075
3024
|
error,
|
|
3076
3025
|
actor.rLog,
|
|
3077
3026
|
{
|
|
@@ -3079,7 +3028,7 @@ async function processMessage(message, actor, conn, handler) {
|
|
|
3079
3028
|
actionId,
|
|
3080
3029
|
actionName
|
|
3081
3030
|
},
|
|
3082
|
-
|
|
3031
|
+
_chunkX5IX3YPOcjs.getEnvUniversal.call(void 0, "RIVET_EXPOSE_ERRORS") === "1" || _chunkX5IX3YPOcjs.getEnvUniversal.call(void 0, "NODE_ENV") === "development"
|
|
3083
3032
|
);
|
|
3084
3033
|
actor.rLog.debug({
|
|
3085
3034
|
msg: "sending error response",
|
|
@@ -3122,7 +3071,7 @@ async function processMessage(message, actor, conn, handler) {
|
|
|
3122
3071
|
group: value.group,
|
|
3123
3072
|
code: value.code,
|
|
3124
3073
|
message: value.message,
|
|
3125
|
-
metadata: value.metadata ?
|
|
3074
|
+
metadata: value.metadata ? _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0,
|
|
3126
3075
|
cbor5.encode(value.metadata)
|
|
3127
3076
|
) : null,
|
|
3128
3077
|
actionId: value.actionId !== void 0 ? value.actionId : null
|
|
@@ -3148,7 +3097,7 @@ async function routeWebSocket(request, requestPath, requestHeaders, config6, act
|
|
|
3148
3097
|
requestPath,
|
|
3149
3098
|
isHibernatable
|
|
3150
3099
|
});
|
|
3151
|
-
const closePromiseResolvers =
|
|
3100
|
+
const closePromiseResolvers = _chunkX5IX3YPOcjs.promiseWithResolvers.call(void 0, );
|
|
3152
3101
|
let handler;
|
|
3153
3102
|
let connDriver;
|
|
3154
3103
|
if (requestPath === PATH_CONNECT) {
|
|
@@ -3201,7 +3150,7 @@ async function routeWebSocket(request, requestPath, requestHeaders, config6, act
|
|
|
3201
3150
|
exposeInternalError
|
|
3202
3151
|
});
|
|
3203
3152
|
} catch (error) {
|
|
3204
|
-
const { group, code } =
|
|
3153
|
+
const { group, code } = _chunkX5IX3YPOcjs.deconstructError.call(void 0,
|
|
3205
3154
|
error,
|
|
3206
3155
|
loggerWithoutContext(),
|
|
3207
3156
|
{},
|
|
@@ -3253,7 +3202,7 @@ async function handleWebSocketConnect(setWebSocket, {
|
|
|
3253
3202
|
maxIncomingMessageSize: runConfig.maxIncomingMessageSize
|
|
3254
3203
|
}).then((message) => {
|
|
3255
3204
|
actor.processMessage(message, conn).catch((error) => {
|
|
3256
|
-
const { code } =
|
|
3205
|
+
const { code } = _chunkX5IX3YPOcjs.deconstructError.call(void 0,
|
|
3257
3206
|
error,
|
|
3258
3207
|
actor.rLog,
|
|
3259
3208
|
{
|
|
@@ -3264,7 +3213,7 @@ async function handleWebSocketConnect(setWebSocket, {
|
|
|
3264
3213
|
ws.close(1011, code);
|
|
3265
3214
|
});
|
|
3266
3215
|
}).catch((error) => {
|
|
3267
|
-
const { code } =
|
|
3216
|
+
const { code } = _chunkX5IX3YPOcjs.deconstructError.call(void 0,
|
|
3268
3217
|
error,
|
|
3269
3218
|
actor.rLog,
|
|
3270
3219
|
{
|
|
@@ -3299,7 +3248,7 @@ async function handleWebSocketConnect(setWebSocket, {
|
|
|
3299
3248
|
try {
|
|
3300
3249
|
actor.rLog.warn({ msg: "websocket error" });
|
|
3301
3250
|
} catch (error) {
|
|
3302
|
-
|
|
3251
|
+
_chunkX5IX3YPOcjs.deconstructError.call(void 0,
|
|
3303
3252
|
error,
|
|
3304
3253
|
actor.rLog,
|
|
3305
3254
|
{ wsEvent: "error" },
|
|
@@ -3368,14 +3317,14 @@ function truncateRawWebSocketPathPrefix(path) {
|
|
|
3368
3317
|
|
|
3369
3318
|
// src/manager/log.ts
|
|
3370
3319
|
function logger3() {
|
|
3371
|
-
return
|
|
3320
|
+
return _chunkX5IX3YPOcjs.getLogger.call(void 0, "actor-manager");
|
|
3372
3321
|
}
|
|
3373
3322
|
|
|
3374
3323
|
// src/manager/gateway.ts
|
|
3375
3324
|
async function handleWebSocketGatewayPathBased(config6, managerDriver, c, actorPathInfo, getUpgradeWebSocket) {
|
|
3376
3325
|
const upgradeWebSocket = getUpgradeWebSocket == null ? void 0 : getUpgradeWebSocket();
|
|
3377
3326
|
if (!upgradeWebSocket) {
|
|
3378
|
-
throw new (0,
|
|
3327
|
+
throw new (0, _chunkSNAUKDDKcjs.WebSocketsNotEnabled)();
|
|
3379
3328
|
}
|
|
3380
3329
|
const { encoding, connParams } = parseWebSocketProtocols(
|
|
3381
3330
|
c.req.header("sec-websocket-protocol")
|
|
@@ -3465,7 +3414,7 @@ async function actorGateway(config6, managerDriver, getUpgradeWebSocket, c, next
|
|
|
3465
3414
|
async function handleWebSocketGateway(config6, managerDriver, getUpgradeWebSocket, c, strippedPath) {
|
|
3466
3415
|
const upgradeWebSocket = getUpgradeWebSocket == null ? void 0 : getUpgradeWebSocket();
|
|
3467
3416
|
if (!upgradeWebSocket) {
|
|
3468
|
-
throw new (0,
|
|
3417
|
+
throw new (0, _chunkSNAUKDDKcjs.WebSocketsNotEnabled)();
|
|
3469
3418
|
}
|
|
3470
3419
|
let target;
|
|
3471
3420
|
let actorId;
|
|
@@ -3476,7 +3425,7 @@ async function handleWebSocketGateway(config6, managerDriver, getUpgradeWebSocke
|
|
|
3476
3425
|
return c.text("WebSocket upgrade requires target.actor protocol", 400);
|
|
3477
3426
|
}
|
|
3478
3427
|
if (!actorId) {
|
|
3479
|
-
throw new (0,
|
|
3428
|
+
throw new (0, _chunkSNAUKDDKcjs.MissingActorHeader)();
|
|
3480
3429
|
}
|
|
3481
3430
|
logger3().debug({
|
|
3482
3431
|
msg: "proxying websocket to actor",
|
|
@@ -3500,7 +3449,7 @@ async function handleHttpGateway(managerDriver, c, next, strippedPath) {
|
|
|
3500
3449
|
return next();
|
|
3501
3450
|
}
|
|
3502
3451
|
if (!actorId) {
|
|
3503
|
-
throw new (0,
|
|
3452
|
+
throw new (0, _chunkSNAUKDDKcjs.MissingActorHeader)();
|
|
3504
3453
|
}
|
|
3505
3454
|
logger3().debug({
|
|
3506
3455
|
msg: "proxying request to actor",
|
|
@@ -3604,7 +3553,7 @@ async function createTestWebSocketProxy(proxyToActorWsPromise) {
|
|
|
3604
3553
|
promise: clientToProxyWsPromise,
|
|
3605
3554
|
resolve: clientToProxyWsResolve,
|
|
3606
3555
|
reject: clientToProxyWsReject
|
|
3607
|
-
} =
|
|
3556
|
+
} = _chunkX5IX3YPOcjs.promiseWithResolvers.call(void 0, );
|
|
3608
3557
|
try {
|
|
3609
3558
|
logger3().debug({ msg: "awaiting client websocket promise" });
|
|
3610
3559
|
proxyToActorWs = await proxyToActorWsPromise;
|
|
@@ -3998,20 +3947,20 @@ function buildManagerRouter(config6, managerDriver, getUpgradeWebSocket) {
|
|
|
3998
3947
|
responses: buildOpenApiResponses(ActorsKvGetResponseSchema)
|
|
3999
3948
|
});
|
|
4000
3949
|
router.openapi(route, async (c) => {
|
|
4001
|
-
if (
|
|
3950
|
+
if (_chunkX5IX3YPOcjs.getNodeEnv.call(void 0, ) === "development" && !config6.token) {
|
|
4002
3951
|
logger3().warn({
|
|
4003
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."
|
|
4004
3953
|
});
|
|
4005
3954
|
}
|
|
4006
|
-
if (
|
|
3955
|
+
if (_chunkX5IX3YPOcjs.getNodeEnv.call(void 0, ) !== "development") {
|
|
4007
3956
|
if (!config6.token) {
|
|
4008
|
-
throw new (0,
|
|
3957
|
+
throw new (0, _chunkSNAUKDDKcjs.RestrictedFeature)("KV store access");
|
|
4009
3958
|
}
|
|
4010
3959
|
if (timingSafeEqual(
|
|
4011
3960
|
config6.token,
|
|
4012
3961
|
c.req.header(HEADER_RIVET_TOKEN) || ""
|
|
4013
3962
|
) === false) {
|
|
4014
|
-
throw new (0,
|
|
3963
|
+
throw new (0, _chunkSNAUKDDKcjs.Forbidden)();
|
|
4015
3964
|
}
|
|
4016
3965
|
}
|
|
4017
3966
|
const { actor_id: actorId, key } = c.req.valid("param");
|
|
@@ -4039,7 +3988,7 @@ function buildManagerRouter(config6, managerDriver, getUpgradeWebSocket) {
|
|
|
4039
3988
|
const output = await managerDriver[method](...args);
|
|
4040
3989
|
response = { ok: output };
|
|
4041
3990
|
} catch (rawErr) {
|
|
4042
|
-
const err =
|
|
3991
|
+
const err = _chunkX5IX3YPOcjs.deconstructError.call(void 0, rawErr, logger3(), {}, true);
|
|
4043
3992
|
response = { err };
|
|
4044
3993
|
}
|
|
4045
3994
|
return c.body(cbor6.encode(response));
|
|
@@ -4097,7 +4046,7 @@ function buildManagerRouter(config6, managerDriver, getUpgradeWebSocket) {
|
|
|
4097
4046
|
return await createTestWebSocketProxy(
|
|
4098
4047
|
clientToProxyWsPromise
|
|
4099
4048
|
);
|
|
4100
|
-
})(c,
|
|
4049
|
+
})(c, _chunkX5IX3YPOcjs.noopNext.call(void 0, ));
|
|
4101
4050
|
});
|
|
4102
4051
|
router.all(".test/inline-driver/send-request/*", async (c) => {
|
|
4103
4052
|
const actorId = c.req.header(HEADER_ACTOR_ID);
|
|
@@ -4127,9 +4076,9 @@ function buildManagerRouter(config6, managerDriver, getUpgradeWebSocket) {
|
|
|
4127
4076
|
} catch (error) {
|
|
4128
4077
|
logger3().error({
|
|
4129
4078
|
msg: "error in test inline raw http",
|
|
4130
|
-
error:
|
|
4079
|
+
error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
|
|
4131
4080
|
});
|
|
4132
|
-
const err =
|
|
4081
|
+
const err = _chunkX5IX3YPOcjs.deconstructError.call(void 0, error, logger3(), {}, true);
|
|
4133
4082
|
return c.json(
|
|
4134
4083
|
{
|
|
4135
4084
|
error: {
|
|
@@ -4177,7 +4126,7 @@ function buildManagerRouter(config6, managerDriver, getUpgradeWebSocket) {
|
|
|
4177
4126
|
} catch (error) {
|
|
4178
4127
|
logger3().error({
|
|
4179
4128
|
msg: "error forcing disconnect",
|
|
4180
|
-
error:
|
|
4129
|
+
error: _chunkX5IX3YPOcjs.stringifyError.call(void 0, error)
|
|
4181
4130
|
});
|
|
4182
4131
|
return c.text(`Error: ${error}`, 500);
|
|
4183
4132
|
}
|
|
@@ -4186,7 +4135,14 @@ function buildManagerRouter(config6, managerDriver, getUpgradeWebSocket) {
|
|
|
4186
4135
|
router.get("/health", (c) => handleHealthRequest(c));
|
|
4187
4136
|
router.get(
|
|
4188
4137
|
"/metadata",
|
|
4189
|
-
(c) => handleMetadataRequest(
|
|
4138
|
+
(c) => handleMetadataRequest(
|
|
4139
|
+
c,
|
|
4140
|
+
config6,
|
|
4141
|
+
{ normal: {} },
|
|
4142
|
+
config6.publicEndpoint,
|
|
4143
|
+
config6.publicNamespace,
|
|
4144
|
+
config6.publicToken
|
|
4145
|
+
)
|
|
4190
4146
|
);
|
|
4191
4147
|
(_a = managerDriver.modifyManagerRouter) == null ? void 0 : _a.call(managerDriver, config6, router);
|
|
4192
4148
|
});
|
|
@@ -4898,9 +4854,9 @@ var CONN_VERSIONED = _vbare.createVersionedDataHandler.call(void 0, {
|
|
|
4898
4854
|
// src/driver-helpers/utils.ts
|
|
4899
4855
|
function serializeEmptyPersistData(input) {
|
|
4900
4856
|
const persistData = {
|
|
4901
|
-
input: input !== void 0 ?
|
|
4857
|
+
input: input !== void 0 ? _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor7.encode(input)) : null,
|
|
4902
4858
|
hasInitialized: false,
|
|
4903
|
-
state:
|
|
4859
|
+
state: _chunkX5IX3YPOcjs.bufferToArrayBuffer.call(void 0, cbor7.encode(void 0)),
|
|
4904
4860
|
scheduledEvents: []
|
|
4905
4861
|
};
|
|
4906
4862
|
return ACTOR_VERSIONED.serializeWithEmbeddedVersion(
|
|
@@ -5003,7 +4959,5 @@ function getInitialActorKvState(input) {
|
|
|
5003
4959
|
|
|
5004
4960
|
|
|
5005
4961
|
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
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.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.ClientConfigSchemaBase = ClientConfigSchemaBase; exports.ClientConfigSchema = ClientConfigSchema; exports.transformClientConfig = transformClientConfig; exports.convertRegistryConfigToClientConfig = convertRegistryConfigToClientConfig; exports.ENGINE_PORT = ENGINE_PORT; exports.ENGINE_ENDPOINT = ENGINE_ENDPOINT; exports.InspectorConfigSchema = InspectorConfigSchema; 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;
|
|
5009
|
-
//# sourceMappingURL=chunk-SKOXACQD.cjs.map
|
|
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-B6BP74X3.cjs.map
|