rivetkit 2.3.5-rc.1 → 2.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/client.d.ts +19 -5
- package/dist/browser/client.js +32 -9
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +12 -2
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/agent-os/index.cjs +115 -5
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +19 -5
- package/dist/tsup/agent-os/index.d.ts +19 -5
- package/dist/tsup/agent-os/index.js +115 -5
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-6HQCLWAW.cjs → chunk-234EFKN2.cjs} +13 -3
- package/dist/tsup/chunk-234EFKN2.cjs.map +1 -0
- package/dist/tsup/{chunk-NIC3QLKL.js → chunk-3ZE5UDOA.js} +3 -3
- package/dist/tsup/{chunk-4XKED5P5.cjs → chunk-AXEGEUYB.cjs} +262 -252
- package/dist/tsup/chunk-AXEGEUYB.cjs.map +1 -0
- package/dist/tsup/{chunk-P4OGQ4JL.js → chunk-BX4G2O6M.js} +3 -3
- package/dist/tsup/{chunk-GAV4PKFT.js → chunk-F6ZW7JZQ.js} +130 -120
- package/dist/tsup/chunk-F6ZW7JZQ.js.map +1 -0
- package/dist/tsup/{chunk-TR5NLR5V.cjs → chunk-FNTTW25Q.cjs} +4 -4
- package/dist/tsup/{chunk-TR5NLR5V.cjs.map → chunk-FNTTW25Q.cjs.map} +1 -1
- package/dist/tsup/{chunk-G3CCRCTK.cjs → chunk-HNHLBM3Y.cjs} +108 -6
- package/dist/tsup/chunk-HNHLBM3Y.cjs.map +1 -0
- package/dist/tsup/{chunk-UJ2FQY63.cjs → chunk-HVOKIYUB.cjs} +7 -7
- package/dist/tsup/{chunk-UJ2FQY63.cjs.map → chunk-HVOKIYUB.cjs.map} +1 -1
- package/dist/tsup/{chunk-PAG6G46L.js → chunk-OH6CBWUD.js} +2 -2
- package/dist/tsup/{chunk-TNIWIUNV.cjs → chunk-PD7SZKHY.cjs} +9 -9
- package/dist/tsup/{chunk-TNIWIUNV.cjs.map → chunk-PD7SZKHY.cjs.map} +1 -1
- package/dist/tsup/{chunk-MGTSVSUC.js → chunk-PLLHHJWR.js} +2 -2
- package/dist/tsup/{chunk-SHBE77IT.js → chunk-QWLJCP3X.js} +106 -4
- package/dist/tsup/chunk-QWLJCP3X.js.map +1 -0
- package/dist/tsup/{chunk-B4IZU537.js → chunk-RDTFPGU2.js} +13 -3
- package/dist/tsup/chunk-RDTFPGU2.js.map +1 -0
- package/dist/tsup/{chunk-M3FCXL3Q.cjs → chunk-WS3PP253.cjs} +3 -3
- package/dist/tsup/{chunk-M3FCXL3Q.cjs.map → chunk-WS3PP253.cjs.map} +1 -1
- package/dist/tsup/client/mod.cjs +5 -5
- package/dist/tsup/client/mod.d.cts +2 -2
- package/dist/tsup/client/mod.d.ts +2 -2
- package/dist/tsup/client/mod.js +4 -4
- package/dist/tsup/common/log.cjs +2 -2
- package/dist/tsup/common/log.js +1 -1
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/{config-BzdqbLAP.d.ts → config-BRpVbJCD.d.ts} +20 -6
- package/dist/tsup/{config-CPPEwn_e.d.cts → config-BobvQpex.d.cts} +20 -6
- package/dist/tsup/{context-wWv-K2K_.d.ts → context-Cj-DFyiy.d.ts} +1 -1
- package/dist/tsup/{context-DSA9gFXB.d.cts → context-YEBNJrws.d.cts} +1 -1
- package/dist/tsup/db/drizzle.cjs +2 -2
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +2 -2
- package/dist/tsup/db/mod.js +1 -1
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.d.cts +1 -1
- package/dist/tsup/dynamic/mod.d.ts +1 -1
- package/dist/tsup/dynamic/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +4 -4
- package/dist/tsup/inspector/mod.js +3 -3
- package/dist/tsup/inspector-tab/mod.cjs +2 -2
- package/dist/tsup/inspector-tab/mod.d.cts +2 -2
- package/dist/tsup/inspector-tab/mod.d.ts +2 -2
- package/dist/tsup/inspector-tab/mod.js +1 -1
- package/dist/tsup/mod.cjs +175 -85
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +3 -3
- package/dist/tsup/mod.d.ts +3 -3
- package/dist/tsup/mod.js +107 -17
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +16 -13
- package/dist/tsup/test/mod.cjs.map +1 -1
- package/dist/tsup/test/mod.d.cts +1 -1
- package/dist/tsup/test/mod.d.ts +1 -1
- package/dist/tsup/test/mod.js +15 -12
- package/dist/tsup/test/mod.js.map +1 -1
- package/dist/tsup/unstable/migrations.cjs +101 -0
- package/dist/tsup/unstable/migrations.cjs.map +1 -0
- package/dist/tsup/unstable/migrations.d.cts +29 -0
- package/dist/tsup/unstable/migrations.d.ts +29 -0
- package/dist/tsup/unstable/migrations.js +101 -0
- package/dist/tsup/unstable/migrations.js.map +1 -0
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +9 -9
- package/dist/tsup/workflow/mod.d.cts +3 -3
- package/dist/tsup/workflow/mod.d.ts +3 -3
- package/dist/tsup/workflow/mod.js +4 -4
- package/package.json +19 -9
- package/src/actor/actions.ts +119 -0
- package/src/actor/config.ts +61 -18
- package/src/actor/definition.ts +3 -0
- package/src/client/actor-common.ts +3 -1
- package/src/client/client.ts +24 -11
- package/src/registry/config/index.ts +2 -4
- package/src/registry/index.ts +86 -5
- package/src/registry/napi-runtime.ts +4 -0
- package/src/registry/native.ts +17 -16
- package/src/registry/runtime.ts +1 -0
- package/src/registry/wasm-runtime.ts +6 -0
- package/src/test/mod.ts +1 -19
- package/src/test/ready.ts +22 -0
- package/src/unstable/migrations.test.ts +170 -0
- package/src/unstable/migrations.ts +141 -0
- package/dist/tsup/chunk-4XKED5P5.cjs.map +0 -1
- package/dist/tsup/chunk-6HQCLWAW.cjs.map +0 -1
- package/dist/tsup/chunk-B4IZU537.js.map +0 -1
- package/dist/tsup/chunk-G3CCRCTK.cjs.map +0 -1
- package/dist/tsup/chunk-GAV4PKFT.js.map +0 -1
- package/dist/tsup/chunk-SHBE77IT.js.map +0 -1
- /package/dist/tsup/{chunk-NIC3QLKL.js.map → chunk-3ZE5UDOA.js.map} +0 -0
- /package/dist/tsup/{chunk-P4OGQ4JL.js.map → chunk-BX4G2O6M.js.map} +0 -0
- /package/dist/tsup/{chunk-PAG6G46L.js.map → chunk-OH6CBWUD.js.map} +0 -0
- /package/dist/tsup/{chunk-MGTSVSUC.js.map → chunk-PLLHHJWR.js.map} +0 -0
package/dist/tsup/mod.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-
|
|
2
|
-
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as
|
|
1
|
+
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-BobvQpex.cjs';
|
|
2
|
+
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as Actions, n as ActorConfig, o as ActorConfigInput, p as ActorConfigSchema, q as ActorContext, r as ActorContextOf, s as ActorCron, t as ActorCronEveryOptions, u as ActorCronSetOptions, v as ActorDefinition, w as ActorInspectorConfig, x as ActorInspectorConfigSchema, y as ActorKey, z as ActorKv, F as ActorLogger, G as ActorOptions, H as ActorOptionsInput, I as ActorOptionsSchema, J as ActorQuery, K as ActorQueue, L as ActorSchedule, N as ActorTypes, O as ActorsSchema, P as AnyActorInstance, T as AnyClient, U as AnyConn, V as AnyStaticActorDefinition, X as AnyStaticActorInstance, Y as AuthIntent, Z as BUILTIN_INSPECTOR_TAB_IDS, _ as BaseActorInstance, $ as BuiltinInspectorTabIdSchema, a0 as CONN_DRIVER_SYMBOL, a1 as CONN_STATE_MANAGER_SYMBOL, a2 as Client, a3 as Conn, a4 as CronFire, a5 as CronJobInfo, a6 as CustomInspectorTabEntrySchema, a7 as DEFAULT_SLEEP_GRACE_PERIOD, a8 as DocActorConfigSchema, a9 as DocActorOptionsSchema, aa as DocConfigurePoolSchema, ab as DocEnvoyConfigSchema, ac as DocRegistryConfigSchema, ad as DocServerlessConfigSchema, ae as DocSqliteConfigSchema, af as FetchHandler, ag as GlobalActorOptions, ah as GlobalActorOptionsInput, ai as GlobalActorOptionsSchema, aj as HideInspectorTabEntrySchema, ak as InspectorTabEntrySchema, al as InspectorUnsubscribe, am as InstanceActorOptions, an as InstanceActorOptionsInput, ao as InstanceActorOptionsSchema, ap as QueueEnqueueAndWaitOptions, aq as QueueFilterName, ar as QueueIterOptions, as as QueueMessageOf, at as QueueName, au as QueueNextBatchOptions, av as QueueNextOptions, aw as QueueResultMessageForName, ax as QueueTryNextBatchOptions, ay as QueueTryNextOptions, az as QueueWaitOptions, aA as RAW_STATE_SYMBOL, aB as RUN_FUNCTION_CONFIG_SYMBOL, aC as Registry, aD as RegistryActors, aE as RegistryConfig, aF as RegistryConfigInput, aG as RegistryConfigSchema, aH as RegistryDeps, aI as RegistryRoutes, aJ as RunConfig, aK as RunConfigSchema, aL as RunInspectorConfig, aM as RuntimeKind, aN as RuntimeKindSchema, aO as ScheduledEventInfo, aP as ScheduledFireInfo, aQ as ServerlessHandler, aR as SqliteBackend, aS as SqliteBackendSchema, aT as SqliteConfig, aU as SqliteConfigSchema, aV as TestConfig, aW as TestConfigSchema, aX as Type, aY as WasmRuntimeBindings, aZ as WasmRuntimeConfig, a_ as WasmRuntimeConfigSchema, a$ as WasmRuntimeInitInput, b0 as WorkflowInspectorConfig, b1 as actor, b2 as buildActorNames, b3 as createClientWithDriver, b4 as disposeRunInspector, b5 as event, b6 as getRunFunction, b7 as getRunInspectorConfig, b8 as getRunMetadata, b9 as isStaticActorDefinition, ba as isStaticActorInstance, bb as lookupInRegistry, bc as queue, bd as setup, be as test } from './config-BobvQpex.cjs';
|
|
3
3
|
export { E as Encoding, t as toUint8Array } from './utils-DQDCphrl.cjs';
|
|
4
4
|
import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
5
5
|
export { RivetCloseEvent, RivetEvent, RivetMessageEvent, UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
6
6
|
import { A as AnyDatabaseProvider } from './config-BxOimoGX.cjs';
|
|
7
7
|
export { R as ActorError, R as RivetError, a as RivetErrorLike, b as RivetErrorOptions, U as UserError, c as UserErrorOptions, n as noopNext } from './utils-CqDnC_PS.cjs';
|
|
8
8
|
import { WSContext } from 'hono/ws';
|
|
9
|
-
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-
|
|
9
|
+
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-YEBNJrws.cjs';
|
|
10
10
|
import 'zod/v4';
|
|
11
11
|
import '@rivetkit/rivetkit-wasm';
|
|
12
12
|
import 'zod';
|
package/dist/tsup/mod.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-
|
|
2
|
-
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as
|
|
1
|
+
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-BRpVbJCD.js';
|
|
2
|
+
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as Actions, n as ActorConfig, o as ActorConfigInput, p as ActorConfigSchema, q as ActorContext, r as ActorContextOf, s as ActorCron, t as ActorCronEveryOptions, u as ActorCronSetOptions, v as ActorDefinition, w as ActorInspectorConfig, x as ActorInspectorConfigSchema, y as ActorKey, z as ActorKv, F as ActorLogger, G as ActorOptions, H as ActorOptionsInput, I as ActorOptionsSchema, J as ActorQuery, K as ActorQueue, L as ActorSchedule, N as ActorTypes, O as ActorsSchema, P as AnyActorInstance, T as AnyClient, U as AnyConn, V as AnyStaticActorDefinition, X as AnyStaticActorInstance, Y as AuthIntent, Z as BUILTIN_INSPECTOR_TAB_IDS, _ as BaseActorInstance, $ as BuiltinInspectorTabIdSchema, a0 as CONN_DRIVER_SYMBOL, a1 as CONN_STATE_MANAGER_SYMBOL, a2 as Client, a3 as Conn, a4 as CronFire, a5 as CronJobInfo, a6 as CustomInspectorTabEntrySchema, a7 as DEFAULT_SLEEP_GRACE_PERIOD, a8 as DocActorConfigSchema, a9 as DocActorOptionsSchema, aa as DocConfigurePoolSchema, ab as DocEnvoyConfigSchema, ac as DocRegistryConfigSchema, ad as DocServerlessConfigSchema, ae as DocSqliteConfigSchema, af as FetchHandler, ag as GlobalActorOptions, ah as GlobalActorOptionsInput, ai as GlobalActorOptionsSchema, aj as HideInspectorTabEntrySchema, ak as InspectorTabEntrySchema, al as InspectorUnsubscribe, am as InstanceActorOptions, an as InstanceActorOptionsInput, ao as InstanceActorOptionsSchema, ap as QueueEnqueueAndWaitOptions, aq as QueueFilterName, ar as QueueIterOptions, as as QueueMessageOf, at as QueueName, au as QueueNextBatchOptions, av as QueueNextOptions, aw as QueueResultMessageForName, ax as QueueTryNextBatchOptions, ay as QueueTryNextOptions, az as QueueWaitOptions, aA as RAW_STATE_SYMBOL, aB as RUN_FUNCTION_CONFIG_SYMBOL, aC as Registry, aD as RegistryActors, aE as RegistryConfig, aF as RegistryConfigInput, aG as RegistryConfigSchema, aH as RegistryDeps, aI as RegistryRoutes, aJ as RunConfig, aK as RunConfigSchema, aL as RunInspectorConfig, aM as RuntimeKind, aN as RuntimeKindSchema, aO as ScheduledEventInfo, aP as ScheduledFireInfo, aQ as ServerlessHandler, aR as SqliteBackend, aS as SqliteBackendSchema, aT as SqliteConfig, aU as SqliteConfigSchema, aV as TestConfig, aW as TestConfigSchema, aX as Type, aY as WasmRuntimeBindings, aZ as WasmRuntimeConfig, a_ as WasmRuntimeConfigSchema, a$ as WasmRuntimeInitInput, b0 as WorkflowInspectorConfig, b1 as actor, b2 as buildActorNames, b3 as createClientWithDriver, b4 as disposeRunInspector, b5 as event, b6 as getRunFunction, b7 as getRunInspectorConfig, b8 as getRunMetadata, b9 as isStaticActorDefinition, ba as isStaticActorInstance, bb as lookupInRegistry, bc as queue, bd as setup, be as test } from './config-BRpVbJCD.js';
|
|
3
3
|
export { E as Encoding, t as toUint8Array } from './utils-CV0akuDD.js';
|
|
4
4
|
import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
5
5
|
export { RivetCloseEvent, RivetEvent, RivetMessageEvent, UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
6
6
|
import { A as AnyDatabaseProvider } from './config-BxOimoGX.js';
|
|
7
7
|
export { R as ActorError, R as RivetError, a as RivetErrorLike, b as RivetErrorOptions, U as UserError, c as UserErrorOptions, n as noopNext } from './utils-CqDnC_PS.js';
|
|
8
8
|
import { WSContext } from 'hono/ws';
|
|
9
|
-
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-
|
|
9
|
+
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-Cj-DFyiy.js';
|
|
10
10
|
import 'zod/v4';
|
|
11
11
|
import '@rivetkit/rivetkit-wasm';
|
|
12
12
|
import 'zod';
|
package/dist/tsup/mod.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
decodeWorkflowHistoryTransport
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PLLHHJWR.js";
|
|
4
4
|
import {
|
|
5
5
|
ACTOR_CONTEXT_INTERNAL_SYMBOL,
|
|
6
6
|
ActorConfigSchema,
|
|
7
7
|
CONN_STATE_MANAGER_SYMBOL,
|
|
8
8
|
RAW_STATE_SYMBOL,
|
|
9
9
|
disposeRunInspector,
|
|
10
|
+
flattenActionHandlers,
|
|
11
|
+
flattenActionInputSchemas,
|
|
10
12
|
getRunFunction,
|
|
11
13
|
getRunInspectorConfig,
|
|
12
14
|
getRunMetadata
|
|
13
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QWLJCP3X.js";
|
|
14
16
|
import {
|
|
15
17
|
ALLOWED_PUBLIC_HEADERS,
|
|
16
18
|
HEADER_CONN_PARAMS,
|
|
@@ -20,13 +22,13 @@ import {
|
|
|
20
22
|
getDatacenters,
|
|
21
23
|
tryParseEndpoint,
|
|
22
24
|
updateRunnerConfig
|
|
23
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-F6ZW7JZQ.js";
|
|
24
26
|
import {
|
|
25
27
|
makePrefixedKey,
|
|
26
28
|
removePrefixFromKey
|
|
27
29
|
} from "./chunk-JI6GZ2C2.js";
|
|
30
|
+
import "./chunk-OH6CBWUD.js";
|
|
28
31
|
import "./chunk-7AFZMFPQ.js";
|
|
29
|
-
import "./chunk-PAG6G46L.js";
|
|
30
32
|
import {
|
|
31
33
|
LogLevelSchema,
|
|
32
34
|
VERSION,
|
|
@@ -59,7 +61,7 @@ import {
|
|
|
59
61
|
parsePortEnv,
|
|
60
62
|
stringifyError,
|
|
61
63
|
toUint8Array
|
|
62
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-RDTFPGU2.js";
|
|
63
65
|
import {
|
|
64
66
|
INTERNAL_ERROR_CODE,
|
|
65
67
|
RivetError,
|
|
@@ -115,6 +117,8 @@ function actor(input) {
|
|
|
115
117
|
input == null ? void 0 : input.options
|
|
116
118
|
);
|
|
117
119
|
const config = ActorConfigSchema.parse(input);
|
|
120
|
+
flattenActionHandlers(config.actions);
|
|
121
|
+
flattenActionInputSchemas(config.actions, config.actionInputSchemas);
|
|
118
122
|
return new ActorDefinition(config);
|
|
119
123
|
}
|
|
120
124
|
function isStaticActorDefinition(definition) {
|
|
@@ -794,7 +798,7 @@ var RegistryConfigSchema = z3.object({
|
|
|
794
798
|
config.engineHost,
|
|
795
799
|
config.enginePort
|
|
796
800
|
);
|
|
797
|
-
const endpoint = config.startEngine ? localEngineEndpoint : (parsedEndpoint == null ? void 0 : parsedEndpoint.endpoint) ?? (isDevEnv ?
|
|
801
|
+
const endpoint = config.startEngine ? localEngineEndpoint : (parsedEndpoint == null ? void 0 : parsedEndpoint.endpoint) ?? (isDevEnv ? localEngineEndpoint : void 0);
|
|
798
802
|
const validateServerlessEndpoint = Boolean(
|
|
799
803
|
config.startEngine || parsedEndpoint
|
|
800
804
|
);
|
|
@@ -811,7 +815,7 @@ var RegistryConfigSchema = z3.object({
|
|
|
811
815
|
path: ["serverless", "publicEndpoint"]
|
|
812
816
|
});
|
|
813
817
|
}
|
|
814
|
-
const publicEndpoint = (parsedPublicEndpoint == null ? void 0 : parsedPublicEndpoint.endpoint) ?? (isDevEnv &&
|
|
818
|
+
const publicEndpoint = (parsedPublicEndpoint == null ? void 0 : parsedPublicEndpoint.endpoint) ?? (isDevEnv && !parsedEndpoint ? endpoint : void 0);
|
|
815
819
|
const publicNamespace = parsedPublicEndpoint == null ? void 0 : parsedPublicEndpoint.namespace;
|
|
816
820
|
const publicToken = (parsedPublicEndpoint == null ? void 0 : parsedPublicEndpoint.token) ?? config.serverless.publicToken;
|
|
817
821
|
return {
|
|
@@ -1493,6 +1497,9 @@ var NapiCoreRuntime = class {
|
|
|
1493
1497
|
async serveRegistry(registry, config) {
|
|
1494
1498
|
await asNativeRegistry(registry).serve(config);
|
|
1495
1499
|
}
|
|
1500
|
+
async waitRegistryReady(registry) {
|
|
1501
|
+
await asNativeRegistry(registry).waitReady();
|
|
1502
|
+
}
|
|
1496
1503
|
async shutdownRegistry(registry) {
|
|
1497
1504
|
await asNativeRegistry(registry).shutdown();
|
|
1498
1505
|
}
|
|
@@ -2161,6 +2168,11 @@ var WasmCoreRuntime = class {
|
|
|
2161
2168
|
async serveRegistry(registry, config) {
|
|
2162
2169
|
await callWasm(() => asWasmRegistry(registry).serve(config));
|
|
2163
2170
|
}
|
|
2171
|
+
async waitRegistryReady() {
|
|
2172
|
+
throw new Error(
|
|
2173
|
+
"registry.startAndWait() is not supported by the WASM runtime"
|
|
2174
|
+
);
|
|
2175
|
+
}
|
|
2164
2176
|
async shutdownRegistry(registry) {
|
|
2165
2177
|
await callWasm(() => asWasmRegistry(registry).shutdown());
|
|
2166
2178
|
}
|
|
@@ -5155,7 +5167,7 @@ function buildActorConfig(definition, registryConfig, runtimeKind) {
|
|
|
5155
5167
|
maxOutgoingMessageSize: registryConfig.maxOutgoingMessageSize,
|
|
5156
5168
|
preloadMaxWorkflowBytes: options.preloadMaxWorkflowBytes,
|
|
5157
5169
|
preloadMaxConnectionsBytes: options.preloadMaxConnectionsBytes,
|
|
5158
|
-
actions: Object.keys(config.actions
|
|
5170
|
+
actions: Object.keys(flattenActionHandlers(config.actions)).sort().map((name) => ({ name })),
|
|
5159
5171
|
inspectorTabs: buildInspectorTabs(config.inspector, runtimeKind)
|
|
5160
5172
|
};
|
|
5161
5173
|
}
|
|
@@ -5232,15 +5244,16 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
5232
5244
|
var _a;
|
|
5233
5245
|
const config = definition.config;
|
|
5234
5246
|
const databaseProvider = config.db;
|
|
5247
|
+
const actionHandlers = flattenActionHandlers(config.actions);
|
|
5235
5248
|
const schemaConfig = {
|
|
5236
|
-
actionInputSchemas:
|
|
5249
|
+
actionInputSchemas: flattenActionInputSchemas(
|
|
5250
|
+
config.actions,
|
|
5251
|
+
config.actionInputSchemas
|
|
5252
|
+
),
|
|
5237
5253
|
connParamsSchema: config.connParamsSchema,
|
|
5238
5254
|
events: config.events,
|
|
5239
5255
|
queues: config.queues
|
|
5240
5256
|
};
|
|
5241
|
-
const actionHandlers = Object.fromEntries(
|
|
5242
|
-
Object.entries(config.actions ?? {}).map(([name, handler]) => [name, handler])
|
|
5243
|
-
);
|
|
5244
5257
|
const createClient = () => createClientWithDriver(
|
|
5245
5258
|
new RemoteEngineControlClient(
|
|
5246
5259
|
convertRegistryConfigToClientConfig(registryConfig)
|
|
@@ -6290,6 +6303,7 @@ async function buildConfiguredRegistry(config) {
|
|
|
6290
6303
|
}
|
|
6291
6304
|
|
|
6292
6305
|
// src/registry/index.ts
|
|
6306
|
+
var REGISTRY_READY_TIMEOUT_MS = 3e4;
|
|
6293
6307
|
function signalExitCode(signal) {
|
|
6294
6308
|
switch (signal) {
|
|
6295
6309
|
case "SIGINT":
|
|
@@ -6315,6 +6329,8 @@ var Registry = class {
|
|
|
6315
6329
|
return RegistryConfigSchema.parse(this.#config);
|
|
6316
6330
|
}
|
|
6317
6331
|
#runtimeServePromise;
|
|
6332
|
+
#runtimeServeLifecyclePromise;
|
|
6333
|
+
#runtimeReadyPromise;
|
|
6318
6334
|
#runtimeServeConfiguredPromise;
|
|
6319
6335
|
#runtimeServerlessPromise;
|
|
6320
6336
|
#configureServerlessPoolPromise;
|
|
@@ -6661,11 +6677,16 @@ var Registry = class {
|
|
|
6661
6677
|
if (!this.#runtimeServePromise) {
|
|
6662
6678
|
const configuredRegistryPromise = this.#buildConfiguredRegistry(config);
|
|
6663
6679
|
this.#runtimeServeConfiguredPromise = configuredRegistryPromise;
|
|
6664
|
-
this.#
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6680
|
+
this.#runtimeServeLifecyclePromise = configuredRegistryPromise.then(
|
|
6681
|
+
async ({ runtime, registry, serveConfig }) => {
|
|
6682
|
+
await runtime.serveRegistry(registry, serveConfig);
|
|
6683
|
+
}
|
|
6684
|
+
);
|
|
6685
|
+
this.#runtimeServePromise = this.#runtimeServeLifecyclePromise.catch(
|
|
6686
|
+
(error) => {
|
|
6687
|
+
logger2().warn({ error }, "runtime registry serve errored");
|
|
6688
|
+
}
|
|
6689
|
+
);
|
|
6669
6690
|
this.#installSignalHandlers(config);
|
|
6670
6691
|
}
|
|
6671
6692
|
if (printWelcome) {
|
|
@@ -6811,6 +6832,75 @@ var Registry = class {
|
|
|
6811
6832
|
startEnvoy() {
|
|
6812
6833
|
this.#startEnvoy(this.parseConfig(), true);
|
|
6813
6834
|
}
|
|
6835
|
+
/**
|
|
6836
|
+
* Starts the serverful registry if needed and waits until its envoy has
|
|
6837
|
+
* registered with the Engine. Repeated and concurrent calls share one
|
|
6838
|
+
* startup lifecycle and readiness promise.
|
|
6839
|
+
*
|
|
6840
|
+
* Unlike {@link start}, this reports startup failures and does not resolve
|
|
6841
|
+
* merely because an HTTP health endpoint is listening.
|
|
6842
|
+
*/
|
|
6843
|
+
startAndWait() {
|
|
6844
|
+
if (this.#shutdownInFlight !== null) {
|
|
6845
|
+
return Promise.reject(
|
|
6846
|
+
new Error("registry.startAndWait() cannot run after shutdown has begun")
|
|
6847
|
+
);
|
|
6848
|
+
}
|
|
6849
|
+
if (this.#runtimeReadyPromise) return this.#runtimeReadyPromise;
|
|
6850
|
+
if (getRivetkitRuntimeMode() === "serverless") {
|
|
6851
|
+
return Promise.reject(
|
|
6852
|
+
new Error(
|
|
6853
|
+
"registry.startAndWait() requires envoy runtime mode; serverless registries become ready per request"
|
|
6854
|
+
)
|
|
6855
|
+
);
|
|
6856
|
+
}
|
|
6857
|
+
const config = this.parseConfig();
|
|
6858
|
+
if (config.runtime === "wasm") {
|
|
6859
|
+
return Promise.reject(
|
|
6860
|
+
new Error(
|
|
6861
|
+
"registry.startAndWait() requires the native runtime; WebAssembly registries do not host an envoy"
|
|
6862
|
+
)
|
|
6863
|
+
);
|
|
6864
|
+
}
|
|
6865
|
+
this.#startEnvoy(config, true);
|
|
6866
|
+
const configuredRegistryPromise = this.#runtimeServeConfiguredPromise;
|
|
6867
|
+
const serveLifecyclePromise = this.#runtimeServeLifecyclePromise;
|
|
6868
|
+
if (!configuredRegistryPromise || !serveLifecyclePromise) {
|
|
6869
|
+
throw new Error("registry envoy startup did not initialize");
|
|
6870
|
+
}
|
|
6871
|
+
let timeout;
|
|
6872
|
+
const timeoutPromise = new Promise((_resolve, reject) => {
|
|
6873
|
+
var _a;
|
|
6874
|
+
timeout = setTimeout(
|
|
6875
|
+
() => reject(
|
|
6876
|
+
new Error(
|
|
6877
|
+
`RivetKit registry did not register with the Engine within ${REGISTRY_READY_TIMEOUT_MS}ms`
|
|
6878
|
+
)
|
|
6879
|
+
),
|
|
6880
|
+
REGISTRY_READY_TIMEOUT_MS
|
|
6881
|
+
);
|
|
6882
|
+
(_a = timeout.unref) == null ? void 0 : _a.call(timeout);
|
|
6883
|
+
});
|
|
6884
|
+
const readinessPromise = (async () => {
|
|
6885
|
+
const { runtime, registry } = await configuredRegistryPromise;
|
|
6886
|
+
const stoppedBeforeReady = serveLifecyclePromise.then(() => {
|
|
6887
|
+
throw new Error("RivetKit registry stopped before becoming ready");
|
|
6888
|
+
});
|
|
6889
|
+
await Promise.race([
|
|
6890
|
+
runtime.waitRegistryReady(registry),
|
|
6891
|
+
stoppedBeforeReady
|
|
6892
|
+
]);
|
|
6893
|
+
})();
|
|
6894
|
+
this.#runtimeReadyPromise = Promise.race([
|
|
6895
|
+
readinessPromise,
|
|
6896
|
+
timeoutPromise
|
|
6897
|
+
]).finally(() => {
|
|
6898
|
+
if (timeout !== void 0) clearTimeout(timeout);
|
|
6899
|
+
});
|
|
6900
|
+
this.#runtimeReadyPromise.catch(() => {
|
|
6901
|
+
});
|
|
6902
|
+
return this.#runtimeReadyPromise;
|
|
6903
|
+
}
|
|
6814
6904
|
/**
|
|
6815
6905
|
* Starts the actor envoy for standalone server deployments.
|
|
6816
6906
|
*
|