rivetkit 3.1.2-rc.7 → 3.1.2-rc.9
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 +4 -0
- package/dist/browser/client.js +64 -26
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +2 -2
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/{chunk-IOQREPUK.js → chunk-24OLPBXH.js} +32 -12
- package/dist/tsup/chunk-24OLPBXH.js.map +1 -0
- package/dist/tsup/{chunk-LE3YMWAP.cjs → chunk-6BCM5FXB.cjs} +10 -10
- package/dist/tsup/{chunk-LE3YMWAP.cjs.map → chunk-6BCM5FXB.cjs.map} +1 -1
- package/dist/tsup/{chunk-XGN6KETJ.js → chunk-7TW4LSJN.js} +2 -2
- package/dist/tsup/{chunk-GQKAGJK5.cjs → chunk-7YVW2AZO.cjs} +3 -3
- package/dist/tsup/{chunk-GQKAGJK5.cjs.map → chunk-7YVW2AZO.cjs.map} +1 -1
- package/dist/tsup/{chunk-FWPWI7QL.js → chunk-BAPWFPDP.js} +2 -2
- package/dist/tsup/{chunk-L4UTSVE3.js → chunk-C4QGTZEW.js} +3 -3
- package/dist/tsup/{chunk-BEXWAJ6U.cjs → chunk-DO4K3PV4.cjs} +7 -7
- package/dist/tsup/{chunk-BEXWAJ6U.cjs.map → chunk-DO4K3PV4.cjs.map} +1 -1
- package/dist/tsup/{chunk-EBFFGWLN.cjs → chunk-DWQV2G7C.cjs} +3 -3
- package/dist/tsup/{chunk-EBFFGWLN.cjs.map → chunk-DWQV2G7C.cjs.map} +1 -1
- package/dist/tsup/{chunk-LJ6SZFME.js → chunk-F4IRT46P.js} +2 -2
- package/dist/tsup/{chunk-ER6SIYWL.cjs → chunk-HM7C4VY6.cjs} +174 -154
- package/dist/tsup/chunk-HM7C4VY6.cjs.map +1 -0
- package/dist/tsup/{chunk-HRSJKLCU.js → chunk-KQLEFYNT.js} +36 -18
- package/dist/tsup/chunk-KQLEFYNT.js.map +1 -0
- package/dist/tsup/{chunk-4QYXOAW5.cjs → chunk-NBYWKPR6.cjs} +4 -4
- package/dist/tsup/{chunk-4QYXOAW5.cjs.map → chunk-NBYWKPR6.cjs.map} +1 -1
- package/dist/tsup/{chunk-AH3SB6EE.cjs → chunk-SYTAFLV7.cjs} +3 -3
- package/dist/tsup/{chunk-AH3SB6EE.cjs.map → chunk-SYTAFLV7.cjs.map} +1 -1
- package/dist/tsup/{chunk-N6GT7FYD.js → chunk-U7RFRYY2.js} +2 -2
- package/dist/tsup/{chunk-DOJBNDVS.cjs → chunk-V7ISUWSD.cjs} +36 -18
- package/dist/tsup/chunk-V7ISUWSD.cjs.map +1 -0
- package/dist/tsup/{chunk-NWQJIAG4.js → chunk-VYXFJR7Y.js} +4 -4
- 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-CyOAiV6S.d.cts → config-B1L9Ytm_.d.cts} +4 -0
- package/dist/tsup/{config-TS1eu7w9.d.ts → config-DhGSJx-3.d.ts} +4 -0
- package/dist/tsup/{context-CxYw0sLz.d.ts → context-B6HOPYyk.d.ts} +1 -1
- package/dist/tsup/{context-Cq5UEIVG.d.cts → context-BuQ4FncM.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 +3 -3
- package/dist/tsup/db/mod.js +2 -2
- package/dist/tsup/dynamic/mod.d.cts +1 -1
- package/dist/tsup/dynamic/mod.d.ts +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.d.cts +2 -2
- package/dist/tsup/inspector-tab/mod.d.ts +2 -2
- package/dist/tsup/mod.cjs +86 -86
- package/dist/tsup/mod.d.cts +3 -3
- package/dist/tsup/mod.d.ts +3 -3
- package/dist/tsup/mod.js +5 -5
- package/dist/tsup/test/mod.cjs +6 -6
- package/dist/tsup/test/mod.d.cts +1 -1
- package/dist/tsup/test/mod.d.ts +1 -1
- package/dist/tsup/test/mod.js +4 -4
- 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 +3 -3
- package/dist/tsup/workflow/mod.d.ts +3 -3
- package/dist/tsup/workflow/mod.js +4 -4
- package/package.json +10 -10
- package/src/client/actor-conn.ts +33 -9
- package/src/client/lifecycle-errors.ts +3 -1
- package/src/common/encoding.ts +45 -15
- package/dist/tsup/chunk-DOJBNDVS.cjs.map +0 -1
- package/dist/tsup/chunk-ER6SIYWL.cjs.map +0 -1
- package/dist/tsup/chunk-HRSJKLCU.js.map +0 -1
- package/dist/tsup/chunk-IOQREPUK.js.map +0 -1
- /package/dist/tsup/{chunk-XGN6KETJ.js.map → chunk-7TW4LSJN.js.map} +0 -0
- /package/dist/tsup/{chunk-FWPWI7QL.js.map → chunk-BAPWFPDP.js.map} +0 -0
- /package/dist/tsup/{chunk-L4UTSVE3.js.map → chunk-C4QGTZEW.js.map} +0 -0
- /package/dist/tsup/{chunk-LJ6SZFME.js.map → chunk-F4IRT46P.js.map} +0 -0
- /package/dist/tsup/{chunk-N6GT7FYD.js.map → chunk-U7RFRYY2.js.map} +0 -0
- /package/dist/tsup/{chunk-NWQJIAG4.js.map → chunk-VYXFJR7Y.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 ActorFork, z as ActorForkLink, F as ActorInspectorConfig, G as ActorInspectorConfigSchema, H as ActorKey, I as ActorKv, J as ActorLogger, K as ActorOptions, L as ActorOptionsInput, N as ActorOptionsSchema, O as ActorQuery, P as ActorQueue, T as ActorRun, U as ActorSchedule, V as ActorTracingOptions, X as ActorTypes, Y as ActorsSchema, Z as AnyActorInstance, _ as AnyClient, $ as AnyConn, a0 as AnyStaticActorDefinition, a1 as AnyStaticActorInstance, a2 as AuthIntent, a3 as BUILTIN_INSPECTOR_TAB_IDS, a4 as BaseActorInstance, a5 as BuiltinInspectorTabIdSchema, a6 as CONN_DRIVER_SYMBOL, a7 as CONN_STATE_MANAGER_SYMBOL, a8 as Client, a9 as Conn, aa as CronFire, ab as CronJobInfo, ac as CustomInspectorTabEntrySchema, ad as DEFAULT_SLEEP_GRACE_PERIOD, ae as DefineRunHandlerOptions, af as DocActorConfigSchema, ag as DocActorOptionsSchema, ah as DocConfigurePoolSchema, ai as DocEnvoyConfigSchema, aj as DocRegistryConfigSchema, ak as DocServerlessConfigSchema, al as DocSqliteConfigSchema, am as FetchHandler, an as GlobalActorOptions, ao as GlobalActorOptionsInput, ap as GlobalActorOptionsSchema, aq as HideInspectorTabEntrySchema, ar as InferEventArgs, as as InferSchemaMap, at as InspectorTabEntrySchema, au as InspectorUnsubscribe, av as InstanceActorOptions, aw as InstanceActorOptionsInput, ax as InstanceActorOptionsSchema, ay as QueueEnqueueAndWaitOptions, az as QueueFilterName, aA as QueueIterOptions, aB as QueueMessageOf, aC as QueueName, aD as QueueNextBatchOptions, aE as QueueNextOptions, aF as QueueResultMessageForName, aG as QueueTryNextBatchOptions, aH as QueueTryNextOptions, aI as QueueWaitOptions, aJ as RAW_STATE_SYMBOL, aK as Registry, aL as RegistryActors, aM as RegistryApplication, aN as RegistryConfig, aO as RegistryConfigInput, aP as RegistryConfigSchema, aQ as RegistryDeps, aR as RegistryListenOptions, aS as RegistryRoutes, aT as RunConfig, aU as RunConfigSchema, aV as RunControl, aW as RunInspectorConfig, aX as RunInspectorFactoryContext, aY as RunInspectorFactoryResult, aZ as RunInspectorKind, a_ as RunWithInactiveOptions, a$ as RuntimeKind, b0 as RuntimeKindSchema, b1 as ScheduledEventInfo, b2 as ScheduledFireInfo, b3 as ServerlessHandler, b4 as SqliteBackend, b5 as SqliteBackendSchema, b6 as SqliteConfig, b7 as SqliteConfigSchema, b8 as TestConfig, b9 as TestConfigSchema, ba as Type, bb as WasmRuntimeBindings, bc as WasmRuntimeConfig, bd as WasmRuntimeConfigSchema, be as WasmRuntimeInitInput, bf as WorkflowInspectorConfig, bg as WorkflowOutcome, bh as WorkflowSpan, bi as WorkflowStepOutcome, bj as WorkflowStepSpan, bk as actor, bl as buildActorNames, bm as createClientWithDriver, bn as defineRunHandler, bo as disposeRunInspector, bp as event, bq as getRunFunction, br as getRunInspectorConfig, bs as getRunMetadata, bt as isStaticActorDefinition, bu as isStaticActorInstance, bv as lookupInRegistry, bw as queue, bx as setup, by 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-B1L9Ytm_.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 ActorFork, z as ActorForkLink, F as ActorInspectorConfig, G as ActorInspectorConfigSchema, H as ActorKey, I as ActorKv, J as ActorLogger, K as ActorOptions, L as ActorOptionsInput, N as ActorOptionsSchema, O as ActorQuery, P as ActorQueue, T as ActorRun, U as ActorSchedule, V as ActorTracingOptions, X as ActorTypes, Y as ActorsSchema, Z as AnyActorInstance, _ as AnyClient, $ as AnyConn, a0 as AnyStaticActorDefinition, a1 as AnyStaticActorInstance, a2 as AuthIntent, a3 as BUILTIN_INSPECTOR_TAB_IDS, a4 as BaseActorInstance, a5 as BuiltinInspectorTabIdSchema, a6 as CONN_DRIVER_SYMBOL, a7 as CONN_STATE_MANAGER_SYMBOL, a8 as Client, a9 as Conn, aa as CronFire, ab as CronJobInfo, ac as CustomInspectorTabEntrySchema, ad as DEFAULT_SLEEP_GRACE_PERIOD, ae as DefineRunHandlerOptions, af as DocActorConfigSchema, ag as DocActorOptionsSchema, ah as DocConfigurePoolSchema, ai as DocEnvoyConfigSchema, aj as DocRegistryConfigSchema, ak as DocServerlessConfigSchema, al as DocSqliteConfigSchema, am as FetchHandler, an as GlobalActorOptions, ao as GlobalActorOptionsInput, ap as GlobalActorOptionsSchema, aq as HideInspectorTabEntrySchema, ar as InferEventArgs, as as InferSchemaMap, at as InspectorTabEntrySchema, au as InspectorUnsubscribe, av as InstanceActorOptions, aw as InstanceActorOptionsInput, ax as InstanceActorOptionsSchema, ay as QueueEnqueueAndWaitOptions, az as QueueFilterName, aA as QueueIterOptions, aB as QueueMessageOf, aC as QueueName, aD as QueueNextBatchOptions, aE as QueueNextOptions, aF as QueueResultMessageForName, aG as QueueTryNextBatchOptions, aH as QueueTryNextOptions, aI as QueueWaitOptions, aJ as RAW_STATE_SYMBOL, aK as Registry, aL as RegistryActors, aM as RegistryApplication, aN as RegistryConfig, aO as RegistryConfigInput, aP as RegistryConfigSchema, aQ as RegistryDeps, aR as RegistryListenOptions, aS as RegistryRoutes, aT as RunConfig, aU as RunConfigSchema, aV as RunControl, aW as RunInspectorConfig, aX as RunInspectorFactoryContext, aY as RunInspectorFactoryResult, aZ as RunInspectorKind, a_ as RunWithInactiveOptions, a$ as RuntimeKind, b0 as RuntimeKindSchema, b1 as ScheduledEventInfo, b2 as ScheduledFireInfo, b3 as ServerlessHandler, b4 as SqliteBackend, b5 as SqliteBackendSchema, b6 as SqliteConfig, b7 as SqliteConfigSchema, b8 as TestConfig, b9 as TestConfigSchema, ba as Type, bb as WasmRuntimeBindings, bc as WasmRuntimeConfig, bd as WasmRuntimeConfigSchema, be as WasmRuntimeInitInput, bf as WorkflowInspectorConfig, bg as WorkflowOutcome, bh as WorkflowSpan, bi as WorkflowStepOutcome, bj as WorkflowStepSpan, bk as actor, bl as buildActorNames, bm as createClientWithDriver, bn as defineRunHandler, bo as disposeRunInspector, bp as event, bq as getRunFunction, br as getRunInspectorConfig, bs as getRunMetadata, bt as isStaticActorDefinition, bu as isStaticActorInstance, bv as lookupInRegistry, bw as queue, bx as setup, by as test } from './config-B1L9Ytm_.cjs';
|
|
3
3
|
export { E as Encoding, t as toUint8Array } from './utils-BctYATXG.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-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-BuQ4FncM.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 ActorFork, z as ActorForkLink, F as ActorInspectorConfig, G as ActorInspectorConfigSchema, H as ActorKey, I as ActorKv, J as ActorLogger, K as ActorOptions, L as ActorOptionsInput, N as ActorOptionsSchema, O as ActorQuery, P as ActorQueue, T as ActorRun, U as ActorSchedule, V as ActorTracingOptions, X as ActorTypes, Y as ActorsSchema, Z as AnyActorInstance, _ as AnyClient, $ as AnyConn, a0 as AnyStaticActorDefinition, a1 as AnyStaticActorInstance, a2 as AuthIntent, a3 as BUILTIN_INSPECTOR_TAB_IDS, a4 as BaseActorInstance, a5 as BuiltinInspectorTabIdSchema, a6 as CONN_DRIVER_SYMBOL, a7 as CONN_STATE_MANAGER_SYMBOL, a8 as Client, a9 as Conn, aa as CronFire, ab as CronJobInfo, ac as CustomInspectorTabEntrySchema, ad as DEFAULT_SLEEP_GRACE_PERIOD, ae as DefineRunHandlerOptions, af as DocActorConfigSchema, ag as DocActorOptionsSchema, ah as DocConfigurePoolSchema, ai as DocEnvoyConfigSchema, aj as DocRegistryConfigSchema, ak as DocServerlessConfigSchema, al as DocSqliteConfigSchema, am as FetchHandler, an as GlobalActorOptions, ao as GlobalActorOptionsInput, ap as GlobalActorOptionsSchema, aq as HideInspectorTabEntrySchema, ar as InferEventArgs, as as InferSchemaMap, at as InspectorTabEntrySchema, au as InspectorUnsubscribe, av as InstanceActorOptions, aw as InstanceActorOptionsInput, ax as InstanceActorOptionsSchema, ay as QueueEnqueueAndWaitOptions, az as QueueFilterName, aA as QueueIterOptions, aB as QueueMessageOf, aC as QueueName, aD as QueueNextBatchOptions, aE as QueueNextOptions, aF as QueueResultMessageForName, aG as QueueTryNextBatchOptions, aH as QueueTryNextOptions, aI as QueueWaitOptions, aJ as RAW_STATE_SYMBOL, aK as Registry, aL as RegistryActors, aM as RegistryApplication, aN as RegistryConfig, aO as RegistryConfigInput, aP as RegistryConfigSchema, aQ as RegistryDeps, aR as RegistryListenOptions, aS as RegistryRoutes, aT as RunConfig, aU as RunConfigSchema, aV as RunControl, aW as RunInspectorConfig, aX as RunInspectorFactoryContext, aY as RunInspectorFactoryResult, aZ as RunInspectorKind, a_ as RunWithInactiveOptions, a$ as RuntimeKind, b0 as RuntimeKindSchema, b1 as ScheduledEventInfo, b2 as ScheduledFireInfo, b3 as ServerlessHandler, b4 as SqliteBackend, b5 as SqliteBackendSchema, b6 as SqliteConfig, b7 as SqliteConfigSchema, b8 as TestConfig, b9 as TestConfigSchema, ba as Type, bb as WasmRuntimeBindings, bc as WasmRuntimeConfig, bd as WasmRuntimeConfigSchema, be as WasmRuntimeInitInput, bf as WorkflowInspectorConfig, bg as WorkflowOutcome, bh as WorkflowSpan, bi as WorkflowStepOutcome, bj as WorkflowStepSpan, bk as actor, bl as buildActorNames, bm as createClientWithDriver, bn as defineRunHandler, bo as disposeRunInspector, bp as event, bq as getRunFunction, br as getRunInspectorConfig, bs as getRunMetadata, bt as isStaticActorDefinition, bu as isStaticActorInstance, bv as lookupInRegistry, bw as queue, bx as setup, by 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-DhGSJx-3.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 ActorFork, z as ActorForkLink, F as ActorInspectorConfig, G as ActorInspectorConfigSchema, H as ActorKey, I as ActorKv, J as ActorLogger, K as ActorOptions, L as ActorOptionsInput, N as ActorOptionsSchema, O as ActorQuery, P as ActorQueue, T as ActorRun, U as ActorSchedule, V as ActorTracingOptions, X as ActorTypes, Y as ActorsSchema, Z as AnyActorInstance, _ as AnyClient, $ as AnyConn, a0 as AnyStaticActorDefinition, a1 as AnyStaticActorInstance, a2 as AuthIntent, a3 as BUILTIN_INSPECTOR_TAB_IDS, a4 as BaseActorInstance, a5 as BuiltinInspectorTabIdSchema, a6 as CONN_DRIVER_SYMBOL, a7 as CONN_STATE_MANAGER_SYMBOL, a8 as Client, a9 as Conn, aa as CronFire, ab as CronJobInfo, ac as CustomInspectorTabEntrySchema, ad as DEFAULT_SLEEP_GRACE_PERIOD, ae as DefineRunHandlerOptions, af as DocActorConfigSchema, ag as DocActorOptionsSchema, ah as DocConfigurePoolSchema, ai as DocEnvoyConfigSchema, aj as DocRegistryConfigSchema, ak as DocServerlessConfigSchema, al as DocSqliteConfigSchema, am as FetchHandler, an as GlobalActorOptions, ao as GlobalActorOptionsInput, ap as GlobalActorOptionsSchema, aq as HideInspectorTabEntrySchema, ar as InferEventArgs, as as InferSchemaMap, at as InspectorTabEntrySchema, au as InspectorUnsubscribe, av as InstanceActorOptions, aw as InstanceActorOptionsInput, ax as InstanceActorOptionsSchema, ay as QueueEnqueueAndWaitOptions, az as QueueFilterName, aA as QueueIterOptions, aB as QueueMessageOf, aC as QueueName, aD as QueueNextBatchOptions, aE as QueueNextOptions, aF as QueueResultMessageForName, aG as QueueTryNextBatchOptions, aH as QueueTryNextOptions, aI as QueueWaitOptions, aJ as RAW_STATE_SYMBOL, aK as Registry, aL as RegistryActors, aM as RegistryApplication, aN as RegistryConfig, aO as RegistryConfigInput, aP as RegistryConfigSchema, aQ as RegistryDeps, aR as RegistryListenOptions, aS as RegistryRoutes, aT as RunConfig, aU as RunConfigSchema, aV as RunControl, aW as RunInspectorConfig, aX as RunInspectorFactoryContext, aY as RunInspectorFactoryResult, aZ as RunInspectorKind, a_ as RunWithInactiveOptions, a$ as RuntimeKind, b0 as RuntimeKindSchema, b1 as ScheduledEventInfo, b2 as ScheduledFireInfo, b3 as ServerlessHandler, b4 as SqliteBackend, b5 as SqliteBackendSchema, b6 as SqliteConfig, b7 as SqliteConfigSchema, b8 as TestConfig, b9 as TestConfigSchema, ba as Type, bb as WasmRuntimeBindings, bc as WasmRuntimeConfig, bd as WasmRuntimeConfigSchema, be as WasmRuntimeInitInput, bf as WorkflowInspectorConfig, bg as WorkflowOutcome, bh as WorkflowSpan, bi as WorkflowStepOutcome, bj as WorkflowStepSpan, bk as actor, bl as buildActorNames, bm as createClientWithDriver, bn as defineRunHandler, bo as disposeRunInspector, bp as event, bq as getRunFunction, br as getRunInspectorConfig, bs as getRunMetadata, bt as isStaticActorDefinition, bu as isStaticActorInstance, bv as lookupInRegistry, bw as queue, bx as setup, by as test } from './config-DhGSJx-3.js';
|
|
3
3
|
export { E as Encoding, t as toUint8Array } from './utils-CR1Y49t6.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-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-B6HOPYyk.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-7TW4LSJN.js";
|
|
4
4
|
import {
|
|
5
5
|
ACTOR_CONTEXT_INTERNAL_SYMBOL,
|
|
6
6
|
ActorConfigSchema,
|
|
@@ -35,17 +35,17 @@ import {
|
|
|
35
35
|
runWithActorInvocationSpan,
|
|
36
36
|
tryParseEndpoint,
|
|
37
37
|
updateRunnerConfig
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-24OLPBXH.js";
|
|
39
39
|
import {
|
|
40
40
|
makePrefixedKey,
|
|
41
41
|
removePrefixFromKey
|
|
42
42
|
} from "./chunk-A2CF6PFH.js";
|
|
43
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-BAPWFPDP.js";
|
|
44
44
|
import {
|
|
45
45
|
bindNativeStateTransactionContext,
|
|
46
46
|
db,
|
|
47
47
|
registerNativeStateTransactionOpener
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-U7RFRYY2.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-KQLEFYNT.js";
|
|
84
84
|
import {
|
|
85
85
|
INTERNAL_ERROR_CODE,
|
|
86
86
|
RivetError,
|
package/dist/tsup/test/mod.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkDO4K3PV4cjs = require('../chunk-DO4K3PV4.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkHM7C4VY6cjs = require('../chunk-HM7C4VY6.cjs');
|
|
7
7
|
require('../chunk-RTWH3AX3.cjs');
|
|
8
|
-
require('../chunk-
|
|
8
|
+
require('../chunk-DWQV2G7C.cjs');
|
|
9
9
|
require('../chunk-KVFIONKQ.cjs');
|
|
10
|
-
require('../chunk-
|
|
10
|
+
require('../chunk-V7ISUWSD.cjs');
|
|
11
11
|
require('../chunk-MGI2VVF6.cjs');
|
|
12
12
|
|
|
13
13
|
// src/test/ready.ts
|
|
@@ -36,8 +36,8 @@ async function setupTest(c, registry) {
|
|
|
36
36
|
registry.config.noWelcome = true;
|
|
37
37
|
registry.start();
|
|
38
38
|
await waitForRegistryReady(registry);
|
|
39
|
-
const client =
|
|
40
|
-
...
|
|
39
|
+
const client = _chunkDO4K3PV4cjs.createClient.call(void 0, {
|
|
40
|
+
..._chunkHM7C4VY6cjs.convertRegistryConfigToClientConfig.call(void 0, registry.parseConfig()),
|
|
41
41
|
disableMetadataLookup: false
|
|
42
42
|
});
|
|
43
43
|
c.onTestFinished(async () => {
|
package/dist/tsup/test/mod.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TestContext } from 'vitest';
|
|
2
|
-
import { aK as Registry, a8 as Client } from '../config-
|
|
2
|
+
import { aK as Registry, a8 as Client } from '../config-B1L9Ytm_.cjs';
|
|
3
3
|
import 'zod/v4';
|
|
4
4
|
import '../config-CBTr4IhE.cjs';
|
|
5
5
|
import '@rivetkit/rivetkit-wasm';
|
package/dist/tsup/test/mod.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TestContext } from 'vitest';
|
|
2
|
-
import { aK as Registry, a8 as Client } from '../config-
|
|
2
|
+
import { aK as Registry, a8 as Client } from '../config-DhGSJx-3.js';
|
|
3
3
|
import 'zod/v4';
|
|
4
4
|
import '../config-CBTr4IhE.js';
|
|
5
5
|
import '@rivetkit/rivetkit-wasm';
|
package/dist/tsup/test/mod.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-C4QGTZEW.js";
|
|
4
4
|
import {
|
|
5
5
|
convertRegistryConfigToClientConfig
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-24OLPBXH.js";
|
|
7
7
|
import "../chunk-A2CF6PFH.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-BAPWFPDP.js";
|
|
9
9
|
import "../chunk-JTHHCZCZ.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-KQLEFYNT.js";
|
|
11
11
|
import "../chunk-ZOVJDAOW.js";
|
|
12
12
|
|
|
13
13
|
// src/test/ready.ts
|
package/dist/tsup/utils.cjs
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkV7ISUWSDcjs = require('./chunk-V7ISUWSD.cjs');
|
|
23
23
|
require('./chunk-MGI2VVF6.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
@@ -42,5 +42,5 @@ require('./chunk-MGI2VVF6.cjs');
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
exports.EXTRA_ERROR_LOG =
|
|
45
|
+
exports.EXTRA_ERROR_LOG = _chunkV7ISUWSDcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunkV7ISUWSDcjs.SinglePromiseQueue; exports.VERSION = _chunkV7ISUWSDcjs.VERSION; exports.arrayBuffersEqual = _chunkV7ISUWSDcjs.arrayBuffersEqual; exports.assertUnreachable = _chunkV7ISUWSDcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunkV7ISUWSDcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunkV7ISUWSDcjs.combineUrlPath; exports.dbg = _chunkV7ISUWSDcjs.dbg; exports.detectRuntime = _chunkV7ISUWSDcjs.detectRuntime; exports.getEnvUniversal = _chunkV7ISUWSDcjs.getEnvUniversal; exports.httpUserAgent = _chunkV7ISUWSDcjs.httpUserAgent; exports.interval = _chunkV7ISUWSDcjs.interval; exports.joinSignals = _chunkV7ISUWSDcjs.joinSignals; exports.jsonParseCompat = _chunkV7ISUWSDcjs.jsonParseCompat; exports.jsonStringifyCompat = _chunkV7ISUWSDcjs.jsonStringifyCompat; exports.promiseWithResolvers = _chunkV7ISUWSDcjs.promiseWithResolvers; exports.setLongTimeout = _chunkV7ISUWSDcjs.setLongTimeout; exports.sleep = _chunkV7ISUWSDcjs.sleep; exports.stringifyError = _chunkV7ISUWSDcjs.stringifyError; exports.toUint8Array = _chunkV7ISUWSDcjs.toUint8Array;
|
|
46
46
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/tsup/utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } var _class; var _class2;
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
3
|
+
var _chunk6BCM5FXBcjs = require('../chunk-6BCM5FXB.cjs');
|
|
4
|
+
require('../chunk-7YVW2AZO.cjs');
|
|
5
|
+
require('../chunk-NBYWKPR6.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -13,7 +13,7 @@ var _chunkAQJFKHBKcjs = require('../chunk-AQJFKHBK.cjs');
|
|
|
13
13
|
var _chunkRTWH3AX3cjs = require('../chunk-RTWH3AX3.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkV7ISUWSDcjs = require('../chunk-V7ISUWSD.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -769,7 +769,7 @@ function workflow(fn, options = {}) {
|
|
|
769
769
|
function getWorkflowInspector(actorId) {
|
|
770
770
|
let workflowInspector = workflowInspectors.get(actorId);
|
|
771
771
|
if (!workflowInspector) {
|
|
772
|
-
workflowInspector =
|
|
772
|
+
workflowInspector = _chunk6BCM5FXBcjs.createWorkflowInspectorAdapter.call(void 0, );
|
|
773
773
|
workflowInspectors.set(actorId, workflowInspector);
|
|
774
774
|
}
|
|
775
775
|
return workflowInspector;
|
|
@@ -842,13 +842,13 @@ function workflow(fn, options = {}) {
|
|
|
842
842
|
if (shouldRethrowWorkflowError(error)) {
|
|
843
843
|
runCtx.log.error({
|
|
844
844
|
msg: "workflow run failed",
|
|
845
|
-
error:
|
|
845
|
+
error: _chunkV7ISUWSDcjs.stringifyError.call(void 0, error)
|
|
846
846
|
});
|
|
847
847
|
throw error;
|
|
848
848
|
}
|
|
849
849
|
runCtx.log.warn({
|
|
850
850
|
msg: "workflow failed and will sleep until woken",
|
|
851
|
-
error:
|
|
851
|
+
error: _chunkV7ISUWSDcjs.stringifyError.call(void 0, error)
|
|
852
852
|
});
|
|
853
853
|
} finally {
|
|
854
854
|
runCtx.abortSignal.removeEventListener("abort", onAbort);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WorkflowErrorEvent } from '@rivetkit/workflow-engine';
|
|
2
2
|
export { Loop, TryBlockCatchKind, TryBlockConfig, TryBlockFailure, TryBlockResult, TryStepCatchKind, TryStepConfig, TryStepFailure, TryStepResult, WorkflowError, WorkflowErrorEvent } from '@rivetkit/workflow-engine';
|
|
3
|
-
import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-
|
|
3
|
+
import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-B1L9Ytm_.cjs';
|
|
4
4
|
import { A as AnyDatabaseProvider } from '../config-CBTr4IhE.cjs';
|
|
5
|
-
import { d as WorkflowContext } from '../context-
|
|
6
|
-
export { e as WorkflowBranchConfig, W as WorkflowBranchContextOf, a as WorkflowContextOf, f as WorkflowLoopConfig, b as WorkflowLoopContextOf, g as WorkflowStepConfig, h as WorkflowStepContext, c as WorkflowStepContextOf, i as WorkflowTryConfig, j as WorkflowTryStepConfig } from '../context-
|
|
5
|
+
import { d as WorkflowContext } from '../context-BuQ4FncM.cjs';
|
|
6
|
+
export { e as WorkflowBranchConfig, W as WorkflowBranchContextOf, a as WorkflowContextOf, f as WorkflowLoopConfig, b as WorkflowLoopContextOf, g as WorkflowStepConfig, h as WorkflowStepContext, c as WorkflowStepContextOf, i as WorkflowTryConfig, j as WorkflowTryStepConfig } from '../context-BuQ4FncM.cjs';
|
|
7
7
|
import 'zod/v4';
|
|
8
8
|
import '@rivetkit/rivetkit-wasm';
|
|
9
9
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WorkflowErrorEvent } from '@rivetkit/workflow-engine';
|
|
2
2
|
export { Loop, TryBlockCatchKind, TryBlockConfig, TryBlockFailure, TryBlockResult, TryStepCatchKind, TryStepConfig, TryStepFailure, TryStepResult, WorkflowError, WorkflowErrorEvent } from '@rivetkit/workflow-engine';
|
|
3
|
-
import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-
|
|
3
|
+
import { E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext } from '../config-DhGSJx-3.js';
|
|
4
4
|
import { A as AnyDatabaseProvider } from '../config-CBTr4IhE.js';
|
|
5
|
-
import { d as WorkflowContext } from '../context-
|
|
6
|
-
export { e as WorkflowBranchConfig, W as WorkflowBranchContextOf, a as WorkflowContextOf, f as WorkflowLoopConfig, b as WorkflowLoopContextOf, g as WorkflowStepConfig, h as WorkflowStepContext, c as WorkflowStepContextOf, i as WorkflowTryConfig, j as WorkflowTryStepConfig } from '../context-
|
|
5
|
+
import { d as WorkflowContext } from '../context-B6HOPYyk.js';
|
|
6
|
+
export { e as WorkflowBranchConfig, W as WorkflowBranchContextOf, a as WorkflowContextOf, f as WorkflowLoopConfig, b as WorkflowLoopContextOf, g as WorkflowStepConfig, h as WorkflowStepContext, c as WorkflowStepContextOf, i as WorkflowTryConfig, j as WorkflowTryStepConfig } from '../context-B6HOPYyk.js';
|
|
7
7
|
import 'zod/v4';
|
|
8
8
|
import '@rivetkit/rivetkit-wasm';
|
|
9
9
|
import 'zod';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWorkflowInspectorAdapter
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-VYXFJR7Y.js";
|
|
4
|
+
import "../chunk-F4IRT46P.js";
|
|
5
|
+
import "../chunk-7TW4LSJN.js";
|
|
6
6
|
import {
|
|
7
7
|
ACTOR_CONTEXT_INTERNAL_SYMBOL,
|
|
8
8
|
defineRunHandler
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "../chunk-A2CF6PFH.js";
|
|
14
14
|
import {
|
|
15
15
|
stringifyError
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-KQLEFYNT.js";
|
|
17
17
|
import {
|
|
18
18
|
RivetError,
|
|
19
19
|
isActorAbortedError
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rivetkit",
|
|
3
|
-
"version": "3.1.2-rc.
|
|
3
|
+
"version": "3.1.2-rc.9",
|
|
4
4
|
"description": "Lightweight libraries for building stateful actors on edge platforms",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -211,16 +211,16 @@
|
|
|
211
211
|
"@hono/zod-openapi": "^1.1.5",
|
|
212
212
|
"@opentelemetry/api": "^1.1.0",
|
|
213
213
|
"@rivetkit/bare-ts": "^0.6.2",
|
|
214
|
-
"@rivetkit/engine-api-full": "3.1.2-rc.
|
|
215
|
-
"@rivetkit/engine-cli": "3.1.2-rc.
|
|
216
|
-
"@rivetkit/engine-envoy-protocol": "3.1.2-rc.
|
|
214
|
+
"@rivetkit/engine-api-full": "3.1.2-rc.9",
|
|
215
|
+
"@rivetkit/engine-cli": "3.1.2-rc.9",
|
|
216
|
+
"@rivetkit/engine-envoy-protocol": "3.1.2-rc.9",
|
|
217
217
|
"@rivetkit/on-change": "6.0.1",
|
|
218
|
-
"@rivetkit/rivetkit-napi": "3.1.2-rc.
|
|
219
|
-
"@rivetkit/rivetkit-wasm": "3.1.2-rc.
|
|
220
|
-
"@rivetkit/traces": "3.1.2-rc.
|
|
221
|
-
"@rivetkit/virtual-websocket": "3.1.2-rc.
|
|
222
|
-
"@rivetkit/workflow-engine": "3.1.2-rc.
|
|
223
|
-
"cbor-x": "^1.6.
|
|
218
|
+
"@rivetkit/rivetkit-napi": "3.1.2-rc.9",
|
|
219
|
+
"@rivetkit/rivetkit-wasm": "3.1.2-rc.9",
|
|
220
|
+
"@rivetkit/traces": "3.1.2-rc.9",
|
|
221
|
+
"@rivetkit/virtual-websocket": "3.1.2-rc.9",
|
|
222
|
+
"@rivetkit/workflow-engine": "3.1.2-rc.9",
|
|
223
|
+
"cbor-x": "^1.6.6",
|
|
224
224
|
"drizzle-orm": "0.45.2",
|
|
225
225
|
"hono": "^4.7.0",
|
|
226
226
|
"invariant": "^2.2.4",
|
package/src/client/actor-conn.ts
CHANGED
|
@@ -345,6 +345,10 @@ export class ActorConnRaw {
|
|
|
345
345
|
/**
|
|
346
346
|
* Call a raw action connection. See {@link ActorConn} for type-safe action calls.
|
|
347
347
|
*
|
|
348
|
+
* Aborting `signal` rejects the call with `signal.reason`. An action still queued while the
|
|
349
|
+
* connection opens or reconnects is dropped and never sent. An action already sent may
|
|
350
|
+
* still run on the actor.
|
|
351
|
+
*
|
|
348
352
|
* @see {@link ActorConn}
|
|
349
353
|
* @template Args - The type of arguments to pass to the action function.
|
|
350
354
|
* @template Response - The type of the response returned by the action function.
|
|
@@ -370,6 +374,8 @@ export class ActorConnRaw {
|
|
|
370
374
|
`Invalid action call: expected an options object { name, args }, got ${typeof opts}. Use conn.actionName(...args) for the shorthand API.`,
|
|
371
375
|
);
|
|
372
376
|
}
|
|
377
|
+
const signal = opts.signal;
|
|
378
|
+
if (signal?.aborted) throw signal.reason;
|
|
373
379
|
if (this.#disposed) throw new errors.ActorConnDisposed();
|
|
374
380
|
if (this.#connectionOpenError) throw this.#connectionOpenError;
|
|
375
381
|
logger().debug({ msg: "action", name: opts.name, args: opts.args });
|
|
@@ -394,26 +400,44 @@ export class ActorConnRaw {
|
|
|
394
400
|
inFlightCount: this.#actionsInFlight.size,
|
|
395
401
|
});
|
|
396
402
|
|
|
397
|
-
|
|
403
|
+
const message = {
|
|
398
404
|
body: {
|
|
399
|
-
tag: "ActionRequest",
|
|
405
|
+
tag: "ActionRequest" as const,
|
|
400
406
|
val: {
|
|
401
407
|
id: BigInt(actionId),
|
|
402
408
|
name: opts.name,
|
|
403
409
|
args: opts.args,
|
|
404
410
|
},
|
|
405
411
|
},
|
|
406
|
-
}
|
|
412
|
+
};
|
|
413
|
+
this.#sendMessage(message);
|
|
414
|
+
|
|
415
|
+
// The actor never sees a queued action, so an abort drops it from the queue. Once the
|
|
416
|
+
// action is sent, an abort only rejects the caller. The actor may still run it, and its
|
|
417
|
+
// late reply settles nothing.
|
|
418
|
+
const onAbort = () => {
|
|
419
|
+
const queuedIndex = this.#messageQueue.indexOf(message);
|
|
420
|
+
if (queuedIndex !== -1) {
|
|
421
|
+
this.#messageQueue.splice(queuedIndex, 1);
|
|
422
|
+
this.#actionsInFlight.delete(actionId);
|
|
423
|
+
}
|
|
424
|
+
reject(signal?.reason);
|
|
425
|
+
};
|
|
426
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
407
427
|
|
|
408
428
|
// TODO: Throw error if disconnect is called
|
|
409
429
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
430
|
+
try {
|
|
431
|
+
const { id: responseId, output } = await promise;
|
|
432
|
+
if (responseId !== BigInt(actionId))
|
|
433
|
+
throw new Error(
|
|
434
|
+
`Request ID ${actionId} does not match response ID ${responseId}`,
|
|
435
|
+
);
|
|
415
436
|
|
|
416
|
-
|
|
437
|
+
return output as Response;
|
|
438
|
+
} finally {
|
|
439
|
+
signal?.removeEventListener("abort", onAbort);
|
|
440
|
+
}
|
|
417
441
|
}
|
|
418
442
|
|
|
419
443
|
/**
|
|
@@ -99,7 +99,9 @@ function classifyActorError(
|
|
|
99
99
|
|
|
100
100
|
if (
|
|
101
101
|
(error.group === "ups" && error.code === "consumer_closed") ||
|
|
102
|
-
(error.group === "depot" &&
|
|
102
|
+
(error.group === "depot" &&
|
|
103
|
+
(error.code === "request_deadline_exceeded" ||
|
|
104
|
+
error.code === "unavailable"))
|
|
103
105
|
) {
|
|
104
106
|
// The connection can recover, but an interrupted action may already have run.
|
|
105
107
|
return buildLifecycleBoundaryInfo(
|
package/src/common/encoding.ts
CHANGED
|
@@ -377,6 +377,21 @@ export interface JsonCompatReviveOptions {
|
|
|
377
377
|
export function reviveJsonCompatValue(
|
|
378
378
|
input: any,
|
|
379
379
|
options: JsonCompatReviveOptions = {},
|
|
380
|
+
): any {
|
|
381
|
+
return reviveValue(input, options, new WeakMap());
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* `revived` maps each object already walked to its revived value. Decoded CBOR
|
|
386
|
+
* can use one object in many places through cbor-x shared references, and
|
|
387
|
+
* walking it once per place grows exponentially with nesting. Containers are
|
|
388
|
+
* recorded before their children are walked, so cyclic input revives to a
|
|
389
|
+
* cyclic value instead of recursing forever.
|
|
390
|
+
*/
|
|
391
|
+
function reviveValue(
|
|
392
|
+
input: any,
|
|
393
|
+
options: JsonCompatReviveOptions,
|
|
394
|
+
revived: WeakMap<object, unknown>,
|
|
380
395
|
): any {
|
|
381
396
|
if (typeof input === "bigint") {
|
|
382
397
|
if (
|
|
@@ -388,15 +403,22 @@ export function reviveJsonCompatValue(
|
|
|
388
403
|
}
|
|
389
404
|
return input;
|
|
390
405
|
}
|
|
406
|
+
if (typeof input !== "object" || input === null) {
|
|
407
|
+
return input;
|
|
408
|
+
}
|
|
409
|
+
if (revived.has(input)) {
|
|
410
|
+
return revived.get(input);
|
|
411
|
+
}
|
|
391
412
|
if (input instanceof Map) {
|
|
392
|
-
const
|
|
413
|
+
const map = new Map();
|
|
414
|
+
revived.set(input, map);
|
|
393
415
|
for (const [k, v] of input.entries()) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
416
|
+
map.set(
|
|
417
|
+
reviveValue(k, options, revived),
|
|
418
|
+
reviveValue(v, options, revived),
|
|
397
419
|
);
|
|
398
420
|
}
|
|
399
|
-
return
|
|
421
|
+
return map;
|
|
400
422
|
}
|
|
401
423
|
if (Array.isArray(input)) {
|
|
402
424
|
if (
|
|
@@ -417,27 +439,35 @@ export function reviveJsonCompatValue(
|
|
|
417
439
|
return undefined;
|
|
418
440
|
}
|
|
419
441
|
if (input[0] === JSON_COMPAT_SET) {
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
)
|
|
423
|
-
|
|
442
|
+
const set = new Set();
|
|
443
|
+
revived.set(input, set);
|
|
444
|
+
for (const value of input[1] as unknown[]) {
|
|
445
|
+
set.add(reviveValue(value, options, revived));
|
|
446
|
+
}
|
|
447
|
+
return set;
|
|
424
448
|
}
|
|
425
449
|
if (input[0].startsWith("$$")) {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
450
|
+
const escaped: unknown[] = [input[0].substring(1)];
|
|
451
|
+
revived.set(input, escaped);
|
|
452
|
+
escaped.push(reviveValue(input[1], options, revived));
|
|
453
|
+
return escaped;
|
|
430
454
|
}
|
|
431
455
|
throw new Error(
|
|
432
456
|
`Unknown JSON encoding type: ${input[0]}. This may indicate corrupted data or a version mismatch.`,
|
|
433
457
|
);
|
|
434
458
|
}
|
|
435
|
-
|
|
459
|
+
const array: unknown[] = [];
|
|
460
|
+
revived.set(input, array);
|
|
461
|
+
for (const value of input) {
|
|
462
|
+
array.push(reviveValue(value, options, revived));
|
|
463
|
+
}
|
|
464
|
+
return array;
|
|
436
465
|
}
|
|
437
466
|
if (isPlainObject(input)) {
|
|
438
467
|
const decoded: Record<string, unknown> = {};
|
|
468
|
+
revived.set(input, decoded);
|
|
439
469
|
for (const [key, value] of Object.entries(input)) {
|
|
440
|
-
decoded[key] =
|
|
470
|
+
decoded[key] = reviveValue(value, options, revived);
|
|
441
471
|
}
|
|
442
472
|
return decoded;
|
|
443
473
|
}
|