rivetkit 2.0.14 → 2.0.16
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-3HCSWRUA.cjs → chunk-3DCOI5K7.cjs} +8 -8
- package/dist/tsup/{chunk-3HCSWRUA.cjs.map → chunk-3DCOI5K7.cjs.map} +1 -1
- package/dist/tsup/{chunk-SXEHZODB.cjs → chunk-5IJOWDWM.cjs} +211 -201
- package/dist/tsup/chunk-5IJOWDWM.cjs.map +1 -0
- package/dist/tsup/{chunk-INNBRUPH.cjs → chunk-BYE4DZ6O.cjs} +14 -14
- package/dist/tsup/{chunk-INNBRUPH.cjs.map → chunk-BYE4DZ6O.cjs.map} +1 -1
- package/dist/tsup/{chunk-DJDDJDWR.cjs → chunk-E67WWRQI.cjs} +12 -12
- package/dist/tsup/{chunk-DJDDJDWR.cjs.map → chunk-E67WWRQI.cjs.map} +1 -1
- package/dist/tsup/{chunk-ATMZDEVA.cjs → chunk-ESUKZPDA.cjs} +3 -3
- package/dist/tsup/{chunk-ATMZDEVA.cjs.map → chunk-ESUKZPDA.cjs.map} +1 -1
- package/dist/tsup/{chunk-MF76IOZD.cjs → chunk-GY6U6LVW.cjs} +7 -7
- package/dist/tsup/{chunk-MF76IOZD.cjs.map → chunk-GY6U6LVW.cjs.map} +1 -1
- package/dist/tsup/{chunk-PO352AW7.js → chunk-IZCQKDOT.js} +2 -2
- package/dist/tsup/{chunk-HNC6Y6JC.cjs → chunk-KVIKPT4T.cjs} +208 -208
- package/dist/tsup/{chunk-HNC6Y6JC.cjs.map → chunk-KVIKPT4T.cjs.map} +1 -1
- package/dist/tsup/{chunk-QZWHQAOF.cjs → chunk-LHYMXJFI.cjs} +6 -6
- package/dist/tsup/{chunk-QZWHQAOF.cjs.map → chunk-LHYMXJFI.cjs.map} +1 -1
- package/dist/tsup/{chunk-G3R2O5VL.js → chunk-MIX6ZN57.js} +92 -82
- package/dist/tsup/chunk-MIX6ZN57.js.map +1 -0
- package/dist/tsup/{chunk-3LGDBNZG.js → chunk-MLBIVAMM.js} +2 -2
- package/dist/tsup/{chunk-Q6ESJU7P.cjs → chunk-N7ICOIWW.cjs} +26 -26
- package/dist/tsup/{chunk-Q6ESJU7P.cjs.map → chunk-N7ICOIWW.cjs.map} +1 -1
- package/dist/tsup/{chunk-SQPFZW4U.js → chunk-NC7XHLWT.js} +6 -6
- package/dist/tsup/{chunk-EY5EMNAB.js → chunk-O2GJQSMM.js} +2 -2
- package/dist/tsup/{chunk-EY5EMNAB.js.map → chunk-O2GJQSMM.js.map} +1 -1
- package/dist/tsup/{chunk-ZD5CZSSF.js → chunk-OWTB6Z2E.js} +10 -10
- package/dist/tsup/{chunk-OWPBIHFM.cjs → chunk-Q6GERFRB.cjs} +2 -2
- package/dist/tsup/{chunk-OWPBIHFM.cjs.map → chunk-Q6GERFRB.cjs.map} +1 -1
- package/dist/tsup/{chunk-43PTNF7W.js → chunk-RCDOEPDO.js} +3 -3
- package/dist/tsup/{chunk-XQR2BHQP.js → chunk-SHJXQIRA.js} +4 -4
- package/dist/tsup/{chunk-5C3MRFAU.js → chunk-TILGZ45J.js} +2 -2
- package/dist/tsup/{chunk-HY3MZSKX.js → chunk-W4U4VMXG.js} +3 -3
- package/dist/tsup/{chunk-FNCNYJFG.cjs → chunk-WOWWTL7O.cjs} +3 -3
- package/dist/tsup/{chunk-FNCNYJFG.cjs.map → chunk-WOWWTL7O.cjs.map} +1 -1
- package/dist/tsup/{chunk-FNQGHSFJ.js → chunk-YZVPBLQL.js} +2 -2
- package/dist/tsup/client/mod.cjs +9 -9
- package/dist/tsup/client/mod.js +8 -8
- 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/driver-helpers/mod.cjs +5 -5
- package/dist/tsup/driver-helpers/mod.js +4 -4
- package/dist/tsup/driver-test-suite/mod.cjs +71 -71
- package/dist/tsup/driver-test-suite/mod.cjs.map +1 -1
- package/dist/tsup/driver-test-suite/mod.js +13 -13
- package/dist/tsup/inspector/mod.cjs +6 -6
- package/dist/tsup/inspector/mod.js +5 -5
- package/dist/tsup/mod.cjs +10 -10
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.js +9 -9
- package/dist/tsup/test/mod.cjs +11 -11
- package/dist/tsup/test/mod.js +10 -10
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/package.json +1 -1
- package/src/common/router.ts +12 -2
- package/src/drivers/default.ts +5 -1
- package/src/drivers/engine/actor-driver.ts +2 -7
- package/src/manager/router.ts +6 -2
- package/src/registry/config.ts +8 -0
- package/src/registry/mod.ts +2 -1
- package/dist/tsup/chunk-G3R2O5VL.js.map +0 -1
- package/dist/tsup/chunk-SXEHZODB.cjs.map +0 -1
- /package/dist/tsup/{chunk-PO352AW7.js.map → chunk-IZCQKDOT.js.map} +0 -0
- /package/dist/tsup/{chunk-3LGDBNZG.js.map → chunk-MLBIVAMM.js.map} +0 -0
- /package/dist/tsup/{chunk-SQPFZW4U.js.map → chunk-NC7XHLWT.js.map} +0 -0
- /package/dist/tsup/{chunk-ZD5CZSSF.js.map → chunk-OWTB6Z2E.js.map} +0 -0
- /package/dist/tsup/{chunk-43PTNF7W.js.map → chunk-RCDOEPDO.js.map} +0 -0
- /package/dist/tsup/{chunk-XQR2BHQP.js.map → chunk-SHJXQIRA.js.map} +0 -0
- /package/dist/tsup/{chunk-5C3MRFAU.js.map → chunk-TILGZ45J.js.map} +0 -0
- /package/dist/tsup/{chunk-HY3MZSKX.js.map → chunk-W4U4VMXG.js.map} +0 -0
- /package/dist/tsup/{chunk-FNQGHSFJ.js.map → chunk-YZVPBLQL.js.map} +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkKVIKPT4Tcjs = require('./chunk-KVIKPT4T.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkN7ICOIWWcjs = require('./chunk-N7ICOIWW.cjs');
|
|
8
8
|
|
|
9
9
|
// src/client/mod.ts
|
|
10
10
|
function createClient(endpointOrConfig) {
|
|
11
11
|
const configInput = endpointOrConfig === void 0 ? {} : typeof endpointOrConfig === "string" ? { endpoint: endpointOrConfig } : endpointOrConfig;
|
|
12
|
-
const config =
|
|
13
|
-
const driver = new (0,
|
|
14
|
-
return
|
|
12
|
+
const config = _chunkN7ICOIWWcjs.ClientConfigSchema.parse(configInput);
|
|
13
|
+
const driver = new (0, _chunkKVIKPT4Tcjs.RemoteManagerDriver)(config);
|
|
14
|
+
return _chunkKVIKPT4Tcjs.createClientWithDriver.call(void 0, driver, config);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
exports.createClient = createClient;
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-LHYMXJFI.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/nathan/rivetkit/packages/rivetkit/dist/tsup/chunk-
|
|
1
|
+
{"version":3,"sources":["/Users/nathan/rivetkit/packages/rivetkit/dist/tsup/chunk-LHYMXJFI.cjs","../../src/client/mod.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACoCO,SAAS,YAAA,CACf,gBAAA,EACY;AAEZ,EAAA,MAAM,YAAA,EACL,iBAAA,IAAqB,KAAA,EAAA,EAClB,CAAC,EAAA,EACD,OAAO,iBAAA,IAAqB,SAAA,EAC3B,EAAE,QAAA,EAAU,iBAAiB,EAAA,EAC7B,gBAAA;AACL,EAAA,MAAM,OAAA,EAAS,oCAAA,CAAmB,KAAA,CAAM,WAAW,CAAA;AAGnD,EAAA,MAAM,OAAA,EAAS,IAAI,0CAAA,CAAoB,MAAM,CAAA;AAC7C,EAAA,OAAO,sDAAA,MAA0B,EAAQ,MAAM,CAAA;AAChD;AD5CA;AACA;AACE;AACF,oCAAC","file":"/Users/nathan/rivetkit/packages/rivetkit/dist/tsup/chunk-LHYMXJFI.cjs","sourcesContent":[null,"import type { Registry } from \"@/registry/mod\";\nimport { RemoteManagerDriver } from \"@/remote-manager-driver/mod\";\nimport {\n\ttype Client,\n\ttype ClientConfigInput,\n\tcreateClientWithDriver,\n} from \"./client\";\nimport { ClientConfigSchema } from \"./config\";\n\nexport {\n\tActorDefinition,\n\tAnyActorDefinition,\n} from \"@/actor/definition\";\nexport type { Transport } from \"@/actor/protocol/old\";\nexport type { Encoding } from \"@/actor/protocol/serde\";\nexport {\n\tActorClientError,\n\tActorError,\n\tInternalError,\n\tMalformedResponseMessage,\n\tManagerError,\n} from \"@/client/errors\";\nexport type { CreateRequest } from \"@/manager/protocol/query\";\nexport type { ActorActionFunction } from \"./actor-common\";\nexport type { ActorConn, EventUnsubscribe } from \"./actor-conn\";\nexport { ActorConnRaw } from \"./actor-conn\";\nexport type { ActorHandle } from \"./actor-handle\";\nexport { ActorHandleRaw } from \"./actor-handle\";\nexport type {\n\tActorAccessor,\n\tClient,\n\tClientRaw,\n\tCreateOptions,\n\tExtractActorsFromRegistry,\n\tExtractRegistryFromClient,\n\tGetOptions,\n\tGetWithIdOptions,\n\tQueryOptions,\n\tRegion,\n} from \"./client\";\n\n/**\n * Creates a client with the actor accessor proxy.\n */\nexport function createClient<A extends Registry<any>>(\n\tendpointOrConfig?: string | ClientConfigInput,\n): Client<A> {\n\t// Parse config\n\tconst configInput =\n\t\tendpointOrConfig === undefined\n\t\t\t? {}\n\t\t\t: typeof endpointOrConfig === \"string\"\n\t\t\t\t? { endpoint: endpointOrConfig }\n\t\t\t\t: endpointOrConfig;\n\tconst config = ClientConfigSchema.parse(configInput);\n\n\t// Create client\n\tconst driver = new RemoteManagerDriver(config);\n\treturn createClientWithDriver<A>(driver, config);\n}\n"]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
inspectorLogger,
|
|
5
5
|
isInspectorEnabled,
|
|
6
6
|
secureInspector
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TILGZ45J.js";
|
|
8
8
|
import {
|
|
9
9
|
ActorDefinition,
|
|
10
10
|
RemoteManagerDriver,
|
|
@@ -17,10 +17,10 @@ import {
|
|
|
17
17
|
lookupInRegistry,
|
|
18
18
|
serializeActorKey,
|
|
19
19
|
updateRunnerConfig
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-OWTB6Z2E.js";
|
|
21
21
|
import {
|
|
22
22
|
CreateActorSchema
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-MLBIVAMM.js";
|
|
24
24
|
import {
|
|
25
25
|
ActionContext,
|
|
26
26
|
ClientConfigSchema,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
createVersionedDataHandler,
|
|
33
33
|
parseMessage,
|
|
34
34
|
serializeEmptyPersistData
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-SHJXQIRA.js";
|
|
36
36
|
import {
|
|
37
37
|
EncodingSchema,
|
|
38
38
|
HEADER_ACTOR_ID,
|
|
@@ -58,12 +58,12 @@ import {
|
|
|
58
58
|
generateRandomString,
|
|
59
59
|
loggerWithoutContext,
|
|
60
60
|
serializeWithEncoding
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-W4U4VMXG.js";
|
|
62
62
|
import {
|
|
63
63
|
configureBaseLogger,
|
|
64
64
|
configureDefaultLogger,
|
|
65
65
|
getLogger
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-IZCQKDOT.js";
|
|
67
67
|
import {
|
|
68
68
|
VERSION,
|
|
69
69
|
assertUnreachable,
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
promiseWithResolvers,
|
|
75
75
|
setLongTimeout,
|
|
76
76
|
stringifyError
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-O2GJQSMM.js";
|
|
78
78
|
import {
|
|
79
79
|
ActorAlreadyExists,
|
|
80
80
|
ConnNotFound,
|
|
@@ -831,6 +831,32 @@ function getRequestConnParams(req) {
|
|
|
831
831
|
|
|
832
832
|
// src/common/router.ts
|
|
833
833
|
import * as cbor2 from "cbor-x";
|
|
834
|
+
|
|
835
|
+
// src/registry/config.ts
|
|
836
|
+
import { z as z2 } from "zod";
|
|
837
|
+
var ActorsSchema = z2.record(
|
|
838
|
+
z2.string(),
|
|
839
|
+
z2.custom()
|
|
840
|
+
);
|
|
841
|
+
var TestConfigSchema = z2.object({ enabled: z2.boolean() });
|
|
842
|
+
var RegistryConfigSchema = z2.object({
|
|
843
|
+
use: z2.record(z2.string(), z2.custom()),
|
|
844
|
+
// TODO: Find a better way of passing around the test config
|
|
845
|
+
/**
|
|
846
|
+
* Test configuration.
|
|
847
|
+
*
|
|
848
|
+
* DO NOT MANUALLY ENABLE. THIS IS USED INTERNALLY.
|
|
849
|
+
* @internal
|
|
850
|
+
**/
|
|
851
|
+
test: TestConfigSchema.optional().default({ enabled: false })
|
|
852
|
+
});
|
|
853
|
+
function buildActorNames(registryConfig) {
|
|
854
|
+
return Object.fromEntries(
|
|
855
|
+
Object.keys(registryConfig.use).map((name) => [name, { metadata: {} }])
|
|
856
|
+
);
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
// src/common/router.ts
|
|
834
860
|
function logger2() {
|
|
835
861
|
return getLogger("router");
|
|
836
862
|
}
|
|
@@ -886,14 +912,16 @@ function handleRouteError(error, c) {
|
|
|
886
912
|
);
|
|
887
913
|
return c.body(output, { status: statusCode });
|
|
888
914
|
}
|
|
889
|
-
function handleMetadataRequest(c, runConfig) {
|
|
915
|
+
function handleMetadataRequest(c, registryConfig, runConfig) {
|
|
890
916
|
const response = {
|
|
891
917
|
runtime: "rivetkit",
|
|
892
918
|
version: VERSION,
|
|
893
919
|
runner: {
|
|
894
920
|
kind: runConfig.runnerKind === "serverless" ? { serverless: {} } : { normal: {} }
|
|
895
921
|
},
|
|
896
|
-
|
|
922
|
+
actorNames: buildActorNames(registryConfig),
|
|
923
|
+
// Do not return client endpoint if default server disabled
|
|
924
|
+
clientEndpoint: runConfig.overrideServerAddress ?? (runConfig.disableDefaultServer ? void 0 : getEndpoint(runConfig))
|
|
897
925
|
};
|
|
898
926
|
return c.json(response);
|
|
899
927
|
}
|
|
@@ -1492,12 +1520,7 @@ var EngineActorDriver = class {
|
|
|
1492
1520
|
metadata: {
|
|
1493
1521
|
inspectorToken: this.#runConfig.inspector.token()
|
|
1494
1522
|
},
|
|
1495
|
-
prepopulateActorNames:
|
|
1496
|
-
Object.keys(this.#registryConfig.use).map((name) => [
|
|
1497
|
-
name,
|
|
1498
|
-
{ metadata: {} }
|
|
1499
|
-
])
|
|
1500
|
-
),
|
|
1523
|
+
prepopulateActorNames: buildActorNames(registryConfig),
|
|
1501
1524
|
onConnected: () => {
|
|
1502
1525
|
if (hasDisconnected) {
|
|
1503
1526
|
logger4().info({
|
|
@@ -2768,7 +2791,7 @@ function chooseDefaultDriver(runConfig) {
|
|
|
2768
2791
|
if (runConfig.driver) {
|
|
2769
2792
|
return runConfig.driver;
|
|
2770
2793
|
}
|
|
2771
|
-
if (runConfig.endpoint || runConfig.token) {
|
|
2794
|
+
if (runConfig.endpoint || runConfig.token || runConfig.runnerKind === "serverless") {
|
|
2772
2795
|
loggerWithoutContext().debug({
|
|
2773
2796
|
msg: "using rivet engine driver",
|
|
2774
2797
|
endpoint: runConfig.endpoint
|
|
@@ -3037,53 +3060,53 @@ import {
|
|
|
3037
3060
|
import { cors as corsMiddleware } from "hono/cors";
|
|
3038
3061
|
import { createMiddleware } from "hono/factory";
|
|
3039
3062
|
import invariant6 from "invariant";
|
|
3040
|
-
import { z as
|
|
3063
|
+
import { z as z6 } from "zod";
|
|
3041
3064
|
|
|
3042
3065
|
// src/manager-api/actors.ts
|
|
3043
|
-
import { z as
|
|
3066
|
+
import { z as z4 } from "zod";
|
|
3044
3067
|
|
|
3045
3068
|
// src/manager-api/common.ts
|
|
3046
|
-
import { z as
|
|
3047
|
-
var RivetIdSchema =
|
|
3069
|
+
import { z as z3 } from "zod";
|
|
3070
|
+
var RivetIdSchema = z3.string();
|
|
3048
3071
|
|
|
3049
3072
|
// src/manager-api/actors.ts
|
|
3050
|
-
var ActorSchema =
|
|
3073
|
+
var ActorSchema = z4.object({
|
|
3051
3074
|
actor_id: RivetIdSchema,
|
|
3052
|
-
name:
|
|
3053
|
-
key:
|
|
3075
|
+
name: z4.string(),
|
|
3076
|
+
key: z4.string(),
|
|
3054
3077
|
namespace_id: RivetIdSchema,
|
|
3055
|
-
runner_name_selector:
|
|
3056
|
-
create_ts:
|
|
3057
|
-
connectable_ts:
|
|
3058
|
-
destroy_ts:
|
|
3059
|
-
sleep_ts:
|
|
3060
|
-
start_ts:
|
|
3078
|
+
runner_name_selector: z4.string(),
|
|
3079
|
+
create_ts: z4.number(),
|
|
3080
|
+
connectable_ts: z4.number().nullable().optional(),
|
|
3081
|
+
destroy_ts: z4.number().nullable().optional(),
|
|
3082
|
+
sleep_ts: z4.number().nullable().optional(),
|
|
3083
|
+
start_ts: z4.number().nullable().optional()
|
|
3061
3084
|
});
|
|
3062
|
-
var ActorsListResponseSchema =
|
|
3063
|
-
actors:
|
|
3085
|
+
var ActorsListResponseSchema = z4.object({
|
|
3086
|
+
actors: z4.array(ActorSchema)
|
|
3064
3087
|
});
|
|
3065
|
-
var ActorsCreateRequestSchema =
|
|
3066
|
-
name:
|
|
3067
|
-
runner_name_selector:
|
|
3068
|
-
crash_policy:
|
|
3069
|
-
key:
|
|
3070
|
-
input:
|
|
3088
|
+
var ActorsCreateRequestSchema = z4.object({
|
|
3089
|
+
name: z4.string(),
|
|
3090
|
+
runner_name_selector: z4.string(),
|
|
3091
|
+
crash_policy: z4.string(),
|
|
3092
|
+
key: z4.string().nullable().optional(),
|
|
3093
|
+
input: z4.string().nullable().optional()
|
|
3071
3094
|
});
|
|
3072
|
-
var ActorsCreateResponseSchema =
|
|
3095
|
+
var ActorsCreateResponseSchema = z4.object({
|
|
3073
3096
|
actor: ActorSchema
|
|
3074
3097
|
});
|
|
3075
|
-
var ActorsGetOrCreateRequestSchema =
|
|
3076
|
-
name:
|
|
3077
|
-
key:
|
|
3078
|
-
runner_name_selector:
|
|
3079
|
-
crash_policy:
|
|
3080
|
-
input:
|
|
3098
|
+
var ActorsGetOrCreateRequestSchema = z4.object({
|
|
3099
|
+
name: z4.string(),
|
|
3100
|
+
key: z4.string(),
|
|
3101
|
+
runner_name_selector: z4.string(),
|
|
3102
|
+
crash_policy: z4.string(),
|
|
3103
|
+
input: z4.string().nullable().optional()
|
|
3081
3104
|
});
|
|
3082
|
-
var ActorsGetOrCreateResponseSchema =
|
|
3105
|
+
var ActorsGetOrCreateResponseSchema = z4.object({
|
|
3083
3106
|
actor: ActorSchema,
|
|
3084
|
-
created:
|
|
3107
|
+
created: z4.boolean()
|
|
3085
3108
|
});
|
|
3086
|
-
var ActorsDeleteResponseSchema =
|
|
3109
|
+
var ActorsDeleteResponseSchema = z4.object({});
|
|
3087
3110
|
|
|
3088
3111
|
// src/manager/gateway.ts
|
|
3089
3112
|
async function actorGateway(runConfig, managerDriver, c, next) {
|
|
@@ -3368,17 +3391,17 @@ async function createTestWebSocketProxy(clientWsPromise) {
|
|
|
3368
3391
|
}
|
|
3369
3392
|
|
|
3370
3393
|
// src/manager/router-schema.ts
|
|
3371
|
-
import { z as
|
|
3372
|
-
var ServerlessStartHeadersSchema =
|
|
3373
|
-
endpoint:
|
|
3374
|
-
token:
|
|
3375
|
-
totalSlots:
|
|
3394
|
+
import { z as z5 } from "zod";
|
|
3395
|
+
var ServerlessStartHeadersSchema = z5.object({
|
|
3396
|
+
endpoint: z5.string({ required_error: "x-rivet-endpoint header is required" }),
|
|
3397
|
+
token: z5.string({ invalid_type_error: "x-rivet-token header must be a string" }).optional(),
|
|
3398
|
+
totalSlots: z5.coerce.number({
|
|
3376
3399
|
invalid_type_error: "x-rivet-total-slots header must be a number"
|
|
3377
3400
|
}).int("x-rivet-total-slots header must be an integer").gte(1, "x-rivet-total-slots header must be positive"),
|
|
3378
|
-
runnerName:
|
|
3401
|
+
runnerName: z5.string({
|
|
3379
3402
|
required_error: "x-rivet-runner-name header is required"
|
|
3380
3403
|
}),
|
|
3381
|
-
namespace:
|
|
3404
|
+
namespace: z5.string({
|
|
3382
3405
|
required_error: "x-rivet-namespace-id header is required"
|
|
3383
3406
|
})
|
|
3384
3407
|
});
|
|
@@ -3485,7 +3508,10 @@ function addServerlessRoutes(driverConfig, registryConfig, runConfig, managerDri
|
|
|
3485
3508
|
return await actorDriver.serverlessHandleStart(c);
|
|
3486
3509
|
});
|
|
3487
3510
|
router.get("/health", (c) => handleHealthRequest(c));
|
|
3488
|
-
router.get(
|
|
3511
|
+
router.get(
|
|
3512
|
+
"/metadata",
|
|
3513
|
+
(c) => handleMetadataRequest(c, registryConfig, runConfig)
|
|
3514
|
+
);
|
|
3489
3515
|
}
|
|
3490
3516
|
function addManagerRoutes(registryConfig, runConfig, managerDriver, router) {
|
|
3491
3517
|
var _a;
|
|
@@ -3513,10 +3539,10 @@ function addManagerRoutes(registryConfig, runConfig, managerDriver, router) {
|
|
|
3513
3539
|
method: "get",
|
|
3514
3540
|
path: "/actors",
|
|
3515
3541
|
request: {
|
|
3516
|
-
query:
|
|
3517
|
-
name:
|
|
3518
|
-
actor_ids:
|
|
3519
|
-
key:
|
|
3542
|
+
query: z6.object({
|
|
3543
|
+
name: z6.string(),
|
|
3544
|
+
actor_ids: z6.string().optional(),
|
|
3545
|
+
key: z6.string().optional()
|
|
3520
3546
|
})
|
|
3521
3547
|
},
|
|
3522
3548
|
responses: buildOpenApiResponses(ActorsListResponseSchema)
|
|
@@ -3802,7 +3828,10 @@ function addManagerRoutes(registryConfig, runConfig, managerDriver, router) {
|
|
|
3802
3828
|
});
|
|
3803
3829
|
}
|
|
3804
3830
|
router.get("/health", (c) => handleHealthRequest(c));
|
|
3805
|
-
router.get(
|
|
3831
|
+
router.get(
|
|
3832
|
+
"/metadata",
|
|
3833
|
+
(c) => handleMetadataRequest(c, registryConfig, runConfig)
|
|
3834
|
+
);
|
|
3806
3835
|
(_a = managerDriver.modifyManagerRouter) == null ? void 0 : _a.call(
|
|
3807
3836
|
managerDriver,
|
|
3808
3837
|
registryConfig,
|
|
@@ -3825,25 +3854,6 @@ function createApiActor(actor2, runnerName = "default") {
|
|
|
3825
3854
|
};
|
|
3826
3855
|
}
|
|
3827
3856
|
|
|
3828
|
-
// src/registry/config.ts
|
|
3829
|
-
import { z as z6 } from "zod";
|
|
3830
|
-
var ActorsSchema = z6.record(
|
|
3831
|
-
z6.string(),
|
|
3832
|
-
z6.custom()
|
|
3833
|
-
);
|
|
3834
|
-
var TestConfigSchema = z6.object({ enabled: z6.boolean() });
|
|
3835
|
-
var RegistryConfigSchema = z6.object({
|
|
3836
|
-
use: z6.record(z6.string(), z6.custom()),
|
|
3837
|
-
// TODO: Find a better way of passing around the test config
|
|
3838
|
-
/**
|
|
3839
|
-
* Test configuration.
|
|
3840
|
-
*
|
|
3841
|
-
* DO NOT MANUALLY ENABLE. THIS IS USED INTERNALLY.
|
|
3842
|
-
* @internal
|
|
3843
|
-
**/
|
|
3844
|
-
test: TestConfigSchema.optional().default({ enabled: false })
|
|
3845
|
-
});
|
|
3846
|
-
|
|
3847
3857
|
// src/registry/log.ts
|
|
3848
3858
|
function logger7() {
|
|
3849
3859
|
return getLogger("registry");
|
|
@@ -3974,7 +3984,7 @@ var Registry = class {
|
|
|
3974
3984
|
console.log();
|
|
3975
3985
|
console.log(` RivetKit ${package_default.version} (${displayInfo.name})`);
|
|
3976
3986
|
if (!config2.disableDefaultServer) {
|
|
3977
|
-
console.log(` - Endpoint: ${config2
|
|
3987
|
+
console.log(` - Endpoint: ${getEndpoint(config2)}`);
|
|
3978
3988
|
} else if (config2.overrideServerAddress) {
|
|
3979
3989
|
console.log(` - Endpoint: ${config2.overrideServerAddress}`);
|
|
3980
3990
|
}
|
|
@@ -4091,6 +4101,7 @@ function setup(input) {
|
|
|
4091
4101
|
export {
|
|
4092
4102
|
handleWebSocketConnect,
|
|
4093
4103
|
handleRawWebSocketHandler,
|
|
4104
|
+
RegistryConfigSchema,
|
|
4094
4105
|
createActorRouter,
|
|
4095
4106
|
actor,
|
|
4096
4107
|
InlineWebSocketAdapter2,
|
|
@@ -4099,9 +4110,8 @@ export {
|
|
|
4099
4110
|
createFileSystemDriver,
|
|
4100
4111
|
createMemoryDriver,
|
|
4101
4112
|
createManagerRouter,
|
|
4102
|
-
RegistryConfigSchema,
|
|
4103
4113
|
Registry,
|
|
4104
4114
|
setup
|
|
4105
4115
|
};
|
|
4106
4116
|
//! These configs configs hold anything that's not platform-specific about running actors.
|
|
4107
|
-
//# sourceMappingURL=chunk-
|
|
4117
|
+
//# sourceMappingURL=chunk-MIX6ZN57.js.map
|