rivetkit 0.0.0-sqlite-profiling-compat.87d61c0 → 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-E4LNLI3W.cjs → chunk-2MOLY6AM.cjs} +444 -29
  19. package/dist/tsup/chunk-2MOLY6AM.cjs.map +1 -0
  20. package/dist/tsup/{chunk-OAUFXOG7.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-EFU4JW3T.js → chunk-BRH4PQS5.js} +436 -21
  30. package/dist/tsup/chunk-BRH4PQS5.js.map +1 -0
  31. package/dist/tsup/{chunk-GM45LG7L.cjs → chunk-BTSDFFDC.cjs} +18 -11
  32. package/dist/tsup/chunk-BTSDFFDC.cjs.map +1 -0
  33. package/dist/tsup/{chunk-B3GLD4IN.js → chunk-D5WUPE47.js} +50 -3
  34. package/dist/tsup/chunk-D5WUPE47.js.map +1 -0
  35. package/dist/tsup/{chunk-O3ZUMAN7.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-D363DMNH.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-BWERJMV6.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-DTRDGPHU.cjs → chunk-TM76Z7XT.cjs} +7 -7
  54. package/dist/tsup/chunk-TM76Z7XT.cjs.map +1 -0
  55. package/dist/tsup/{chunk-3GVMLSND.js → chunk-TRUHDXOU.js} +1023 -354
  56. package/dist/tsup/chunk-TRUHDXOU.js.map +1 -0
  57. package/dist/tsup/{chunk-PT7AC5PC.js → chunk-TSQTI6H6.js} +16 -9
  58. package/dist/tsup/chunk-TSQTI6H6.js.map +1 -0
  59. package/dist/tsup/{chunk-FNAXD5BQ.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.cts → config-BfG1qpYz.d.cts} +80 -14
  80. package/dist/tsup/{config-B0LNDrLY.d.ts → 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-D4WDwf9m.d.cts → context-Cvnf3BRe.d.cts} +3 -2
  83. package/dist/tsup/{context-oc9zhA3x.d.ts → 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-3GVMLSND.js.map +0 -1
  230. package/dist/tsup/chunk-3MHDOUD7.cjs.map +0 -1
  231. package/dist/tsup/chunk-4FC7TVS6.cjs.map +0 -1
  232. package/dist/tsup/chunk-B3GLD4IN.js.map +0 -1
  233. package/dist/tsup/chunk-BWERJMV6.cjs.map +0 -1
  234. package/dist/tsup/chunk-D363DMNH.cjs.map +0 -1
  235. package/dist/tsup/chunk-DTRDGPHU.cjs.map +0 -1
  236. package/dist/tsup/chunk-E4LNLI3W.cjs.map +0 -1
  237. package/dist/tsup/chunk-EFU4JW3T.js.map +0 -1
  238. package/dist/tsup/chunk-FNAXD5BQ.cjs.map +0 -1
  239. package/dist/tsup/chunk-GM45LG7L.cjs.map +0 -1
  240. package/dist/tsup/chunk-HXUEHHJF.js.map +0 -1
  241. package/dist/tsup/chunk-JZ7TWV65.js.map +0 -1
  242. package/dist/tsup/chunk-O3ZUMAN7.js.map +0 -1
  243. package/dist/tsup/chunk-P6F5MEWX.cjs +0 -382
  244. package/dist/tsup/chunk-P6F5MEWX.cjs.map +0 -1
  245. package/dist/tsup/chunk-PT7AC5PC.js.map +0 -1
  246. package/dist/tsup/chunk-UV7INX3N.js +0 -382
  247. package/dist/tsup/chunk-UV7INX3N.js.map +0 -1
  248. package/dist/tsup/chunk-VE2X4KMG.cjs.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-OAUFXOG7.js.map → chunk-3DONDAMG.js.map} +0 -0
@@ -3,22 +3,25 @@ import * as v1 from "@/common/bare/generated/inspector/v1";
3
3
  import * as v2 from "@/common/bare/generated/inspector/v2";
4
4
  import * as v3 from "@/common/bare/generated/inspector/v3";
5
5
  import * as v4 from "@/common/bare/generated/inspector/v4";
6
+ import * as v5 from "@/common/bare/generated/inspector/v5";
7
+ import * as v6 from "@/common/bare/generated/inspector/v6";
6
8
  import {
7
9
  decodeWorkflowHistoryTransport,
8
10
  encodeWorkflowHistoryTransport,
9
11
  } from "@/common/inspector-transport";
10
12
 
11
- export * from "@/common/bare/generated/inspector/v4";
13
+ export * from "@/common/bare/generated/inspector/v6";
12
14
  export { decodeWorkflowHistoryTransport, encodeWorkflowHistoryTransport };
13
15
  export type { WorkflowHistory as TransportWorkflowHistory } from "@/common/bare/transport/v1";
14
16
 
15
- export const CURRENT_VERSION = 4;
17
+ export const CURRENT_VERSION = 6;
16
18
 
17
19
  const EVENTS_DROPPED_ERROR = "inspector.events_dropped";
18
20
  const WORKFLOW_HISTORY_DROPPED_ERROR = "inspector.workflow_history_dropped";
19
21
  const QUEUE_DROPPED_ERROR = "inspector.queue_dropped";
20
22
  const TRACE_DROPPED_ERROR = "inspector.trace_dropped";
21
23
  const DATABASE_DROPPED_ERROR = "inspector.database_dropped";
24
+ const SCHEDULES_DROPPED_ERROR = "inspector.schedules_dropped";
22
25
 
23
26
  const v1ToClientToV2 = (v1Data: v1.ToClient): v2.ToClient => {
24
27
  if (v1Data.body.tag === "Init") {
@@ -156,6 +159,89 @@ const v4ToClientToV3 = (v4Data: v4.ToClient): v3.ToClient => {
156
159
  return v4Data as unknown as v3.ToClient;
157
160
  };
158
161
 
162
+ const v4ToClientToV5 = (v4Data: v4.ToClient): v5.ToClient => {
163
+ if (v4Data.body.tag === "Init") {
164
+ // A v4 runtime predates tab config in Init; default to an empty list.
165
+ // The client reads that as "no custom tabs" (built-in tabs only).
166
+ const init = v4Data.body.val;
167
+ return {
168
+ body: {
169
+ tag: "Init",
170
+ val: { ...init, tabConfig: [] },
171
+ },
172
+ };
173
+ }
174
+
175
+ return v4Data as unknown as v5.ToClient;
176
+ };
177
+
178
+ const v5ToClientToV4 = (v5Data: v5.ToClient): v4.ToClient => {
179
+ if (v5Data.body.tag === "Init") {
180
+ const { tabConfig: _tabConfig, ...rest } = v5Data.body.val;
181
+ return {
182
+ body: {
183
+ tag: "Init",
184
+ val: rest,
185
+ },
186
+ };
187
+ }
188
+
189
+ return v5Data as unknown as v4.ToClient;
190
+ };
191
+
192
+ const v5ToClientToV6 = (v5Data: v5.ToClient): v6.ToClient => {
193
+ if (v5Data.body.tag === "Init") {
194
+ return {
195
+ body: {
196
+ tag: "Init",
197
+ val: { ...v5Data.body.val, schedules: [] },
198
+ },
199
+ };
200
+ }
201
+ return v5Data as unknown as v6.ToClient;
202
+ };
203
+
204
+ const v6ToClientToV5 = (v6Data: v6.ToClient): v5.ToClient => {
205
+ if (v6Data.body.tag === "Init") {
206
+ const { schedules: _schedules, ...rest } = v6Data.body.val;
207
+ return { body: { tag: "Init", val: rest } };
208
+ }
209
+ if (
210
+ v6Data.body.tag === "SchedulesUpdated" ||
211
+ v6Data.body.tag === "SchedulesResponse" ||
212
+ v6Data.body.tag === "ScheduleHistoryResponse" ||
213
+ v6Data.body.tag === "ScheduleDeleteResponse"
214
+ ) {
215
+ return {
216
+ body: {
217
+ tag: "Error",
218
+ val: { message: SCHEDULES_DROPPED_ERROR },
219
+ },
220
+ };
221
+ }
222
+ return v6Data as unknown as v5.ToClient;
223
+ };
224
+
225
+ const v4ToServerToV5 = (v4Data: v4.ToServer): v5.ToServer =>
226
+ v4Data as unknown as v5.ToServer;
227
+
228
+ const v5ToServerToV4 = (v5Data: v5.ToServer): v4.ToServer =>
229
+ v5Data as unknown as v4.ToServer;
230
+
231
+ const v5ToServerToV6 = (v5Data: v5.ToServer): v6.ToServer =>
232
+ v5Data as unknown as v6.ToServer;
233
+
234
+ const v6ToServerToV5 = (v6Data: v6.ToServer): v5.ToServer => {
235
+ if (
236
+ v6Data.body.tag === "SchedulesRequest" ||
237
+ v6Data.body.tag === "ScheduleHistoryRequest" ||
238
+ v6Data.body.tag === "ScheduleDeleteRequest"
239
+ ) {
240
+ throw new Error("Cannot convert v6-only schedule requests to v5");
241
+ }
242
+ return v6Data as unknown as v5.ToServer;
243
+ };
244
+
159
245
  const v1ToServerToV2 = (v1Data: v1.ToServer): v2.ToServer => {
160
246
  if (
161
247
  v1Data.body.tag === "EventsRequest" ||
@@ -206,7 +292,7 @@ const v4ToServerToV3 = (v4Data: v4.ToServer): v3.ToServer => {
206
292
  return v4Data as unknown as v3.ToServer;
207
293
  };
208
294
 
209
- export const TO_SERVER_VERSIONED = createVersionedDataHandler<v4.ToServer>({
295
+ export const TO_SERVER_VERSIONED = createVersionedDataHandler<v6.ToServer>({
210
296
  serializeVersion: (data, version) => {
211
297
  switch (version) {
212
298
  case 1:
@@ -216,7 +302,11 @@ export const TO_SERVER_VERSIONED = createVersionedDataHandler<v4.ToServer>({
216
302
  case 3:
217
303
  return v3.encodeToServer(data as unknown as v3.ToServer);
218
304
  case 4:
219
- return v4.encodeToServer(data);
305
+ return v4.encodeToServer(data as unknown as v4.ToServer);
306
+ case 5:
307
+ return v5.encodeToServer(data as unknown as v5.ToServer);
308
+ case 6:
309
+ return v6.encodeToServer(data);
220
310
  default:
221
311
  throw new Error(`Unknown version ${version}`);
222
312
  }
@@ -224,13 +314,17 @@ export const TO_SERVER_VERSIONED = createVersionedDataHandler<v4.ToServer>({
224
314
  deserializeVersion: (bytes, version) => {
225
315
  switch (version) {
226
316
  case 1:
227
- return v1.decodeToServer(bytes) as unknown as v4.ToServer;
317
+ return v1.decodeToServer(bytes) as unknown as v5.ToServer;
228
318
  case 2:
229
- return v2.decodeToServer(bytes) as unknown as v4.ToServer;
319
+ return v2.decodeToServer(bytes) as unknown as v5.ToServer;
230
320
  case 3:
231
- return v3.decodeToServer(bytes) as unknown as v4.ToServer;
321
+ return v3.decodeToServer(bytes) as unknown as v5.ToServer;
232
322
  case 4:
233
- return v4.decodeToServer(bytes);
323
+ return v4.decodeToServer(bytes) as unknown as v5.ToServer;
324
+ case 5:
325
+ return v5.decodeToServer(bytes) as unknown as v6.ToServer;
326
+ case 6:
327
+ return v6.decodeToServer(bytes);
234
328
  default:
235
329
  throw new Error(`Unknown version ${version}`);
236
330
  }
@@ -239,11 +333,19 @@ export const TO_SERVER_VERSIONED = createVersionedDataHandler<v4.ToServer>({
239
333
  v1ToServerToV2,
240
334
  v2ToServerToV3,
241
335
  v3ToServerToV4,
336
+ v4ToServerToV5,
337
+ v5ToServerToV6,
338
+ ],
339
+ serializeConverters: () => [
340
+ v6ToServerToV5,
341
+ v5ToServerToV4,
342
+ v4ToServerToV3,
343
+ v3ToServerToV2,
344
+ v2ToServerToV1,
242
345
  ],
243
- serializeConverters: () => [v4ToServerToV3, v3ToServerToV2, v2ToServerToV1],
244
346
  });
245
347
 
246
- export const TO_CLIENT_VERSIONED = createVersionedDataHandler<v4.ToClient>({
348
+ export const TO_CLIENT_VERSIONED = createVersionedDataHandler<v6.ToClient>({
247
349
  serializeVersion: (data, version) => {
248
350
  switch (version) {
249
351
  case 1:
@@ -253,7 +355,11 @@ export const TO_CLIENT_VERSIONED = createVersionedDataHandler<v4.ToClient>({
253
355
  case 3:
254
356
  return v3.encodeToClient(data as unknown as v3.ToClient);
255
357
  case 4:
256
- return v4.encodeToClient(data);
358
+ return v4.encodeToClient(data as unknown as v4.ToClient);
359
+ case 5:
360
+ return v5.encodeToClient(data as unknown as v5.ToClient);
361
+ case 6:
362
+ return v6.encodeToClient(data);
257
363
  default:
258
364
  throw new Error(`Unknown version ${version}`);
259
365
  }
@@ -261,13 +367,17 @@ export const TO_CLIENT_VERSIONED = createVersionedDataHandler<v4.ToClient>({
261
367
  deserializeVersion: (bytes, version) => {
262
368
  switch (version) {
263
369
  case 1:
264
- return v1.decodeToClient(bytes) as unknown as v4.ToClient;
370
+ return v1.decodeToClient(bytes) as unknown as v5.ToClient;
265
371
  case 2:
266
- return v2.decodeToClient(bytes) as unknown as v4.ToClient;
372
+ return v2.decodeToClient(bytes) as unknown as v5.ToClient;
267
373
  case 3:
268
- return v3.decodeToClient(bytes) as unknown as v4.ToClient;
374
+ return v3.decodeToClient(bytes) as unknown as v5.ToClient;
269
375
  case 4:
270
- return v4.decodeToClient(bytes);
376
+ return v4.decodeToClient(bytes) as unknown as v5.ToClient;
377
+ case 5:
378
+ return v5.decodeToClient(bytes) as unknown as v6.ToClient;
379
+ case 6:
380
+ return v6.decodeToClient(bytes);
271
381
  default:
272
382
  throw new Error(`Unknown version ${version}`);
273
383
  }
@@ -276,6 +386,14 @@ export const TO_CLIENT_VERSIONED = createVersionedDataHandler<v4.ToClient>({
276
386
  v1ToClientToV2,
277
387
  v2ToClientToV3,
278
388
  v3ToClientToV4,
389
+ v4ToClientToV5,
390
+ v5ToClientToV6,
391
+ ],
392
+ serializeConverters: () => [
393
+ v6ToClientToV5,
394
+ v5ToClientToV4,
395
+ v4ToClientToV3,
396
+ v3ToClientToV2,
397
+ v2ToClientToV1,
279
398
  ],
280
- serializeConverters: () => [v4ToClientToV3, v3ToClientToV2, v2ToClientToV1],
281
399
  });
@@ -1,4 +1,4 @@
1
- export * from "@/common/bare/generated/inspector/v4";
1
+ export * from "@/common/bare/generated/inspector/v5";
2
2
  export type { WorkflowHistory as TransportWorkflowHistory } from "@/common/bare/transport/v1";
3
3
  export {
4
4
  decodeWorkflowHistoryTransport,
@@ -0,0 +1,61 @@
1
+ import type { JsonCompatValue } from "@/common/encoding";
2
+ import type { WorkflowHistoryBytes } from "@/common/inspector-transport";
3
+ import { encodeCborCompat } from "@/serde";
4
+ import { bufferToArrayBuffer } from "@/utils";
5
+
6
+ export type {
7
+ WorkflowBranchStatus,
8
+ WorkflowCbor,
9
+ WorkflowEntry,
10
+ WorkflowEntryKind,
11
+ WorkflowEntryMetadata,
12
+ WorkflowHistory,
13
+ WorkflowJoinEntry,
14
+ WorkflowLocation,
15
+ WorkflowLoopEntry,
16
+ WorkflowLoopIterationMarker,
17
+ WorkflowMessageEntry,
18
+ WorkflowNameIndex,
19
+ WorkflowPathSegment,
20
+ WorkflowRaceEntry,
21
+ WorkflowRemovedEntry,
22
+ WorkflowRollbackCheckpointEntry,
23
+ WorkflowSleepEntry,
24
+ WorkflowStepEntry,
25
+ WorkflowVersionCheckEntry,
26
+ } from "@/common/bare/transport/v1";
27
+ export {
28
+ WorkflowBranchStatusType,
29
+ WorkflowEntryStatus,
30
+ WorkflowSleepState,
31
+ } from "@/common/bare/transport/v1";
32
+ export type { WorkflowHistoryBytes } from "@/common/inspector-transport";
33
+ export {
34
+ decodeWorkflowHistoryTransport,
35
+ encodeWorkflowHistoryTransport,
36
+ } from "@/common/inspector-transport";
37
+
38
+ /** @experimental State exposed by a durable workflow run handler to the Inspector. */
39
+ export type WorkflowState =
40
+ | "pending"
41
+ | "running"
42
+ | "sleeping"
43
+ | "failed"
44
+ | "completed"
45
+ | "cancelled"
46
+ | "rolling_back";
47
+
48
+ /** @experimental The raw workflow Inspector adapter consumed by RivetKit's transport. */
49
+ export interface WorkflowInspectorAdapter {
50
+ getHistory: () => WorkflowHistoryBytes | null;
51
+ getState: () => Promise<WorkflowState | null>;
52
+ onHistoryUpdated: (
53
+ listener: (history: WorkflowHistoryBytes) => void,
54
+ ) => () => void;
55
+ replayFromStep: (entryId?: string) => Promise<WorkflowHistoryBytes | null>;
56
+ }
57
+
58
+ /** @experimental Encodes a workflow Inspector value with RivetKit's CBOR-compatible codec. */
59
+ export function encodeWorkflowInspectorValue(value: unknown): ArrayBuffer {
60
+ return bufferToArrayBuffer(encodeCborCompat(value as JsonCompatValue));
61
+ }
@@ -69,6 +69,7 @@ export type BuiltinInspectorTabId =
69
69
  | "database"
70
70
  | "state"
71
71
  | "queue"
72
+ | "schedules"
72
73
  | "connections"
73
74
  | "console";
74
75
 
@@ -280,18 +281,6 @@ export const InspectorQueueResponseSchema = z.object({
280
281
  messages: z.array(InspectorQueueMessageSchema),
281
282
  });
282
283
 
283
- /** `GET /inspector/tab-config` response shape. */
284
- export const InspectorTabConfigResponseSchema = z.object({
285
- tabs: z.array(
286
- z.object({
287
- id: z.string(),
288
- label: z.string().optional(),
289
- icon: z.string().nullable().optional(),
290
- hidden: z.boolean().optional(),
291
- }),
292
- ),
293
- });
294
-
295
284
  export type InspectorStateResponse = z.infer<
296
285
  typeof InspectorStateResponseSchema
297
286
  >;
@@ -310,6 +299,3 @@ export type InspectorQueueMessage = z.infer<typeof InspectorQueueMessageSchema>;
310
299
  export type InspectorQueueResponse = z.infer<
311
300
  typeof InspectorQueueResponseSchema
312
301
  >;
313
- export type InspectorTabConfigResponse = z.infer<
314
- typeof InspectorTabConfigResponseSchema
315
- >;
@@ -1,33 +1,17 @@
1
1
  import { z } from "zod/v4";
2
- import { getLogger } from "@/common/log";
3
2
  import {
4
- getNodeEnv,
5
3
  getRivetEnvoyVersion,
6
4
  getRivetPool,
7
5
  getRivetTotalSlots,
8
6
  } from "@/utils/env-vars";
9
7
 
10
- let warnedMissingVersion = false;
11
-
12
8
  export const EnvoyConfigSchema = z.object({
13
9
  poolName: z.string().default(() => getRivetPool() ?? "default"),
14
- version: z.number().default(() => {
15
- const version = getRivetEnvoyVersion();
16
- if (version !== undefined) return version;
17
-
18
- if (getNodeEnv() === "production" && !warnedMissingVersion) {
19
- warnedMissingVersion = true;
20
- getLogger("rivetkit").error(
21
- "RIVET_ENVOY_VERSION is not set. Actors will not be versioned, which means they won't be drained on deploy. This is only needed when self-hosting or using a custom envoy (not needed for Rivet Compute). Set this as a build arg in your Dockerfile. See https://rivet.dev/docs/actors/versions",
22
- );
23
- }
24
-
25
- return 1;
26
- }),
10
+ version: z.number().default(() => getRivetEnvoyVersion() ?? 1),
27
11
 
28
12
  // Deprecated.
29
13
  totalSlots: z.number().default(() => getRivetTotalSlots() ?? 100000),
30
- envoyKey: z.string().optional(),
14
+ nodeKey: z.string().optional(),
31
15
  });
32
16
  export type EnvoyConfigInput = z.input<typeof EnvoyConfigSchema>;
33
17
  export type EnvoyConfig = z.infer<typeof EnvoyConfigSchema>;
@@ -1,16 +1,12 @@
1
1
  import { z } from "zod";
2
2
  import { getRunMetadata } from "@/actor/config";
3
- import type {
4
- AnyActorDefinition,
5
- BaseActorDefinition,
6
- } from "@/actor/definition";
3
+ import type { AnyActorDefinition } from "@/actor/definition";
7
4
  import {
8
- KEYS,
9
- queueMessagesPrefix,
10
- queueMetadataKey,
11
- workflowStoragePrefix,
12
- } from "@/actor/keys";
13
- import { buildEngineEndpoint, ENGINE_HOST, ENGINE_PORT } from "@/common/engine";
5
+ buildEngineEndpoint,
6
+ ENGINE_HOST,
7
+ ENGINE_PORT,
8
+ isLocalEngineEndpoint,
9
+ } from "@/common/engine";
14
10
  import { type Logger, LogLevelSchema } from "@/common/log";
15
11
  import { VERSION } from "@/utils";
16
12
  import { tryParseEndpoint } from "@/utils/endpoint-parser";
@@ -23,6 +19,7 @@ import {
23
19
  getRivetRunEngineHost,
24
20
  getRivetRunEnginePort,
25
21
  getRivetRunEngineVersion,
22
+ getRivetRunServices,
26
23
  getRivetToken,
27
24
  isDev,
28
25
  } from "@/utils/env-vars";
@@ -161,7 +158,7 @@ export const RegistryConfigSchema = z
161
158
  // // created or must be imported async using `await import(...)`
162
159
  // getUpgradeWebSocket: z.custom<GetUpgradeWebSocket>().optional(),
163
160
 
164
- // MARK: Runner Configuration
161
+ // MARK: Node Configuration
165
162
  /**
166
163
  * Endpoint to connect to for Rivet Engine.
167
164
  *
@@ -252,10 +249,16 @@ export const RegistryConfigSchema = z
252
249
  .string()
253
250
  .optional()
254
251
  .default(() => getRivetRunEngineVersion() ?? VERSION),
252
+ /**
253
+ * Starts the first-party Services actor host when RivetKit manages
254
+ * a local engine. Disabled by default. Set RIVET_RUN_SERVICES=1
255
+ * or startServices: true to enable it.
256
+ */
257
+ startServices: z.boolean().optional(),
255
258
  /**
256
259
  * @experimental
257
260
  *
258
- * Automatically configure serverless envoys in the engine.
261
+ * Automatically configure serverless nodes in the engine.
259
262
  */
260
263
  configurePool: ConfigurePoolSchema.optional(),
261
264
 
@@ -263,7 +266,7 @@ export const RegistryConfigSchema = z
263
266
  serverless: ServerlessConfigSchema.optional().default(() =>
264
267
  ServerlessConfigSchema.parse({}),
265
268
  ),
266
- envoy: EnvoyConfigSchema.optional().default(() =>
269
+ node: EnvoyConfigSchema.optional().default(() =>
267
270
  EnvoyConfigSchema.parse({}),
268
271
  ),
269
272
 
@@ -271,9 +274,9 @@ export const RegistryConfigSchema = z
271
274
  /**
272
275
  * Graceful shutdown configuration for SIGINT/SIGTERM.
273
276
  *
274
- * When a persistent envoy is running (Mode A, started via `registry.start()`),
277
+ * When a persistent node is running (Mode A, started via `registry.start()`),
275
278
  * rivetkit installs Node SIGINT/SIGTERM handlers that call into core's
276
- * `shutdown()` and wait up to `gracePeriodMs` for the envoy to drain
279
+ * `shutdown()` and wait up to `gracePeriodMs` for the node to drain
277
280
  * before re-raising the signal to let Node exit via its default path.
278
281
  *
279
282
  * Handlers are NOT installed when `handler(request)` is used alone
@@ -286,9 +289,11 @@ export const RegistryConfigSchema = z
286
289
  /**
287
290
  * Wait this many milliseconds for the serve promise to resolve
288
291
  * after calling `CoreRegistry::shutdown()`. Defaults to the
289
- * engine-provided actor stop threshold once the envoy connects.
292
+ * engine-provided actor stop threshold once the node connects. A
293
+ * signal-driven shutdown of a managed local development engine waits
294
+ * one second by default so a file watcher can restart promptly.
290
295
  *
291
- * Must be long enough for rivetkit-core to drain the envoy.
296
+ * Set a longer period when a complete graceful node drain is required.
292
297
  */
293
298
  gracePeriodMs: z.number().int().min(1_000).optional(),
294
299
  /**
@@ -345,12 +350,12 @@ export const RegistryConfigSchema = z
345
350
  });
346
351
  }
347
352
 
348
- // configurePool requires an engine (via endpoint or startEngine).
349
- if (config.configurePool && !parsedEndpoint && !config.startEngine) {
353
+ // Serverless pool configuration is disabled for v3.
354
+ if (config.configurePool) {
350
355
  ctx.addIssue({
351
356
  code: "custom",
352
- message:
353
- "configurePool requires either endpoint or startEngine",
357
+ message: "serverless is disabled in this version",
358
+ path: ["configurePool"],
354
359
  });
355
360
  }
356
361
 
@@ -362,9 +367,8 @@ export const RegistryConfigSchema = z
362
367
  const endpoint = config.startEngine
363
368
  ? localEngineEndpoint
364
369
  : (parsedEndpoint?.endpoint ??
365
- (isDevEnv
366
- ? buildEngineEndpoint(ENGINE_HOST, ENGINE_PORT)
367
- : undefined));
370
+ (isDevEnv ? localEngineEndpoint : undefined));
371
+ const startServices = config.startServices ?? getRivetRunServices();
368
372
  const validateServerlessEndpoint = Boolean(
369
373
  config.startEngine || parsedEndpoint,
370
374
  );
@@ -372,7 +376,12 @@ export const RegistryConfigSchema = z
372
376
  const namespace =
373
377
  parsedEndpoint?.namespace ?? config.namespace ?? "default";
374
378
  // Token priority: parsed from endpoint URL > config value (includes env var)
375
- const token = parsedEndpoint?.token ?? config.token;
379
+ const token =
380
+ parsedEndpoint?.token ??
381
+ config.token ??
382
+ (endpoint && isLocalEngineEndpoint(endpoint)
383
+ ? "default"
384
+ : undefined);
376
385
 
377
386
  // Parse publicEndpoint string (env var fallback is applied via transform in serverless schema)
378
387
  const parsedPublicEndpoint = config.serverless.publicEndpoint
@@ -397,7 +406,7 @@ export const RegistryConfigSchema = z
397
406
  // In dev mode, clients connect directly to the local Rivet Engine.
398
407
  const publicEndpoint =
399
408
  parsedPublicEndpoint?.endpoint ??
400
- (isDevEnv && config.startEngine ? endpoint : undefined);
409
+ (isDevEnv && !parsedEndpoint ? endpoint : undefined);
401
410
  // We extract publicNamespace to validate that it matches the backend
402
411
  // namespace (see validation above), not for functional use.
403
412
  const publicNamespace = parsedPublicEndpoint?.namespace;
@@ -409,6 +418,8 @@ export const RegistryConfigSchema = z
409
418
  ...config,
410
419
  sqlite,
411
420
  endpoint,
421
+ engineSpawn: !parsedEndpoint && Boolean(endpoint),
422
+ startServices,
412
423
  namespace,
413
424
  token,
414
425
  publicEndpoint,
@@ -440,31 +451,6 @@ export function buildActorNames(
440
451
  // Actor options take precedence over run metadata
441
452
  metadata.icon = options.icon ?? runMeta.icon;
442
453
  metadata.name = options.name ?? runMeta.name;
443
- metadata.preload = {
444
- keys: [
445
- Array.from(KEYS.PERSIST_DATA),
446
- Array.from(KEYS.INSPECTOR_TOKEN),
447
- Array.from(queueMetadataKey()),
448
- Array.from(KEYS.LAST_PUSHED_ALARM),
449
- ],
450
- prefixes: [
451
- {
452
- prefix: Array.from(workflowStoragePrefix()),
453
- maxBytes: options.preloadMaxWorkflowBytes ?? 131_072,
454
- partial: false,
455
- },
456
- {
457
- prefix: Array.from(KEYS.CONN_PREFIX),
458
- maxBytes: options.preloadMaxConnectionsBytes ?? 65_536,
459
- partial: false,
460
- },
461
- {
462
- prefix: Array.from(queueMessagesPrefix()),
463
- maxBytes: 65_536,
464
- partial: false,
465
- },
466
- ],
467
- };
468
454
  // Remove undefined values
469
455
  if (!metadata.icon) delete metadata.icon;
470
456
  if (!metadata.name) delete metadata.name;
@@ -479,10 +465,10 @@ export function buildActorNames(
479
465
 
480
466
  export const DocConfigurePoolSchema = z
481
467
  .object({
482
- name: z.string().optional().describe("Name of the runner pool."),
468
+ name: z.string().optional().describe("Name of the node pool."),
483
469
  url: z
484
470
  .string()
485
- .describe("URL of the serverless platform to configure runners."),
471
+ .describe("URL of the serverless platform to configure nodes."),
486
472
  headers: z
487
473
  .record(z.string(), z.string())
488
474
  .optional()
@@ -515,7 +501,7 @@ export const DocConfigurePoolSchema = z
515
501
  .boolean()
516
502
  .optional()
517
503
  .describe(
518
- "Drain runners when a new version is deployed. Defaults to true.",
504
+ "Drain nodes when a new version is deployed. Defaults to true.",
519
505
  ),
520
506
  })
521
507
  .optional();
@@ -558,17 +544,17 @@ export const DocEnvoyConfigSchema = z
558
544
  poolName: z
559
545
  .string()
560
546
  .optional()
561
- .describe("Name of this envoy pool. Default: 'default'"),
562
- envoyKey: z
547
+ .describe("Name of this node pool. Default: 'default'"),
548
+ nodeKey: z
563
549
  .string()
564
550
  .optional()
565
- .describe("Deprecated. Authentication key for the envoy."),
551
+ .describe("Deprecated. Authentication key for the node."),
566
552
  version: z
567
553
  .number()
568
554
  .optional()
569
- .describe("Version number of this envoy. Default: 1"),
555
+ .describe("Version number of this node. Default: 1"),
570
556
  })
571
- .describe("Configuration for envoy mode.");
557
+ .describe("Configuration for node mode.");
572
558
 
573
559
  export const DocSqliteConfigSchema = z
574
560
  .object({
@@ -665,10 +651,16 @@ export const DocRegistryConfigSchema = z
665
651
  .describe(
666
652
  "Version of the local engine package to use. Defaults to the current RivetKit version.",
667
653
  ),
654
+ startServices: z
655
+ .boolean()
656
+ .optional()
657
+ .describe(
658
+ "Starts Services when RivetKit manages a local Engine. Disabled by default. Set RIVET_RUN_SERVICES=1 or startServices: true to enable.",
659
+ ),
668
660
  configurePool: DocConfigurePoolSchema.describe(
669
- "Automatically configure serverless runners in the engine.",
661
+ "Automatically configure serverless nodes in the engine.",
670
662
  ),
671
663
  serverless: DocServerlessConfigSchema.optional(),
672
- envoy: DocEnvoyConfigSchema.optional(),
664
+ node: DocEnvoyConfigSchema.optional(),
673
665
  })
674
666
  .describe("RivetKit registry configuration.");