rivetkit 0.0.0-sqlite-sync-3-0-1-final.5663d2f → 0.0.0-sqlite-sync-3-0-6-final.cf8679c

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 (118) hide show
  1. package/dist/browser/client.d.ts +103 -27
  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-DGU2H5IJ.cjs → chunk-275ZGRSG.cjs} +3 -3
  7. package/dist/tsup/{chunk-DGU2H5IJ.cjs.map → chunk-275ZGRSG.cjs.map} +1 -1
  8. package/dist/tsup/{chunk-X567WA3N.cjs → chunk-E54YPM4V.cjs} +10 -10
  9. package/dist/tsup/{chunk-X567WA3N.cjs.map → chunk-E54YPM4V.cjs.map} +1 -1
  10. package/dist/tsup/{chunk-6UDO6UYM.cjs → chunk-I26AW6BG.cjs} +2 -2
  11. package/dist/tsup/{chunk-6UDO6UYM.cjs.map → chunk-I26AW6BG.cjs.map} +1 -1
  12. package/dist/tsup/{chunk-C2NON6V4.cjs → chunk-JHHUCWBC.cjs} +7 -7
  13. package/dist/tsup/{chunk-C2NON6V4.cjs.map → chunk-JHHUCWBC.cjs.map} +1 -1
  14. package/dist/tsup/{chunk-XLD6TRSE.cjs → chunk-LYXPQB6H.cjs} +3 -3
  15. package/dist/tsup/{chunk-XLD6TRSE.cjs.map → chunk-LYXPQB6H.cjs.map} +1 -1
  16. package/dist/tsup/{chunk-DU7V4SDK.js → chunk-M72ZKQ7R.js} +2 -2
  17. package/dist/tsup/{chunk-DU7V4SDK.js.map → chunk-M72ZKQ7R.js.map} +1 -1
  18. package/dist/tsup/{chunk-3ZKCK6NL.js → chunk-ME74LHJM.js} +7 -7
  19. package/dist/tsup/chunk-ME74LHJM.js.map +1 -0
  20. package/dist/tsup/{chunk-UXDASKP6.js → chunk-PBIQPYE5.js} +12 -13
  21. package/dist/tsup/chunk-PBIQPYE5.js.map +1 -0
  22. package/dist/tsup/{chunk-TTMWSZZA.js → chunk-R4QCQBB4.js} +2 -2
  23. package/dist/tsup/{chunk-GAFMEUAL.js → chunk-RJ7WDGOJ.js} +3 -3
  24. package/dist/tsup/{chunk-YJ2X5STT.cjs → chunk-SJJWJU26.cjs} +145 -145
  25. package/dist/tsup/chunk-SJJWJU26.cjs.map +1 -0
  26. package/dist/tsup/{chunk-SEKTNJU6.js → chunk-SSMFNH4N.js} +4 -4
  27. package/dist/tsup/{chunk-EKERHPCE.cjs → chunk-TKCX6KNZ.cjs} +4 -4
  28. package/dist/tsup/{chunk-EKERHPCE.cjs.map → chunk-TKCX6KNZ.cjs.map} +1 -1
  29. package/dist/tsup/{chunk-G26OT2Q6.cjs → chunk-TVBQQXQE.cjs} +3 -3
  30. package/dist/tsup/{chunk-G26OT2Q6.cjs.map → chunk-TVBQQXQE.cjs.map} +1 -1
  31. package/dist/tsup/{chunk-YNAEH775.js → chunk-VXVJHTW6.js} +2 -2
  32. package/dist/tsup/{chunk-MT4SROQM.js → chunk-XATHAIZX.js} +2 -2
  33. package/dist/tsup/{chunk-T7DJZSPH.js → chunk-Y5TV6V5Z.js} +2 -2
  34. package/dist/tsup/{chunk-SSF2XC33.cjs → chunk-YWWDUC6D.cjs} +12 -13
  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 +3 -3
  38. package/dist/tsup/client/mod.d.ts +3 -3
  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-RMLak20L.d.cts → config-5K0rzjv1.d.cts} +57 -25
  45. package/dist/tsup/{config-BfG1qpYz.d.ts → config-Df5jOcde.d.cts} +50 -8
  46. package/dist/tsup/{config-BfG1qpYz.d.cts → config-Df5jOcde.d.ts} +50 -8
  47. package/dist/tsup/{config-CASGH-5t.d.ts → config-DsAjIyfZ.d.ts} +57 -25
  48. package/dist/tsup/{context-C1tMYvV-.d.ts → context-B19Rx5Zg.d.cts} +5 -2
  49. package/dist/tsup/{context-CxNE2KvK.d.cts → context-BEh8x4jn.d.ts} +5 -2
  50. package/dist/tsup/db/drizzle.cjs +2 -2
  51. package/dist/tsup/db/drizzle.d.cts +1 -1
  52. package/dist/tsup/db/drizzle.d.ts +1 -1
  53. package/dist/tsup/db/drizzle.js +1 -1
  54. package/dist/tsup/db/mod.cjs +3 -3
  55. package/dist/tsup/db/mod.d.cts +2 -2
  56. package/dist/tsup/db/mod.d.ts +2 -2
  57. package/dist/tsup/db/mod.js +2 -2
  58. package/dist/tsup/dynamic/mod.cjs +2 -2
  59. package/dist/tsup/dynamic/mod.d.cts +2 -2
  60. package/dist/tsup/dynamic/mod.d.ts +2 -2
  61. package/dist/tsup/dynamic/mod.js +1 -1
  62. package/dist/tsup/inspector/mod.cjs +5 -5
  63. package/dist/tsup/inspector/mod.js +4 -4
  64. package/dist/tsup/inspector/workflow.cjs +4 -4
  65. package/dist/tsup/inspector/workflow.js +3 -3
  66. package/dist/tsup/inspector-tab/mod.cjs +2 -2
  67. package/dist/tsup/inspector-tab/mod.d.cts +3 -3
  68. package/dist/tsup/inspector-tab/mod.d.ts +3 -3
  69. package/dist/tsup/inspector-tab/mod.js +1 -1
  70. package/dist/tsup/mod.cjs +255 -135
  71. package/dist/tsup/mod.cjs.map +1 -1
  72. package/dist/tsup/mod.d.cts +6 -4
  73. package/dist/tsup/mod.d.ts +6 -4
  74. package/dist/tsup/mod.js +152 -32
  75. package/dist/tsup/mod.js.map +1 -1
  76. package/dist/tsup/test/mod.cjs +6 -6
  77. package/dist/tsup/test/mod.d.cts +2 -2
  78. package/dist/tsup/test/mod.d.ts +2 -2
  79. package/dist/tsup/test/mod.js +4 -4
  80. package/dist/tsup/unstable/migrations.d.cts +1 -1
  81. package/dist/tsup/unstable/migrations.d.ts +1 -1
  82. package/dist/tsup/utils.cjs +2 -2
  83. package/dist/tsup/utils.js +1 -1
  84. package/dist/tsup/workflow/mod.cjs +13 -10
  85. package/dist/tsup/workflow/mod.cjs.map +1 -1
  86. package/dist/tsup/workflow/mod.d.cts +4 -4
  87. package/dist/tsup/workflow/mod.d.ts +4 -4
  88. package/dist/tsup/workflow/mod.js +8 -5
  89. package/dist/tsup/workflow/mod.js.map +1 -1
  90. package/package.json +9 -9
  91. package/src/actor/config.ts +41 -29
  92. package/src/actor/contexts/index.ts +2 -0
  93. package/src/actor/definition.ts +33 -1
  94. package/src/actor/schema.ts +4 -0
  95. package/src/client/actor-common.ts +4 -0
  96. package/src/client/actor-conn.ts +2 -0
  97. package/src/client/actor-handle.ts +2 -0
  98. package/src/client/config.ts +1 -1
  99. package/src/client/queue.ts +2 -0
  100. package/src/common/database/config.ts +50 -7
  101. package/src/db/mod.ts +1 -0
  102. package/src/registry/index.ts +142 -1
  103. package/src/registry/napi-runtime.ts +15 -4
  104. package/src/registry/native.ts +4 -11
  105. package/src/registry/runtime.ts +6 -8
  106. package/src/registry/wasm-runtime.ts +0 -14
  107. package/src/workflow/context.ts +3 -0
  108. package/dist/tsup/chunk-3ZKCK6NL.js.map +0 -1
  109. package/dist/tsup/chunk-SSF2XC33.cjs.map +0 -1
  110. package/dist/tsup/chunk-UXDASKP6.js.map +0 -1
  111. package/dist/tsup/chunk-YJ2X5STT.cjs.map +0 -1
  112. package/src/common/bare/generated/actor-runtime-socket-protocol/v1.ts +0 -848
  113. /package/dist/tsup/{chunk-TTMWSZZA.js.map → chunk-R4QCQBB4.js.map} +0 -0
  114. /package/dist/tsup/{chunk-GAFMEUAL.js.map → chunk-RJ7WDGOJ.js.map} +0 -0
  115. /package/dist/tsup/{chunk-SEKTNJU6.js.map → chunk-SSMFNH4N.js.map} +0 -0
  116. /package/dist/tsup/{chunk-YNAEH775.js.map → chunk-VXVJHTW6.js.map} +0 -0
  117. /package/dist/tsup/{chunk-MT4SROQM.js.map → chunk-XATHAIZX.js.map} +0 -0
  118. /package/dist/tsup/{chunk-T7DJZSPH.js.map → chunk-Y5TV6V5Z.js.map} +0 -0
@@ -51,13 +51,16 @@ interface SqliteTransactionOptions {
51
51
  * to change without notice.
52
52
  */
53
53
  interface SqliteProfilingOptions {
54
- /** Exact SQL statements to give fingerprint labels. Profiling defaults to actor
55
- * aggregates without fingerprint labels. Profile logs remain enabled.
56
- * RIVETKIT_SQLITE_PROFILING overrides selection with a JSON object containing
57
- * queries and/or fingerprints arrays. An empty object clears fingerprint selection. */
58
- queries?: string[];
59
- /** Exact query fingerprints to label separately, as reported in profile logs. */
60
- fingerprints?: string[];
54
+ /** Exact SQL filter. Union with filterQueryFingerprints; both empty means all queries. */
55
+ filterQueries?: string[];
56
+ /** Fingerprint filter, including transaction fingerprints. Filters metrics, not diagnostic logs. */
57
+ filterQueryFingerprints?: string[];
58
+ /** Metric defaults apply even when omitted. Disabled metrics allocate no series. */
59
+ metrics?: SqliteProfilingMetricsOptions;
60
+ /** Duration buckets in seconds. Default [0.01, 0.1, 1]. Positive, finite, strictly increasing.
61
+ * All actors in a process enabling the duration histogram must use identical buckets. */
62
+ durationHistogramBucketsSeconds?: number[];
63
+ /** Maximum distinct statement fingerprints per process. Default: 512. */
61
64
  maxTrackedStatementFingerprints?: number;
62
65
  maxTrackedTransactionFingerprints?: number;
63
66
  maxPrometheusSeries?: number;
@@ -69,6 +72,45 @@ interface SqliteProfilingOptions {
69
72
  maxDiagnosticEventsPerMinute?: number;
70
73
  diagnosticEventQueueCapacity?: number;
71
74
  }
75
+ /** SQLite profiling metrics. Physical-request metrics and gauges have no query labels. */
76
+ interface SqliteProfilingMetricsOptions {
77
+ /** Execution count and cumulative seconds. Uses histogram count/sum when enabled, otherwise counters. Default: true. */
78
+ duration?: boolean;
79
+ /** Execution duration histogram. Only applies when duration is enabled. Default: true. */
80
+ durationHistogram?: boolean;
81
+ /** Outcome counters, including success and errors. Default: true. */
82
+ outcomes?: boolean;
83
+ /** Per-query timing phase histograms. Default: false. */
84
+ phaseDurationHistogram?: boolean;
85
+ /** Storage round trips per operation histogram. Default: false. */
86
+ getPagesRoundTripsHistogram?: boolean;
87
+ /** Statements per transaction histogram. Default: false. */
88
+ transactionStatementCountHistogram?: boolean;
89
+ /** Per-query pages returned from storage, including returned prefetch pages. Default: true. */
90
+ pagesFetched?: boolean;
91
+ /** Actor-level page counters by page kind (no query labels). Default: false. */
92
+ localPages?: boolean;
93
+ /** Actor-level byte counters by byte kind (no query labels). Default: false. */
94
+ localBytes?: boolean;
95
+ /** Actor-level physical storage request duration histogram. Default: false. */
96
+ getPagesDurationHistogram?: boolean;
97
+ /** Actor-level pages per storage request histograms, by page kind. Default: false. */
98
+ getPagesPagesHistogram?: boolean;
99
+ /** Actor-level storage response byte histogram. Default: false. */
100
+ getPagesResponseBytesHistogram?: boolean;
101
+ /** Actor-level missing response page counter. Default: false. */
102
+ getPagesMissingPages?: boolean;
103
+ /** Queued SQLite work, aggregated by actor name. Default: true. */
104
+ workerQueueDepth?: boolean;
105
+ /** Executing SQLite work, aggregated by actor name. Default: true. */
106
+ workerInflight?: boolean;
107
+ /** Transaction waiters, aggregated by actor name. Default: true. */
108
+ coordinatorQueueDepth?: boolean;
109
+ /** Counts observations exceeding fingerprint or series limits. Default: true. */
110
+ fingerprintOverflow?: boolean;
111
+ /** Counts diagnostic events dropped by rate limits or backpressure. Default: true. */
112
+ eventDropped?: boolean;
113
+ }
72
114
  interface SqliteNativeMetrics {
73
115
  requestBuildNs: number;
74
116
  serializeNs: number;
@@ -303,6 +345,7 @@ interface EventTypeToken<T, TContext = any> {
303
345
  interface QueueTypeToken<TMessage, TComplete = never, TContext = any> {
304
346
  readonly _queueMessage?: TMessage;
305
347
  readonly _queueComplete?: TComplete;
348
+ /** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
306
349
  readonly canPublish?: SchemaHook<TContext>;
307
350
  readonly message?: PrimitiveSchema;
308
351
  readonly complete?: PrimitiveSchema;
@@ -315,6 +358,7 @@ interface EventSchemaDefinition<TContext = any> {
315
358
  interface QueueSchemaDefinition<TContext = any> {
316
359
  message: PrimitiveSchema;
317
360
  complete?: PrimitiveSchema;
361
+ /** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
318
362
  canPublish?: SchemaHook<TContext>;
319
363
  }
320
364
  type EventSchema<TContext = any> = PrimitiveSchema | EventSchemaDefinition<TContext>;
@@ -698,9 +742,6 @@ type RuntimeSqlBindParam = ({
698
742
  blobValue: RuntimeBytes;
699
743
  };
700
744
  type RuntimeSqlBindParams = RuntimeSqlBindParam[] | null;
701
- interface RuntimeActorRuntimeSocketEndpointInfo {
702
- path: string;
703
- }
704
745
  interface RuntimeSqlQueryResult {
705
746
  columns: string[];
706
747
  rows: unknown[][];
@@ -731,7 +772,6 @@ interface RuntimeActorConfig {
731
772
  sqliteDeferredCommits?: boolean;
732
773
  sqliteProfiling?: SqliteProfilingOptions;
733
774
  tracing?: RuntimeActorTracingConfig;
734
- enableActorRuntimeSocket?: boolean;
735
775
  hasState?: boolean;
736
776
  canHibernateWebsocket?: boolean;
737
777
  stateSaveIntervalMs?: number;
@@ -866,6 +906,8 @@ interface CoreRuntime {
866
906
  shutdownRegistry(registry: RegistryHandle): Promise<void>;
867
907
  shutdownTelemetry?(): Promise<void>;
868
908
  registryActorStopThresholdMs?(registry: RegistryHandle): Promise<number | undefined>;
909
+ registryActiveActorCount?(registry: RegistryHandle): number;
910
+ onRegistryActiveActorCountChange?(registry: RegistryHandle, callback: (count: number) => void, cancelToken: CancellationTokenHandle): void;
869
911
  handleServerlessRequest(registry: RegistryHandle, req: RuntimeServerlessRequest, onStreamEvent: RuntimeServerlessStreamCallback, cancelToken: CancellationTokenHandle, config: RuntimeServeConfig): Promise<RuntimeServerlessResponseHead>;
870
912
  serveListener(registry: RegistryHandle, listener: RuntimeListenerConfig, config: RuntimeServeConfig): Promise<void>;
871
913
  serveApplicationListener(registry: RegistryHandle, listener: RuntimeApplicationListenerConfig, config: RuntimeServeConfig): Promise<void>;
@@ -985,7 +1027,6 @@ interface CoreRuntime {
985
1027
  actorSqlWhenDurable(ctx: ActorContextHandle, ticket: number): Promise<void>;
986
1028
  actorSqlAbortGeneration(ctx: ActorContextHandle, reason: string): void;
987
1029
  actorSqlClose(ctx: ActorContextHandle): Promise<void>;
988
- actorRuntimeSocketProvision(ctx: ActorContextHandle): Promise<RuntimeActorRuntimeSocketEndpointInfo>;
989
1030
  actorQueueSend(ctx: ActorContextHandle, name: string, body: RuntimeBytes): Promise<RuntimeQueueMessage>;
990
1031
  actorQueueNextBatch(ctx: ActorContextHandle, options?: RuntimeQueueNextBatchOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage[]>;
991
1032
  actorQueueWaitForNames(ctx: ActorContextHandle, names: string[], options?: RuntimeQueueWaitOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage>;
@@ -1066,9 +1107,13 @@ type ActorWebSocketOptions = ActorGatewayOptions;
1066
1107
  */
1067
1108
  type ActorDefinitionActions<AD extends AnyActorDefinition> = IsAny<AD> extends true ? Record<string, ActorActionFunction<any[], any>> : ActorActionMap<ActionsOf<AD>>;
1068
1109
  type ActorQueueSend<TQueues extends QueueSchemaConfig> = {
1110
+ /** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
1069
1111
  <K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K], options: QueueSendWaitOptions): Promise<QueueSendResult<InferQueueCompleteMap<TQueues>[K]>>;
1112
+ /** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
1070
1113
  <K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K], options?: QueueSendNoWaitOptions): Promise<void>;
1114
+ /** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
1071
1115
  (name: keyof TQueues extends never ? string : never, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
1116
+ /** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
1072
1117
  (name: keyof TQueues extends never ? string : never, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
1073
1118
  };
1074
1119
  type ActorEventSubscribe<TEvents extends EventSchemaConfig> = {
@@ -1165,7 +1210,9 @@ declare class ActorConnRaw {
1165
1210
  * @protected
1166
1211
  */
1167
1212
  constructor(client: ClientRaw, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, currentActorInvocation?: CurrentActorInvocation);
1213
+ /** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
1168
1214
  send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
1215
+ /** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
1169
1216
  send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
1170
1217
  /**
1171
1218
  * Call a raw action connection. See {@link ActorConn} for type-safe action calls.
@@ -1322,7 +1369,9 @@ declare class ActorHandleRaw {
1322
1369
  * @protected
1323
1370
  */
1324
1371
  constructor(client: any, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, signal?: AbortSignal, currentActorInvocation?: CurrentActorInvocation, startCallSpan?: StartCallSpan, retryBudget?: RetryBudget);
1372
+ /** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
1325
1373
  send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
1374
+ /** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
1326
1375
  send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
1327
1376
  /**
1328
1377
  * Call a raw action. This method sends an HTTP request to invoke the named action.
@@ -1723,10 +1772,7 @@ type ActorKvListOptions<T extends ActorKvValueType = "text", K extends ActorKvKe
1723
1772
  limit?: number;
1724
1773
  };
1725
1774
  type ActorClientFor<T> = T extends Registry<any> ? Client<T> : T;
1726
- /**
1727
- * @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`)
1728
- * or actor state instead.
1729
- */
1775
+ /** @deprecated Actor KV was deprecated in 3.0 and will be removed in a future version. Store data in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/kv */
1730
1776
  interface ActorKv {
1731
1777
  get<T extends ActorKvValueType = "text">(key: Uint8Array | string, options?: ActorKvValueOptions<T>): Promise<ActorKvValueTypeMap[T] | null>;
1732
1778
  put<T extends ActorKvValueType = "text">(key: Uint8Array | string, value: Uint8Array | string | ArrayBuffer, options?: ActorKvValueOptions<T>): Promise<void>;
@@ -1867,6 +1913,7 @@ interface QueueIterOptions<TName extends string = string, TCompletable extends b
1867
1913
  signal?: AbortSignal;
1868
1914
  completable?: TCompletable;
1869
1915
  }
1916
+ /** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
1870
1917
  interface ActorQueue<TQueues extends QueueSchemaConfig = Record<never, never>> {
1871
1918
  send<TName extends QueueFilterName<TQueues>>(name: TName, body: QueueMessageForName<TQueues, TName>["body"]): Promise<any>;
1872
1919
  next<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(opts?: QueueNextOptions<TName, TCompletable>): Promise<any>;
@@ -1888,6 +1935,7 @@ interface ActorQueue<TQueues extends QueueSchemaConfig = Record<never, never>> {
1888
1935
  interface Conn<_TState = unknown, TConnParams = unknown, TConnState = unknown, _TVars = unknown, _TInput = unknown, _TDatabase extends AnyDatabaseProvider = AnyDatabaseProvider, _TEvents extends EventSchemaConfig = Record<never, never>, _TQueues extends QueueSchemaConfig = Record<never, never>> {
1889
1936
  id: string;
1890
1937
  params: TConnParams;
1938
+ /** @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 */
1891
1939
  state: TConnState;
1892
1940
  isHibernatable: boolean;
1893
1941
  send(name: string, ...args: any[]): void;
@@ -1898,16 +1946,15 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
1898
1946
  [ACTOR_CONTEXT_INTERNAL_SYMBOL]?: unknown;
1899
1947
  /** Returns the raw unwrapped state without the write-through proxy. */
1900
1948
  [RAW_STATE_SYMBOL](): TState;
1949
+ /** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
1901
1950
  state: TState;
1902
1951
  vars: TVars;
1903
- /**
1904
- * @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`)
1905
- * or actor state instead.
1906
- */
1952
+ /** @deprecated Actor KV was deprecated in 3.0 and will be removed in a future version. Store data in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/kv */
1907
1953
  readonly kv: ActorKv;
1908
1954
  readonly db: InferDatabaseClient<TDatabase>;
1909
1955
  readonly schedule: ActorSchedule;
1910
1956
  readonly cron: ActorCron;
1957
+ /** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
1911
1958
  readonly queue: ActorQueue<TQueues>;
1912
1959
  /** @experimental */
1913
1960
  readonly run: ActorRun;
@@ -1915,25 +1962,22 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
1915
1962
  readonly name: string;
1916
1963
  readonly key: string[];
1917
1964
  readonly region: string;
1918
- /** Provisions the experimental Actor Runtime Socket for this actor generation. */
1919
- actorRuntimeSocket(): Promise<{
1920
- path: string;
1921
- }>;
1922
1965
  readonly conns: Map<string, Conn<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>>;
1923
1966
  readonly log: ActorLogger;
1924
1967
  readonly abortSignal: AbortSignal;
1925
1968
  readonly aborted: boolean;
1926
1969
  readonly request?: Request;
1927
- /** @deprecated No-op. Always returns `false`. Use `keepAwake(promise)` or `waitUntil(promise)` instead. Will be removed in 2.2.0. */
1970
+ /** @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 */
1928
1971
  readonly preventSleep: boolean;
1929
1972
  broadcast(name: string, ...args: any[]): void;
1973
+ /** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
1930
1974
  saveState(opts?: {
1931
1975
  immediate?: boolean;
1932
1976
  maxWait?: number;
1933
1977
  }): Promise<void>;
1934
1978
  keepAwake<T>(promise: Promise<T>): Promise<T>;
1935
1979
  waitUntil(promise: Promise<unknown>): void;
1936
- /** @deprecated No-op. Use `keepAwake(promise)` to hold the actor awake for a specific promise. Will be removed in 2.2.0. */
1980
+ /** @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 */
1937
1981
  setPreventSleep(preventSleep: boolean): void;
1938
1982
  sleep(): void;
1939
1983
  destroy(): void;
@@ -1985,6 +2029,7 @@ type ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase ext
1985
2029
  type BeforeActionResponseContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
1986
2030
  type BeforeConnectContext<TState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, unknown, unknown, TVars, TInput, TDatabase, TEvents, TQueues>;
1987
2031
  type ConnectContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
2032
+ /** @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 */
1988
2033
  type CreateConnStateContext<TState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, unknown, unknown, TVars, TInput, TDatabase, TEvents, TQueues>;
1989
2034
  type CreateContext<TState, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, unknown, unknown, unknown, TInput, TDatabase, TEvents, TQueues>;
1990
2035
  type CreateVarsContext<TState, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = CreateContext<TState, TInput, TDatabase, TEvents, TQueues>;
@@ -1993,6 +2038,7 @@ type DisconnectContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
1993
2038
  type RequestContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
1994
2039
  type RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
1995
2040
  type SleepContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
2041
+ /** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. See https://rivet.dev/actors/docs/deprecated/state */
1996
2042
  type StateChangeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
1997
2043
  type WakeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
1998
2044
  type MigrateContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = WakeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
@@ -2060,7 +2106,6 @@ declare const ActorConfigSchema: z.ZodObject<{
2060
2106
  options: z.ZodPrefault<z.ZodObject<{
2061
2107
  name: z.ZodOptional<z.ZodString>;
2062
2108
  icon: z.ZodOptional<z.ZodString>;
2063
- enableActorRuntimeSocket: z.ZodDefault<z.ZodBoolean>;
2064
2109
  canHibernateWebSocket: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
2065
2110
  createVarsTimeout: z.ZodDefault<z.ZodNumber>;
2066
2111
  createConnStateTimeout: z.ZodDefault<z.ZodNumber>;
@@ -2104,13 +2149,17 @@ declare const ActorConfigSchema: z.ZodObject<{
2104
2149
  }, z.core.$strict>>;
2105
2150
  }, z.core.$strict>;
2106
2151
  type CreateState<TState, _TConnParams, _TConnState, _TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
2152
+ /** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
2107
2153
  state: TState;
2108
2154
  } | {
2155
+ /** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
2109
2156
  createState: (c: CreateContext<TState, TInput, TDatabase, TEvents, TQueues>, input: TInput) => TState | Promise<TState>;
2110
2157
  } | Record<never, never>;
2111
2158
  type CreateConnState<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
2159
+ /** @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 */
2112
2160
  connState: TConnState;
2113
2161
  } | {
2162
+ /** @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 */
2114
2163
  createConnState: (c: CreateConnStateContext<TState, TVars, TInput, TDatabase, TEvents, TQueues>, params: TConnParams) => TConnState | Promise<TConnState>;
2115
2164
  } | Record<never, never>;
2116
2165
  /**
@@ -2197,6 +2246,12 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
2197
2246
  *
2198
2247
  * Can be either a function or a RunConfig object with optional name/icon metadata.
2199
2248
  *
2249
+ * Passing a plain function was deprecated in 3.0 and will be removed in a
2250
+ * future version; it logs a warning at startup. Start background work from
2251
+ * `onWake` with `c.keepAwake` and track it in `c.vars` instead.
2252
+ * `run: workflow(...)` is not deprecated. See
2253
+ * https://rivet.dev/actors/docs/deprecated/run
2254
+ *
2200
2255
  * @returns Void or a Promise.
2201
2256
  */
2202
2257
  run?: ((c: RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>) => void | Promise<void>) | RunConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
@@ -2210,6 +2265,7 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
2210
2265
  * another onStateChange call, preventing infinite recursion.
2211
2266
  *
2212
2267
  * @param newState The updated state
2268
+ * @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state
2213
2269
  */
2214
2270
  onStateChange?: (c: StateChangeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, newState: TState) => void;
2215
2271
  /**
@@ -2302,6 +2358,8 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
2302
2358
  events?: TEvents;
2303
2359
  /**
2304
2360
  * Schema map for queue payloads sent by this actor.
2361
+ *
2362
+ * @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues
2305
2363
  */
2306
2364
  queues?: TQueues;
2307
2365
  }
@@ -2674,6 +2732,24 @@ declare class Registry<A extends RegistryActors> {
2674
2732
  * ```
2675
2733
  */
2676
2734
  start(): void;
2735
+ /**
2736
+ * Returns the number of actors hosted by this process's envoy, which is zero
2737
+ * while it is not serving. Requires the native runtime.
2738
+ */
2739
+ activeActorCount(): number;
2740
+ /**
2741
+ * Calls `callback` with the number of actors hosted by this process's envoy
2742
+ * and again whenever it changes. Rapid changes may coalesce.
2743
+ * Returns a function that unsubscribes. Requires the native runtime.
2744
+ *
2745
+ * @example
2746
+ * ```ts
2747
+ * const unsubscribe = registry.onActiveActorCountChange((count) => {
2748
+ * setTaskProtection(count > 0);
2749
+ * });
2750
+ * ```
2751
+ */
2752
+ onActiveActorCountChange(callback: (count: number) => void): () => void;
2677
2753
  }
2678
2754
 
2679
2755
  /**
@@ -230,7 +230,7 @@ function noopNext() {
230
230
  // package.json
231
231
  var package_default = {
232
232
  name: "rivetkit",
233
- version: "0.0.0-sqlite-sync-3-0-1-final.5663d2f",
233
+ version: "0.0.0-sqlite-sync-3-0-6-final.cf8679c",
234
234
  description: "Lightweight libraries for building stateful actors on edge platforms",
235
235
  license: "Apache-2.0",
236
236
  keywords: [
@@ -1459,7 +1459,7 @@ var ClientConfigSchemaBase = z3.object({
1459
1459
  if (!resolved && !hasWarnedMissingEndpoint) {
1460
1460
  hasWarnedMissingEndpoint = true;
1461
1461
  console.warn(
1462
- `[rivetkit] No endpoint provided to client. Defaulting to ${DEFAULT_ENDPOINT}. Starting in 2.2.0, an explicit endpoint will be required. Pass an endpoint to createClient() or createRivetKit(), or set the RIVET_ENDPOINT environment variable.`
1462
+ `[rivetkit] No endpoint provided to client. Defaulting to ${DEFAULT_ENDPOINT}. Starting in 3.2.0, an explicit endpoint will be required. Pass an endpoint to createClient() or createRivetKit(), or set the RIVET_ENDPOINT environment variable.`
1463
1463
  );
1464
1464
  }
1465
1465
  return resolved ?? DEFAULT_ENDPOINT;