rivetkit 3.0.1 → 3.0.3
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 +69 -7
- package/dist/browser/client.js +1 -1
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +1 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/{chunk-2JSFY7XD.js → chunk-6XKZ4JI7.js} +2 -2
- package/dist/tsup/{chunk-3PFAODLE.cjs → chunk-7UGPT7WZ.cjs} +3 -3
- package/dist/tsup/{chunk-3PFAODLE.cjs.map → chunk-7UGPT7WZ.cjs.map} +1 -1
- package/dist/tsup/{chunk-4VEJIK7O.cjs → chunk-DQTCLK7I.cjs} +3 -3
- package/dist/tsup/{chunk-4VEJIK7O.cjs.map → chunk-DQTCLK7I.cjs.map} +1 -1
- package/dist/tsup/{chunk-NSQWB4QD.cjs → chunk-I4WHG6X3.cjs} +3 -3
- package/dist/tsup/{chunk-NSQWB4QD.cjs.map → chunk-I4WHG6X3.cjs.map} +1 -1
- package/dist/tsup/{chunk-57I7SSSV.js → chunk-IFIAM2WX.js} +4 -4
- package/dist/tsup/{chunk-JOCSSMLU.js → chunk-JEQKU2GS.js} +3 -3
- package/dist/tsup/{chunk-B5WDVY32.js → chunk-JHPMLQHW.js} +2 -2
- package/dist/tsup/{chunk-B5WDVY32.js.map → chunk-JHPMLQHW.js.map} +1 -1
- package/dist/tsup/{chunk-7K6MC544.js → chunk-KA2HY475.js} +2 -2
- package/dist/tsup/{chunk-PLZVADML.js → chunk-KXQU67B5.js} +2 -2
- package/dist/tsup/{chunk-QX7DWU46.js → chunk-MD5JLJL3.js} +2 -2
- package/dist/tsup/{chunk-N7V3BQUB.cjs → chunk-NEI2VMRH.cjs} +10 -10
- package/dist/tsup/{chunk-N7V3BQUB.cjs.map → chunk-NEI2VMRH.cjs.map} +1 -1
- package/dist/tsup/{chunk-LXSYHJ7E.cjs → chunk-PPEFSNNR.cjs} +4 -4
- package/dist/tsup/{chunk-LXSYHJ7E.cjs.map → chunk-PPEFSNNR.cjs.map} +1 -1
- package/dist/tsup/{chunk-B3MXZSPO.cjs → chunk-RZHBGWOL.cjs} +143 -143
- package/dist/tsup/{chunk-B3MXZSPO.cjs.map → chunk-RZHBGWOL.cjs.map} +1 -1
- package/dist/tsup/{chunk-QI7E2UH5.cjs → chunk-SUU72UBE.cjs} +2 -2
- package/dist/tsup/{chunk-QI7E2UH5.cjs.map → chunk-SUU72UBE.cjs.map} +1 -1
- package/dist/tsup/{chunk-HQ5JCCK6.cjs → chunk-UBEFOC6D.cjs} +7 -7
- package/dist/tsup/{chunk-HQ5JCCK6.cjs.map → chunk-UBEFOC6D.cjs.map} +1 -1
- package/dist/tsup/{chunk-BOVQ3JQK.js → chunk-XLQCNXZ6.js} +3 -3
- 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-XfKwGYxx.d.ts → config-BtUHYdoj.d.ts} +21 -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-K9uOKlok.d.cts → config-H6pJy_J1.d.cts} +21 -1
- package/dist/tsup/{context-Bm7mA4E3.d.ts → context-DrDoMXSD.d.ts} +2 -2
- package/dist/tsup/{context-CPCM-xn6.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.d.cts +2 -2
- package/dist/tsup/dynamic/mod.d.ts +2 -2
- 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.d.cts +3 -3
- package/dist/tsup/inspector-tab/mod.d.ts +3 -3
- package/dist/tsup/mod.cjs +212 -87
- 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 +131 -6
- 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 +7 -7
- package/dist/tsup/workflow/mod.d.cts +4 -4
- package/dist/tsup/workflow/mod.d.ts +4 -4
- package/dist/tsup/workflow/mod.js +4 -4
- package/package.json +9 -9
- package/src/common/database/config.ts +50 -7
- package/src/db/mod.ts +1 -0
- package/src/registry/index.ts +142 -1
- package/src/registry/napi-runtime.ts +15 -0
- package/src/registry/runtime.ts +6 -0
- /package/dist/tsup/{chunk-2JSFY7XD.js.map → chunk-6XKZ4JI7.js.map} +0 -0
- /package/dist/tsup/{chunk-57I7SSSV.js.map → chunk-IFIAM2WX.js.map} +0 -0
- /package/dist/tsup/{chunk-JOCSSMLU.js.map → chunk-JEQKU2GS.js.map} +0 -0
- /package/dist/tsup/{chunk-7K6MC544.js.map → chunk-KA2HY475.js.map} +0 -0
- /package/dist/tsup/{chunk-PLZVADML.js.map → chunk-KXQU67B5.js.map} +0 -0
- /package/dist/tsup/{chunk-QX7DWU46.js.map → chunk-MD5JLJL3.js.map} +0 -0
- /package/dist/tsup/{chunk-BOVQ3JQK.js.map → chunk-XLQCNXZ6.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,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
decodeWorkflowHistoryTransport
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MD5JLJL3.js";
|
|
4
4
|
import {
|
|
5
5
|
ACTOR_CONTEXT_INTERNAL_SYMBOL,
|
|
6
6
|
ActorConfigSchema,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
runWithActorInvocationSpan,
|
|
36
36
|
tryParseEndpoint,
|
|
37
37
|
updateRunnerConfig
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-JEQKU2GS.js";
|
|
39
39
|
import {
|
|
40
40
|
makePrefixedKey,
|
|
41
41
|
removePrefixFromKey
|
|
@@ -44,9 +44,9 @@ import {
|
|
|
44
44
|
bindNativeStateTransactionContext,
|
|
45
45
|
db,
|
|
46
46
|
registerNativeStateTransactionOpener
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-KA2HY475.js";
|
|
48
48
|
import "./chunk-JTHHCZCZ.js";
|
|
49
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-KXQU67B5.js";
|
|
50
50
|
import {
|
|
51
51
|
LogLevelSchema,
|
|
52
52
|
VERSION,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
parsePortEnv,
|
|
81
81
|
stringifyError,
|
|
82
82
|
toUint8Array
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-JHPMLQHW.js";
|
|
84
84
|
import {
|
|
85
85
|
INTERNAL_ERROR_CODE,
|
|
86
86
|
RivetError,
|
|
@@ -1599,6 +1599,15 @@ var NapiCoreRuntime = class {
|
|
|
1599
1599
|
async registryActorStopThresholdMs(registry) {
|
|
1600
1600
|
return await asNativeRegistry(registry).actorStopThresholdMs() ?? void 0;
|
|
1601
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
|
+
}
|
|
1602
1611
|
async registryHealth(registry) {
|
|
1603
1612
|
const response = await asNativeRegistry(registry).health();
|
|
1604
1613
|
return {
|
|
@@ -7421,6 +7430,7 @@ async function buildConfiguredRegistry(config) {
|
|
|
7421
7430
|
var REGISTRY_READY_TIMEOUT_MS = 3e4;
|
|
7422
7431
|
var LOCAL_ENGINE_READY_TIMEOUT_MS = 6e4;
|
|
7423
7432
|
var LOCAL_DEV_SHUTDOWN_GRACE_PERIOD_MS = 4e3;
|
|
7433
|
+
var DEFAULT_ACTOR_STOP_THRESHOLD_MS = 3e4;
|
|
7424
7434
|
function rejectServerless() {
|
|
7425
7435
|
throw new Error("serverless is disabled in this version");
|
|
7426
7436
|
}
|
|
@@ -7507,6 +7517,11 @@ var Registry = class {
|
|
|
7507
7517
|
#shutdownInstalled = false;
|
|
7508
7518
|
#shutdownInFlight = null;
|
|
7509
7519
|
#signalHandlers = {};
|
|
7520
|
+
#envoyConfiguredRegistry;
|
|
7521
|
+
#activeActorCountListeners = /* @__PURE__ */ new Set();
|
|
7522
|
+
#activeActorCountToken;
|
|
7523
|
+
#lastActiveActorCount;
|
|
7524
|
+
#activeActorCountSupported;
|
|
7510
7525
|
constructor(config, deps) {
|
|
7511
7526
|
var _a;
|
|
7512
7527
|
this.#config = config;
|
|
@@ -7921,6 +7936,21 @@ var Registry = class {
|
|
|
7921
7936
|
}
|
|
7922
7937
|
const configuredRegistryPromise = this.#buildConfiguredRegistry(config);
|
|
7923
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
|
+
);
|
|
7924
7954
|
this.#runtimeServeLifecyclePromise = configuredRegistryPromise.then(
|
|
7925
7955
|
async ({ runtime, registry, serveConfig }) => {
|
|
7926
7956
|
await runtime.serveRegistry(registry, serveConfig);
|
|
@@ -8006,7 +8036,7 @@ var Registry = class {
|
|
|
8006
8036
|
if (gracePeriodMs === void 0) {
|
|
8007
8037
|
gracePeriodMs = localDevSignal ? LOCAL_DEV_SHUTDOWN_GRACE_PERIOD_MS : await this.#actorStopThresholdMs(
|
|
8008
8038
|
modeAPromise ?? modeBPromise
|
|
8009
|
-
) ??
|
|
8039
|
+
) ?? DEFAULT_ACTOR_STOP_THRESHOLD_MS;
|
|
8010
8040
|
}
|
|
8011
8041
|
const drain = async () => {
|
|
8012
8042
|
const registries = [];
|
|
@@ -8200,6 +8230,101 @@ var Registry = class {
|
|
|
8200
8230
|
const config = this.parseConfig();
|
|
8201
8231
|
this.#startEnvoy(config, true);
|
|
8202
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
|
+
}
|
|
8203
8328
|
#printWelcome(config, kind, listener) {
|
|
8204
8329
|
if (config.noWelcome || this.#welcomePrinted) return;
|
|
8205
8330
|
this.#welcomePrinted = true;
|