rivetkit 0.0.0-sqlite-profiling-compat.4a9a623 → 0.0.0-sqlite-sync-3x-release.a00b07f

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 (277) hide show
  1. package/dist/browser/client.d.ts +1317 -765
  2. package/dist/browser/client.js +1457 -737
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.d.ts +252 -129
  5. package/dist/browser/inspector/client.js +2042 -228
  6. package/dist/browser/inspector/client.js.map +1 -1
  7. package/dist/tsup/actor/errors.cjs +6 -2
  8. package/dist/tsup/actor/errors.cjs.map +1 -1
  9. package/dist/tsup/actor/errors.d.cts +1 -1
  10. package/dist/tsup/actor/errors.d.ts +1 -1
  11. package/dist/tsup/actor/errors.js +5 -1
  12. package/dist/tsup/agent-os/index.cjs +3 -2367
  13. package/dist/tsup/agent-os/index.cjs.map +1 -1
  14. package/dist/tsup/agent-os/index.d.cts +1 -2277
  15. package/dist/tsup/agent-os/index.d.ts +1 -2277
  16. package/dist/tsup/agent-os/index.js +3 -2367
  17. package/dist/tsup/agent-os/index.js.map +1 -1
  18. package/dist/tsup/{chunk-7QKCGUTJ.cjs → chunk-2MOLY6AM.cjs} +444 -29
  19. package/dist/tsup/chunk-2MOLY6AM.cjs.map +1 -0
  20. package/dist/tsup/{chunk-IICIOTML.js → chunk-3DONDAMG.js} +2 -2
  21. package/dist/tsup/{chunk-XIX5DOZN.js → chunk-6FEYCVZC.js} +196 -20
  22. package/dist/tsup/chunk-6FEYCVZC.js.map +1 -0
  23. package/dist/tsup/chunk-6KXVLIXL.cjs +14 -0
  24. package/dist/tsup/chunk-6KXVLIXL.cjs.map +1 -0
  25. package/dist/tsup/chunk-73RNTXHB.cjs +243 -0
  26. package/dist/tsup/chunk-73RNTXHB.cjs.map +1 -0
  27. package/dist/tsup/{chunk-HXUEHHJF.js → chunk-A2CF6PFH.js} +19 -11
  28. package/dist/tsup/chunk-A2CF6PFH.js.map +1 -0
  29. package/dist/tsup/{chunk-75UE45DE.js → chunk-BRH4PQS5.js} +436 -21
  30. package/dist/tsup/chunk-BRH4PQS5.js.map +1 -0
  31. package/dist/tsup/{chunk-2WMYYG4R.cjs → chunk-BTSDFFDC.cjs} +18 -11
  32. package/dist/tsup/chunk-BTSDFFDC.cjs.map +1 -0
  33. package/dist/tsup/{chunk-RIT7N3TX.js → chunk-D5WUPE47.js} +50 -3
  34. package/dist/tsup/chunk-D5WUPE47.js.map +1 -0
  35. package/dist/tsup/{chunk-4PX3ZKJR.js → chunk-DJUBJQEQ.js} +3 -3
  36. package/dist/tsup/chunk-DJUBJQEQ.js.map +1 -0
  37. package/dist/tsup/{chunk-3MHDOUD7.cjs → chunk-HDVZ6YZG.cjs} +197 -21
  38. package/dist/tsup/chunk-HDVZ6YZG.cjs.map +1 -0
  39. package/dist/tsup/{chunk-JZ7TWV65.js → chunk-JTHHCZCZ.js} +24 -1
  40. package/dist/tsup/chunk-JTHHCZCZ.js.map +1 -0
  41. package/dist/tsup/{chunk-ND567FR5.cjs → chunk-JUHXV3HF.cjs} +3 -3
  42. package/dist/tsup/chunk-JUHXV3HF.cjs.map +1 -0
  43. package/dist/tsup/chunk-JUWMP5O3.js +14 -0
  44. package/dist/tsup/chunk-JUWMP5O3.js.map +1 -0
  45. package/dist/tsup/{chunk-ZA7FLHKH.cjs → chunk-KVFIONKQ.cjs} +25 -2
  46. package/dist/tsup/chunk-KVFIONKQ.cjs.map +1 -0
  47. package/dist/tsup/{chunk-4FC7TVS6.cjs → chunk-MGI2VVF6.cjs} +39 -7
  48. package/dist/tsup/chunk-MGI2VVF6.cjs.map +1 -0
  49. package/dist/tsup/{chunk-NHUTYWKU.cjs → chunk-OTVJYZ2L.cjs} +1139 -470
  50. package/dist/tsup/chunk-OTVJYZ2L.cjs.map +1 -0
  51. package/dist/tsup/{chunk-VE2X4KMG.cjs → chunk-RTWH3AX3.cjs} +18 -10
  52. package/dist/tsup/chunk-RTWH3AX3.cjs.map +1 -0
  53. package/dist/tsup/{chunk-QAVN4QNO.cjs → chunk-TM76Z7XT.cjs} +7 -7
  54. package/dist/tsup/chunk-TM76Z7XT.cjs.map +1 -0
  55. package/dist/tsup/{chunk-AGDY6TKH.js → chunk-TRUHDXOU.js} +1023 -354
  56. package/dist/tsup/chunk-TRUHDXOU.js.map +1 -0
  57. package/dist/tsup/{chunk-XFYEVYHG.js → chunk-TSQTI6H6.js} +16 -9
  58. package/dist/tsup/chunk-TSQTI6H6.js.map +1 -0
  59. package/dist/tsup/{chunk-2CICCOBL.cjs → chunk-Z7E2G3JZ.cjs} +52 -5
  60. package/dist/tsup/chunk-Z7E2G3JZ.cjs.map +1 -0
  61. package/dist/tsup/{chunk-ZZ3WBRPD.js → chunk-ZOVJDAOW.js} +38 -6
  62. package/dist/tsup/chunk-ZOVJDAOW.js.map +1 -0
  63. package/dist/tsup/chunk-ZYK4B5WV.js +243 -0
  64. package/dist/tsup/chunk-ZYK4B5WV.js.map +1 -0
  65. package/dist/tsup/client/mod.cjs +8 -9
  66. package/dist/tsup/client/mod.cjs.map +1 -1
  67. package/dist/tsup/client/mod.d.cts +32 -6
  68. package/dist/tsup/client/mod.d.ts +32 -6
  69. package/dist/tsup/client/mod.js +7 -8
  70. package/dist/tsup/common/log.cjs +5 -3
  71. package/dist/tsup/common/log.cjs.map +1 -1
  72. package/dist/tsup/common/log.d.cts +5 -1
  73. package/dist/tsup/common/log.d.ts +5 -1
  74. package/dist/tsup/common/log.js +6 -4
  75. package/dist/tsup/common/websocket.cjs +4 -4
  76. package/dist/tsup/common/websocket.cjs.map +1 -1
  77. package/dist/tsup/common/websocket.js +3 -3
  78. package/dist/tsup/{config-BR1Nn0QQ.d.ts → config-B4erdavw.d.ts} +571 -65
  79. package/dist/tsup/{config-B0LNDrLY.d.ts → config-BfG1qpYz.d.cts} +80 -14
  80. package/dist/tsup/{config-B0LNDrLY.d.cts → config-BfG1qpYz.d.ts} +80 -14
  81. package/dist/tsup/{config-tCvkwzyN.d.cts → config-DK144OAw.d.cts} +571 -65
  82. package/dist/tsup/{context-oc9zhA3x.d.ts → context-Cvnf3BRe.d.cts} +3 -2
  83. package/dist/tsup/{context-D4WDwf9m.d.cts → context-Oxi6YWcG.d.ts} +3 -2
  84. package/dist/tsup/db/drizzle.cjs +127 -67
  85. package/dist/tsup/db/drizzle.cjs.map +1 -1
  86. package/dist/tsup/db/drizzle.d.cts +8 -4
  87. package/dist/tsup/db/drizzle.d.ts +8 -4
  88. package/dist/tsup/db/drizzle.js +127 -67
  89. package/dist/tsup/db/drizzle.js.map +1 -1
  90. package/dist/tsup/db/mod.cjs +6 -126
  91. package/dist/tsup/db/mod.cjs.map +1 -1
  92. package/dist/tsup/db/mod.d.cts +8 -4
  93. package/dist/tsup/db/mod.d.ts +8 -4
  94. package/dist/tsup/db/mod.js +5 -125
  95. package/dist/tsup/db/mod.js.map +1 -1
  96. package/dist/tsup/dynamic/mod.cjs +2 -2
  97. package/dist/tsup/dynamic/mod.cjs.map +1 -1
  98. package/dist/tsup/dynamic/mod.d.cts +6 -4
  99. package/dist/tsup/dynamic/mod.d.ts +6 -4
  100. package/dist/tsup/dynamic/mod.js +1 -1
  101. package/dist/tsup/inspector/mod.cjs +47 -12
  102. package/dist/tsup/inspector/mod.cjs.map +1 -1
  103. package/dist/tsup/inspector/mod.d.cts +26 -136
  104. package/dist/tsup/inspector/mod.d.ts +26 -136
  105. package/dist/tsup/inspector/mod.js +46 -11
  106. package/dist/tsup/inspector/mod.js.map +1 -1
  107. package/dist/tsup/inspector/workflow.cjs +21 -0
  108. package/dist/tsup/inspector/workflow.cjs.map +1 -0
  109. package/dist/tsup/inspector/workflow.d.cts +144 -0
  110. package/dist/tsup/inspector/workflow.d.ts +144 -0
  111. package/dist/tsup/inspector/workflow.js +21 -0
  112. package/dist/tsup/inspector/workflow.js.map +1 -0
  113. package/dist/tsup/inspector-tab/mod.cjs +2 -13
  114. package/dist/tsup/inspector-tab/mod.cjs.map +1 -1
  115. package/dist/tsup/inspector-tab/mod.d.cts +9 -17
  116. package/dist/tsup/inspector-tab/mod.d.ts +9 -17
  117. package/dist/tsup/inspector-tab/mod.js +1 -12
  118. package/dist/tsup/inspector-tab/mod.js.map +1 -1
  119. package/dist/tsup/mod.cjs +2724 -611
  120. package/dist/tsup/mod.cjs.map +1 -1
  121. package/dist/tsup/mod.d.cts +9 -7
  122. package/dist/tsup/mod.d.ts +9 -7
  123. package/dist/tsup/mod.js +2641 -528
  124. package/dist/tsup/mod.js.map +1 -1
  125. package/dist/tsup/test/mod.cjs +19 -17
  126. package/dist/tsup/test/mod.cjs.map +1 -1
  127. package/dist/tsup/test/mod.d.cts +6 -4
  128. package/dist/tsup/test/mod.d.ts +6 -4
  129. package/dist/tsup/test/mod.js +18 -16
  130. package/dist/tsup/test/mod.js.map +1 -1
  131. package/dist/tsup/unstable/migrations.cjs +101 -0
  132. package/dist/tsup/unstable/migrations.cjs.map +1 -0
  133. package/dist/tsup/unstable/migrations.d.cts +29 -0
  134. package/dist/tsup/unstable/migrations.d.ts +29 -0
  135. package/dist/tsup/unstable/migrations.js +101 -0
  136. package/dist/tsup/unstable/migrations.js.map +1 -0
  137. package/dist/tsup/{utils-CqDnC_PS.d.cts → utils-3rsE0JvI.d.cts} +25 -2
  138. package/dist/tsup/{utils-CqDnC_PS.d.ts → utils-3rsE0JvI.d.ts} +25 -2
  139. package/dist/tsup/utils-C1O-SklO.d.ts +162 -0
  140. package/dist/tsup/utils-C6b0aYUM.d.cts +162 -0
  141. package/dist/tsup/utils.cjs +7 -3
  142. package/dist/tsup/utils.cjs.map +1 -1
  143. package/dist/tsup/utils.d.cts +4 -147
  144. package/dist/tsup/utils.d.ts +4 -147
  145. package/dist/tsup/utils.js +6 -2
  146. package/dist/tsup/workflow/mod.cjs +260 -200
  147. package/dist/tsup/workflow/mod.cjs.map +1 -1
  148. package/dist/tsup/workflow/mod.d.cts +8 -6
  149. package/dist/tsup/workflow/mod.d.ts +8 -6
  150. package/dist/tsup/workflow/mod.js +249 -189
  151. package/dist/tsup/workflow/mod.js.map +1 -1
  152. package/package.json +34 -14
  153. package/src/actor/actions.ts +155 -0
  154. package/src/actor/config.ts +403 -43
  155. package/src/actor/definition.ts +26 -7
  156. package/src/actor/errors.ts +87 -5
  157. package/src/actor/keys.ts +86 -0
  158. package/src/actor/mod.ts +15 -1
  159. package/src/actor/tracing.ts +28 -0
  160. package/src/agent-os/index.ts +5 -65
  161. package/src/client/actor-common.ts +8 -15
  162. package/src/client/actor-conn.ts +135 -8
  163. package/src/client/actor-handle.ts +180 -42
  164. package/src/client/actor-query.ts +8 -1
  165. package/src/client/auth.ts +37 -0
  166. package/src/client/client.ts +89 -21
  167. package/src/client/config.ts +27 -2
  168. package/src/client/errors.ts +2 -1
  169. package/src/client/lifecycle-errors.ts +16 -1
  170. package/src/client/mod.ts +9 -0
  171. package/src/client/outbound-telemetry.ts +66 -0
  172. package/src/client/query.ts +2 -0
  173. package/src/client/queue.ts +3 -0
  174. package/src/client/raw-utils.ts +37 -8
  175. package/src/client/resolve-gateway-target.ts +2 -0
  176. package/src/client/retry-budget.ts +78 -0
  177. package/src/client/token-provider.ts +93 -0
  178. package/src/client/utils.ts +16 -2
  179. package/src/common/actor-router-consts.ts +5 -0
  180. package/src/common/actor-telemetry-context.ts +19 -0
  181. package/src/common/bare/generated/actor-runtime-socket-protocol/v1.ts +848 -0
  182. package/src/common/bare/generated/inspector/v5.ts +1016 -0
  183. package/src/common/bare/generated/inspector/v6.ts +1367 -0
  184. package/src/common/bare/transport/v1.ts +36 -0
  185. package/src/common/database/config.ts +108 -15
  186. package/src/common/database/mod.ts +247 -76
  187. package/src/common/database/native-database.ts +433 -23
  188. package/src/common/database/shared.ts +24 -0
  189. package/src/common/encoding.ts +31 -21
  190. package/src/common/fetch-like.ts +63 -0
  191. package/src/common/inspector-transport.ts +12 -2
  192. package/src/common/log.ts +14 -8
  193. package/src/common/otel-context.ts +99 -0
  194. package/src/common/router.ts +1 -1
  195. package/src/common/utils.ts +7 -19
  196. package/src/db/drizzle.ts +182 -80
  197. package/src/db/mod.ts +2 -0
  198. package/src/dynamic/isolate-runtime.ts +0 -2
  199. package/src/engine-api/actors.ts +3 -3
  200. package/src/engine-client/actor-http-client.ts +29 -20
  201. package/src/engine-client/actor-websocket-client.ts +6 -3
  202. package/src/engine-client/api-endpoints.ts +72 -14
  203. package/src/engine-client/driver.ts +8 -15
  204. package/src/engine-client/mod.ts +248 -112
  205. package/src/inspector/client.browser.ts +134 -16
  206. package/src/inspector/mod.ts +1 -1
  207. package/src/inspector/workflow.ts +61 -0
  208. package/src/inspector-tab/mod.ts +1 -15
  209. package/src/registry/config/envoy.ts +2 -18
  210. package/src/registry/config/index.ts +53 -61
  211. package/src/registry/index.ts +311 -21
  212. package/src/registry/napi-runtime.ts +583 -39
  213. package/src/registry/native-http.ts +225 -0
  214. package/src/registry/native.ts +1365 -414
  215. package/src/registry/run-handler-coordinator.ts +219 -0
  216. package/src/registry/runtime.ts +372 -7
  217. package/src/registry/wasm-runtime.ts +490 -21
  218. package/src/registry/write-through-proxy.ts +101 -0
  219. package/src/test/mod.ts +1 -19
  220. package/src/test/ready.ts +22 -0
  221. package/src/unstable/migrations.ts +141 -0
  222. package/src/utils/env-vars.ts +15 -6
  223. package/src/utils/node.ts +44 -28
  224. package/src/utils.ts +3 -0
  225. package/src/workflow/context.ts +9 -27
  226. package/src/workflow/driver.ts +253 -116
  227. package/src/workflow/inspector.ts +23 -24
  228. package/src/workflow/mod.ts +50 -72
  229. package/dist/tsup/chunk-2CICCOBL.cjs.map +0 -1
  230. package/dist/tsup/chunk-2WMYYG4R.cjs.map +0 -1
  231. package/dist/tsup/chunk-3MHDOUD7.cjs.map +0 -1
  232. package/dist/tsup/chunk-4FC7TVS6.cjs.map +0 -1
  233. package/dist/tsup/chunk-4PX3ZKJR.js.map +0 -1
  234. package/dist/tsup/chunk-75UE45DE.js.map +0 -1
  235. package/dist/tsup/chunk-7QKCGUTJ.cjs.map +0 -1
  236. package/dist/tsup/chunk-AGDY6TKH.js.map +0 -1
  237. package/dist/tsup/chunk-HXUEHHJF.js.map +0 -1
  238. package/dist/tsup/chunk-JZ7TWV65.js.map +0 -1
  239. package/dist/tsup/chunk-ND567FR5.cjs.map +0 -1
  240. package/dist/tsup/chunk-NHUTYWKU.cjs.map +0 -1
  241. package/dist/tsup/chunk-QAVN4QNO.cjs.map +0 -1
  242. package/dist/tsup/chunk-RIT7N3TX.js.map +0 -1
  243. package/dist/tsup/chunk-RV5MAFDT.cjs +0 -382
  244. package/dist/tsup/chunk-RV5MAFDT.cjs.map +0 -1
  245. package/dist/tsup/chunk-VE2X4KMG.cjs.map +0 -1
  246. package/dist/tsup/chunk-XFYEVYHG.js.map +0 -1
  247. package/dist/tsup/chunk-XHGDS3DZ.js +0 -382
  248. package/dist/tsup/chunk-XHGDS3DZ.js.map +0 -1
  249. package/dist/tsup/chunk-XIX5DOZN.js.map +0 -1
  250. package/dist/tsup/chunk-ZA7FLHKH.cjs.map +0 -1
  251. package/dist/tsup/chunk-ZZ3WBRPD.js.map +0 -1
  252. package/src/actor/driver.ts +0 -141
  253. package/src/actor/instance/mod.ts +0 -2484
  254. package/src/actor/keys.test.ts +0 -275
  255. package/src/actor/utils.test.ts +0 -48
  256. package/src/agent-os/actor/cron.ts +0 -84
  257. package/src/agent-os/actor/db.ts +0 -54
  258. package/src/agent-os/actor/filesystem.ts +0 -131
  259. package/src/agent-os/actor/index.ts +0 -285
  260. package/src/agent-os/actor/network.ts +0 -58
  261. package/src/agent-os/actor/preview.ts +0 -190
  262. package/src/agent-os/actor/process.ts +0 -177
  263. package/src/agent-os/actor/session.ts +0 -518
  264. package/src/agent-os/actor/shell.ts +0 -60
  265. package/src/agent-os/config.ts +0 -79
  266. package/src/agent-os/fs/database-vfs.ts +0 -624
  267. package/src/agent-os/types.ts +0 -148
  268. package/src/client/test.ts +0 -44
  269. package/src/common/database/mod.test.ts +0 -137
  270. package/src/common/database/native-database.test.ts +0 -211
  271. package/src/common/inline-websocket-adapter.test.ts +0 -51
  272. package/src/drivers/engine/actor-driver.ts +0 -2473
  273. package/src/registry/process-metrics.ts +0 -250
  274. package/src/registry/runtime.test.ts +0 -50
  275. package/src/utils/endpoint-parser.test.ts +0 -206
  276. package/src/utils.test.ts +0 -34
  277. /package/dist/tsup/{chunk-IICIOTML.js.map → chunk-3DONDAMG.js.map} +0 -0
@@ -1,13 +1,15 @@
1
1
  import { z } from 'zod/v4';
2
- import { A as AnyDatabaseProvider, S as SqliteProfilingOptions, e as SqliteNativeMetrics, I as InferDatabaseClient } from './config-B0LNDrLY.js';
2
+ import { A as AnyDatabaseProvider, a as SqliteProfilingOptions, f as SqliteNativeMetrics, I as InferDatabaseClient } from './config-BfG1qpYz.js';
3
3
  import * as _rivetkit_rivetkit_wasm from '@rivetkit/rivetkit-wasm';
4
4
  import { z as z$1 } from 'zod';
5
5
  import { Logger } from 'pino';
6
6
  import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
7
+ import { WorkflowState } from './inspector/workflow.js';
7
8
  import { StandardSchemaV1 } from '@standard-schema/spec';
9
+ import { Rivet } from '@rivetkit/engine-api-full';
10
+ import { E as Encoding, G as GetUpgradeWebSocket } from './utils-C1O-SklO.js';
8
11
  import { Context, Hono } from 'hono';
9
- import { GetUpgradeWebSocket } from './utils.js';
10
- import { R as RivetError } from './utils-CqDnC_PS.js';
12
+ import { R as RivetError } from './utils-3rsE0JvI.js';
11
13
 
12
14
  declare const ActorKeySchema: z.ZodArray<z.ZodString>;
13
15
  type ActorKey = z.infer<typeof ActorKeySchema>;
@@ -28,6 +30,7 @@ declare const CreateRequestSchema: z.ZodObject<{
28
30
  key: z.ZodArray<z.ZodString>;
29
31
  input: z.ZodOptional<z.ZodUnknown>;
30
32
  region: z.ZodOptional<z.ZodString>;
33
+ poolName: z.ZodOptional<z.ZodString>;
31
34
  }, z.core.$strip>;
32
35
  declare const ActorQuerySchema: z.ZodUnion<readonly [z.ZodObject<{
33
36
  getForId: z.ZodObject<{
@@ -45,6 +48,7 @@ declare const ActorQuerySchema: z.ZodUnion<readonly [z.ZodObject<{
45
48
  key: z.ZodArray<z.ZodString>;
46
49
  input: z.ZodOptional<z.ZodUnknown>;
47
50
  region: z.ZodOptional<z.ZodString>;
51
+ poolName: z.ZodOptional<z.ZodString>;
48
52
  }, z.core.$strip>;
49
53
  }, z.core.$strip>, z.ZodObject<{
50
54
  create: z.ZodObject<{
@@ -52,6 +56,7 @@ declare const ActorQuerySchema: z.ZodUnion<readonly [z.ZodObject<{
52
56
  key: z.ZodArray<z.ZodString>;
53
57
  input: z.ZodOptional<z.ZodUnknown>;
54
58
  region: z.ZodOptional<z.ZodString>;
59
+ poolName: z.ZodOptional<z.ZodString>;
55
60
  }, z.core.$strip>;
56
61
  }, z.core.$strip>]>;
57
62
  type ActorQuery = z.infer<typeof ActorQuerySchema>;
@@ -60,16 +65,6 @@ type ActorQuery = z.infer<typeof ActorQuerySchema>;
60
65
  */
61
66
  type CreateRequest = z.infer<typeof CreateRequestSchema>;
62
67
 
63
- declare const EncodingSchema: z.ZodEnum<{
64
- json: "json";
65
- cbor: "cbor";
66
- bare: "bare";
67
- }>;
68
- /**
69
- * Encoding used to communicate between the client & actor.
70
- */
71
- type Encoding = z.infer<typeof EncodingSchema>;
72
-
73
68
  declare const ActorsSchema: z$1.ZodRecord<z$1.ZodString, z$1.ZodCustom<AnyActorDefinition, AnyActorDefinition>>;
74
69
  type RegistryActors = z$1.infer<typeof ActorsSchema>;
75
70
  declare const RuntimeKindSchema: z$1.ZodEnum<{
@@ -170,6 +165,7 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
170
165
  engineHost: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodString>>;
171
166
  enginePort: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
172
167
  engineVersion: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodString>>;
168
+ startServices: z$1.ZodOptional<z$1.ZodBoolean>;
173
169
  configurePool: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodObject<{
174
170
  name: z$1.ZodOptional<z$1.ZodString>;
175
171
  url: z$1.ZodString;
@@ -186,11 +182,11 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
186
182
  publicEndpoint: z$1.ZodPipe<z$1.ZodOptional<z$1.ZodString>, z$1.ZodTransform<string | undefined, string | undefined>>;
187
183
  publicToken: z$1.ZodPipe<z$1.ZodOptional<z$1.ZodString>, z$1.ZodTransform<string | undefined, string | undefined>>;
188
184
  }, z$1.core.$strip>>>;
189
- envoy: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodObject<{
185
+ node: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodObject<{
190
186
  poolName: z$1.ZodDefault<z$1.ZodString>;
191
187
  version: z$1.ZodDefault<z$1.ZodNumber>;
192
188
  totalSlots: z$1.ZodDefault<z$1.ZodNumber>;
193
- envoyKey: z$1.ZodOptional<z$1.ZodString>;
189
+ nodeKey: z$1.ZodOptional<z$1.ZodString>;
194
190
  }, z$1.core.$strip>>>;
195
191
  shutdown: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodObject<{
196
192
  gracePeriodMs: z$1.ZodOptional<z$1.ZodNumber>;
@@ -201,6 +197,8 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
201
197
  backend: "local" | "remote";
202
198
  } | undefined;
203
199
  endpoint: string | undefined;
200
+ engineSpawn: boolean;
201
+ startServices: boolean;
204
202
  namespace: string;
205
203
  token: string | undefined;
206
204
  publicEndpoint: string | undefined;
@@ -237,11 +235,11 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
237
235
  engineHost: string;
238
236
  enginePort: number;
239
237
  engineVersion: string;
240
- envoy: {
238
+ node: {
241
239
  poolName: string;
242
240
  version: number;
243
241
  totalSlots: number;
244
- envoyKey?: string | undefined;
242
+ nodeKey?: string | undefined;
245
243
  };
246
244
  shutdown: {
247
245
  disableSignalHandlers: boolean;
@@ -296,11 +294,11 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
296
294
  publicEndpoint: string | undefined;
297
295
  publicToken: string | undefined;
298
296
  };
299
- envoy: {
297
+ node: {
300
298
  poolName: string;
301
299
  version: number;
302
300
  totalSlots: number;
303
- envoyKey?: string | undefined;
301
+ nodeKey?: string | undefined;
304
302
  };
305
303
  shutdown: {
306
304
  disableSignalHandlers: boolean;
@@ -308,6 +306,7 @@ declare const RegistryConfigSchema: z$1.ZodPipe<z$1.ZodObject<{
308
306
  };
309
307
  staticDir?: string | undefined;
310
308
  httpHost?: string | undefined;
309
+ startServices?: boolean | undefined;
311
310
  configurePool?: {
312
311
  url: string;
313
312
  name?: string | undefined;
@@ -345,7 +344,7 @@ declare const DocServerlessConfigSchema: z$1.ZodObject<{
345
344
  declare const DocEnvoyConfigSchema: z$1.ZodObject<{
346
345
  totalSlots: z$1.ZodOptional<z$1.ZodNumber>;
347
346
  poolName: z$1.ZodOptional<z$1.ZodString>;
348
- envoyKey: z$1.ZodOptional<z$1.ZodString>;
347
+ nodeKey: z$1.ZodOptional<z$1.ZodString>;
349
348
  version: z$1.ZodOptional<z$1.ZodNumber>;
350
349
  }, z$1.core.$strip>;
351
350
  declare const DocSqliteConfigSchema: z$1.ZodOptional<z$1.ZodObject<{
@@ -386,6 +385,7 @@ declare const DocRegistryConfigSchema: z$1.ZodObject<{
386
385
  httpHost: z$1.ZodOptional<z$1.ZodString>;
387
386
  startEngine: z$1.ZodOptional<z$1.ZodBoolean>;
388
387
  engineVersion: z$1.ZodOptional<z$1.ZodString>;
388
+ startServices: z$1.ZodOptional<z$1.ZodBoolean>;
389
389
  configurePool: z$1.ZodOptional<z$1.ZodObject<{
390
390
  name: z$1.ZodOptional<z$1.ZodString>;
391
391
  url: z$1.ZodString;
@@ -402,10 +402,10 @@ declare const DocRegistryConfigSchema: z$1.ZodObject<{
402
402
  publicEndpoint: z$1.ZodOptional<z$1.ZodString>;
403
403
  publicToken: z$1.ZodOptional<z$1.ZodString>;
404
404
  }, z$1.core.$strip>>;
405
- envoy: z$1.ZodOptional<z$1.ZodObject<{
405
+ node: z$1.ZodOptional<z$1.ZodObject<{
406
406
  totalSlots: z$1.ZodOptional<z$1.ZodNumber>;
407
407
  poolName: z$1.ZodOptional<z$1.ZodString>;
408
- envoyKey: z$1.ZodOptional<z$1.ZodString>;
408
+ nodeKey: z$1.ZodOptional<z$1.ZodString>;
409
409
  version: z$1.ZodOptional<z$1.ZodNumber>;
410
410
  }, z$1.core.$strip>>;
411
411
  }, z$1.core.$strip>;
@@ -486,6 +486,26 @@ declare function actor<TState, TConnParams, TConnState, TVars, TInput, TDatabase
486
486
  declare function isStaticActorDefinition(definition: AnyActorDefinition): definition is AnyStaticActorDefinition;
487
487
  declare function lookupInRegistry(config: RegistryConfig, name: string): AnyActorDefinition;
488
488
 
489
+ /** A namespace-scoped Engine grant. The caller must provide every grant explicitly. */
490
+ type TokenGrant = Rivet.AuthTokenGrant;
491
+ /** Options for `client.auth.issueToken()`. `expiresIn` is in seconds. */
492
+ type IssueTokenOptions = Pick<Rivet.AuthTokenCreateRequest, "subject" | "grants"> & {
493
+ expiresIn?: Rivet.AuthTokenCreateRequest["duration"];
494
+ };
495
+ /** Token timestamps are Unix milliseconds. */
496
+ interface IssuedToken {
497
+ token: Rivet.AuthTokenCreateResponse["token"];
498
+ issuedAt: Rivet.AuthTokenCreateResponse["issuedTs"];
499
+ expiresAt: Rivet.AuthTokenCreateResponse["expiresTs"];
500
+ }
501
+ /** Resources that can be scoped to a single actor ID. */
502
+ type ActorTokenResource = Extract<Rivet.AuthTokenGrant["resource"], "actor_gateway" | "actor" | "actor_kv">;
503
+ type ActorTokenPermissions = Partial<Record<ActorTokenResource, Rivet.AuthTokenGrant["operations"]>>;
504
+ /** Options for `actor.issueToken()`. Omit permissions for gateway read access only. */
505
+ type ActorIssueTokenOptions = Pick<IssueTokenOptions, "subject" | "expiresIn"> & {
506
+ permissions?: ActorTokenPermissions;
507
+ };
508
+
489
509
  type GatewayTarget = {
490
510
  directId: string;
491
511
  } | ActorQuery;
@@ -493,6 +513,7 @@ interface GatewayRequestOptions {
493
513
  skipReadyWait?: boolean;
494
514
  }
495
515
  interface EngineControlClient {
516
+ issueToken(options: IssueTokenOptions): Promise<IssuedToken>;
496
517
  getForId(input: GetForIdInput): Promise<ActorOutput | undefined>;
497
518
  getWithKey(input: GetWithKeyInput): Promise<ActorOutput | undefined>;
498
519
  getOrCreateWithKey(input: GetOrCreateWithKeyInput): Promise<ActorOutput>;
@@ -500,6 +521,8 @@ interface EngineControlClient {
500
521
  listActors(input: ListActorsInput): Promise<ActorOutput[]>;
501
522
  sendRequest(target: GatewayTarget, actorRequest: Request, options?: GatewayRequestOptions): Promise<Response>;
502
523
  openWebSocket(path: string, target: GatewayTarget, encoding: Encoding, params: unknown, options?: GatewayRequestOptions): Promise<UniversalWebSocket>;
524
+ /** Refresh a credential rejected during this WebSocket handshake, if supported. */
525
+ refreshAuthToken?(ws: UniversalWebSocket): Promise<boolean>;
503
526
  proxyRequest(c: Context, actorRequest: Request, actorId: string): Promise<Response>;
504
527
  proxyWebSocket(c: Context, path: string, actorId: string, encoding: Encoding, params: unknown): Promise<Response>;
505
528
  buildGatewayUrl(target: GatewayTarget, options?: GatewayRequestOptions): Promise<string>;
@@ -512,11 +535,6 @@ interface EngineControlClient {
512
535
  * Test-only helper that simulates an abrupt actor crash.
513
536
  */
514
537
  hardCrashActor?(actorId: string): Promise<void>;
515
- kvGet(actorId: string, key: Uint8Array): Promise<string | null>;
516
- kvBatchGet(actorId: string, keys: Uint8Array[]): Promise<(Uint8Array | null)[]>;
517
- kvBatchPut(actorId: string, entries: [Uint8Array, Uint8Array][]): Promise<void>;
518
- kvBatchDelete(actorId: string, keys: Uint8Array[]): Promise<void>;
519
- kvDeleteRange(actorId: string, start: Uint8Array, end: Uint8Array): Promise<void>;
520
538
  }
521
539
  interface RuntimeDisplayInformation {
522
540
  properties: Record<string, string>;
@@ -538,6 +556,8 @@ interface GetOrCreateWithKeyInput {
538
556
  input?: unknown;
539
557
  region?: string;
540
558
  crashPolicy?: CrashPolicy;
559
+ /** Overrides the client's configured pool name for this actor. */
560
+ poolName?: string;
541
561
  }
542
562
  interface CreateInput {
543
563
  c?: Context | undefined;
@@ -546,6 +566,8 @@ interface CreateInput {
546
566
  input?: unknown;
547
567
  region?: string;
548
568
  crashPolicy?: CrashPolicy;
569
+ /** Overrides the client's configured pool name for this actor. */
570
+ poolName?: string;
549
571
  }
550
572
  interface ListActorsInput {
551
573
  c?: Context | undefined;
@@ -565,6 +587,25 @@ interface ActorOutput {
565
587
  error?: unknown;
566
588
  }
567
589
 
590
+ /** Correlation owned by the currently executing Core actor invocation. */
591
+ interface ActorInvocationTraceContext {
592
+ /** Ray ID the invocation received, absent when nothing upstream supplied one. */
593
+ readonly rayId?: string;
594
+ /** Core-owned invocation span context, absent when tracing is disabled. */
595
+ readonly span?: ActorInvocationSpanContext;
596
+ }
597
+ /** W3C span context of the Core invocation span. */
598
+ interface ActorInvocationSpanContext {
599
+ /** W3C trace identifier. */
600
+ readonly traceId: string;
601
+ /** W3C span identifier for the Core invocation. */
602
+ readonly spanId: string;
603
+ /** OpenTelemetry trace flags encoded as an integer. */
604
+ readonly traceFlags: number;
605
+ /** Optional vendor trace state inherited by the Core invocation. */
606
+ readonly tracestate?: string;
607
+ }
608
+
568
609
  declare const handleBrand: unique symbol;
569
610
  type OpaqueHandle<Name extends string> = {
570
611
  readonly [handleBrand]: Name;
@@ -575,18 +616,47 @@ type ActorContextHandle = OpaqueHandle<"actorContext">;
575
616
  type ConnHandle = OpaqueHandle<"conn">;
576
617
  type WebSocketHandle = OpaqueHandle<"webSocket">;
577
618
  type CancellationTokenHandle = OpaqueHandle<"cancellationToken">;
619
+ type ActorStateTransactionHandle = OpaqueHandle<"actorStateTransaction">;
620
+ type SqliteTransactionHandle = OpaqueHandle<"sqliteTransaction">;
578
621
  type RuntimeBytes = Uint8Array;
579
622
  interface RuntimeActorKeySegment {
580
623
  kind: string;
581
624
  stringValue?: string;
582
625
  numberValue?: number;
583
626
  }
627
+ /** Resolves correlation at operation time so retained clients cannot freeze stale context. */
628
+ type CurrentActorInvocation = () => ActorInvocationTraceContext | undefined;
629
+ /** One open call from an actor out to another actor. */
630
+ interface RuntimeOutboundCall {
631
+ /**
632
+ * W3C context of the call's own span, to send to the callee so it parents to
633
+ * the call. Absent when tracing is disabled.
634
+ */
635
+ readonly span?: ActorInvocationSpanContext;
636
+ /**
637
+ * Records the call's outcome. `error` is the failure encoded the way the
638
+ * bridge encodes errors, so a structured error keeps its group and code.
639
+ */
640
+ finish(error?: string): void;
641
+ }
642
+ /**
643
+ * Opens the span covering one call out to another actor, or returns `undefined`
644
+ * outside an invocation or on a runtime without invocation telemetry. Callers
645
+ * send their own context when it returns nothing.
646
+ */
647
+ type StartCallSpan = (actorName: string, actionName: string) => RuntimeOutboundCall | undefined;
584
648
  interface RuntimeHttpRequest {
585
649
  method: string;
586
650
  uri: string;
587
651
  headers?: Record<string, string>;
588
652
  body?: RuntimeBytes;
589
653
  }
654
+ interface RuntimeHttpResponseBodyStream {
655
+ cancelled(): Promise<void>;
656
+ write(chunk: Uint8Array): Promise<void>;
657
+ end(): Promise<void>;
658
+ error(message: string): Promise<void>;
659
+ }
590
660
  interface RuntimeStateDeltaPayload {
591
661
  state?: RuntimeBytes;
592
662
  connHibernation: Array<{
@@ -595,6 +665,10 @@ interface RuntimeStateDeltaPayload {
595
665
  }>;
596
666
  connHibernationRemoved: string[];
597
667
  }
668
+ interface RuntimeWorkflowKvWrite {
669
+ key: RuntimeBytes;
670
+ value: RuntimeBytes;
671
+ }
598
672
  interface RuntimeRequestSaveOpts {
599
673
  immediate?: boolean;
600
674
  maxWaitMs?: number;
@@ -620,6 +694,38 @@ interface RuntimeQueueInspectMessage {
620
694
  name: string;
621
695
  createdAtMs: number;
622
696
  }
697
+ interface RuntimeScheduledEventInfo {
698
+ id: string;
699
+ action: string;
700
+ args: RuntimeBytes;
701
+ runAt: number;
702
+ }
703
+ interface RuntimeCronJobInfo {
704
+ name: string;
705
+ kind: "cron" | "every";
706
+ action: string;
707
+ args: RuntimeBytes;
708
+ nextRunAt: number;
709
+ lastRunAt?: number;
710
+ expression?: string;
711
+ timezone?: string;
712
+ intervalMs?: number;
713
+ maxHistory: number;
714
+ }
715
+ interface RuntimeScheduleErrorInfo {
716
+ group: string;
717
+ code: string;
718
+ message: string;
719
+ metadata?: unknown;
720
+ }
721
+ interface RuntimeCronFire {
722
+ action: string;
723
+ scheduledAt: number;
724
+ firedAt: number;
725
+ finishedAt?: number;
726
+ result: "running" | "ok" | "error" | "skipped";
727
+ error?: RuntimeScheduleErrorInfo;
728
+ }
623
729
  interface RuntimeQueueNextBatchOptions {
624
730
  names?: string[];
625
731
  count?: number;
@@ -680,6 +786,9 @@ type RuntimeSqlBindParam = ({
680
786
  blobValue: RuntimeBytes;
681
787
  };
682
788
  type RuntimeSqlBindParams = RuntimeSqlBindParam[] | null;
789
+ interface RuntimeActorRuntimeSocketEndpointInfo {
790
+ path: string;
791
+ }
683
792
  interface RuntimeSqlQueryResult {
684
793
  columns: string[];
685
794
  rows: unknown[][];
@@ -689,16 +798,28 @@ interface RuntimeSqlExecuteResult extends RuntimeSqlQueryResult {
689
798
  changes: number;
690
799
  lastInsertRowId?: number | null;
691
800
  }
801
+ interface RuntimeSqlBatchStatement {
802
+ sql: string;
803
+ params?: RuntimeSqlBindParams;
804
+ }
692
805
  interface RuntimeSqlRunResult {
693
806
  changes: number;
694
807
  }
808
+ /** Sample rates for the traces an actor starts, in the shape core takes. */
809
+ interface RuntimeActorTracingConfig {
810
+ sampler?: number;
811
+ /** Keyed by flattened, dot-separated action name. */
812
+ actions?: Record<string, number>;
813
+ }
695
814
  interface RuntimeActorConfig {
696
815
  name?: string;
697
816
  icon?: string;
698
817
  hasDatabase?: boolean;
699
818
  remoteSqlite?: boolean;
700
- /** @experimental This entire configuration surface is subject to change. */
819
+ sqliteDeferredCommits?: boolean;
701
820
  sqliteProfiling?: SqliteProfilingOptions;
821
+ tracing?: RuntimeActorTracingConfig;
822
+ enableActorRuntimeSocket?: boolean;
702
823
  hasState?: boolean;
703
824
  canHibernateWebsocket?: boolean;
704
825
  stateSaveIntervalMs?: number;
@@ -719,6 +840,7 @@ interface RuntimeActorConfig {
719
840
  connectionLivenessTimeoutMs?: number;
720
841
  connectionLivenessIntervalMs?: number;
721
842
  maxQueueSize?: number;
843
+ maxSchedules?: number;
722
844
  maxQueueMessageSize?: number;
723
845
  maxIncomingMessageSize?: number;
724
846
  maxOutgoingMessageSize?: number;
@@ -750,6 +872,10 @@ interface RuntimeServeConfig {
750
872
  namespace: string;
751
873
  poolName: string;
752
874
  engineBinaryPath?: string;
875
+ startServices?: boolean;
876
+ servicesBinaryPath?: string;
877
+ /** Whether config resolution selected a managed local development engine. */
878
+ engineSpawn?: boolean;
753
879
  engineHost?: string;
754
880
  enginePort?: number;
755
881
  handleInspectorHttpInRuntime?: boolean;
@@ -766,6 +892,7 @@ interface RuntimeListenerConfig {
766
892
  port: number;
767
893
  host?: string;
768
894
  publicDir?: string;
895
+ application?: RuntimeApplicationFetch;
769
896
  }
770
897
  interface RuntimeServerlessRequest {
771
898
  method: string;
@@ -773,6 +900,19 @@ interface RuntimeServerlessRequest {
773
900
  headers: Record<string, string>;
774
901
  body: RuntimeBytes;
775
902
  }
903
+ interface RuntimeApplicationRequest extends RuntimeServerlessRequest {
904
+ cancelToken?: CancellationTokenHandle;
905
+ }
906
+ interface RuntimeApplicationResponse {
907
+ status: number;
908
+ headers: Record<string, string>;
909
+ body?: RuntimeBytes;
910
+ stream?: boolean;
911
+ }
912
+ type RuntimeApplicationFetch = (request: RuntimeApplicationRequest, responseBodyStream?: RuntimeHttpResponseBodyStream) => Promise<RuntimeApplicationResponse>;
913
+ interface RuntimeApplicationListenerConfig extends RuntimeListenerConfig {
914
+ application: RuntimeApplicationFetch;
915
+ }
776
916
  interface RuntimeServerlessResponseHead {
777
917
  status: number;
778
918
  headers: Record<string, string>;
@@ -810,10 +950,13 @@ interface CoreRuntime {
810
950
  createRegistry(): RegistryHandle;
811
951
  registerActor(registry: RegistryHandle, name: string, factory: ActorFactoryHandle): void;
812
952
  serveRegistry(registry: RegistryHandle, config: RuntimeServeConfig): Promise<void>;
953
+ waitRegistryReady(registry: RegistryHandle): Promise<void>;
813
954
  shutdownRegistry(registry: RegistryHandle): Promise<void>;
955
+ shutdownTelemetry?(): Promise<void>;
814
956
  registryActorStopThresholdMs?(registry: RegistryHandle): Promise<number | undefined>;
815
957
  handleServerlessRequest(registry: RegistryHandle, req: RuntimeServerlessRequest, onStreamEvent: RuntimeServerlessStreamCallback, cancelToken: CancellationTokenHandle, config: RuntimeServeConfig): Promise<RuntimeServerlessResponseHead>;
816
958
  serveListener(registry: RegistryHandle, listener: RuntimeListenerConfig, config: RuntimeServeConfig): Promise<void>;
959
+ serveApplicationListener(registry: RegistryHandle, listener: RuntimeApplicationListenerConfig, config: RuntimeServeConfig): Promise<void>;
817
960
  registryHealth?(registry: RegistryHandle): Promise<RuntimeRegistryRouteResponse>;
818
961
  registryMetadata?(registry: RegistryHandle): Promise<RuntimeRegistryRouteResponse>;
819
962
  registryMetrics?(registry: RegistryHandle): Promise<RuntimeRegistryRouteResponse>;
@@ -821,11 +964,17 @@ interface CoreRuntime {
821
964
  createCancellationToken(): CancellationTokenHandle;
822
965
  cancellationTokenAborted(token: CancellationTokenHandle): boolean;
823
966
  cancelCancellationToken(token: CancellationTokenHandle): void;
824
- onCancellationTokenCancelled(token: CancellationTokenHandle, callback: (...args: unknown[]) => unknown): void;
967
+ /**
968
+ * Calls `callback` once when `token` is cancelled. Returns a release
969
+ * function that drops the registration without calling `callback`; call it
970
+ * once cancellation no longer matters so the native listener is freed.
971
+ */
972
+ onCancellationTokenCancelled(token: CancellationTokenHandle, callback: (...args: unknown[]) => unknown): () => void;
825
973
  actorState(ctx: ActorContextHandle): RuntimeBytes;
826
974
  actorBeginOnStateChange(ctx: ActorContextHandle): void;
827
975
  actorEndOnStateChange(ctx: ActorContextHandle): void;
828
976
  actorSetAlarm(ctx: ActorContextHandle, timestampMs?: number | undefined | null): void;
977
+ actorSetRunWakeAt(ctx: ActorContextHandle, timestampMs?: number | undefined | null): Promise<void>;
829
978
  actorRequestSave(ctx: ActorContextHandle, opts?: RuntimeRequestSaveOpts | undefined | null): void;
830
979
  actorRequestSaveAndWait(ctx: ActorContextHandle, opts?: RuntimeRequestSaveOpts | undefined | null): Promise<void>;
831
980
  actorInspectorSnapshot(ctx: ActorContextHandle): RuntimeInspectorSnapshot;
@@ -836,7 +985,33 @@ interface CoreRuntime {
836
985
  actorTakePendingHibernationChanges(ctx: ActorContextHandle): string[];
837
986
  actorDirtyHibernatableConns(ctx: ActorContextHandle): ConnHandle[];
838
987
  actorSaveState(ctx: ActorContextHandle, payload: RuntimeStateDeltaPayload): Promise<void>;
988
+ actorSaveStateAndWorkflowBatch(ctx: ActorContextHandle, writes: RuntimeWorkflowKvWrite[]): Promise<void>;
839
989
  actorId(ctx: ActorContextHandle): string;
990
+ /**
991
+ * Runs one actor callback with `ctx` as the current invocation: operations
992
+ * on retained handles for the same actor resolve to it, and its Core span
993
+ * is the active OpenTelemetry span for the duration of `run`. Only actions,
994
+ * raw requests, and queue dispatch run this way; other callbacks have no
995
+ * invocation span.
996
+ */
997
+ runWithActorInvocationContext<T>(ctx: ActorContextHandle, run: () => T): T;
998
+ /**
999
+ * Correlation of the invocation currently executing for this actor, or
1000
+ * `undefined` outside an invocation or after it finished. A sampled-out
1001
+ * invocation can still expose valid span context for propagation.
1002
+ */
1003
+ actorInvocationTraceContext(ctx: ActorContextHandle): ActorInvocationTraceContext | undefined;
1004
+ /**
1005
+ * Opens the span covering one call this actor makes to another actor. See
1006
+ * `StartCallSpan` for when this returns nothing.
1007
+ */
1008
+ startCallSpan(ctx: ActorContextHandle, actorName: string, actionName: string): RuntimeOutboundCall | undefined;
1009
+ /** Backs `ActorRun.startWorkflowSpan`. */
1010
+ startWorkflowSpan(ctx: ActorContextHandle): Promise<WorkflowSpan>;
1011
+ /** Backs `ActorRun.runOutsideWorkflowSpan`. */
1012
+ runOutsideActorInvocationContext<T>(run: () => T): T;
1013
+ /** Identity of the invocation the caller runs in, usable as a cache key. */
1014
+ currentInvocationScope(): object | undefined;
840
1015
  actorName(ctx: ActorContextHandle): string;
841
1016
  actorKey(ctx: ActorContextHandle): RuntimeActorKeySegment[];
842
1017
  actorRegion(ctx: ActorContextHandle): string;
@@ -868,22 +1043,58 @@ interface CoreRuntime {
868
1043
  actorKvBatchPut(ctx: ActorContextHandle, entries: RuntimeKvEntry[]): Promise<void>;
869
1044
  actorKvBatchDelete(ctx: ActorContextHandle, keys: RuntimeBytes[]): Promise<void>;
870
1045
  actorSqlExec(ctx: ActorContextHandle, sql: string): Promise<RuntimeSqlExecResult>;
1046
+ actorSqlExecSync(ctx: ActorContextHandle, sql: string): RuntimeSqlExecResult;
871
1047
  actorSqlExecute(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
1048
+ actorSqlExecuteSync(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): RuntimeSqlExecuteResult;
1049
+ actorSqlExecuteBatch(ctx: ActorContextHandle, statements: RuntimeSqlBatchStatement[]): Promise<RuntimeSqlExecuteResult[]>;
1050
+ actorSqlBeginTransaction(ctx: ActorContextHandle, timeoutMs?: number, name?: string): Promise<SqliteTransactionHandle>;
1051
+ actorSqlBeginTransactionSync(ctx: ActorContextHandle, timeoutMs?: number, name?: string): SqliteTransactionHandle;
1052
+ actorSqlTransactionExec(transaction: SqliteTransactionHandle, sql: string): Promise<RuntimeSqlExecResult>;
1053
+ actorSqlTransactionExecSync(transaction: SqliteTransactionHandle, sql: string): RuntimeSqlExecResult;
1054
+ actorSqlTransactionExecute(transaction: SqliteTransactionHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
1055
+ actorSqlTransactionExecuteSync(transaction: SqliteTransactionHandle, sql: string, params?: RuntimeSqlBindParams): RuntimeSqlExecuteResult;
1056
+ actorSqlTransactionCommit(transaction: SqliteTransactionHandle): Promise<void>;
1057
+ actorSqlTransactionCommitSync(transaction: SqliteTransactionHandle): void;
1058
+ actorSqlTransactionRollback(transaction: SqliteTransactionHandle): Promise<void>;
1059
+ actorSqlTransactionRollbackSync(transaction: SqliteTransactionHandle): void;
1060
+ actorBeginStateTransaction(ctx: ActorContextHandle, timeoutMs?: number): Promise<ActorStateTransactionHandle>;
1061
+ actorStateTransactionExecute(transaction: ActorStateTransactionHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlExecuteResult>;
1062
+ actorStateTransactionCommit(transaction: ActorStateTransactionHandle, payload: RuntimeStateDeltaPayload): Promise<void>;
1063
+ actorStateTransactionRollback(transaction: ActorStateTransactionHandle): Promise<void>;
872
1064
  actorSqlQuery(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlQueryResult>;
873
1065
  actorSqlRun(ctx: ActorContextHandle, sql: string, params?: RuntimeSqlBindParams): Promise<RuntimeSqlRunResult>;
874
1066
  actorSqlMetrics(ctx: ActorContextHandle): SqliteNativeMetrics | null;
875
1067
  actorSqlTakeLastKvError(ctx: ActorContextHandle): string | null;
1068
+ /** Opens the actor database so later synchronous calls never fetch its first pages. */
1069
+ actorSqlOpen(ctx: ActorContextHandle): Promise<void>;
1070
+ /** Returns the ticket of the latest local commit. */
1071
+ actorSqlCommitTicket(ctx: ActorContextHandle): number;
1072
+ /** Resolves once the commit `ticket` names and every earlier commit are durable. */
1073
+ actorSqlWhenDurable(ctx: ActorContextHandle, ticket: number): Promise<void>;
1074
+ actorSqlAbortGeneration(ctx: ActorContextHandle, reason: string): void;
876
1075
  actorSqlClose(ctx: ActorContextHandle): Promise<void>;
1076
+ actorRuntimeSocketProvision(ctx: ActorContextHandle): Promise<RuntimeActorRuntimeSocketEndpointInfo>;
877
1077
  actorQueueSend(ctx: ActorContextHandle, name: string, body: RuntimeBytes): Promise<RuntimeQueueMessage>;
878
1078
  actorQueueNextBatch(ctx: ActorContextHandle, options?: RuntimeQueueNextBatchOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage[]>;
879
1079
  actorQueueWaitForNames(ctx: ActorContextHandle, names: string[], options?: RuntimeQueueWaitOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage>;
880
1080
  actorQueueWaitForNamesAvailable(ctx: ActorContextHandle, names: string[], options?: RuntimeQueueWaitOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<void>;
1081
+ actorQueueCompletePersisted(ctx: ActorContextHandle, messageId: bigint, expectedName: string, response?: RuntimeBytes | undefined | null): Promise<boolean>;
881
1082
  actorQueueEnqueueAndWait(ctx: ActorContextHandle, name: string, body: RuntimeBytes, options?: RuntimeQueueEnqueueAndWaitOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeBytes | null>;
882
1083
  actorQueueTryNextBatch(ctx: ActorContextHandle, options?: RuntimeQueueTryNextBatchOptions | undefined | null): RuntimeQueueMessage[];
883
1084
  actorQueueMaxSize(ctx: ActorContextHandle): number;
884
1085
  actorQueueInspectMessages(ctx: ActorContextHandle): Promise<RuntimeQueueInspectMessage[]>;
885
- actorScheduleAfter(ctx: ActorContextHandle, durationMs: number, actionName: string, args: RuntimeBytes): void;
886
- actorScheduleAt(ctx: ActorContextHandle, timestampMs: number, actionName: string, args: RuntimeBytes): void;
1086
+ actorQueueReset(ctx: ActorContextHandle): Promise<void>;
1087
+ actorScheduleAfter(ctx: ActorContextHandle, durationMs: number, actionName: string, args: RuntimeBytes): Promise<string>;
1088
+ actorScheduleAt(ctx: ActorContextHandle, timestampMs: number, actionName: string, args: RuntimeBytes): Promise<string>;
1089
+ actorScheduleCancel(ctx: ActorContextHandle, id: string): Promise<boolean>;
1090
+ actorScheduleGet(ctx: ActorContextHandle, id: string): Promise<RuntimeScheduledEventInfo | undefined>;
1091
+ actorScheduleList(ctx: ActorContextHandle): Promise<RuntimeScheduledEventInfo[]>;
1092
+ actorCronSet(ctx: ActorContextHandle, name: string, expression: string, timezone: string | undefined, actionName: string, args: RuntimeBytes, maxHistory: number | undefined): Promise<void>;
1093
+ actorCronEvery(ctx: ActorContextHandle, name: string, intervalMs: number, actionName: string, args: RuntimeBytes, maxHistory: number | undefined): Promise<void>;
1094
+ actorCronGet(ctx: ActorContextHandle, name: string): Promise<RuntimeCronJobInfo | undefined>;
1095
+ actorCronList(ctx: ActorContextHandle): Promise<RuntimeCronJobInfo[]>;
1096
+ actorCronDelete(ctx: ActorContextHandle, name: string): Promise<boolean>;
1097
+ actorCronHistory(ctx: ActorContextHandle, name: string, limit: number | undefined): Promise<RuntimeCronFire[]>;
887
1098
  connId(conn: ConnHandle): string;
888
1099
  connParams(conn: ConnHandle): RuntimeBytes;
889
1100
  connState(conn: ConnHandle): RuntimeBytes;
@@ -906,6 +1117,15 @@ type FetchHandler = (request: Request, ...args: any) => Response | Promise<Respo
906
1117
  interface ServerlessHandler {
907
1118
  fetch: FetchHandler;
908
1119
  }
1120
+ interface RegistryApplication {
1121
+ fetch: FetchHandler;
1122
+ }
1123
+ interface RegistryListenOptions {
1124
+ port?: number;
1125
+ host?: string;
1126
+ publicDir?: string;
1127
+ application?: RegistryApplication;
1128
+ }
909
1129
  interface RegistryRoutes {
910
1130
  health(): Promise<Response>;
911
1131
  metadata(): Promise<Response>;
@@ -955,18 +1175,16 @@ declare class Registry<A extends RegistryActors> {
955
1175
  * @param opts.host Address to bind. Defaults to `0.0.0.0`.
956
1176
  * @param opts.publicDir If set, serves static files from this directory
957
1177
  * as a fallback below the framework routes.
1178
+ * @param opts.application If set, handles requests that do not match a
1179
+ * framework route.
958
1180
  *
959
1181
  * @example
960
1182
  * ```ts
961
1183
  * await registry.listen();
962
- * await registry.listen({ port: 8080, publicDir: "./public" });
1184
+ * await registry.listen({ application: app });
963
1185
  * ```
964
1186
  */
965
- listen(opts?: {
966
- port?: number;
967
- host?: string;
968
- publicDir?: string;
969
- }): Promise<void>;
1187
+ listen(opts?: RegistryListenOptions): Promise<void>;
970
1188
  /**
971
1189
  * Gracefully drains all live registries.
972
1190
  *
@@ -989,6 +1207,15 @@ declare class Registry<A extends RegistryActors> {
989
1207
  */
990
1208
  shutdown(): Promise<void>;
991
1209
  startEnvoy(): void;
1210
+ /**
1211
+ * Starts the serverful registry if needed and waits until its envoy has
1212
+ * registered with the Engine. Repeated and concurrent calls share one
1213
+ * startup lifecycle and readiness promise.
1214
+ *
1215
+ * Unlike {@link start}, this reports startup failures and does not resolve
1216
+ * merely because an HTTP health endpoint is listening.
1217
+ */
1218
+ startAndWait(): Promise<void>;
992
1219
  /**
993
1220
  * Starts the actor envoy for standalone server deployments.
994
1221
  *
@@ -1034,9 +1261,11 @@ type ActorActionFunction<Args extends Array<unknown> = unknown[], Response = unk
1034
1261
  type IsAny<T> = 0 extends 1 & T ? true : false;
1035
1262
  type LooseEventSubscribe = (eventName: string, callback: (...args: any[]) => void) => () => void;
1036
1263
  type ActorActionMap<R> = {
1037
- [K in keyof NonNullable<R>]: NonNullable<R>[K] extends (...args: infer Args) => infer Return ? ActorActionFunction<Args, Awaited<Return>> : never;
1264
+ [K in keyof NonNullable<R>]: NonNullable<R>[K] extends (...args: infer Args) => infer Return ? ActorActionFunction<Args, Awaited<Return>> : NonNullable<R>[K] extends Record<string, unknown> ? ActorActionMap<NonNullable<R>[K]> : never;
1038
1265
  };
1039
- type ActionsOf<AD extends AnyActorDefinition> = AD extends BaseActorDefinition<any, any, any, any, any, any, any, any, infer R> ? R : never;
1266
+ type ActionsOf<AD extends AnyActorDefinition> = AD["config"] extends {
1267
+ actions?: infer R;
1268
+ } ? R : never;
1040
1269
  interface ActorGatewayOptions {
1041
1270
  skipReadyWait?: boolean;
1042
1271
  }
@@ -1136,7 +1365,7 @@ declare class ActorConnRaw {
1136
1365
  *
1137
1366
  * @protected
1138
1367
  */
1139
- constructor(client: ClientRaw, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions);
1368
+ constructor(client: ClientRaw, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, currentActorInvocation?: CurrentActorInvocation);
1140
1369
  send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
1141
1370
  send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
1142
1371
  /**
@@ -1257,6 +1486,27 @@ declare class ActorConnRaw {
1257
1486
  */
1258
1487
  type ActorConn<AD extends AnyActorDefinition> = Omit<ActorConnRaw, "send" | "on" | "once"> & ActorDefinitionQueueSend<AD> & ActorDefinitionEventSubscriptions<AD> & ActorDefinitionActions<AD>;
1259
1488
 
1489
+ /** How many retries a client may spend, as a share of the requests it sends. */
1490
+ interface RetryBudgetOptions {
1491
+ /** Retries allowed per 100 requests (default 10). */
1492
+ percent?: number;
1493
+ /** Retries the client can bank for a burst of refusals; the budget starts full (default 100). */
1494
+ maxTokens?: number;
1495
+ }
1496
+ /**
1497
+ * Bounds the client's retries of refused requests. Each request adds a fraction of a token and
1498
+ * each retry spends one, so retries stay a fixed share of traffic while the service sheds load
1499
+ * instead of multiplying it.
1500
+ */
1501
+ declare class RetryBudget {
1502
+ #private;
1503
+ constructor(options?: RetryBudgetOptions);
1504
+ /** Credits one request sent. */
1505
+ deposit(): void;
1506
+ /** Spends one token. Returns `false` when the budget is spent. */
1507
+ tryWithdraw(): boolean;
1508
+ }
1509
+
1260
1510
  /**
1261
1511
  * Provides underlying functions for stateless {@link ActorHandle} for action calls.
1262
1512
  * Similar to ActorConnRaw but doesn't maintain a connection.
@@ -1272,7 +1522,7 @@ declare class ActorHandleRaw {
1272
1522
  *
1273
1523
  * @protected
1274
1524
  */
1275
- constructor(client: any, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions);
1525
+ 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);
1276
1526
  send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
1277
1527
  send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
1278
1528
  /**
@@ -1306,6 +1556,8 @@ declare class ActorHandleRaw {
1306
1556
  * Resolves the actor to get its unique actor ID.
1307
1557
  */
1308
1558
  resolve(): Promise<string>;
1559
+ /** Issue a token scoped to this actor. Defaults to actor gateway read access. */
1560
+ issueToken(options?: ActorIssueTokenOptions): Promise<IssuedToken>;
1309
1561
  /**
1310
1562
  * Returns the raw URL for routing traffic to the actor.
1311
1563
  */
@@ -1331,7 +1583,7 @@ declare class ActorHandleRaw {
1331
1583
  type ActorHandle<AD extends AnyActorDefinition> = Omit<ActorHandleRaw, "connect" | "send"> & {
1332
1584
  connect(params?: unknown, options?: ActorConnectOptions): ActorConn<AD>;
1333
1585
  resolve(): Promise<string>;
1334
- } & ActorDefinitionQueueSend<AD> & ActorDefinitionActions<AD>;
1586
+ } & ActorDefinitionQueueSend<AD> & Omit<ActorDefinitionActions<AD>, keyof ActorHandleRaw>;
1335
1587
 
1336
1588
  /** Extract the actor registry from the registry definition. */
1337
1589
  type ExtractActorsFromRegistry<A extends Registry<any>> = A extends Registry<infer Actors> ? Actors : never;
@@ -1431,6 +1683,11 @@ interface GetOrCreateOptions extends QueryOptions {
1431
1683
  createInRegion?: string;
1432
1684
  /** Input data to pass to the actor. */
1433
1685
  createWithInput?: unknown;
1686
+ /**
1687
+ * Name of the envoy pool to select for this actor if it is created.
1688
+ * Overrides the client's configured `poolName` for this call.
1689
+ */
1690
+ poolName?: string;
1434
1691
  }
1435
1692
  /**
1436
1693
  * Options for creating a actor.
@@ -1442,6 +1699,11 @@ interface CreateOptions extends QueryOptions {
1442
1699
  region?: string;
1443
1700
  /** Input data to pass to the actor. */
1444
1701
  input?: unknown;
1702
+ /**
1703
+ * Name of the envoy pool to select for this actor.
1704
+ * Overrides the client's configured `poolName` for this call.
1705
+ */
1706
+ poolName?: string;
1445
1707
  }
1446
1708
  /**
1447
1709
  * Represents a region to connect to.
@@ -1463,6 +1725,20 @@ interface Region {
1463
1725
  }
1464
1726
  declare const ACTOR_CONNS_SYMBOL: unique symbol;
1465
1727
  declare const CREATE_ACTOR_CONN_PROXY: unique symbol;
1728
+ /** Options for constructing a raw actor client. */
1729
+ interface ClientRawOptions {
1730
+ encoding?: Encoding;
1731
+ gateway?: ActorGatewayOptions;
1732
+ /** Bounds retries of refused requests across every handle of this client. */
1733
+ retryBudget?: RetryBudgetOptions;
1734
+ }
1735
+ /** Runtime-supplied wiring for clients created inside an actor. Set only by the native runtime. */
1736
+ interface ActorClientRuntimeOptions {
1737
+ /** Supplies the calling actor's invocation so actor-to-actor clients propagate its trace and ray ID. */
1738
+ currentActorInvocation?: CurrentActorInvocation;
1739
+ /** Opens and finishes the Core span covering an actor-to-actor call. */
1740
+ startCallSpan?: StartCallSpan;
1741
+ }
1466
1742
  /**
1467
1743
  * Client for managing & connecting to actors.
1468
1744
  *
@@ -1471,11 +1747,15 @@ declare const CREATE_ACTOR_CONN_PROXY: unique symbol;
1471
1747
  */
1472
1748
  declare class ClientRaw {
1473
1749
  #private;
1750
+ /** Issue namespace-scoped tokens with an explicit grant list. */
1751
+ readonly auth: {
1752
+ issueToken(options: IssueTokenOptions): Promise<IssuedToken>;
1753
+ };
1474
1754
  [ACTOR_CONNS_SYMBOL]: Set<ActorConnRaw>;
1475
1755
  /**
1476
1756
  * Creates an instance of Client.
1477
1757
  */
1478
- constructor(driver: EngineControlClient, encoding: Encoding | undefined, gatewayOptions?: ActorGatewayOptions);
1758
+ constructor(driver: EngineControlClient, options?: ClientRawOptions & ActorClientRuntimeOptions);
1479
1759
  /**
1480
1760
  * Gets a stateless handle to a actor by its ID.
1481
1761
  *
@@ -1531,14 +1811,34 @@ declare class ClientRaw {
1531
1811
  *
1532
1812
  * @template A The actor registry type.
1533
1813
  */
1534
- type Client<A extends Registry<any>> = ClientRaw & {
1814
+ type Client<A extends Registry<any>> = ClientRaw & Omit<{
1535
1815
  [K in keyof ExtractActorsFromRegistry<A>]: ActorAccessor<ExtractActorsFromRegistry<A>[K]>;
1536
- };
1816
+ }, keyof ClientRaw>;
1537
1817
  type AnyClient = Client<Registry<any>>;
1538
- declare function createClientWithDriver<A extends Registry<any>>(driver: EngineControlClient, config?: {
1539
- encoding?: Encoding;
1540
- gateway?: ActorGatewayOptions;
1541
- }): Client<A>;
1818
+ declare function createClientWithDriver<A extends Registry<any>>(driver: EngineControlClient, options?: ClientRawOptions & ActorClientRuntimeOptions): Client<A>;
1819
+
1820
+ /** Sample rates keyed by action name, nested like the actor's action groups. */
1821
+ interface ActionSampleRates {
1822
+ readonly [name: string]: number | ActionSampleRates;
1823
+ }
1824
+ /**
1825
+ * {@link ActionSampleRates} limited to the actions of one actor, so a rate for
1826
+ * an action that does not exist is a compile error.
1827
+ */
1828
+ type ActionTraceSamplers<TActions> = {
1829
+ readonly [K in keyof TActions]?: TActions[K] extends (...args: never[]) => unknown ? number : ActionTraceSamplers<TActions[K]>;
1830
+ };
1831
+ /** Trace sampling for one actor definition. */
1832
+ interface ActorTracingOptions<TActions> {
1833
+ /**
1834
+ * Share of this actor's invocations that are recorded, from 0 to 1. A rate
1835
+ * lowers what is recorded and never raises it, so an invocation inside a
1836
+ * trace the caller did not record is not recorded at any rate.
1837
+ */
1838
+ readonly sampler?: number;
1839
+ /** Rates that replace `sampler` for single actions. */
1840
+ readonly actions?: ActionTraceSamplers<TActions>;
1841
+ }
1542
1842
 
1543
1843
  declare const DEFAULT_SLEEP_GRACE_PERIOD = 15000;
1544
1844
  declare const ACTOR_CONTEXT_INTERNAL_SYMBOL: unique symbol;
@@ -1578,7 +1878,7 @@ type ActorKvListOptions<T extends ActorKvValueType = "text", K extends ActorKvKe
1578
1878
  };
1579
1879
  type ActorClientFor<T> = T extends Registry<any> ? Client<T> : T;
1580
1880
  /**
1581
- * @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db` / `c.sql`)
1881
+ * @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`)
1582
1882
  * or actor state instead.
1583
1883
  */
1584
1884
  interface ActorKv {
@@ -1595,10 +1895,83 @@ interface ActorKv {
1595
1895
  [key: string]: any;
1596
1896
  }
1597
1897
  interface ActorSchedule {
1598
- after(duration: number, action: string, ...args: unknown[]): Promise<void>;
1599
- at(timestamp: number, action: string, ...args: unknown[]): Promise<void>;
1898
+ after(duration: number, action: string, ...args: unknown[]): Promise<string>;
1899
+ at(timestamp: number, action: string, ...args: unknown[]): Promise<string>;
1900
+ cancel(id: string): Promise<boolean>;
1901
+ get(id: string): Promise<ScheduledEventInfo | undefined>;
1902
+ list(): Promise<ScheduledEventInfo[]>;
1903
+ [key: string]: any;
1904
+ }
1905
+ interface ActorCronSetOptions {
1906
+ name: string;
1907
+ expression: string;
1908
+ action: string;
1909
+ args?: unknown[];
1910
+ timezone?: string;
1911
+ /** Defaults to 100. Set to 0 to disable and clear history. Maximum 1,000. */
1912
+ maxHistory?: number;
1913
+ }
1914
+ interface ActorCronEveryOptions {
1915
+ name: string;
1916
+ /** Fixed interval in milliseconds. Minimum 5,000. */
1917
+ interval: number;
1918
+ action: string;
1919
+ args?: unknown[];
1920
+ /** Defaults to 100. Set to 0 to disable and clear history. Maximum 1,000. */
1921
+ maxHistory?: number;
1922
+ }
1923
+ interface ActorCron {
1924
+ set(options: ActorCronSetOptions): Promise<void>;
1925
+ every(options: ActorCronEveryOptions): Promise<void>;
1926
+ get(name: string): Promise<CronJobInfo | undefined>;
1927
+ list(): Promise<CronJobInfo[]>;
1928
+ delete(name: string): Promise<boolean>;
1929
+ history(name: string, options?: {
1930
+ limit?: number;
1931
+ }): Promise<CronFire[]>;
1600
1932
  [key: string]: any;
1601
1933
  }
1934
+ interface ScheduledEventInfo {
1935
+ id: string;
1936
+ action: string;
1937
+ args: unknown[];
1938
+ runAt: number;
1939
+ }
1940
+ type CronJobInfo = {
1941
+ name: string;
1942
+ action: string;
1943
+ args: unknown[];
1944
+ nextRunAt: number;
1945
+ lastRunAt?: number;
1946
+ maxHistory: number;
1947
+ } & ({
1948
+ kind: "cron";
1949
+ expression: string;
1950
+ timezone: string;
1951
+ } | {
1952
+ kind: "every";
1953
+ interval: number;
1954
+ });
1955
+ interface ScheduledFireInfo {
1956
+ kind: "at" | "cron" | "every";
1957
+ id: string;
1958
+ name?: string;
1959
+ scheduledAt: number;
1960
+ firedAt: number;
1961
+ }
1962
+ interface CronFire {
1963
+ action: string;
1964
+ scheduledAt: number;
1965
+ firedAt: number;
1966
+ finishedAt?: number;
1967
+ result: "running" | "ok" | "error" | "skipped";
1968
+ error?: {
1969
+ group: string;
1970
+ code: string;
1971
+ message: string;
1972
+ metadata?: unknown;
1973
+ };
1974
+ }
1602
1975
  type QueueMessageOf<Name extends string, Body> = {
1603
1976
  id: number | bigint;
1604
1977
  name: Name;
@@ -1657,6 +2030,13 @@ interface ActorQueue<TQueues extends QueueSchemaConfig = Record<never, never>> {
1657
2030
  next<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(opts?: QueueNextOptions<TName, TCompletable>): Promise<any>;
1658
2031
  nextBatch<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(opts?: QueueNextBatchOptions<TName, TCompletable>): Promise<any[]>;
1659
2032
  waitForNames<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(names: readonly TName[], opts?: QueueWaitOptions<TCompletable>): Promise<any>;
2033
+ /** @experimental */
2034
+ waitForAvailable<const TName extends QueueFilterName<TQueues>>(names?: readonly TName[], opts?: Omit<QueueWaitOptions<false>, "completable">): Promise<void>;
2035
+ /** @experimental */
2036
+ complete<const TName extends QueueFilterName<TQueues>>(message: {
2037
+ id: number | bigint;
2038
+ name: TName;
2039
+ }, ...args: QueueCompleteArgsForName<TQueues, TName>): Promise<void>;
1660
2040
  enqueueAndWait<const TName extends QueueFilterName<TQueues>>(name: TName, body: QueueMessageForName<TQueues, TName>["body"], opts?: QueueEnqueueAndWaitOptions): Promise<QueueCompletionResultForName<TQueues, TName>>;
1661
2041
  tryNext<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(opts?: QueueTryNextOptions<TName, TCompletable>): Promise<any>;
1662
2042
  tryNextBatch<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(opts?: QueueTryNextBatchOptions<TName, TCompletable>): Promise<any[]>;
@@ -1680,17 +2060,24 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
1680
2060
  state: TState;
1681
2061
  vars: TVars;
1682
2062
  /**
1683
- * @deprecated Actor KV is deprecated. Use embedded SQLite (`db` / `sql`)
2063
+ * @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`)
1684
2064
  * or actor state instead.
1685
2065
  */
1686
2066
  readonly kv: ActorKv;
1687
2067
  readonly db: InferDatabaseClient<TDatabase>;
1688
2068
  readonly schedule: ActorSchedule;
2069
+ readonly cron: ActorCron;
1689
2070
  readonly queue: ActorQueue<TQueues>;
2071
+ /** @experimental */
2072
+ readonly run: ActorRun;
1690
2073
  readonly actorId: string;
1691
2074
  readonly name: string;
1692
2075
  readonly key: string[];
1693
2076
  readonly region: string;
2077
+ /** Provisions the experimental Actor Runtime Socket for this actor generation. */
2078
+ actorRuntimeSocket(): Promise<{
2079
+ path: string;
2080
+ }>;
1694
2081
  readonly conns: Map<string, Conn<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>>;
1695
2082
  readonly log: ActorLogger;
1696
2083
  readonly abortSignal: AbortSignal;
@@ -1712,6 +2099,43 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
1712
2099
  client<T = any>(): ActorClientFor<T>;
1713
2100
  [key: string]: any;
1714
2101
  }
2102
+ /** @experimental How one run of a workflow function ended. */
2103
+ type WorkflowOutcome = "completed" | "sleeping" | "evicted" | "failed" | "cancelled";
2104
+ /** @experimental How one workflow step attempt ended. `retry` will be tried again, `failed` will not. */
2105
+ type WorkflowStepOutcome = "ok" | "retry" | "failed";
2106
+ /** @experimental One open run of a workflow function, traced as its own invocation. */
2107
+ interface WorkflowSpan {
2108
+ /** Runs `body` attributed to this run. */
2109
+ run<T>(body: () => Promise<T>): Promise<T>;
2110
+ /**
2111
+ * Called by a workflow engine before each attempt at a step. Returns
2112
+ * nothing when tracing is off.
2113
+ */
2114
+ startStep(name: string, attempt: number): WorkflowStepSpan | undefined;
2115
+ finish(outcome: WorkflowOutcome): Promise<void>;
2116
+ }
2117
+ /** @experimental One open attempt at one workflow step. */
2118
+ interface WorkflowStepSpan {
2119
+ /** Runs `body` attributed to this attempt. */
2120
+ run<T>(body: () => Promise<T>): Promise<T>;
2121
+ /** `error` is what the step callback threw. */
2122
+ finish(outcome: WorkflowStepOutcome, error?: unknown): void;
2123
+ }
2124
+ /** @experimental */
2125
+ interface ActorRun {
2126
+ /**
2127
+ * @experimental Sets or clears the durable Unix-millisecond deadline that
2128
+ * ensures this actor's run handler is active, starting it if inactive.
2129
+ */
2130
+ setWakeAt(timestamp: number | null): Promise<void>;
2131
+ /** @experimental Called by a workflow engine each time it runs the workflow function. */
2132
+ startWorkflowSpan(): Promise<WorkflowSpan>;
2133
+ /**
2134
+ * @experimental Runs `body` outside the current workflow run, so a workflow
2135
+ * engine's own history storage stays out of the trace.
2136
+ */
2137
+ runOutsideWorkflowSpan<T>(body: () => T): T;
2138
+ }
1715
2139
  type ActionContext<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> & {
1716
2140
  conn: Conn<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
1717
2141
  };
@@ -1740,11 +2164,14 @@ interface ActorTypes<TState, TConnParams, TConnState, TVars, TInput, TDatabase e
1740
2164
  database?: TDatabase;
1741
2165
  }
1742
2166
  type InspectorUnsubscribe = () => void;
2167
+ /** @experimental */
1743
2168
  interface WorkflowInspectorConfig<THistory = unknown> {
1744
2169
  getHistory: () => THistory | null;
2170
+ getState?: () => Promise<WorkflowState | null>;
1745
2171
  onHistoryUpdated?: (listener: (history: THistory) => void) => InspectorUnsubscribe;
1746
2172
  replayFromStep?: (entryId?: string) => Promise<THistory | null>;
1747
2173
  }
2174
+ /** @experimental */
1748
2175
  interface RunInspectorConfig<THistory = unknown> {
1749
2176
  workflow?: WorkflowInspectorConfig<THistory>;
1750
2177
  }
@@ -1753,12 +2180,13 @@ interface RunInspectorConfig<THistory = unknown> {
1753
2180
  * `hidden: true` entries and reject custom-tab ids that collide with
1754
2181
  * a built-in.
1755
2182
  */
1756
- declare const BUILTIN_INSPECTOR_TAB_IDS: readonly ["workflow", "database", "state", "queue", "connections", "console"];
2183
+ declare const BUILTIN_INSPECTOR_TAB_IDS: readonly ["workflow", "database", "state", "queue", "schedules", "connections", "console"];
1757
2184
  declare const BuiltinInspectorTabIdSchema: z.ZodEnum<{
1758
2185
  workflow: "workflow";
1759
2186
  state: "state";
1760
2187
  database: "database";
1761
2188
  queue: "queue";
2189
+ schedules: "schedules";
1762
2190
  connections: "connections";
1763
2191
  console: "console";
1764
2192
  }>;
@@ -1775,6 +2203,7 @@ declare const HideInspectorTabEntrySchema: z.ZodObject<{
1775
2203
  state: "state";
1776
2204
  database: "database";
1777
2205
  queue: "queue";
2206
+ schedules: "schedules";
1778
2207
  connections: "connections";
1779
2208
  console: "console";
1780
2209
  }>;
@@ -1792,6 +2221,7 @@ declare const InspectorTabEntrySchema: z.ZodUnion<readonly [z.ZodObject<{
1792
2221
  state: "state";
1793
2222
  database: "database";
1794
2223
  queue: "queue";
2224
+ schedules: "schedules";
1795
2225
  connections: "connections";
1796
2226
  console: "console";
1797
2227
  }>;
@@ -1810,6 +2240,7 @@ declare const ActorInspectorConfigSchema: z.ZodObject<{
1810
2240
  state: "state";
1811
2241
  database: "database";
1812
2242
  queue: "queue";
2243
+ schedules: "schedules";
1813
2244
  connections: "connections";
1814
2245
  console: "console";
1815
2246
  }>;
@@ -1824,6 +2255,7 @@ declare const RunConfigSchema: z.ZodObject<{
1824
2255
  inspector: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1825
2256
  workflow: z.ZodOptional<z.ZodObject<{
1826
2257
  getHistory: z.ZodCustom<() => unknown, () => unknown>;
2258
+ getState: z.ZodOptional<z.ZodCustom<() => Promise<WorkflowState | null>, () => Promise<WorkflowState | null>>>;
1827
2259
  onHistoryUpdated: z.ZodOptional<z.ZodCustom<(listener: (history: unknown) => void) => InspectorUnsubscribe, (listener: (history: unknown) => void) => InspectorUnsubscribe>>;
1828
2260
  replayFromStep: z.ZodOptional<z.ZodCustom<(entryId?: string) => Promise<unknown>, (entryId?: string) => Promise<unknown>>>;
1829
2261
  }, z.core.$strip>>;
@@ -1834,7 +2266,59 @@ type RunConfig<TState = unknown, TConnParams = unknown, TConnState = unknown, TV
1834
2266
  run: (c: RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>) => void | Promise<void>;
1835
2267
  };
1836
2268
  type AnyRunConfig = RunConfig<any, any, any, any, any, AnyDatabaseProvider, any, any>;
1837
- declare const RUN_FUNCTION_CONFIG_SYMBOL: unique symbol;
2269
+ /** @experimental */
2270
+ type RunInspectorKind = "workflow";
2271
+ /** @experimental */
2272
+ interface RunWithInactiveOptions {
2273
+ /** Restart the run handler before releasing the exclusive gate on success. */
2274
+ restartOnSuccess?: boolean;
2275
+ }
2276
+ /** @experimental */
2277
+ interface RunControl {
2278
+ run: {
2279
+ /**
2280
+ * Executes only while no run handler is active or waiting to start.
2281
+ *
2282
+ * This is a non-blocking acquisition: concurrent replay/control requests
2283
+ * fail instead of waiting behind an active run.
2284
+ */
2285
+ withInactive<T>(options: RunWithInactiveOptions, callback: () => T | Promise<T>): Promise<T>;
2286
+ };
2287
+ }
2288
+ /** @experimental */
2289
+ interface RunInspectorFactoryContext {
2290
+ actorId: string;
2291
+ control: RunControl;
2292
+ }
2293
+ /** @experimental */
2294
+ interface RunInspectorFactoryResult<THistory = unknown> {
2295
+ inspector: {
2296
+ workflow: Required<WorkflowInspectorConfig<THistory>> & {
2297
+ getState: () => Promise<WorkflowState | null>;
2298
+ };
2299
+ };
2300
+ /** Releases actor-specific listeners and encoded history. */
2301
+ dispose?: () => void;
2302
+ }
2303
+ interface RunHandlerDisplayOptions {
2304
+ name?: string;
2305
+ icon?: string;
2306
+ }
2307
+ /** @experimental */
2308
+ type DefineRunHandlerOptions<THistory = unknown> = RunHandlerDisplayOptions & ({
2309
+ inspectorKind?: never;
2310
+ createInspector?: never;
2311
+ } | {
2312
+ /** Static metadata used to install Inspector callbacks at registry build time. */
2313
+ inspectorKind: RunInspectorKind;
2314
+ /** Creates one Inspector adapter for each live actor. */
2315
+ createInspector: (context: RunInspectorFactoryContext) => RunInspectorFactoryResult<THistory>;
2316
+ });
2317
+ /**
2318
+ * @experimental Adds supported RivetKit run metadata while preserving the function's exact
2319
+ * callable type.
2320
+ */
2321
+ declare function defineRunHandler<TRun extends (...args: any[]) => any, THistory = unknown>(run: TRun, options: DefineRunHandlerOptions<THistory>): TRun;
1838
2322
  /** Extract the run function from either a function or RunConfig object. */
1839
2323
  declare function getRunFunction(run: ((...args: any[]) => any) | AnyRunConfig | undefined): ((...args: any[]) => any) | undefined;
1840
2324
  /** Extract run metadata (name/icon) from RunConfig if provided. */
@@ -1849,6 +2333,7 @@ declare function disposeRunInspector(run: ((...args: any[]) => any) | AnyRunConf
1849
2333
  declare const GlobalActorOptionsSchema: z.ZodPrefault<z.ZodObject<{
1850
2334
  name: z.ZodOptional<z.ZodString>;
1851
2335
  icon: z.ZodOptional<z.ZodString>;
2336
+ enableActorRuntimeSocket: z.ZodDefault<z.ZodBoolean>;
1852
2337
  canHibernateWebSocket: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
1853
2338
  }, z.core.$strict>>;
1854
2339
  type GlobalActorOptions = z.infer<typeof GlobalActorOptionsSchema>;
@@ -1869,6 +2354,7 @@ declare const InstanceActorOptionsSchema: z.ZodPrefault<z.ZodObject<{
1869
2354
  noSleep: z.ZodDefault<z.ZodBoolean>;
1870
2355
  sleepTimeout: z.ZodDefault<z.ZodNumber>;
1871
2356
  maxQueueSize: z.ZodDefault<z.ZodNumber>;
2357
+ maxSchedules: z.ZodDefault<z.ZodNumber>;
1872
2358
  maxQueueMessageSize: z.ZodDefault<z.ZodNumber>;
1873
2359
  preloadMaxWorkflowBytes: z.ZodOptional<z.ZodNumber>;
1874
2360
  preloadMaxConnectionsBytes: z.ZodOptional<z.ZodNumber>;
@@ -1878,6 +2364,7 @@ type InstanceActorOptionsInput = z.input<typeof InstanceActorOptionsSchema>;
1878
2364
  declare const ActorOptionsSchema: z.ZodPrefault<z.ZodObject<{
1879
2365
  name: z.ZodOptional<z.ZodString>;
1880
2366
  icon: z.ZodOptional<z.ZodString>;
2367
+ enableActorRuntimeSocket: z.ZodDefault<z.ZodBoolean>;
1881
2368
  canHibernateWebSocket: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
1882
2369
  createVarsTimeout: z.ZodDefault<z.ZodNumber>;
1883
2370
  createConnStateTimeout: z.ZodDefault<z.ZodNumber>;
@@ -1894,6 +2381,7 @@ declare const ActorOptionsSchema: z.ZodPrefault<z.ZodObject<{
1894
2381
  noSleep: z.ZodDefault<z.ZodBoolean>;
1895
2382
  sleepTimeout: z.ZodDefault<z.ZodNumber>;
1896
2383
  maxQueueSize: z.ZodDefault<z.ZodNumber>;
2384
+ maxSchedules: z.ZodDefault<z.ZodNumber>;
1897
2385
  maxQueueMessageSize: z.ZodDefault<z.ZodNumber>;
1898
2386
  preloadMaxWorkflowBytes: z.ZodOptional<z.ZodNumber>;
1899
2387
  preloadMaxConnectionsBytes: z.ZodOptional<z.ZodNumber>;
@@ -1913,6 +2401,7 @@ declare const ActorConfigSchema: z.ZodObject<{
1913
2401
  inspector: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1914
2402
  workflow: z.ZodOptional<z.ZodObject<{
1915
2403
  getHistory: z.ZodCustom<() => unknown, () => unknown>;
2404
+ getState: z.ZodOptional<z.ZodCustom<() => Promise<WorkflowState | null>, () => Promise<WorkflowState | null>>>;
1916
2405
  onHistoryUpdated: z.ZodOptional<z.ZodCustom<(listener: (history: unknown) => void) => InspectorUnsubscribe, (listener: (history: unknown) => void) => InspectorUnsubscribe>>;
1917
2406
  replayFromStep: z.ZodOptional<z.ZodCustom<(entryId?: string) => Promise<unknown>, (entryId?: string) => Promise<unknown>>>;
1918
2407
  }, z.core.$strip>>;
@@ -1925,8 +2414,12 @@ declare const ActorConfigSchema: z.ZodObject<{
1925
2414
  onBeforeActionResponse: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
1926
2415
  onRequest: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
1927
2416
  onWebSocket: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
1928
- actions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>>;
2417
+ actions: z.ZodDefault<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
1929
2418
  actionInputSchemas: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2419
+ tracing: z.ZodOptional<z.ZodObject<{
2420
+ sampler: z.ZodOptional<z.ZodNumber>;
2421
+ actions: z.ZodOptional<z.ZodType<ActionSampleRates, unknown, z.core.$ZodTypeInternals<ActionSampleRates, unknown>>>;
2422
+ }, z.core.$strict>>;
1930
2423
  connParamsSchema: z.ZodOptional<z.ZodAny>;
1931
2424
  events: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1932
2425
  queues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
@@ -1940,6 +2433,7 @@ declare const ActorConfigSchema: z.ZodObject<{
1940
2433
  options: z.ZodPrefault<z.ZodObject<{
1941
2434
  name: z.ZodOptional<z.ZodString>;
1942
2435
  icon: z.ZodOptional<z.ZodString>;
2436
+ enableActorRuntimeSocket: z.ZodDefault<z.ZodBoolean>;
1943
2437
  canHibernateWebSocket: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
1944
2438
  createVarsTimeout: z.ZodDefault<z.ZodNumber>;
1945
2439
  createConnStateTimeout: z.ZodDefault<z.ZodNumber>;
@@ -1956,6 +2450,7 @@ declare const ActorConfigSchema: z.ZodObject<{
1956
2450
  noSleep: z.ZodDefault<z.ZodBoolean>;
1957
2451
  sleepTimeout: z.ZodDefault<z.ZodNumber>;
1958
2452
  maxQueueSize: z.ZodDefault<z.ZodNumber>;
2453
+ maxSchedules: z.ZodDefault<z.ZodNumber>;
1959
2454
  maxQueueMessageSize: z.ZodDefault<z.ZodNumber>;
1960
2455
  preloadMaxWorkflowBytes: z.ZodOptional<z.ZodNumber>;
1961
2456
  preloadMaxConnectionsBytes: z.ZodOptional<z.ZodNumber>;
@@ -1973,6 +2468,7 @@ declare const ActorConfigSchema: z.ZodObject<{
1973
2468
  state: "state";
1974
2469
  database: "database";
1975
2470
  queue: "queue";
2471
+ schedules: "schedules";
1976
2472
  connections: "connections";
1977
2473
  console: "console";
1978
2474
  }>;
@@ -2005,7 +2501,10 @@ type CreateVars<TState, _TConnParams, _TConnState, TVars, TInput, TDatabase exte
2005
2501
  createVars: (c: CreateVarsContext<TState, TInput, TDatabase, TEvents, TQueues>, driverCtx: any) => TVars | Promise<TVars>;
2006
2502
  } | Record<never, never>;
2007
2503
  interface Actions<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> {
2008
- [Action: string]: (c: ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, ...args: any[]) => any;
2504
+ [Action: string]: ((c: ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, ...args: any[]) => any) | Actions<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
2505
+ }
2506
+ interface ActionInputSchemas {
2507
+ [Action: string]: PrimitiveSchema | ActionInputSchemas;
2009
2508
  }
2010
2509
  /**
2011
2510
  * @experimental
@@ -2161,9 +2660,15 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
2161
2660
  onWebSocket?: (c: WebSocketContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, websocket: UniversalWebSocket) => void | Promise<void>;
2162
2661
  actions?: TActions;
2163
2662
  /**
2164
- * Optional schema map for validating action argument tuples in native runtimes.
2663
+ * Optional schemas for validating action argument tuples in native runtimes.
2664
+ * May mirror nested action groups or use dot-separated low-level action names.
2665
+ */
2666
+ actionInputSchemas?: ActionInputSchemas;
2667
+ /**
2668
+ * How much of this actor's work is recorded in traces. Defaults to the
2669
+ * process sampler from `OTEL_TRACES_SAMPLER`.
2165
2670
  */
2166
- actionInputSchemas?: Record<string, PrimitiveSchema>;
2671
+ tracing?: ActorTracingOptions<TActions>;
2167
2672
  /**
2168
2673
  * Optional schema for validating connection params in native runtimes.
2169
2674
  */
@@ -2186,11 +2691,12 @@ type ActorDatabaseConfig<TDatabase extends AnyDatabaseProvider> = {
2186
2691
  type ActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>, TActions extends Actions<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> = Actions<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>> = Omit<z.infer<typeof ActorConfigSchema>, "actions" | "events" | "queues" | "onCreate" | "onDestroy" | "onMigrate" | "onWake" | "onSleep" | "run" | "onStateChange" | "onBeforeConnect" | "onConnect" | "onDisconnect" | "onBeforeActionResponse" | "onRequest" | "onWebSocket" | "state" | "createState" | "connState" | "createConnState" | "vars" | "createVars" | "db"> & BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues, TActions> & CreateState<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & CreateConnState<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & CreateVars<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & ActorDatabaseConfig<TDatabase>;
2187
2692
  type ActorConfigInput<TState = undefined, TConnParams = undefined, TConnState = undefined, TVars = undefined, TInput = undefined, TDatabase extends AnyDatabaseProvider = undefined, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>, TActions extends Actions<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> = Record<never, never>> = {
2188
2693
  types?: ActorTypes<TState, TConnParams, TConnState, TVars, TInput, TDatabase>;
2189
- } & Omit<z.input<typeof ActorConfigSchema>, "actions" | "events" | "queues" | "onCreate" | "onDestroy" | "onMigrate" | "onWake" | "onSleep" | "run" | "onStateChange" | "onBeforeConnect" | "onConnect" | "onDisconnect" | "onBeforeActionResponse" | "onRequest" | "onWebSocket" | "state" | "createState" | "connState" | "createConnState" | "vars" | "createVars" | "db"> & BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues, TActions> & CreateState<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & CreateConnState<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & CreateVars<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & ActorDatabaseConfig<TDatabase>;
2694
+ } & Omit<z.input<typeof ActorConfigSchema>, "actions" | "tracing" | "events" | "queues" | "onCreate" | "onDestroy" | "onMigrate" | "onWake" | "onSleep" | "run" | "onStateChange" | "onBeforeConnect" | "onConnect" | "onDisconnect" | "onBeforeActionResponse" | "onRequest" | "onWebSocket" | "state" | "createState" | "connState" | "createConnState" | "vars" | "createVars" | "db"> & BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues, TActions> & CreateState<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & CreateConnState<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & CreateVars<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues> & ActorDatabaseConfig<TDatabase>;
2190
2695
  declare function test<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig, TActions extends Actions<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>>(input: ActorConfigInput<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues, TActions>): ActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
2191
2696
  declare const DocActorOptionsSchema: z.ZodObject<{
2192
2697
  name: z.ZodOptional<z.ZodString>;
2193
2698
  icon: z.ZodOptional<z.ZodString>;
2699
+ enableActorRuntimeSocket: z.ZodOptional<z.ZodBoolean>;
2194
2700
  createVarsTimeout: z.ZodOptional<z.ZodNumber>;
2195
2701
  createConnStateTimeout: z.ZodOptional<z.ZodNumber>;
2196
2702
  onMigrateTimeout: z.ZodOptional<z.ZodNumber>;
@@ -2206,10 +2712,9 @@ declare const DocActorOptionsSchema: z.ZodObject<{
2206
2712
  noSleep: z.ZodOptional<z.ZodBoolean>;
2207
2713
  sleepTimeout: z.ZodOptional<z.ZodNumber>;
2208
2714
  maxQueueSize: z.ZodOptional<z.ZodNumber>;
2715
+ maxSchedules: z.ZodOptional<z.ZodNumber>;
2209
2716
  maxQueueMessageSize: z.ZodOptional<z.ZodNumber>;
2210
2717
  canHibernateWebSocket: z.ZodOptional<z.ZodBoolean>;
2211
- preloadMaxWorkflowBytes: z.ZodOptional<z.ZodNumber>;
2212
- preloadMaxConnectionsBytes: z.ZodOptional<z.ZodNumber>;
2213
2718
  }, z.core.$strip>;
2214
2719
  declare const DocActorConfigSchema: z.ZodObject<{
2215
2720
  state: z.ZodOptional<z.ZodUnknown>;
@@ -2234,12 +2739,14 @@ declare const DocActorConfigSchema: z.ZodObject<{
2234
2739
  onWebSocket: z.ZodOptional<z.ZodUnknown>;
2235
2740
  actions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2236
2741
  actionInputSchemas: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2742
+ tracing: z.ZodOptional<z.ZodUnknown>;
2237
2743
  connParamsSchema: z.ZodOptional<z.ZodUnknown>;
2238
2744
  events: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2239
2745
  queues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2240
2746
  options: z.ZodOptional<z.ZodObject<{
2241
2747
  name: z.ZodOptional<z.ZodString>;
2242
2748
  icon: z.ZodOptional<z.ZodString>;
2749
+ enableActorRuntimeSocket: z.ZodOptional<z.ZodBoolean>;
2243
2750
  createVarsTimeout: z.ZodOptional<z.ZodNumber>;
2244
2751
  createConnStateTimeout: z.ZodOptional<z.ZodNumber>;
2245
2752
  onMigrateTimeout: z.ZodOptional<z.ZodNumber>;
@@ -2255,11 +2762,10 @@ declare const DocActorConfigSchema: z.ZodObject<{
2255
2762
  noSleep: z.ZodOptional<z.ZodBoolean>;
2256
2763
  sleepTimeout: z.ZodOptional<z.ZodNumber>;
2257
2764
  maxQueueSize: z.ZodOptional<z.ZodNumber>;
2765
+ maxSchedules: z.ZodOptional<z.ZodNumber>;
2258
2766
  maxQueueMessageSize: z.ZodOptional<z.ZodNumber>;
2259
2767
  canHibernateWebSocket: z.ZodOptional<z.ZodBoolean>;
2260
- preloadMaxWorkflowBytes: z.ZodOptional<z.ZodNumber>;
2261
- preloadMaxConnectionsBytes: z.ZodOptional<z.ZodNumber>;
2262
2768
  }, z.core.$strip>>;
2263
2769
  }, z.core.$strip>;
2264
2770
 
2265
- export { type Conn as $, type AnyActorDefinition as A, type BaseActorDefinition as B, type ConnectContext as C, type DestroyContext as D, type EventSchemaConfig as E, type ActorQuery as F, type ActorQueue as G, type ActorSchedule as H, type ActorTypes as I, ActorsSchema as J, type AnyActorInstance as K, type AnyClient as L, type MigrateContext as M, type AnyConn as N, type AnyStaticActorDefinition as O, type AnyStaticActorInstance as P, type QueueSchemaConfig as Q, type RequestContext as R, type SleepContext as S, type AuthIntent as T, BUILTIN_INSPECTOR_TAB_IDS as U, type BaseActorInstance as V, type WakeContext as W, BuiltinInspectorTabIdSchema as X, CONN_DRIVER_SYMBOL as Y, CONN_STATE_MANAGER_SYMBOL as Z, type Client as _, type ActionContext as a, getRunFunction as a$, CustomInspectorTabEntrySchema as a0, DEFAULT_SLEEP_GRACE_PERIOD as a1, DocActorConfigSchema as a2, DocActorOptionsSchema as a3, DocConfigurePoolSchema as a4, DocEnvoyConfigSchema as a5, DocRegistryConfigSchema as a6, DocServerlessConfigSchema as a7, DocSqliteConfigSchema as a8, type Encoding as a9, type RegistryConfigInput as aA, RegistryConfigSchema as aB, type RegistryDeps as aC, type RegistryRoutes as aD, type RunConfig as aE, RunConfigSchema as aF, type RunInspectorConfig as aG, type RuntimeKind as aH, RuntimeKindSchema as aI, type ServerlessHandler as aJ, type SqliteBackend as aK, SqliteBackendSchema as aL, type SqliteConfig as aM, SqliteConfigSchema as aN, type TestConfig as aO, TestConfigSchema as aP, type Type as aQ, type WasmRuntimeBindings as aR, type WasmRuntimeConfig as aS, WasmRuntimeConfigSchema as aT, type WasmRuntimeInitInput as aU, type WorkflowInspectorConfig as aV, actor as aW, buildActorNames as aX, createClientWithDriver as aY, disposeRunInspector as aZ, event as a_, type FetchHandler as aa, type GlobalActorOptions as ab, type GlobalActorOptionsInput as ac, GlobalActorOptionsSchema as ad, HideInspectorTabEntrySchema as ae, InspectorTabEntrySchema as af, type InspectorUnsubscribe as ag, type InstanceActorOptions as ah, type InstanceActorOptionsInput as ai, InstanceActorOptionsSchema as aj, type QueueEnqueueAndWaitOptions as ak, type QueueFilterName as al, type QueueIterOptions as am, type QueueMessageOf as an, type QueueName as ao, type QueueNextBatchOptions as ap, type QueueNextOptions as aq, type QueueResultMessageForName as ar, type QueueTryNextBatchOptions as as, type QueueTryNextOptions as at, type QueueWaitOptions as au, RAW_STATE_SYMBOL as av, RUN_FUNCTION_CONFIG_SYMBOL as aw, Registry as ax, type RegistryActors as ay, type RegistryConfig as az, type BeforeActionResponseContext as b, getRunInspectorConfig as b0, getRunMetadata as b1, isStaticActorDefinition as b2, isStaticActorInstance as b3, lookupInRegistry as b4, queue as b5, setup as b6, test as b7, type ActorAccessor as b8, type ActorActionFunction as b9, type ActorActionOptions as ba, type ActorConn as bb, ActorConnRaw as bc, type ActorConnStatus as bd, type ActorConnectOptions as be, type ActorGatewayOptions as bf, type ActorHandle as bg, ActorHandleRaw as bh, ClientRaw as bi, type ConnectionStateCallback as bj, type CreateOptions as bk, type CreateRequest as bl, type EventUnsubscribe as bm, type ExtractActorsFromRegistry as bn, type ExtractRegistryFromClient as bo, type GetOptions as bp, type GetWithIdOptions as bq, type QueryOptions as br, type Region as bs, type StatusChangeCallback as bt, type InferEventArgs as bu, type InferSchemaMap as bv, type BeforeConnectContext as c, type CreateConnStateContext as d, type CreateContext as e, type CreateVarsContext as f, type DisconnectContext as g, type RunContext as h, type StateChangeContext as i, type WebSocketContext as j, ACTOR_CONTEXT_INTERNAL_SYMBOL as k, type Actions as l, type ActorConfig as m, type ActorConfigInput as n, ActorConfigSchema as o, type ActorContext as p, type ActorContextOf as q, ActorDefinition as r, type ActorInspectorConfig as s, ActorInspectorConfigSchema as t, type ActorKey as u, type ActorKv as v, type ActorLogger as w, type ActorOptions as x, type ActorOptionsInput as y, ActorOptionsSchema as z };
2771
+ export { type AnyStaticActorInstance as $, type AnyActorDefinition as A, type BaseActorDefinition as B, type ConnectContext as C, type DestroyContext as D, type EventSchemaConfig as E, type ActorKey as F, type ActorKv as G, type ActorLogger as H, type ActorOptions as I, type ActorOptionsInput as J, ActorOptionsSchema as K, type ActorQuery as L, type MigrateContext as M, type ActorQueue as N, type ActorRun as O, type ActorSchedule as P, type QueueSchemaConfig as Q, type RequestContext as R, type SleepContext as S, type ActorTracingOptions as T, type ActorTypes as U, ActorsSchema as V, type WakeContext as W, type AnyActorInstance as X, type AnyClient as Y, type AnyConn as Z, type AnyStaticActorDefinition as _, type ActionContext as a, type ScheduledEventInfo as a$, type AuthIntent as a0, BUILTIN_INSPECTOR_TAB_IDS as a1, type BaseActorInstance as a2, BuiltinInspectorTabIdSchema as a3, CONN_DRIVER_SYMBOL as a4, CONN_STATE_MANAGER_SYMBOL as a5, type Client as a6, type Conn as a7, type CronFire as a8, type CronJobInfo as a9, type QueueName as aA, type QueueNextBatchOptions as aB, type QueueNextOptions as aC, type QueueResultMessageForName as aD, type QueueTryNextBatchOptions as aE, type QueueTryNextOptions as aF, type QueueWaitOptions as aG, RAW_STATE_SYMBOL as aH, Registry as aI, type RegistryActors as aJ, type RegistryApplication as aK, type RegistryConfig as aL, type RegistryConfigInput as aM, RegistryConfigSchema as aN, type RegistryDeps as aO, type RegistryListenOptions as aP, type RegistryRoutes as aQ, type RunConfig as aR, RunConfigSchema as aS, type RunControl as aT, type RunInspectorConfig as aU, type RunInspectorFactoryContext as aV, type RunInspectorFactoryResult as aW, type RunInspectorKind as aX, type RunWithInactiveOptions as aY, type RuntimeKind as aZ, RuntimeKindSchema as a_, CustomInspectorTabEntrySchema as aa, DEFAULT_SLEEP_GRACE_PERIOD as ab, type DefineRunHandlerOptions as ac, DocActorConfigSchema as ad, DocActorOptionsSchema as ae, DocConfigurePoolSchema as af, DocEnvoyConfigSchema as ag, DocRegistryConfigSchema as ah, DocServerlessConfigSchema as ai, DocSqliteConfigSchema as aj, type FetchHandler as ak, type GlobalActorOptions as al, type GlobalActorOptionsInput as am, GlobalActorOptionsSchema as an, HideInspectorTabEntrySchema as ao, type InferEventArgs as ap, type InferSchemaMap as aq, InspectorTabEntrySchema as ar, type InspectorUnsubscribe as as, type InstanceActorOptions as at, type InstanceActorOptionsInput as au, InstanceActorOptionsSchema as av, type QueueEnqueueAndWaitOptions as aw, type QueueFilterName as ax, type QueueIterOptions as ay, type QueueMessageOf as az, type BeforeActionResponseContext as b, type ScheduledFireInfo as b0, type ServerlessHandler as b1, type SqliteBackend as b2, SqliteBackendSchema as b3, type SqliteConfig as b4, SqliteConfigSchema as b5, type TestConfig as b6, TestConfigSchema as b7, type Type as b8, type WasmRuntimeBindings as b9, type ActorConn as bA, ActorConnRaw as bB, type ActorConnStatus as bC, type ActorConnectOptions as bD, type ActorGatewayOptions as bE, type ActorHandle as bF, ActorHandleRaw as bG, type ActorIssueTokenOptions as bH, type ActorTokenPermissions as bI, type ActorTokenResource as bJ, ClientRaw as bK, type ConnectionStateCallback as bL, type CreateOptions as bM, type CreateRequest as bN, type EventUnsubscribe as bO, type ExtractActorsFromRegistry as bP, type ExtractRegistryFromClient as bQ, type GetOptions as bR, type GetWithIdOptions as bS, type IssueTokenOptions as bT, type IssuedToken as bU, type QueryOptions as bV, type Region as bW, type StatusChangeCallback as bX, type TokenGrant as bY, type WasmRuntimeConfig as ba, WasmRuntimeConfigSchema as bb, type WasmRuntimeInitInput as bc, type WorkflowInspectorConfig as bd, type WorkflowOutcome as be, type WorkflowSpan as bf, type WorkflowStepOutcome as bg, type WorkflowStepSpan as bh, actor as bi, buildActorNames as bj, createClientWithDriver as bk, defineRunHandler as bl, disposeRunInspector as bm, event as bn, getRunFunction as bo, getRunInspectorConfig as bp, getRunMetadata as bq, isStaticActorDefinition as br, isStaticActorInstance as bs, lookupInRegistry as bt, queue as bu, setup as bv, test as bw, type ActorAccessor as bx, type ActorActionFunction as by, type ActorActionOptions as bz, type BeforeConnectContext as c, type CreateConnStateContext as d, type CreateContext as e, type CreateVarsContext as f, type DisconnectContext as g, type RunContext as h, type StateChangeContext as i, type WebSocketContext as j, ACTOR_CONTEXT_INTERNAL_SYMBOL as k, type ActionInputSchemas as l, type ActionSampleRates as m, type ActionTraceSamplers as n, type Actions as o, type ActorConfig as p, type ActorConfigInput as q, ActorConfigSchema as r, type ActorContext as s, type ActorContextOf as t, type ActorCron as u, type ActorCronEveryOptions as v, type ActorCronSetOptions as w, ActorDefinition as x, type ActorInspectorConfig as y, ActorInspectorConfigSchema as z };