rivetkit 3.0.5 → 3.0.7

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.
Files changed (107) hide show
  1. package/dist/browser/client.d.ts +34 -28
  2. package/dist/browser/client.js +2 -2
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.js +1 -1
  5. package/dist/browser/inspector/client.js.map +1 -1
  6. package/dist/tsup/{chunk-WIL6MWU4.cjs → chunk-5A2KUC5L.cjs} +10 -10
  7. package/dist/tsup/{chunk-WIL6MWU4.cjs.map → chunk-5A2KUC5L.cjs.map} +1 -1
  8. package/dist/tsup/{chunk-NEGCEZM6.js → chunk-7OXC5BQF.js} +2 -2
  9. package/dist/tsup/{chunk-NEGCEZM6.js.map → chunk-7OXC5BQF.js.map} +1 -1
  10. package/dist/tsup/{chunk-NNKSJSMR.js → chunk-AY25XAXA.js} +3 -3
  11. package/dist/tsup/{chunk-NSDT2GWM.cjs → chunk-HKD7AH4Z.cjs} +145 -145
  12. package/dist/tsup/chunk-HKD7AH4Z.cjs.map +1 -0
  13. package/dist/tsup/{chunk-NHB4KDZL.cjs → chunk-K6WETGBW.cjs} +3 -3
  14. package/dist/tsup/{chunk-NHB4KDZL.cjs.map → chunk-K6WETGBW.cjs.map} +1 -1
  15. package/dist/tsup/{chunk-MVJLQPWC.js → chunk-NMLZDHH2.js} +2 -2
  16. package/dist/tsup/{chunk-STFQQWYY.cjs → chunk-OEOODXVI.cjs} +4 -4
  17. package/dist/tsup/{chunk-STFQQWYY.cjs.map → chunk-OEOODXVI.cjs.map} +1 -1
  18. package/dist/tsup/{chunk-A7Q5DJ2P.js → chunk-PBIQPYE5.js} +12 -15
  19. package/dist/tsup/chunk-PBIQPYE5.js.map +1 -0
  20. package/dist/tsup/{chunk-EC72YM63.js → chunk-QTCX5KN3.js} +2 -2
  21. package/dist/tsup/{chunk-VJROJMLX.js → chunk-RFJ4NNO3.js} +4 -4
  22. package/dist/tsup/{chunk-YPAJANQG.js → chunk-S6ZMUE7Q.js} +2 -2
  23. package/dist/tsup/{chunk-4QY3LBN6.cjs → chunk-U3CMQVMS.cjs} +3 -3
  24. package/dist/tsup/{chunk-4QY3LBN6.cjs.map → chunk-U3CMQVMS.cjs.map} +1 -1
  25. package/dist/tsup/{chunk-DL7PKMEP.cjs → chunk-VM4SXQOC.cjs} +3 -3
  26. package/dist/tsup/{chunk-DL7PKMEP.cjs.map → chunk-VM4SXQOC.cjs.map} +1 -1
  27. package/dist/tsup/{chunk-BY6YFH2K.cjs → chunk-WBUHPDDM.cjs} +2 -2
  28. package/dist/tsup/{chunk-BY6YFH2K.cjs.map → chunk-WBUHPDDM.cjs.map} +1 -1
  29. package/dist/tsup/{chunk-XILB6EBK.js → chunk-YMCG4FCB.js} +7 -7
  30. package/dist/tsup/chunk-YMCG4FCB.js.map +1 -0
  31. package/dist/tsup/{chunk-WNURZU2P.js → chunk-YO4TJ56P.js} +2 -2
  32. package/dist/tsup/{chunk-D3VCNACM.cjs → chunk-YTELGNB3.cjs} +7 -7
  33. package/dist/tsup/{chunk-D3VCNACM.cjs.map → chunk-YTELGNB3.cjs.map} +1 -1
  34. package/dist/tsup/{chunk-INFADXXI.cjs → chunk-YWWDUC6D.cjs} +12 -15
  35. package/dist/tsup/chunk-YWWDUC6D.cjs.map +1 -0
  36. package/dist/tsup/client/mod.cjs +5 -5
  37. package/dist/tsup/client/mod.d.cts +2 -2
  38. package/dist/tsup/client/mod.d.ts +2 -2
  39. package/dist/tsup/client/mod.js +4 -4
  40. package/dist/tsup/common/log.cjs +2 -2
  41. package/dist/tsup/common/log.js +1 -1
  42. package/dist/tsup/common/websocket.cjs +3 -3
  43. package/dist/tsup/common/websocket.js +2 -2
  44. package/dist/tsup/{config-CM_AlRlT.d.cts → config-BDJltifk.d.cts} +36 -32
  45. package/dist/tsup/{config-DcUqgwcz.d.ts → config-DXC7qzme.d.ts} +36 -32
  46. package/dist/tsup/{context-Bws3ikEx.d.ts → context-DgPsVbw6.d.ts} +4 -1
  47. package/dist/tsup/{context-1BFHhiTs.d.cts → context-osC4Q1ax.d.cts} +4 -1
  48. package/dist/tsup/db/drizzle.cjs +2 -2
  49. package/dist/tsup/db/drizzle.js +1 -1
  50. package/dist/tsup/db/mod.cjs +3 -3
  51. package/dist/tsup/db/mod.js +2 -2
  52. package/dist/tsup/dynamic/mod.cjs +2 -2
  53. package/dist/tsup/dynamic/mod.d.cts +1 -1
  54. package/dist/tsup/dynamic/mod.d.ts +1 -1
  55. package/dist/tsup/dynamic/mod.js +1 -1
  56. package/dist/tsup/inspector/mod.cjs +5 -5
  57. package/dist/tsup/inspector/mod.js +4 -4
  58. package/dist/tsup/inspector/workflow.cjs +4 -4
  59. package/dist/tsup/inspector/workflow.js +3 -3
  60. package/dist/tsup/inspector-tab/mod.cjs +2 -2
  61. package/dist/tsup/inspector-tab/mod.d.cts +2 -2
  62. package/dist/tsup/inspector-tab/mod.d.ts +2 -2
  63. package/dist/tsup/inspector-tab/mod.js +1 -1
  64. package/dist/tsup/mod.cjs +129 -134
  65. package/dist/tsup/mod.cjs.map +1 -1
  66. package/dist/tsup/mod.d.cts +5 -3
  67. package/dist/tsup/mod.d.ts +5 -3
  68. package/dist/tsup/mod.js +26 -31
  69. package/dist/tsup/mod.js.map +1 -1
  70. package/dist/tsup/test/mod.cjs +6 -6
  71. package/dist/tsup/test/mod.d.cts +1 -1
  72. package/dist/tsup/test/mod.d.ts +1 -1
  73. package/dist/tsup/test/mod.js +4 -4
  74. package/dist/tsup/utils.cjs +2 -2
  75. package/dist/tsup/utils.js +1 -1
  76. package/dist/tsup/workflow/mod.cjs +13 -10
  77. package/dist/tsup/workflow/mod.cjs.map +1 -1
  78. package/dist/tsup/workflow/mod.d.cts +3 -3
  79. package/dist/tsup/workflow/mod.d.ts +3 -3
  80. package/dist/tsup/workflow/mod.js +8 -5
  81. package/dist/tsup/workflow/mod.js.map +1 -1
  82. package/package.json +9 -9
  83. package/src/actor/config.ts +35 -37
  84. package/src/actor/contexts/index.ts +2 -0
  85. package/src/actor/definition.ts +33 -1
  86. package/src/actor/schema.ts +4 -0
  87. package/src/client/actor-common.ts +4 -0
  88. package/src/client/actor-conn.ts +2 -0
  89. package/src/client/actor-handle.ts +2 -0
  90. package/src/client/config.ts +1 -1
  91. package/src/client/queue.ts +2 -0
  92. package/src/registry/napi-runtime.ts +0 -4
  93. package/src/registry/native.ts +4 -11
  94. package/src/registry/runtime.ts +0 -8
  95. package/src/registry/wasm-runtime.ts +0 -14
  96. package/src/workflow/context.ts +3 -0
  97. package/dist/tsup/chunk-A7Q5DJ2P.js.map +0 -1
  98. package/dist/tsup/chunk-INFADXXI.cjs.map +0 -1
  99. package/dist/tsup/chunk-NSDT2GWM.cjs.map +0 -1
  100. package/dist/tsup/chunk-XILB6EBK.js.map +0 -1
  101. package/src/common/bare/generated/actor-runtime-socket-protocol/v1.ts +0 -848
  102. /package/dist/tsup/{chunk-NNKSJSMR.js.map → chunk-AY25XAXA.js.map} +0 -0
  103. /package/dist/tsup/{chunk-MVJLQPWC.js.map → chunk-NMLZDHH2.js.map} +0 -0
  104. /package/dist/tsup/{chunk-EC72YM63.js.map → chunk-QTCX5KN3.js.map} +0 -0
  105. /package/dist/tsup/{chunk-VJROJMLX.js.map → chunk-RFJ4NNO3.js.map} +0 -0
  106. /package/dist/tsup/{chunk-YPAJANQG.js.map → chunk-S6ZMUE7Q.js.map} +0 -0
  107. /package/dist/tsup/{chunk-WNURZU2P.js.map → chunk-YO4TJ56P.js.map} +0 -0
@@ -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-CM_AlRlT.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-CM_AlRlT.cjs';
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-BDJltifk.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-BDJltifk.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
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-1BFHhiTs.cjs';
9
+ export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-osC4Q1ax.cjs';
10
10
  import 'zod/v4';
11
11
  import '@rivetkit/rivetkit-wasm';
12
12
  import 'zod';
@@ -68,6 +68,7 @@ type BeforeConnectContextOf<AD extends AnyActorDefinition> = AD extends BaseActo
68
68
  type ConnectContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? ConnectContext<S, CP, CS, V, I, DB, E, Q> : never;
69
69
  type ConnContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? ActionContext<S, CP, CS, V, I, DB, E, Q> : never;
70
70
  type ConnInitContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, any, any, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? BeforeConnectContext<S, V, I, DB, E, Q> : never;
71
+ /** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
71
72
  type CreateConnStateContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, any, any, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? CreateConnStateContext<S, V, I, DB, E, Q> : never;
72
73
  type CreateContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, any, any, any, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? CreateContext<S, I, DB, E, Q> : never;
73
74
  type CreateVarsContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, any, any, any, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? CreateVarsContext<S, I, DB, E, Q> : never;
@@ -77,6 +78,7 @@ type MigrateContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefin
77
78
  type RequestContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? RequestContext<S, CP, CS, V, I, DB, E, Q> : never;
78
79
  type RunContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? RunContext<S, CP, CS, V, I, DB, E, Q> : never;
79
80
  type SleepContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? SleepContext<S, CP, CS, V, I, DB, E, Q> : never;
81
+ /** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. See https://rivet.dev/actors/docs/deprecated/state */
80
82
  type StateChangeContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? StateChangeContext<S, CP, CS, V, I, DB, E, Q> : never;
81
83
  type WakeContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? WakeContext<S, CP, CS, V, I, DB, E, Q> : never;
82
84
  type WebSocketContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? WebSocketContext<S, CP, CS, V, I, DB, E, Q> : never;
@@ -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-DcUqgwcz.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-DcUqgwcz.js';
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-DXC7qzme.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-DXC7qzme.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
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-Bws3ikEx.js';
9
+ export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-DgPsVbw6.js';
10
10
  import 'zod/v4';
11
11
  import '@rivetkit/rivetkit-wasm';
12
12
  import 'zod';
@@ -68,6 +68,7 @@ type BeforeConnectContextOf<AD extends AnyActorDefinition> = AD extends BaseActo
68
68
  type ConnectContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? ConnectContext<S, CP, CS, V, I, DB, E, Q> : never;
69
69
  type ConnContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? ActionContext<S, CP, CS, V, I, DB, E, Q> : never;
70
70
  type ConnInitContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, any, any, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? BeforeConnectContext<S, V, I, DB, E, Q> : never;
71
+ /** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
71
72
  type CreateConnStateContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, any, any, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? CreateConnStateContext<S, V, I, DB, E, Q> : never;
72
73
  type CreateContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, any, any, any, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? CreateContext<S, I, DB, E, Q> : never;
73
74
  type CreateVarsContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, any, any, any, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? CreateVarsContext<S, I, DB, E, Q> : never;
@@ -77,6 +78,7 @@ type MigrateContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefin
77
78
  type RequestContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? RequestContext<S, CP, CS, V, I, DB, E, Q> : never;
78
79
  type RunContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? RunContext<S, CP, CS, V, I, DB, E, Q> : never;
79
80
  type SleepContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? SleepContext<S, CP, CS, V, I, DB, E, Q> : never;
81
+ /** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. See https://rivet.dev/actors/docs/deprecated/state */
80
82
  type StateChangeContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? StateChangeContext<S, CP, CS, V, I, DB, E, Q> : never;
81
83
  type WakeContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? WakeContext<S, CP, CS, V, I, DB, E, Q> : never;
82
84
  type WebSocketContextOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<infer S, infer CP, infer CS, infer V, infer I, infer DB extends AnyDatabaseProvider, infer E extends EventSchemaConfig, infer Q extends QueueSchemaConfig, any> ? WebSocketContext<S, CP, CS, V, I, DB, E, Q> : never;
package/dist/tsup/mod.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  decodeWorkflowHistoryTransport
3
- } from "./chunk-EC72YM63.js";
3
+ } from "./chunk-QTCX5KN3.js";
4
4
  import {
5
5
  ACTOR_CONTEXT_INTERNAL_SYMBOL,
6
6
  ActorConfigSchema,
@@ -17,7 +17,7 @@ import {
17
17
  getRunInspectorKind,
18
18
  getRunMetadata,
19
19
  hasRunInspectorConfig
20
- } from "./chunk-A7Q5DJ2P.js";
20
+ } from "./chunk-PBIQPYE5.js";
21
21
  import {
22
22
  ALLOWED_PUBLIC_HEADERS,
23
23
  ENGINE_HOST,
@@ -35,18 +35,18 @@ import {
35
35
  runWithActorInvocationSpan,
36
36
  tryParseEndpoint,
37
37
  updateRunnerConfig
38
- } from "./chunk-XILB6EBK.js";
38
+ } from "./chunk-YMCG4FCB.js";
39
39
  import {
40
40
  makePrefixedKey,
41
41
  removePrefixFromKey
42
42
  } from "./chunk-A2CF6PFH.js";
43
- import "./chunk-MVJLQPWC.js";
44
43
  import {
45
44
  bindNativeStateTransactionContext,
46
45
  db,
47
46
  registerNativeStateTransactionOpener
48
- } from "./chunk-WNURZU2P.js";
47
+ } from "./chunk-YO4TJ56P.js";
49
48
  import "./chunk-JTHHCZCZ.js";
49
+ import "./chunk-NMLZDHH2.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-NEGCEZM6.js";
83
+ } from "./chunk-7OXC5BQF.js";
84
84
  import {
85
85
  INTERNAL_ERROR_CODE,
86
86
  RivetError,
@@ -116,11 +116,25 @@ function warnDeprecatedOptionKeys(options) {
116
116
  if (opts[key] !== void 0 && !warnedDeprecatedOptionKeys.has(key)) {
117
117
  warnedDeprecatedOptionKeys.add(key);
118
118
  loggerWithoutContext().warn({
119
- msg: `actor option \`${key}\` is deprecated and is now ignored. ${detail} Will be removed in 2.2.0.`
119
+ msg: `actor option \`${key}\` is deprecated and is now ignored. ${detail} Will be removed in 3.2.0.`
120
120
  });
121
121
  }
122
122
  }
123
123
  }
124
+ var warnedDeprecatedRun = false;
125
+ function warnDeprecatedRun(input) {
126
+ if (warnedDeprecatedRun || !input || typeof input !== "object") return;
127
+ const run = input.run;
128
+ if (run === void 0) return;
129
+ const runFunction = typeof run === "object" && run !== null ? run.run : run;
130
+ if (typeof runFunction === "function" && getRunInspectorKind(runFunction) === "workflow") {
131
+ return;
132
+ }
133
+ warnedDeprecatedRun = true;
134
+ loggerWithoutContext().warn({
135
+ msg: "actor option `run` with a plain function was deprecated in 3.0 and will be removed in a future version. Start background work from `onWake` with `c.keepAwake` and track it in `c.vars`. `run: workflow(...)` is not deprecated. See https://rivet.dev/actors/docs/deprecated/run"
136
+ });
137
+ }
124
138
  var ActorDefinition = class {
125
139
  #config;
126
140
  constructor(config) {
@@ -138,6 +152,7 @@ function actor(input) {
138
152
  warnDeprecatedOptionKeys(
139
153
  input == null ? void 0 : input.options
140
154
  );
155
+ warnDeprecatedRun(input);
141
156
  const config = ActorConfigSchema.parse(input);
142
157
  flattenActionHandlers(config.actions);
143
158
  flattenActionInputSchemas(config.actions, config.actionInputSchemas);
@@ -1985,9 +2000,6 @@ var NapiCoreRuntime = class {
1985
2000
  }
1986
2001
  await nativeCtx.sql().close();
1987
2002
  }
1988
- async actorRuntimeSocketProvision(ctx) {
1989
- return await asNativeActorContext(ctx).provisionActorRuntimeSocket();
1990
- }
1991
2003
  async actorQueueSend(ctx, name, body) {
1992
2004
  return toNapiQueueMessage(
1993
2005
  await this.#actorContextForOperation(ctx).queue().send(name, toNapiBuffer(body))
@@ -3070,17 +3082,6 @@ var WasmCoreRuntime = class {
3070
3082
  this.#sql.delete(wasmCtx);
3071
3083
  await callWasm(() => database.close());
3072
3084
  }
3073
- async actorRuntimeSocketProvision(_ctx) {
3074
- throw new RivetError(
3075
- "actor_runtime_socket",
3076
- "unsupported",
3077
- "Actor Runtime Socket is only available on Unix native runtimes.",
3078
- {
3079
- public: true,
3080
- metadata: { runtime: "wasm" }
3081
- }
3082
- );
3083
- }
3084
3085
  async actorQueueSend(ctx, name, body) {
3085
3086
  const queue2 = childHandle(asWasmActorContext(ctx), "queue");
3086
3087
  return normalizeQueueMessage(
@@ -5250,11 +5251,6 @@ var ActorContextHandleAdapter = class {
5250
5251
  }
5251
5252
  return this.#kv;
5252
5253
  }
5253
- async actorRuntimeSocket() {
5254
- return await callNative(
5255
- () => this.#runtime.actorRuntimeSocketProvision(this.#ctx)
5256
- );
5257
- }
5258
5254
  get db() {
5259
5255
  if (!this.#databaseProvider) {
5260
5256
  throw databaseNotConfiguredError();
@@ -5811,16 +5807,16 @@ var ActorContextHandleAdapter = class {
5811
5807
  // need to keep an actor awake should use `keepAwake(promise)` or
5812
5808
  // `waitUntil(promise)` so the native counter machinery in rivetkit-core
5813
5809
  // owns the lifecycle.
5814
- /** @deprecated Use `keepAwake(promise)` or `waitUntil(promise)` instead. */
5810
+ /** @deprecated `setPreventSleep` was deprecated in 3.0 and will be removed in a future version. It is a no-op. Use `c.keepAwake(promise)` or `c.waitUntil(promise)`. See https://rivet.dev/actors/docs/deprecated/prevent-sleep */
5815
5811
  setPreventSleep(_preventSleep) {
5816
5812
  logger2().warn({
5817
- msg: "setPreventSleep is deprecated and is a no-op; use keepAwake(promise) or waitUntil(promise) instead"
5813
+ msg: "setPreventSleep was deprecated in 3.0 and will be removed in a future version. It is a no-op; use keepAwake(promise) or waitUntil(promise) instead. See https://rivet.dev/actors/docs/deprecated/prevent-sleep"
5818
5814
  });
5819
5815
  }
5820
- /** @deprecated Use `keepAwake(promise)` or `waitUntil(promise)` instead. */
5816
+ /** @deprecated `preventSleep` was deprecated in 3.0 and will be removed in a future version. It is a no-op that always returns `false`. Use `c.keepAwake(promise)` or `c.waitUntil(promise)`. See https://rivet.dev/actors/docs/deprecated/prevent-sleep */
5821
5817
  get preventSleep() {
5822
5818
  logger2().warn({
5823
- msg: "preventSleep is deprecated and always returns false; use keepAwake(promise) or waitUntil(promise) instead"
5819
+ msg: "preventSleep was deprecated in 3.0 and will be removed in a future version. It always returns false; use keepAwake(promise) or waitUntil(promise) instead. See https://rivet.dev/actors/docs/deprecated/prevent-sleep"
5824
5820
  });
5825
5821
  return false;
5826
5822
  }
@@ -6150,7 +6146,6 @@ function buildActorConfig(definition, registryConfig, runtimeKind) {
6150
6146
  definition.config.actions,
6151
6147
  definition.config.tracing
6152
6148
  ),
6153
- enableActorRuntimeSocket: options.enableActorRuntimeSocket === true,
6154
6149
  hasState: config.state !== void 0 || typeof config.createState === "function",
6155
6150
  canHibernateWebsocket: typeof canHibernate === "boolean" ? canHibernate : void 0,
6156
6151
  stateSaveIntervalMs: options.stateSaveInterval,