rivetkit 3.0.1-preview.2 → 3.0.2
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 +78 -7
- package/dist/browser/client.js +67 -7
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +4 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/{chunk-4QJQH4T4.cjs → chunk-3C5KLO4V.cjs} +4 -4
- package/dist/tsup/{chunk-4QJQH4T4.cjs.map → chunk-3C5KLO4V.cjs.map} +1 -1
- package/dist/tsup/{chunk-BSGU45BD.cjs → chunk-3KVVYC5I.cjs} +202 -145
- package/dist/tsup/chunk-3KVVYC5I.cjs.map +1 -0
- package/dist/tsup/{chunk-JRLVFBMY.js → chunk-3RE23GTB.js} +9 -3
- package/dist/tsup/chunk-3RE23GTB.js.map +1 -0
- package/dist/tsup/{chunk-SD3PQA7R.js → chunk-47W6FHPJ.js} +2 -2
- package/dist/tsup/{chunk-JKTXQQEE.js → chunk-4ASLJWUQ.js} +4 -4
- package/dist/tsup/{chunk-G5VHMGDB.js → chunk-ANP7UCAM.js} +66 -9
- package/dist/tsup/chunk-ANP7UCAM.js.map +1 -0
- package/dist/tsup/{chunk-LNYYP2PY.cjs → chunk-BBEH6RML.cjs} +3 -3
- package/dist/tsup/{chunk-LNYYP2PY.cjs.map → chunk-BBEH6RML.cjs.map} +1 -1
- package/dist/tsup/{chunk-AGQUQEZM.cjs → chunk-DVXMOEFT.cjs} +7 -7
- package/dist/tsup/{chunk-AGQUQEZM.cjs.map → chunk-DVXMOEFT.cjs.map} +1 -1
- package/dist/tsup/{chunk-N7UDXIJN.cjs → chunk-FR5QOAYE.cjs} +10 -10
- package/dist/tsup/{chunk-N7UDXIJN.cjs.map → chunk-FR5QOAYE.cjs.map} +1 -1
- package/dist/tsup/{chunk-OOHHMLQX.js → chunk-HJWK46Z5.js} +3 -3
- package/dist/tsup/{chunk-CEUOGGOM.js → chunk-J7T52LN6.js} +2 -2
- package/dist/tsup/{chunk-4E76XTEX.cjs → chunk-KF7ETIFK.cjs} +3 -3
- package/dist/tsup/{chunk-4E76XTEX.cjs.map → chunk-KF7ETIFK.cjs.map} +1 -1
- package/dist/tsup/{chunk-FUSYDRMB.cjs → chunk-M3H37DUQ.cjs} +9 -3
- package/dist/tsup/chunk-M3H37DUQ.cjs.map +1 -0
- package/dist/tsup/{chunk-BT4SSKF6.cjs → chunk-M7KPJSGO.cjs} +3 -3
- package/dist/tsup/{chunk-BT4SSKF6.cjs.map → chunk-M7KPJSGO.cjs.map} +1 -1
- package/dist/tsup/{chunk-GPKL6OTF.js → chunk-OF63EVJQ.js} +2 -2
- package/dist/tsup/{chunk-HDVZ6YZG.cjs → chunk-SSF2XC33.cjs} +1 -1
- package/dist/tsup/chunk-SSF2XC33.cjs.map +1 -0
- package/dist/tsup/{chunk-6FEYCVZC.js → chunk-UXDASKP6.js} +1 -1
- package/dist/tsup/chunk-UXDASKP6.js.map +1 -0
- package/dist/tsup/{chunk-O3HSYSUU.js → chunk-ZAZAKYNQ.js} +2 -2
- package/dist/tsup/client/mod.cjs +5 -5
- package/dist/tsup/client/mod.d.cts +3 -3
- package/dist/tsup/client/mod.d.ts +3 -3
- 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-DJ3KW-fe.d.ts → config-BtUHYdoj.d.ts} +23 -1
- package/dist/tsup/{config-B2wlj9wx.d.ts → config-CBTr4IhE.d.cts} +50 -8
- package/dist/tsup/{config-B2wlj9wx.d.cts → config-CBTr4IhE.d.ts} +50 -8
- package/dist/tsup/{config-8NgsxIcT.d.cts → config-H6pJy_J1.d.cts} +23 -1
- package/dist/tsup/{context-BL8kUGjq.d.ts → context-DrDoMXSD.d.ts} +2 -2
- package/dist/tsup/{context-_RoE_YHL.d.cts → context-TWrKZjqf.d.cts} +2 -2
- package/dist/tsup/db/drizzle.cjs +2 -2
- package/dist/tsup/db/drizzle.d.cts +1 -1
- package/dist/tsup/db/drizzle.d.ts +1 -1
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +3 -3
- package/dist/tsup/db/mod.d.cts +2 -2
- package/dist/tsup/db/mod.d.ts +2 -2
- package/dist/tsup/db/mod.js +2 -2
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.d.cts +2 -2
- package/dist/tsup/dynamic/mod.d.ts +2 -2
- package/dist/tsup/dynamic/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +5 -5
- package/dist/tsup/inspector/mod.js +4 -4
- package/dist/tsup/inspector/workflow.cjs +4 -4
- package/dist/tsup/inspector/workflow.js +3 -3
- package/dist/tsup/inspector-tab/mod.cjs +2 -2
- package/dist/tsup/inspector-tab/mod.d.cts +3 -3
- package/dist/tsup/inspector-tab/mod.d.ts +3 -3
- package/dist/tsup/inspector-tab/mod.js +1 -1
- package/dist/tsup/mod.cjs +258 -125
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +4 -4
- package/dist/tsup/mod.d.ts +4 -4
- package/dist/tsup/mod.js +159 -26
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +6 -6
- package/dist/tsup/test/mod.d.cts +2 -2
- package/dist/tsup/test/mod.d.ts +2 -2
- package/dist/tsup/test/mod.js +4 -4
- package/dist/tsup/unstable/migrations.d.cts +1 -1
- package/dist/tsup/unstable/migrations.d.ts +1 -1
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +10 -10
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +4 -4
- package/dist/tsup/workflow/mod.d.ts +4 -4
- package/dist/tsup/workflow/mod.js +5 -5
- package/package.json +12 -9
- package/src/actor/config.ts +2 -0
- package/src/client/actor-handle.ts +43 -7
- package/src/client/raw-utils.ts +17 -3
- package/src/client/utils.ts +4 -0
- package/src/common/database/config.ts +50 -7
- package/src/db/mod.ts +1 -0
- package/src/registry/config/index.ts +7 -5
- package/src/registry/index.ts +142 -1
- package/src/registry/napi-runtime.ts +15 -0
- package/src/registry/native.ts +24 -17
- package/src/registry/runtime.ts +7 -1
- package/src/utils/env-vars.ts +4 -2
- package/dist/tsup/chunk-6FEYCVZC.js.map +0 -1
- package/dist/tsup/chunk-BSGU45BD.cjs.map +0 -1
- package/dist/tsup/chunk-FUSYDRMB.cjs.map +0 -1
- package/dist/tsup/chunk-G5VHMGDB.js.map +0 -1
- package/dist/tsup/chunk-HDVZ6YZG.cjs.map +0 -1
- package/dist/tsup/chunk-JRLVFBMY.js.map +0 -1
- /package/dist/tsup/{chunk-SD3PQA7R.js.map → chunk-47W6FHPJ.js.map} +0 -0
- /package/dist/tsup/{chunk-JKTXQQEE.js.map → chunk-4ASLJWUQ.js.map} +0 -0
- /package/dist/tsup/{chunk-OOHHMLQX.js.map → chunk-HJWK46Z5.js.map} +0 -0
- /package/dist/tsup/{chunk-CEUOGGOM.js.map → chunk-J7T52LN6.js.map} +0 -0
- /package/dist/tsup/{chunk-GPKL6OTF.js.map → chunk-OF63EVJQ.js.map} +0 -0
- /package/dist/tsup/{chunk-O3HSYSUU.js.map → chunk-ZAZAKYNQ.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 ActionInputSchemas, m as ActionSampleRates, n as ActionTraceSamplers, o as Actions, p as ActorConfig, q as ActorConfigInput, r as ActorConfigSchema, s as ActorContext, t as ActorContextOf, u as ActorCron, v as ActorCronEveryOptions, w as ActorCronSetOptions, x as ActorDefinition, y as ActorInspectorConfig, z as ActorInspectorConfigSchema, F as ActorKey, G as ActorKv, H as ActorLogger, I as ActorOptions, J as ActorOptionsInput, K as ActorOptionsSchema, L as ActorQuery, N as ActorQueue, O as ActorRun, P as ActorSchedule, T as ActorTracingOptions, U as ActorTypes, V as ActorsSchema, X as AnyActorInstance, Y as AnyClient, Z as AnyConn, _ as AnyStaticActorDefinition, $ as AnyStaticActorInstance, a0 as AuthIntent, a1 as BUILTIN_INSPECTOR_TAB_IDS, a2 as BaseActorInstance, a3 as BuiltinInspectorTabIdSchema, a4 as CONN_DRIVER_SYMBOL, a5 as CONN_STATE_MANAGER_SYMBOL, a6 as Client, a7 as Conn, a8 as CronFire, a9 as CronJobInfo, aa as CustomInspectorTabEntrySchema, ab as DEFAULT_SLEEP_GRACE_PERIOD, ac as DefineRunHandlerOptions, ad as DocActorConfigSchema, ae as DocActorOptionsSchema, af as DocConfigurePoolSchema, ag as DocEnvoyConfigSchema, ah as DocRegistryConfigSchema, ai as DocServerlessConfigSchema, aj as DocSqliteConfigSchema, ak as FetchHandler, al as GlobalActorOptions, am as GlobalActorOptionsInput, an as GlobalActorOptionsSchema, ao as HideInspectorTabEntrySchema, ap as InferEventArgs, aq as InferSchemaMap, ar as InspectorTabEntrySchema, as as InspectorUnsubscribe, at as InstanceActorOptions, au as InstanceActorOptionsInput, av as InstanceActorOptionsSchema, aw as QueueEnqueueAndWaitOptions, ax as QueueFilterName, ay as QueueIterOptions, az as QueueMessageOf, aA as QueueName, aB as QueueNextBatchOptions, aC as QueueNextOptions, aD as QueueResultMessageForName, aE as QueueTryNextBatchOptions, aF as QueueTryNextOptions, aG as QueueWaitOptions, aH as RAW_STATE_SYMBOL, aI as Registry, aJ as RegistryActors, aK as RegistryApplication, aL as RegistryConfig, aM as RegistryConfigInput, aN as RegistryConfigSchema, aO as RegistryDeps, aP as RegistryListenOptions, aQ as RegistryRoutes, aR as RunConfig, aS as RunConfigSchema, aT as RunControl, aU as RunInspectorConfig, aV as RunInspectorFactoryContext, aW as RunInspectorFactoryResult, aX as RunInspectorKind, aY as RunWithInactiveOptions, aZ as RuntimeKind, a_ as RuntimeKindSchema, a$ as ScheduledEventInfo, b0 as ScheduledFireInfo, b1 as ServerlessHandler, b2 as SqliteBackend, b3 as SqliteBackendSchema, b4 as SqliteConfig, b5 as SqliteConfigSchema, b6 as TestConfig, b7 as TestConfigSchema, b8 as Type, b9 as WasmRuntimeBindings, ba as WasmRuntimeConfig, bb as WasmRuntimeConfigSchema, bc as WasmRuntimeInitInput, bd as WorkflowInspectorConfig, be as WorkflowOutcome, bf as WorkflowSpan, bg as WorkflowStepOutcome, bh as WorkflowStepSpan, bi as actor, bj as buildActorNames, bk as createClientWithDriver, bl as defineRunHandler, bm as disposeRunInspector, bn as event, bo as getRunFunction, bp as getRunInspectorConfig, bq as getRunMetadata, br as isStaticActorDefinition, bs as isStaticActorInstance, bt as lookupInRegistry, bu as queue, bv as setup, bw as test } from './config-
|
|
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-H6pJy_J1.cjs';
|
|
2
|
+
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as ActionSampleRates, n as ActionTraceSamplers, o as Actions, p as ActorConfig, q as ActorConfigInput, r as ActorConfigSchema, s as ActorContext, t as ActorContextOf, u as ActorCron, v as ActorCronEveryOptions, w as ActorCronSetOptions, x as ActorDefinition, y as ActorInspectorConfig, z as ActorInspectorConfigSchema, F as ActorKey, G as ActorKv, H as ActorLogger, I as ActorOptions, J as ActorOptionsInput, K as ActorOptionsSchema, L as ActorQuery, N as ActorQueue, O as ActorRun, P as ActorSchedule, T as ActorTracingOptions, U as ActorTypes, V as ActorsSchema, X as AnyActorInstance, Y as AnyClient, Z as AnyConn, _ as AnyStaticActorDefinition, $ as AnyStaticActorInstance, a0 as AuthIntent, a1 as BUILTIN_INSPECTOR_TAB_IDS, a2 as BaseActorInstance, a3 as BuiltinInspectorTabIdSchema, a4 as CONN_DRIVER_SYMBOL, a5 as CONN_STATE_MANAGER_SYMBOL, a6 as Client, a7 as Conn, a8 as CronFire, a9 as CronJobInfo, aa as CustomInspectorTabEntrySchema, ab as DEFAULT_SLEEP_GRACE_PERIOD, ac as DefineRunHandlerOptions, ad as DocActorConfigSchema, ae as DocActorOptionsSchema, af as DocConfigurePoolSchema, ag as DocEnvoyConfigSchema, ah as DocRegistryConfigSchema, ai as DocServerlessConfigSchema, aj as DocSqliteConfigSchema, ak as FetchHandler, al as GlobalActorOptions, am as GlobalActorOptionsInput, an as GlobalActorOptionsSchema, ao as HideInspectorTabEntrySchema, ap as InferEventArgs, aq as InferSchemaMap, ar as InspectorTabEntrySchema, as as InspectorUnsubscribe, at as InstanceActorOptions, au as InstanceActorOptionsInput, av as InstanceActorOptionsSchema, aw as QueueEnqueueAndWaitOptions, ax as QueueFilterName, ay as QueueIterOptions, az as QueueMessageOf, aA as QueueName, aB as QueueNextBatchOptions, aC as QueueNextOptions, aD as QueueResultMessageForName, aE as QueueTryNextBatchOptions, aF as QueueTryNextOptions, aG as QueueWaitOptions, aH as RAW_STATE_SYMBOL, aI as Registry, aJ as RegistryActors, aK as RegistryApplication, aL as RegistryConfig, aM as RegistryConfigInput, aN as RegistryConfigSchema, aO as RegistryDeps, aP as RegistryListenOptions, aQ as RegistryRoutes, aR as RunConfig, aS as RunConfigSchema, aT as RunControl, aU as RunInspectorConfig, aV as RunInspectorFactoryContext, aW as RunInspectorFactoryResult, aX as RunInspectorKind, aY as RunWithInactiveOptions, aZ as RuntimeKind, a_ as RuntimeKindSchema, a$ as ScheduledEventInfo, b0 as ScheduledFireInfo, b1 as ServerlessHandler, b2 as SqliteBackend, b3 as SqliteBackendSchema, b4 as SqliteConfig, b5 as SqliteConfigSchema, b6 as TestConfig, b7 as TestConfigSchema, b8 as Type, b9 as WasmRuntimeBindings, ba as WasmRuntimeConfig, bb as WasmRuntimeConfigSchema, bc as WasmRuntimeInitInput, bd as WorkflowInspectorConfig, be as WorkflowOutcome, bf as WorkflowSpan, bg as WorkflowStepOutcome, bh as WorkflowStepSpan, bi as actor, bj as buildActorNames, bk as createClientWithDriver, bl as defineRunHandler, bm as disposeRunInspector, bn as event, bo as getRunFunction, bp as getRunInspectorConfig, bq as getRunMetadata, br as isStaticActorDefinition, bs as isStaticActorInstance, bt as lookupInRegistry, bu as queue, bv as setup, bw as test } from './config-H6pJy_J1.cjs';
|
|
3
3
|
export { E as Encoding, t as toUint8Array } from './utils-C6b0aYUM.cjs';
|
|
4
4
|
import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
5
5
|
export { RivetCloseEvent, RivetEvent, RivetMessageEvent, UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
6
|
-
import { A as AnyDatabaseProvider } from './config-
|
|
6
|
+
import { A as AnyDatabaseProvider } from './config-CBTr4IhE.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-3rsE0JvI.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-TWrKZjqf.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 ActionInputSchemas, m as ActionSampleRates, n as ActionTraceSamplers, o as Actions, p as ActorConfig, q as ActorConfigInput, r as ActorConfigSchema, s as ActorContext, t as ActorContextOf, u as ActorCron, v as ActorCronEveryOptions, w as ActorCronSetOptions, x as ActorDefinition, y as ActorInspectorConfig, z as ActorInspectorConfigSchema, F as ActorKey, G as ActorKv, H as ActorLogger, I as ActorOptions, J as ActorOptionsInput, K as ActorOptionsSchema, L as ActorQuery, N as ActorQueue, O as ActorRun, P as ActorSchedule, T as ActorTracingOptions, U as ActorTypes, V as ActorsSchema, X as AnyActorInstance, Y as AnyClient, Z as AnyConn, _ as AnyStaticActorDefinition, $ as AnyStaticActorInstance, a0 as AuthIntent, a1 as BUILTIN_INSPECTOR_TAB_IDS, a2 as BaseActorInstance, a3 as BuiltinInspectorTabIdSchema, a4 as CONN_DRIVER_SYMBOL, a5 as CONN_STATE_MANAGER_SYMBOL, a6 as Client, a7 as Conn, a8 as CronFire, a9 as CronJobInfo, aa as CustomInspectorTabEntrySchema, ab as DEFAULT_SLEEP_GRACE_PERIOD, ac as DefineRunHandlerOptions, ad as DocActorConfigSchema, ae as DocActorOptionsSchema, af as DocConfigurePoolSchema, ag as DocEnvoyConfigSchema, ah as DocRegistryConfigSchema, ai as DocServerlessConfigSchema, aj as DocSqliteConfigSchema, ak as FetchHandler, al as GlobalActorOptions, am as GlobalActorOptionsInput, an as GlobalActorOptionsSchema, ao as HideInspectorTabEntrySchema, ap as InferEventArgs, aq as InferSchemaMap, ar as InspectorTabEntrySchema, as as InspectorUnsubscribe, at as InstanceActorOptions, au as InstanceActorOptionsInput, av as InstanceActorOptionsSchema, aw as QueueEnqueueAndWaitOptions, ax as QueueFilterName, ay as QueueIterOptions, az as QueueMessageOf, aA as QueueName, aB as QueueNextBatchOptions, aC as QueueNextOptions, aD as QueueResultMessageForName, aE as QueueTryNextBatchOptions, aF as QueueTryNextOptions, aG as QueueWaitOptions, aH as RAW_STATE_SYMBOL, aI as Registry, aJ as RegistryActors, aK as RegistryApplication, aL as RegistryConfig, aM as RegistryConfigInput, aN as RegistryConfigSchema, aO as RegistryDeps, aP as RegistryListenOptions, aQ as RegistryRoutes, aR as RunConfig, aS as RunConfigSchema, aT as RunControl, aU as RunInspectorConfig, aV as RunInspectorFactoryContext, aW as RunInspectorFactoryResult, aX as RunInspectorKind, aY as RunWithInactiveOptions, aZ as RuntimeKind, a_ as RuntimeKindSchema, a$ as ScheduledEventInfo, b0 as ScheduledFireInfo, b1 as ServerlessHandler, b2 as SqliteBackend, b3 as SqliteBackendSchema, b4 as SqliteConfig, b5 as SqliteConfigSchema, b6 as TestConfig, b7 as TestConfigSchema, b8 as Type, b9 as WasmRuntimeBindings, ba as WasmRuntimeConfig, bb as WasmRuntimeConfigSchema, bc as WasmRuntimeInitInput, bd as WorkflowInspectorConfig, be as WorkflowOutcome, bf as WorkflowSpan, bg as WorkflowStepOutcome, bh as WorkflowStepSpan, bi as actor, bj as buildActorNames, bk as createClientWithDriver, bl as defineRunHandler, bm as disposeRunInspector, bn as event, bo as getRunFunction, bp as getRunInspectorConfig, bq as getRunMetadata, br as isStaticActorDefinition, bs as isStaticActorInstance, bt as lookupInRegistry, bu as queue, bv as setup, bw as test } from './config-
|
|
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-BtUHYdoj.js';
|
|
2
|
+
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as ActionSampleRates, n as ActionTraceSamplers, o as Actions, p as ActorConfig, q as ActorConfigInput, r as ActorConfigSchema, s as ActorContext, t as ActorContextOf, u as ActorCron, v as ActorCronEveryOptions, w as ActorCronSetOptions, x as ActorDefinition, y as ActorInspectorConfig, z as ActorInspectorConfigSchema, F as ActorKey, G as ActorKv, H as ActorLogger, I as ActorOptions, J as ActorOptionsInput, K as ActorOptionsSchema, L as ActorQuery, N as ActorQueue, O as ActorRun, P as ActorSchedule, T as ActorTracingOptions, U as ActorTypes, V as ActorsSchema, X as AnyActorInstance, Y as AnyClient, Z as AnyConn, _ as AnyStaticActorDefinition, $ as AnyStaticActorInstance, a0 as AuthIntent, a1 as BUILTIN_INSPECTOR_TAB_IDS, a2 as BaseActorInstance, a3 as BuiltinInspectorTabIdSchema, a4 as CONN_DRIVER_SYMBOL, a5 as CONN_STATE_MANAGER_SYMBOL, a6 as Client, a7 as Conn, a8 as CronFire, a9 as CronJobInfo, aa as CustomInspectorTabEntrySchema, ab as DEFAULT_SLEEP_GRACE_PERIOD, ac as DefineRunHandlerOptions, ad as DocActorConfigSchema, ae as DocActorOptionsSchema, af as DocConfigurePoolSchema, ag as DocEnvoyConfigSchema, ah as DocRegistryConfigSchema, ai as DocServerlessConfigSchema, aj as DocSqliteConfigSchema, ak as FetchHandler, al as GlobalActorOptions, am as GlobalActorOptionsInput, an as GlobalActorOptionsSchema, ao as HideInspectorTabEntrySchema, ap as InferEventArgs, aq as InferSchemaMap, ar as InspectorTabEntrySchema, as as InspectorUnsubscribe, at as InstanceActorOptions, au as InstanceActorOptionsInput, av as InstanceActorOptionsSchema, aw as QueueEnqueueAndWaitOptions, ax as QueueFilterName, ay as QueueIterOptions, az as QueueMessageOf, aA as QueueName, aB as QueueNextBatchOptions, aC as QueueNextOptions, aD as QueueResultMessageForName, aE as QueueTryNextBatchOptions, aF as QueueTryNextOptions, aG as QueueWaitOptions, aH as RAW_STATE_SYMBOL, aI as Registry, aJ as RegistryActors, aK as RegistryApplication, aL as RegistryConfig, aM as RegistryConfigInput, aN as RegistryConfigSchema, aO as RegistryDeps, aP as RegistryListenOptions, aQ as RegistryRoutes, aR as RunConfig, aS as RunConfigSchema, aT as RunControl, aU as RunInspectorConfig, aV as RunInspectorFactoryContext, aW as RunInspectorFactoryResult, aX as RunInspectorKind, aY as RunWithInactiveOptions, aZ as RuntimeKind, a_ as RuntimeKindSchema, a$ as ScheduledEventInfo, b0 as ScheduledFireInfo, b1 as ServerlessHandler, b2 as SqliteBackend, b3 as SqliteBackendSchema, b4 as SqliteConfig, b5 as SqliteConfigSchema, b6 as TestConfig, b7 as TestConfigSchema, b8 as Type, b9 as WasmRuntimeBindings, ba as WasmRuntimeConfig, bb as WasmRuntimeConfigSchema, bc as WasmRuntimeInitInput, bd as WorkflowInspectorConfig, be as WorkflowOutcome, bf as WorkflowSpan, bg as WorkflowStepOutcome, bh as WorkflowStepSpan, bi as actor, bj as buildActorNames, bk as createClientWithDriver, bl as defineRunHandler, bm as disposeRunInspector, bn as event, bo as getRunFunction, bp as getRunInspectorConfig, bq as getRunMetadata, br as isStaticActorDefinition, bs as isStaticActorInstance, bt as lookupInRegistry, bu as queue, bv as setup, bw as test } from './config-BtUHYdoj.js';
|
|
3
3
|
export { E as Encoding, t as toUint8Array } from './utils-C1O-SklO.js';
|
|
4
4
|
import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
5
5
|
export { RivetCloseEvent, RivetEvent, RivetMessageEvent, UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
6
|
-
import { A as AnyDatabaseProvider } from './config-
|
|
6
|
+
import { A as AnyDatabaseProvider } from './config-CBTr4IhE.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-3rsE0JvI.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-DrDoMXSD.js';
|
|
10
10
|
import 'zod/v4';
|
|
11
11
|
import '@rivetkit/rivetkit-wasm';
|
|
12
12
|
import 'zod';
|
package/dist/tsup/mod.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
decodeWorkflowHistoryTransport
|
|
3
|
+
} from "./chunk-J7T52LN6.js";
|
|
1
4
|
import {
|
|
2
5
|
ACTOR_CONTEXT_INTERNAL_SYMBOL,
|
|
3
6
|
ActorConfigSchema,
|
|
@@ -14,10 +17,7 @@ import {
|
|
|
14
17
|
getRunInspectorKind,
|
|
15
18
|
getRunMetadata,
|
|
16
19
|
hasRunInspectorConfig
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import {
|
|
19
|
-
decodeWorkflowHistoryTransport
|
|
20
|
-
} from "./chunk-CEUOGGOM.js";
|
|
20
|
+
} from "./chunk-UXDASKP6.js";
|
|
21
21
|
import {
|
|
22
22
|
ALLOWED_PUBLIC_HEADERS,
|
|
23
23
|
ENGINE_HOST,
|
|
@@ -35,17 +35,17 @@ import {
|
|
|
35
35
|
runWithActorInvocationSpan,
|
|
36
36
|
tryParseEndpoint,
|
|
37
37
|
updateRunnerConfig
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-ANP7UCAM.js";
|
|
39
39
|
import {
|
|
40
40
|
makePrefixedKey,
|
|
41
41
|
removePrefixFromKey
|
|
42
42
|
} from "./chunk-A2CF6PFH.js";
|
|
43
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-ZAZAKYNQ.js";
|
|
44
44
|
import {
|
|
45
45
|
bindNativeStateTransactionContext,
|
|
46
46
|
db,
|
|
47
47
|
registerNativeStateTransactionOpener
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-OF63EVJQ.js";
|
|
49
49
|
import "./chunk-JTHHCZCZ.js";
|
|
50
50
|
import {
|
|
51
51
|
LogLevelSchema,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
parsePortEnv,
|
|
81
81
|
stringifyError,
|
|
82
82
|
toUint8Array
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-3RE23GTB.js";
|
|
84
84
|
import {
|
|
85
85
|
INTERNAL_ERROR_CODE,
|
|
86
86
|
RivetError,
|
|
@@ -714,8 +714,8 @@ var RegistryConfigSchema = z3.object({
|
|
|
714
714
|
engineVersion: z3.string().optional().default(() => getRivetRunEngineVersion() ?? VERSION),
|
|
715
715
|
/**
|
|
716
716
|
* Starts the first-party Services actor host when RivetKit manages
|
|
717
|
-
* a local engine.
|
|
718
|
-
* or startServices:
|
|
717
|
+
* a local engine. Enabled by default for a managed local Engine. Set
|
|
718
|
+
* RIVET_RUN_SERVICES=0 or startServices: false to disable it.
|
|
719
719
|
*/
|
|
720
720
|
startServices: z3.boolean().optional(),
|
|
721
721
|
/**
|
|
@@ -802,7 +802,8 @@ var RegistryConfigSchema = z3.object({
|
|
|
802
802
|
config.enginePort
|
|
803
803
|
);
|
|
804
804
|
const endpoint = config.startEngine ? localEngineEndpoint : (parsedEndpoint == null ? void 0 : parsedEndpoint.endpoint) ?? (isDevEnv ? localEngineEndpoint : void 0);
|
|
805
|
-
const
|
|
805
|
+
const engineSpawn = !parsedEndpoint && Boolean(endpoint);
|
|
806
|
+
const startServices = config.startServices ?? getRivetRunServices() ?? engineSpawn;
|
|
806
807
|
const validateServerlessEndpoint = Boolean(
|
|
807
808
|
config.startEngine || parsedEndpoint
|
|
808
809
|
);
|
|
@@ -826,7 +827,7 @@ var RegistryConfigSchema = z3.object({
|
|
|
826
827
|
...config,
|
|
827
828
|
sqlite,
|
|
828
829
|
endpoint,
|
|
829
|
-
engineSpawn
|
|
830
|
+
engineSpawn,
|
|
830
831
|
startServices,
|
|
831
832
|
namespace,
|
|
832
833
|
token,
|
|
@@ -942,7 +943,7 @@ var DocRegistryConfigSchema = z3.object({
|
|
|
942
943
|
"Version of the local engine package to use. Defaults to the current RivetKit version."
|
|
943
944
|
),
|
|
944
945
|
startServices: z3.boolean().optional().describe(
|
|
945
|
-
"Starts Services when RivetKit manages a local Engine.
|
|
946
|
+
"Starts Services when RivetKit manages a local Engine. Enabled by default for a managed local Engine. Set RIVET_RUN_SERVICES=0 or startServices: false to disable."
|
|
946
947
|
),
|
|
947
948
|
configurePool: DocConfigurePoolSchema.describe(
|
|
948
949
|
"Automatically configure serverless nodes in the engine."
|
|
@@ -1404,7 +1405,7 @@ function normalizeRuntimeSqlExecuteResult(result) {
|
|
|
1404
1405
|
}
|
|
1405
1406
|
function servicesBinaryUnavailable(cause) {
|
|
1406
1407
|
return new Error(
|
|
1407
|
-
"services.binary_unavailable: Install @rivet-dev/services
|
|
1408
|
+
"services.binary_unavailable: Install @rivet-dev/services to run local Services, set RIVET_SERVICES_BINARY to its executable path, or set RIVET_RUN_SERVICES=0 to disable Services.",
|
|
1408
1409
|
{ cause }
|
|
1409
1410
|
);
|
|
1410
1411
|
}
|
|
@@ -1598,6 +1599,15 @@ var NapiCoreRuntime = class {
|
|
|
1598
1599
|
async registryActorStopThresholdMs(registry) {
|
|
1599
1600
|
return await asNativeRegistry(registry).actorStopThresholdMs() ?? void 0;
|
|
1600
1601
|
}
|
|
1602
|
+
registryActiveActorCount(registry) {
|
|
1603
|
+
return asNativeRegistry(registry).activeActorCount();
|
|
1604
|
+
}
|
|
1605
|
+
onRegistryActiveActorCountChange(registry, callback, cancelToken) {
|
|
1606
|
+
asNativeRegistry(registry).onActiveActorCountChange(
|
|
1607
|
+
callback,
|
|
1608
|
+
asNativeCancellationToken(cancelToken)
|
|
1609
|
+
);
|
|
1610
|
+
}
|
|
1601
1611
|
async registryHealth(registry) {
|
|
1602
1612
|
const response = await asNativeRegistry(registry).health();
|
|
1603
1613
|
return {
|
|
@@ -7216,6 +7226,11 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
7216
7226
|
async (error, payload) => {
|
|
7217
7227
|
const { ctx, conn, args, scheduledFire, cancelToken } = unwrapTsfnPayload(error, payload);
|
|
7218
7228
|
const actorCtx = conn != null ? makeConnCtx(ctx, conn, void 0, cancelToken) : makeActorCtx(ctx, void 0, cancelToken);
|
|
7229
|
+
if (scheduledFire) {
|
|
7230
|
+
Object.defineProperty(actorCtx, "scheduledFire", {
|
|
7231
|
+
value: scheduledFire
|
|
7232
|
+
});
|
|
7233
|
+
}
|
|
7219
7234
|
const runAction = async () => {
|
|
7220
7235
|
try {
|
|
7221
7236
|
return encodeValue(
|
|
@@ -7328,7 +7343,7 @@ function buildNativeFactory(runtime, registryConfig, definition) {
|
|
|
7328
7343
|
buildActorConfig(definition, registryConfig, runtime.kind)
|
|
7329
7344
|
);
|
|
7330
7345
|
}
|
|
7331
|
-
async function buildServeConfig(config,
|
|
7346
|
+
async function buildServeConfig(config, resolveNativeBinaries = true) {
|
|
7332
7347
|
var _a;
|
|
7333
7348
|
if (!config.endpoint) {
|
|
7334
7349
|
throw nativeEndpointNotConfiguredError();
|
|
@@ -7340,7 +7355,7 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
|
|
|
7340
7355
|
token: config.token,
|
|
7341
7356
|
namespace: config.namespace,
|
|
7342
7357
|
poolName: config.node.poolName,
|
|
7343
|
-
startServices:
|
|
7358
|
+
startServices: resolveNativeBinaries && config.startServices,
|
|
7344
7359
|
handleInspectorHttpInRuntime: true,
|
|
7345
7360
|
serverlessBasePath: config.serverless.basePath,
|
|
7346
7361
|
serverlessPackageVersion: VERSION,
|
|
@@ -7350,16 +7365,18 @@ async function buildServeConfig(config, resolveServicesBinary = true) {
|
|
|
7350
7365
|
serverlessValidateEndpoint: config.validateServerlessEndpoint,
|
|
7351
7366
|
serverlessMaxStartPayloadBytes: config.serverless.maxStartPayloadBytes
|
|
7352
7367
|
};
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
|
|
7368
|
+
if (resolveNativeBinaries) {
|
|
7369
|
+
try {
|
|
7370
|
+
const { getEnginePath } = await loadEngineCli();
|
|
7371
|
+
serveConfig.engineBinaryPath = getEnginePath();
|
|
7372
|
+
} catch (error) {
|
|
7373
|
+
logger2().warn({
|
|
7374
|
+
msg: "could not resolve a local engine binary; if a local engine must be spawned it will fail with engine.binary_unavailable \u2014 set RIVET_ENGINE_BINARY_PATH or install the @rivetkit/engine-cli platform package",
|
|
7375
|
+
error: stringifyError(error)
|
|
7376
|
+
});
|
|
7377
|
+
}
|
|
7361
7378
|
}
|
|
7362
|
-
if (
|
|
7379
|
+
if (resolveNativeBinaries && config.startServices) {
|
|
7363
7380
|
const servicesBinary = getEnvUniversal("RIVET_SERVICES_BINARY");
|
|
7364
7381
|
if (servicesBinary) {
|
|
7365
7382
|
serveConfig.servicesBinaryPath = servicesBinary;
|
|
@@ -7413,6 +7430,7 @@ async function buildConfiguredRegistry(config) {
|
|
|
7413
7430
|
var REGISTRY_READY_TIMEOUT_MS = 3e4;
|
|
7414
7431
|
var LOCAL_ENGINE_READY_TIMEOUT_MS = 6e4;
|
|
7415
7432
|
var LOCAL_DEV_SHUTDOWN_GRACE_PERIOD_MS = 4e3;
|
|
7433
|
+
var DEFAULT_ACTOR_STOP_THRESHOLD_MS = 3e4;
|
|
7416
7434
|
function rejectServerless() {
|
|
7417
7435
|
throw new Error("serverless is disabled in this version");
|
|
7418
7436
|
}
|
|
@@ -7499,6 +7517,11 @@ var Registry = class {
|
|
|
7499
7517
|
#shutdownInstalled = false;
|
|
7500
7518
|
#shutdownInFlight = null;
|
|
7501
7519
|
#signalHandlers = {};
|
|
7520
|
+
#envoyConfiguredRegistry;
|
|
7521
|
+
#activeActorCountListeners = /* @__PURE__ */ new Set();
|
|
7522
|
+
#activeActorCountToken;
|
|
7523
|
+
#lastActiveActorCount;
|
|
7524
|
+
#activeActorCountSupported;
|
|
7502
7525
|
constructor(config, deps) {
|
|
7503
7526
|
var _a;
|
|
7504
7527
|
this.#config = config;
|
|
@@ -7913,6 +7936,21 @@ var Registry = class {
|
|
|
7913
7936
|
}
|
|
7914
7937
|
const configuredRegistryPromise = this.#buildConfiguredRegistry(config);
|
|
7915
7938
|
this.#runtimeServeConfiguredPromise = configuredRegistryPromise;
|
|
7939
|
+
configuredRegistryPromise.then(
|
|
7940
|
+
(configured) => {
|
|
7941
|
+
this.#envoyConfiguredRegistry = configured;
|
|
7942
|
+
try {
|
|
7943
|
+
this.#syncActiveActorCountSubscription();
|
|
7944
|
+
} catch (error) {
|
|
7945
|
+
logger2().error(
|
|
7946
|
+
{ error },
|
|
7947
|
+
"failed to subscribe to the active actor count"
|
|
7948
|
+
);
|
|
7949
|
+
}
|
|
7950
|
+
},
|
|
7951
|
+
// The serve lifecycle below reports build failures.
|
|
7952
|
+
() => void 0
|
|
7953
|
+
);
|
|
7916
7954
|
this.#runtimeServeLifecyclePromise = configuredRegistryPromise.then(
|
|
7917
7955
|
async ({ runtime, registry, serveConfig }) => {
|
|
7918
7956
|
await runtime.serveRegistry(registry, serveConfig);
|
|
@@ -7998,7 +8036,7 @@ var Registry = class {
|
|
|
7998
8036
|
if (gracePeriodMs === void 0) {
|
|
7999
8037
|
gracePeriodMs = localDevSignal ? LOCAL_DEV_SHUTDOWN_GRACE_PERIOD_MS : await this.#actorStopThresholdMs(
|
|
8000
8038
|
modeAPromise ?? modeBPromise
|
|
8001
|
-
) ??
|
|
8039
|
+
) ?? DEFAULT_ACTOR_STOP_THRESHOLD_MS;
|
|
8002
8040
|
}
|
|
8003
8041
|
const drain = async () => {
|
|
8004
8042
|
const registries = [];
|
|
@@ -8192,6 +8230,101 @@ var Registry = class {
|
|
|
8192
8230
|
const config = this.parseConfig();
|
|
8193
8231
|
this.#startEnvoy(config, true);
|
|
8194
8232
|
}
|
|
8233
|
+
/**
|
|
8234
|
+
* Returns the number of actors hosted by this process's envoy, which is zero
|
|
8235
|
+
* while it is not serving. Requires the native runtime.
|
|
8236
|
+
*/
|
|
8237
|
+
activeActorCount() {
|
|
8238
|
+
this.#assertActiveActorCountSupported("activeActorCount");
|
|
8239
|
+
const configured = this.#envoyConfiguredRegistry;
|
|
8240
|
+
if (!configured) return 0;
|
|
8241
|
+
const { runtime, registry } = configured;
|
|
8242
|
+
if (!runtime.registryActiveActorCount) {
|
|
8243
|
+
throw new Error(
|
|
8244
|
+
"registry.activeActorCount() is not supported by this runtime"
|
|
8245
|
+
);
|
|
8246
|
+
}
|
|
8247
|
+
return runtime.registryActiveActorCount(registry);
|
|
8248
|
+
}
|
|
8249
|
+
/**
|
|
8250
|
+
* Calls `callback` with the number of actors hosted by this process's envoy
|
|
8251
|
+
* and again whenever it changes. Rapid changes may coalesce.
|
|
8252
|
+
* Returns a function that unsubscribes. Requires the native runtime.
|
|
8253
|
+
*
|
|
8254
|
+
* @example
|
|
8255
|
+
* ```ts
|
|
8256
|
+
* const unsubscribe = registry.onActiveActorCountChange((count) => {
|
|
8257
|
+
* setTaskProtection(count > 0);
|
|
8258
|
+
* });
|
|
8259
|
+
* ```
|
|
8260
|
+
*/
|
|
8261
|
+
onActiveActorCountChange(callback) {
|
|
8262
|
+
this.#assertActiveActorCountSupported("onActiveActorCountChange");
|
|
8263
|
+
const listener = (count) => callback(count);
|
|
8264
|
+
this.#activeActorCountListeners.add(listener);
|
|
8265
|
+
this.#syncActiveActorCountSubscription();
|
|
8266
|
+
const lastCount = this.#lastActiveActorCount;
|
|
8267
|
+
if (lastCount !== void 0) {
|
|
8268
|
+
queueMicrotask(() => {
|
|
8269
|
+
if (this.#activeActorCountListeners.has(listener)) {
|
|
8270
|
+
this.#deliverActiveActorCount(listener, lastCount);
|
|
8271
|
+
}
|
|
8272
|
+
});
|
|
8273
|
+
}
|
|
8274
|
+
return () => {
|
|
8275
|
+
this.#activeActorCountListeners.delete(listener);
|
|
8276
|
+
this.#syncActiveActorCountSubscription();
|
|
8277
|
+
};
|
|
8278
|
+
}
|
|
8279
|
+
#assertActiveActorCountSupported(method2) {
|
|
8280
|
+
this.#activeActorCountSupported ??= this.parseConfig().runtime !== "wasm";
|
|
8281
|
+
if (!this.#activeActorCountSupported) {
|
|
8282
|
+
throw new Error(
|
|
8283
|
+
`registry.${method2}() requires the native runtime; WebAssembly registries do not host an envoy`
|
|
8284
|
+
);
|
|
8285
|
+
}
|
|
8286
|
+
}
|
|
8287
|
+
/** Holds one native subscription while any listener is registered. */
|
|
8288
|
+
#syncActiveActorCountSubscription() {
|
|
8289
|
+
const configured = this.#envoyConfiguredRegistry;
|
|
8290
|
+
if (!configured) return;
|
|
8291
|
+
const { runtime, registry } = configured;
|
|
8292
|
+
const token = this.#activeActorCountToken;
|
|
8293
|
+
if (this.#activeActorCountListeners.size === 0) {
|
|
8294
|
+
if (token !== void 0) {
|
|
8295
|
+
this.#activeActorCountToken = void 0;
|
|
8296
|
+
this.#lastActiveActorCount = void 0;
|
|
8297
|
+
runtime.cancelCancellationToken(token);
|
|
8298
|
+
}
|
|
8299
|
+
return;
|
|
8300
|
+
}
|
|
8301
|
+
if (token !== void 0) return;
|
|
8302
|
+
if (!runtime.onRegistryActiveActorCountChange) {
|
|
8303
|
+
throw new Error(
|
|
8304
|
+
"active actor count subscriptions are not supported by this runtime"
|
|
8305
|
+
);
|
|
8306
|
+
}
|
|
8307
|
+
const nextToken = runtime.createCancellationToken();
|
|
8308
|
+
this.#activeActorCountToken = nextToken;
|
|
8309
|
+
runtime.onRegistryActiveActorCountChange(
|
|
8310
|
+
registry,
|
|
8311
|
+
(count) => {
|
|
8312
|
+
if (this.#activeActorCountToken !== nextToken) return;
|
|
8313
|
+
this.#lastActiveActorCount = count;
|
|
8314
|
+
for (const listener of [...this.#activeActorCountListeners]) {
|
|
8315
|
+
this.#deliverActiveActorCount(listener, count);
|
|
8316
|
+
}
|
|
8317
|
+
},
|
|
8318
|
+
nextToken
|
|
8319
|
+
);
|
|
8320
|
+
}
|
|
8321
|
+
#deliverActiveActorCount(listener, count) {
|
|
8322
|
+
try {
|
|
8323
|
+
listener(count);
|
|
8324
|
+
} catch (error) {
|
|
8325
|
+
logger2().error({ error }, "active actor count listener threw");
|
|
8326
|
+
}
|
|
8327
|
+
}
|
|
8195
8328
|
#printWelcome(config, kind, listener) {
|
|
8196
8329
|
if (config.noWelcome || this.#welcomePrinted) return;
|
|
8197
8330
|
this.#welcomePrinted = true;
|