rivetkit 2.1.5 → 2.1.6-rc.1

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 (333) hide show
  1. package/dist/browser/client.d.ts +593 -588
  2. package/dist/browser/client.js +215 -35
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.js +109 -10
  5. package/dist/browser/inspector/client.js.map +1 -1
  6. package/dist/inspector.tar.gz +0 -0
  7. package/dist/tsup/actor/errors.cjs +2 -2
  8. package/dist/tsup/actor/errors.js +1 -1
  9. package/dist/tsup/{actor-router-consts-D29T1Z-K.d.cts → actor-router-consts-DU-1IdQj.d.cts} +1 -1
  10. package/dist/tsup/{actor-router-consts-D29T1Z-K.d.ts → actor-router-consts-DU-1IdQj.d.ts} +1 -1
  11. package/dist/tsup/chunk-2ELYUO6C.cjs +112 -0
  12. package/dist/tsup/chunk-2ELYUO6C.cjs.map +1 -0
  13. package/dist/tsup/chunk-2LY7RW3Y.cjs +2316 -0
  14. package/dist/tsup/chunk-2LY7RW3Y.cjs.map +1 -0
  15. package/dist/tsup/{chunk-L47L3ZWJ.cjs → chunk-6G7ZNM27.cjs} +11 -6
  16. package/dist/tsup/chunk-6G7ZNM27.cjs.map +1 -0
  17. package/dist/tsup/{chunk-PB5AEMKQ.cjs → chunk-A4KEUCB6.cjs} +84 -34
  18. package/dist/tsup/chunk-A4KEUCB6.cjs.map +1 -0
  19. package/dist/tsup/{chunk-7HTNH26M.js → chunk-AKUJ5OTO.js} +11 -6
  20. package/dist/tsup/chunk-AKUJ5OTO.js.map +1 -0
  21. package/dist/tsup/{chunk-TADUYCHF.js → chunk-C22JYHVT.js} +77 -27
  22. package/dist/tsup/chunk-C22JYHVT.js.map +1 -0
  23. package/dist/tsup/chunk-C4EB42ET.js +1459 -0
  24. package/dist/tsup/chunk-C4EB42ET.js.map +1 -0
  25. package/dist/tsup/chunk-CGGGBIDP.cjs +1459 -0
  26. package/dist/tsup/chunk-CGGGBIDP.cjs.map +1 -0
  27. package/dist/tsup/chunk-CMQPDBBR.cjs +1486 -0
  28. package/dist/tsup/chunk-CMQPDBBR.cjs.map +1 -0
  29. package/dist/tsup/{chunk-GQGRQDRL.cjs → chunk-DH6UINWA.cjs} +4 -4
  30. package/dist/tsup/{chunk-GQGRQDRL.cjs.map → chunk-DH6UINWA.cjs.map} +1 -1
  31. package/dist/tsup/chunk-DK46YYCJ.js +1486 -0
  32. package/dist/tsup/chunk-DK46YYCJ.js.map +1 -0
  33. package/dist/tsup/chunk-EGWXXBZV.js +2316 -0
  34. package/dist/tsup/chunk-EGWXXBZV.js.map +1 -0
  35. package/dist/tsup/{chunk-S662Y6ZU.js → chunk-EONWXYMN.js} +2 -2
  36. package/dist/tsup/{chunk-N4KRDJ56.js → chunk-GFGRBYO2.js} +35 -6
  37. package/dist/tsup/chunk-GFGRBYO2.js.map +1 -0
  38. package/dist/tsup/{chunk-IIJNPVPQ.cjs → chunk-GUHXWPGB.cjs} +1515 -1479
  39. package/dist/tsup/chunk-GUHXWPGB.cjs.map +1 -0
  40. package/dist/tsup/{chunk-TI5PXQGG.cjs → chunk-HNE2AK6C.cjs} +2375 -3713
  41. package/dist/tsup/chunk-HNE2AK6C.cjs.map +1 -0
  42. package/dist/tsup/{chunk-2OK7S6QF.js → chunk-I5I6OALK.js} +2 -2
  43. package/dist/tsup/chunk-IHQAF2HV.cjs +23 -0
  44. package/dist/tsup/chunk-IHQAF2HV.cjs.map +1 -0
  45. package/dist/tsup/{chunk-U5SMSA27.cjs → chunk-JJNZQDUN.cjs} +667 -2517
  46. package/dist/tsup/chunk-JJNZQDUN.cjs.map +1 -0
  47. package/dist/tsup/{chunk-ZPWOYQHN.js → chunk-JJSPHLJN.js} +219 -287
  48. package/dist/tsup/chunk-JJSPHLJN.js.map +1 -0
  49. package/dist/tsup/chunk-JRKPV5NJ.js +481 -0
  50. package/dist/tsup/chunk-JRKPV5NJ.js.map +1 -0
  51. package/dist/tsup/{chunk-VKVNIQRQ.js → chunk-K7MVU5SI.js} +36 -41
  52. package/dist/tsup/chunk-K7MVU5SI.js.map +1 -0
  53. package/dist/tsup/{chunk-KJSYAUOM.js → chunk-MLK3GY6P.js} +43 -27
  54. package/dist/tsup/chunk-MLK3GY6P.js.map +1 -0
  55. package/dist/tsup/{chunk-HYPIHCDT.cjs → chunk-MPLMTJY5.cjs} +123 -23
  56. package/dist/tsup/chunk-MPLMTJY5.cjs.map +1 -0
  57. package/dist/tsup/{chunk-MIX2KB6U.js → chunk-PQWI44WD.js} +1755 -3093
  58. package/dist/tsup/chunk-PQWI44WD.js.map +1 -0
  59. package/dist/tsup/{chunk-SR3KQE7Q.cjs → chunk-SQFCIDCG.cjs} +35 -6
  60. package/dist/tsup/chunk-SQFCIDCG.cjs.map +1 -0
  61. package/dist/tsup/{chunk-WY2SHWXQ.js → chunk-SVHJSM2E.js} +110 -24
  62. package/dist/tsup/chunk-SVHJSM2E.js.map +1 -0
  63. package/dist/tsup/chunk-T5KYKM6R.js +49 -0
  64. package/dist/tsup/chunk-T5KYKM6R.js.map +1 -0
  65. package/dist/tsup/{chunk-7WF2QSIC.cjs → chunk-TJ7DKW6F.cjs} +123 -37
  66. package/dist/tsup/chunk-TJ7DKW6F.cjs.map +1 -0
  67. package/dist/tsup/chunk-UQZRMTM3.js +23 -0
  68. package/dist/tsup/chunk-UQZRMTM3.js.map +1 -0
  69. package/dist/tsup/{chunk-JC6BEPE7.cjs → chunk-V3JSZR5P.cjs} +3 -3
  70. package/dist/tsup/{chunk-JC6BEPE7.cjs.map → chunk-V3JSZR5P.cjs.map} +1 -1
  71. package/dist/tsup/{chunk-OAXJWGMU.cjs → chunk-VBR35EQF.cjs} +271 -339
  72. package/dist/tsup/chunk-VBR35EQF.cjs.map +1 -0
  73. package/dist/tsup/{chunk-EIATSBYZ.js → chunk-VWYO36X4.js} +117 -17
  74. package/dist/tsup/chunk-VWYO36X4.js.map +1 -0
  75. package/dist/tsup/{chunk-JPXO2H55.js → chunk-WW27B6DM.js} +1452 -1416
  76. package/dist/tsup/chunk-WW27B6DM.js.map +1 -0
  77. package/dist/tsup/chunk-YAE3MEJM.cjs +49 -0
  78. package/dist/tsup/chunk-YAE3MEJM.cjs.map +1 -0
  79. package/dist/tsup/{chunk-SRIM3GHD.js → chunk-YGYGANCA.js} +473 -2323
  80. package/dist/tsup/chunk-YGYGANCA.js.map +1 -0
  81. package/dist/tsup/chunk-YZJWZBY5.cjs +481 -0
  82. package/dist/tsup/chunk-YZJWZBY5.cjs.map +1 -0
  83. package/dist/tsup/{chunk-ZFY5J2EP.cjs → chunk-ZZLJ5TSM.cjs} +39 -44
  84. package/dist/tsup/chunk-ZZLJ5TSM.cjs.map +1 -0
  85. package/dist/tsup/client/mod.cjs +10 -7
  86. package/dist/tsup/client/mod.cjs.map +1 -1
  87. package/dist/tsup/client/mod.d.cts +6 -6
  88. package/dist/tsup/client/mod.d.ts +6 -6
  89. package/dist/tsup/client/mod.js +11 -8
  90. package/dist/tsup/common/log.cjs +3 -3
  91. package/dist/tsup/common/log.js +2 -2
  92. package/dist/tsup/common/websocket.cjs +4 -4
  93. package/dist/tsup/common/websocket.js +3 -3
  94. package/dist/tsup/{config-Qj-zLJPc.d.ts → config-C2Wwnc69.d.ts} +142 -208
  95. package/dist/tsup/{config-BiNoIHRs.d.ts → config-DROwzBLT.d.cts} +82 -6
  96. package/dist/tsup/{config-BiNoIHRs.d.cts → config-DROwzBLT.d.ts} +82 -6
  97. package/dist/tsup/{config-iPj5l1bL.d.cts → config-ehT-_3BB.d.cts} +142 -208
  98. package/dist/tsup/{context-DzvH1PBK.d.cts → context-DGMJuAyc.d.ts} +16 -3
  99. package/dist/tsup/{context-CQCMuHND.d.ts → context-Dpp2RJbW.d.cts} +16 -3
  100. package/dist/tsup/db/drizzle/mod.cjs +3 -3
  101. package/dist/tsup/db/drizzle/mod.d.cts +1 -1
  102. package/dist/tsup/db/drizzle/mod.d.ts +1 -1
  103. package/dist/tsup/db/drizzle/mod.js +2 -2
  104. package/dist/tsup/db/mod.cjs +3 -3
  105. package/dist/tsup/db/mod.d.cts +1 -1
  106. package/dist/tsup/db/mod.d.ts +1 -1
  107. package/dist/tsup/db/mod.js +2 -2
  108. package/dist/tsup/{driver-Jo8v-kbU.d.ts → driver-CYZP9QYo.d.ts} +1 -1
  109. package/dist/tsup/{driver-iV8J-WMv.d.cts → driver-CoTFpipv.d.cts} +1 -1
  110. package/dist/tsup/driver-helpers/mod.cjs +7 -5
  111. package/dist/tsup/driver-helpers/mod.cjs.map +1 -1
  112. package/dist/tsup/driver-helpers/mod.d.cts +17 -18
  113. package/dist/tsup/driver-helpers/mod.d.ts +17 -18
  114. package/dist/tsup/driver-helpers/mod.js +11 -9
  115. package/dist/tsup/driver-test-suite/mod.cjs +1275 -228
  116. package/dist/tsup/driver-test-suite/mod.cjs.map +1 -1
  117. package/dist/tsup/driver-test-suite/mod.d.cts +6 -5
  118. package/dist/tsup/driver-test-suite/mod.d.ts +6 -5
  119. package/dist/tsup/driver-test-suite/mod.js +1581 -534
  120. package/dist/tsup/driver-test-suite/mod.js.map +1 -1
  121. package/dist/tsup/inspector/mod.cjs +4 -4
  122. package/dist/tsup/inspector/mod.js +3 -3
  123. package/dist/tsup/mod.cjs +15 -9
  124. package/dist/tsup/mod.cjs.map +1 -1
  125. package/dist/tsup/mod.d.cts +9 -9
  126. package/dist/tsup/mod.d.ts +9 -9
  127. package/dist/tsup/mod.js +19 -13
  128. package/dist/tsup/sandbox/client.cjs +28 -0
  129. package/dist/tsup/sandbox/client.cjs.map +1 -0
  130. package/dist/tsup/sandbox/client.d.cts +88 -0
  131. package/dist/tsup/sandbox/client.d.ts +88 -0
  132. package/dist/tsup/sandbox/client.js +28 -0
  133. package/dist/tsup/sandbox/client.js.map +1 -0
  134. package/dist/tsup/sandbox/index.cjs +761 -0
  135. package/dist/tsup/sandbox/index.cjs.map +1 -0
  136. package/dist/tsup/sandbox/index.d.cts +120 -0
  137. package/dist/tsup/sandbox/index.d.ts +120 -0
  138. package/dist/tsup/sandbox/index.js +761 -0
  139. package/dist/tsup/sandbox/index.js.map +1 -0
  140. package/dist/tsup/sandbox/providers/computesdk.cjs +3 -0
  141. package/dist/tsup/sandbox/providers/computesdk.cjs.map +1 -0
  142. package/dist/tsup/sandbox/providers/computesdk.d.cts +7 -0
  143. package/dist/tsup/sandbox/providers/computesdk.d.ts +7 -0
  144. package/dist/tsup/sandbox/providers/computesdk.js +3 -0
  145. package/dist/tsup/sandbox/providers/computesdk.js.map +1 -0
  146. package/dist/tsup/sandbox/providers/daytona.cjs +3 -0
  147. package/dist/tsup/sandbox/providers/daytona.cjs.map +1 -0
  148. package/dist/tsup/sandbox/providers/daytona.d.cts +1 -0
  149. package/dist/tsup/sandbox/providers/daytona.d.ts +1 -0
  150. package/dist/tsup/sandbox/providers/daytona.js +3 -0
  151. package/dist/tsup/sandbox/providers/daytona.js.map +1 -0
  152. package/dist/tsup/sandbox/providers/docker.cjs +3 -0
  153. package/dist/tsup/sandbox/providers/docker.cjs.map +1 -0
  154. package/dist/tsup/sandbox/providers/docker.d.cts +1 -0
  155. package/dist/tsup/sandbox/providers/docker.d.ts +1 -0
  156. package/dist/tsup/sandbox/providers/docker.js +3 -0
  157. package/dist/tsup/sandbox/providers/docker.js.map +1 -0
  158. package/dist/tsup/sandbox/providers/e2b.cjs +3 -0
  159. package/dist/tsup/sandbox/providers/e2b.cjs.map +1 -0
  160. package/dist/tsup/sandbox/providers/e2b.d.cts +1 -0
  161. package/dist/tsup/sandbox/providers/e2b.d.ts +1 -0
  162. package/dist/tsup/sandbox/providers/e2b.js +3 -0
  163. package/dist/tsup/sandbox/providers/e2b.js.map +1 -0
  164. package/dist/tsup/sandbox/providers/local.cjs +3 -0
  165. package/dist/tsup/sandbox/providers/local.cjs.map +1 -0
  166. package/dist/tsup/sandbox/providers/local.d.cts +1 -0
  167. package/dist/tsup/sandbox/providers/local.d.ts +1 -0
  168. package/dist/tsup/sandbox/providers/local.js +3 -0
  169. package/dist/tsup/sandbox/providers/local.js.map +1 -0
  170. package/dist/tsup/sandbox/providers/modal.cjs +3 -0
  171. package/dist/tsup/sandbox/providers/modal.cjs.map +1 -0
  172. package/dist/tsup/sandbox/providers/modal.d.cts +1 -0
  173. package/dist/tsup/sandbox/providers/modal.d.ts +1 -0
  174. package/dist/tsup/sandbox/providers/modal.js +3 -0
  175. package/dist/tsup/sandbox/providers/modal.js.map +1 -0
  176. package/dist/tsup/sandbox/providers/vercel.cjs +3 -0
  177. package/dist/tsup/sandbox/providers/vercel.cjs.map +1 -0
  178. package/dist/tsup/sandbox/providers/vercel.d.cts +1 -0
  179. package/dist/tsup/sandbox/providers/vercel.d.ts +1 -0
  180. package/dist/tsup/sandbox/providers/vercel.js +3 -0
  181. package/dist/tsup/sandbox/providers/vercel.js.map +1 -0
  182. package/dist/tsup/serve-test-suite/mod.cjs +451 -327
  183. package/dist/tsup/serve-test-suite/mod.cjs.map +1 -1
  184. package/dist/tsup/serve-test-suite/mod.js +362 -238
  185. package/dist/tsup/serve-test-suite/mod.js.map +1 -1
  186. package/dist/tsup/test/mod.cjs +17 -14
  187. package/dist/tsup/test/mod.cjs.map +1 -1
  188. package/dist/tsup/test/mod.d.cts +4 -4
  189. package/dist/tsup/test/mod.d.ts +4 -4
  190. package/dist/tsup/test/mod.js +14 -11
  191. package/dist/tsup/test/mod.js.map +1 -1
  192. package/dist/tsup/utils.cjs +3 -3
  193. package/dist/tsup/utils.js +2 -2
  194. package/dist/tsup/workflow/mod.cjs +6 -6
  195. package/dist/tsup/workflow/mod.d.cts +13 -9
  196. package/dist/tsup/workflow/mod.d.ts +13 -9
  197. package/dist/tsup/workflow/mod.js +5 -5
  198. package/package.json +114 -15
  199. package/src/actor/config.ts +94 -88
  200. package/src/actor/conn/drivers/websocket.ts +2 -1
  201. package/src/actor/contexts/base/actor.ts +27 -4
  202. package/src/actor/database.ts +6 -1
  203. package/src/actor/driver.ts +27 -8
  204. package/src/actor/errors.ts +10 -5
  205. package/src/actor/instance/connection-manager.ts +4 -3
  206. package/src/actor/instance/kv.ts +52 -9
  207. package/src/actor/instance/mod.ts +135 -84
  208. package/src/actor/instance/queue-manager.ts +2 -5
  209. package/src/actor/instance/queue.ts +31 -29
  210. package/src/actor/instance/state-manager.ts +7 -1
  211. package/src/actor/instance/traces-driver.ts +34 -36
  212. package/src/actor/metrics.ts +137 -0
  213. package/src/actor/protocol/old.ts +9 -12
  214. package/src/actor/router-websocket-endpoints.ts +12 -6
  215. package/src/actor/router.ts +46 -9
  216. package/src/actor/schema.ts +14 -22
  217. package/src/client/actor-common.ts +65 -0
  218. package/src/client/actor-conn.ts +71 -9
  219. package/src/client/actor-handle.ts +22 -5
  220. package/src/client/client.ts +32 -6
  221. package/src/client/config.ts +18 -21
  222. package/src/client/mod.ts +1 -0
  223. package/src/client/queue.ts +8 -6
  224. package/src/common/inline-websocket-adapter.ts +8 -2
  225. package/src/common/router.ts +1 -4
  226. package/src/common/utils.ts +2 -5
  227. package/src/db/config.ts +10 -5
  228. package/src/db/drizzle/mod.ts +51 -41
  229. package/src/db/mod.ts +54 -29
  230. package/src/db/shared.ts +42 -8
  231. package/src/driver-helpers/mod.ts +2 -1
  232. package/src/driver-helpers/sqlite-pool.ts +42 -0
  233. package/src/driver-helpers/utils.ts +0 -20
  234. package/src/driver-test-suite/mod.ts +11 -1
  235. package/src/driver-test-suite/tests/access-control.ts +19 -12
  236. package/src/driver-test-suite/tests/action-features.ts +20 -8
  237. package/src/driver-test-suite/tests/actor-conn.ts +94 -8
  238. package/src/driver-test-suite/tests/actor-db-kv-stats.ts +282 -0
  239. package/src/driver-test-suite/tests/actor-db-raw.ts +6 -2
  240. package/src/driver-test-suite/tests/actor-db.ts +101 -31
  241. package/src/driver-test-suite/tests/actor-inspector.ts +174 -32
  242. package/src/driver-test-suite/tests/actor-kv.ts +79 -33
  243. package/src/driver-test-suite/tests/actor-lifecycle.ts +4 -12
  244. package/src/driver-test-suite/tests/actor-queue.ts +125 -17
  245. package/src/driver-test-suite/tests/actor-run.ts +59 -55
  246. package/src/driver-test-suite/tests/actor-sandbox.ts +78 -0
  247. package/src/driver-test-suite/tests/actor-schedule.ts +1 -4
  248. package/src/driver-test-suite/tests/actor-sleep.ts +111 -0
  249. package/src/driver-test-suite/tests/actor-workflow.ts +387 -3
  250. package/src/driver-test-suite/tests/conn-error-serialization.ts +3 -1
  251. package/src/driver-test-suite/tests/raw-websocket.ts +5 -1
  252. package/src/drivers/default.ts +1 -3
  253. package/src/drivers/engine/actor-driver.ts +94 -21
  254. package/src/drivers/engine/config.ts +4 -12
  255. package/src/drivers/engine/mod.ts +1 -5
  256. package/src/drivers/file-system/actor.ts +43 -8
  257. package/src/drivers/file-system/global-state.ts +180 -64
  258. package/src/drivers/file-system/kv-limits.ts +1 -1
  259. package/src/drivers/file-system/sqlite-runtime.ts +13 -4
  260. package/src/engine-process/mod.ts +5 -1
  261. package/src/inspector/actor-inspector.ts +47 -21
  262. package/src/inspector/config.ts +1 -4
  263. package/src/inspector/mod.browser.ts +2 -2
  264. package/src/inspector/mod.ts +4 -1
  265. package/src/inspector/serve-ui.ts +0 -1
  266. package/src/inspector/workflow-history-json.ts +309 -0
  267. package/src/manager/gateway.ts +6 -2
  268. package/src/manager/router.ts +3 -3
  269. package/src/registry/config/index.ts +65 -12
  270. package/src/registry/config/runner.ts +19 -4
  271. package/src/registry/index.ts +42 -89
  272. package/src/sandbox/actor/db.ts +36 -0
  273. package/src/sandbox/actor/index.ts +476 -0
  274. package/src/sandbox/actor/session.ts +350 -0
  275. package/src/sandbox/actor.test.ts +36 -0
  276. package/src/sandbox/client.test.ts +484 -0
  277. package/src/sandbox/client.ts +707 -0
  278. package/src/sandbox/config.ts +151 -0
  279. package/src/sandbox/index.ts +41 -0
  280. package/src/sandbox/providers/computesdk.ts +1 -0
  281. package/src/sandbox/providers/daytona.ts +1 -0
  282. package/src/sandbox/providers/docker.ts +1 -0
  283. package/src/sandbox/providers/e2b.ts +1 -0
  284. package/src/sandbox/providers/local.ts +1 -0
  285. package/src/sandbox/providers/modal.ts +1 -0
  286. package/src/sandbox/providers/vercel.ts +1 -0
  287. package/src/sandbox/session-persist-driver.ts +180 -0
  288. package/src/sandbox/types.ts +138 -0
  289. package/src/serverless/configure.ts +5 -3
  290. package/src/serverless/router.test.ts +17 -9
  291. package/src/serverless/router.ts +20 -13
  292. package/src/test/mod.ts +3 -4
  293. package/src/utils/endpoint-parser.test.ts +6 -2
  294. package/src/utils/endpoint-parser.ts +6 -2
  295. package/src/utils/env-vars.ts +0 -2
  296. package/src/utils/node.ts +1 -1
  297. package/src/utils/serve.ts +10 -5
  298. package/src/utils.ts +6 -1
  299. package/src/workflow/constants.ts +1 -2
  300. package/src/workflow/context.ts +42 -9
  301. package/src/workflow/driver.ts +57 -23
  302. package/src/workflow/inspector.ts +7 -13
  303. package/src/workflow/mod.ts +91 -4
  304. package/dist/tsup/chunk-6LJAZ5R4.cjs +0 -96
  305. package/dist/tsup/chunk-6LJAZ5R4.cjs.map +0 -1
  306. package/dist/tsup/chunk-7HTNH26M.js.map +0 -1
  307. package/dist/tsup/chunk-7WF2QSIC.cjs.map +0 -1
  308. package/dist/tsup/chunk-D2SPAJVT.cjs +0 -645
  309. package/dist/tsup/chunk-D2SPAJVT.cjs.map +0 -1
  310. package/dist/tsup/chunk-EIATSBYZ.js.map +0 -1
  311. package/dist/tsup/chunk-HYPIHCDT.cjs.map +0 -1
  312. package/dist/tsup/chunk-IIJNPVPQ.cjs.map +0 -1
  313. package/dist/tsup/chunk-JPXO2H55.js.map +0 -1
  314. package/dist/tsup/chunk-KJSYAUOM.js.map +0 -1
  315. package/dist/tsup/chunk-L47L3ZWJ.cjs.map +0 -1
  316. package/dist/tsup/chunk-MIX2KB6U.js.map +0 -1
  317. package/dist/tsup/chunk-N4KRDJ56.js.map +0 -1
  318. package/dist/tsup/chunk-OAXJWGMU.cjs.map +0 -1
  319. package/dist/tsup/chunk-PB5AEMKQ.cjs.map +0 -1
  320. package/dist/tsup/chunk-R5OQUSLN.js +0 -645
  321. package/dist/tsup/chunk-R5OQUSLN.js.map +0 -1
  322. package/dist/tsup/chunk-SR3KQE7Q.cjs.map +0 -1
  323. package/dist/tsup/chunk-SRIM3GHD.js.map +0 -1
  324. package/dist/tsup/chunk-TADUYCHF.js.map +0 -1
  325. package/dist/tsup/chunk-TI5PXQGG.cjs.map +0 -1
  326. package/dist/tsup/chunk-U5SMSA27.cjs.map +0 -1
  327. package/dist/tsup/chunk-VKVNIQRQ.js.map +0 -1
  328. package/dist/tsup/chunk-WY2SHWXQ.js.map +0 -1
  329. package/dist/tsup/chunk-ZFY5J2EP.cjs.map +0 -1
  330. package/dist/tsup/chunk-ZPWOYQHN.js.map +0 -1
  331. package/src/db/sqlite-vfs.ts +0 -12
  332. /package/dist/tsup/{chunk-S662Y6ZU.js.map → chunk-EONWXYMN.js.map} +0 -0
  333. /package/dist/tsup/{chunk-2OK7S6QF.js.map → chunk-I5I6OALK.js.map} +0 -0
@@ -1,6 +1,11 @@
1
1
  import {
2
2
  hibernationActor,
3
3
  logger,
4
+ manyQueueActionParentActor,
5
+ manyQueueChildActor,
6
+ manyQueueRunParentActor,
7
+ queueActor,
8
+ queueLimitedActor,
4
9
  runWithEarlyExit,
5
10
  runWithError,
6
11
  runWithQueueConsumer,
@@ -9,48 +14,68 @@ import {
9
14
  sleep,
10
15
  sleepWithLongRpc,
11
16
  sleepWithNoSleepOption,
17
+ sleepWithPreventSleep,
12
18
  sleepWithRawHttp,
13
19
  sleepWithRawWebSocket,
20
+ sleepWithWaitUntilMessage,
14
21
  workflowAccessActor,
22
+ workflowCompleteActor,
15
23
  workflowCounterActor,
24
+ workflowDestroyActor,
25
+ workflowErrorHookActor,
26
+ workflowErrorHookEffectsActor,
27
+ workflowErrorHookSleepActor,
28
+ workflowFailedStepActor,
29
+ workflowNestedJoinActor,
30
+ workflowNestedLoopActor,
31
+ workflowNestedRaceActor,
16
32
  workflowQueueActor,
17
33
  workflowSleepActor,
34
+ workflowSpawnChildActor,
35
+ workflowSpawnParentActor,
18
36
  workflowStopTeardownActor
19
- } from "../chunk-R5OQUSLN.js";
20
- import "../chunk-WY2SHWXQ.js";
21
- import "../chunk-S662Y6ZU.js";
37
+ } from "../chunk-DK46YYCJ.js";
38
+ import "../chunk-SVHJSM2E.js";
22
39
  import {
23
40
  db as db2,
24
41
  integer,
25
42
  mod_exports,
26
43
  sqliteTable,
27
44
  text
28
- } from "../chunk-VKVNIQRQ.js";
45
+ } from "../chunk-K7MVU5SI.js";
46
+ import {
47
+ setup
48
+ } from "../chunk-JJSPHLJN.js";
29
49
  import {
30
50
  actor,
31
51
  event,
32
- queue,
33
- setup
34
- } from "../chunk-ZPWOYQHN.js";
52
+ queue
53
+ } from "../chunk-UQZRMTM3.js";
35
54
  import {
36
55
  createFileSystemOrMemoryDriver
37
- } from "../chunk-SRIM3GHD.js";
38
- import "../chunk-JPXO2H55.js";
39
- import "../chunk-2OK7S6QF.js";
56
+ } from "../chunk-EGWXXBZV.js";
57
+ import "../chunk-YGYGANCA.js";
58
+ import "../chunk-EONWXYMN.js";
59
+ import "../chunk-WW27B6DM.js";
60
+ import "../chunk-I5I6OALK.js";
40
61
  import {
41
62
  db
42
- } from "../chunk-KJSYAUOM.js";
43
- import "../chunk-N4KRDJ56.js";
63
+ } from "../chunk-MLK3GY6P.js";
64
+ import {
65
+ AsyncMutex,
66
+ toSqliteBindings
67
+ } from "../chunk-GFGRBYO2.js";
44
68
  import {
45
69
  buildManagerRouter
46
- } from "../chunk-MIX2KB6U.js";
70
+ } from "../chunk-C4EB42ET.js";
71
+ import "../chunk-PQWI44WD.js";
47
72
  import "../chunk-LXUQ667X.js";
48
- import "../chunk-TADUYCHF.js";
49
- import "../chunk-EIATSBYZ.js";
73
+ import "../chunk-C22JYHVT.js";
74
+ import "../chunk-VWYO36X4.js";
50
75
  import {
51
76
  ActorError,
52
77
  UserError
53
- } from "../chunk-7HTNH26M.js";
78
+ } from "../chunk-AKUJ5OTO.js";
54
79
  import "../chunk-424PT5DM.js";
55
80
 
56
81
  // src/serve-test-suite/mod.ts
@@ -361,10 +386,7 @@ var dbActorRaw = actor({
361
386
  actions: {
362
387
  configureDisconnectInsert: (c, enabled, delayMs) => {
363
388
  c.state.disconnectInsertEnabled = enabled;
364
- c.state.disconnectInsertDelayMs = Math.max(
365
- 0,
366
- Math.floor(delayMs)
367
- );
389
+ c.state.disconnectInsertDelayMs = Math.max(0, Math.floor(delayMs));
368
390
  },
369
391
  getDisconnectInsertCount: async (c) => {
370
392
  var _a;
@@ -386,9 +408,7 @@ var dbActorRaw = actor({
386
408
  return { id: results[0].id };
387
409
  },
388
410
  getValues: async (c) => {
389
- const results = await c.db.execute(
390
- `SELECT * FROM test_data ORDER BY id`
391
- );
411
+ const results = await c.db.execute(`SELECT * FROM test_data ORDER BY id`);
392
412
  return results;
393
413
  },
394
414
  getValue: async (c, id) => {
@@ -520,7 +540,9 @@ var dbActorRaw = actor({
520
540
  for (let i = 0; i < normalizedChurnCount; i++) {
521
541
  const id = i % normalizedSeedCount + 1;
522
542
  if (i % 9 === 0) {
523
- await c.db.execute(`DELETE FROM test_data WHERE id = ${id}`);
543
+ await c.db.execute(
544
+ `DELETE FROM test_data WHERE id = ${id}`
545
+ );
524
546
  } else {
525
547
  const payload = makePayload(768 + i % 7 * 96);
526
548
  await c.db.execute(
@@ -654,10 +676,7 @@ var dbActorDrizzle = actor({
654
676
  actions: {
655
677
  configureDisconnectInsert: (c, enabled, delayMs) => {
656
678
  c.state.disconnectInsertEnabled = enabled;
657
- c.state.disconnectInsertDelayMs = Math.max(
658
- 0,
659
- Math.floor(delayMs)
660
- );
679
+ c.state.disconnectInsertDelayMs = Math.max(0, Math.floor(delayMs));
661
680
  },
662
681
  getDisconnectInsertCount: async (c) => {
663
682
  var _a;
@@ -679,9 +698,7 @@ var dbActorDrizzle = actor({
679
698
  return { id: results[0].id };
680
699
  },
681
700
  getValues: async (c) => {
682
- const results = await c.db.execute(
683
- `SELECT * FROM test_data ORDER BY id`
684
- );
701
+ const results = await c.db.execute(`SELECT * FROM test_data ORDER BY id`);
685
702
  return results;
686
703
  },
687
704
  getValue: async (c, id) => {
@@ -814,7 +831,9 @@ var dbActorDrizzle = actor({
814
831
  for (let i = 0; i < normalizedChurnCount; i++) {
815
832
  const id = i % normalizedSeedCount + 1;
816
833
  if (i % 9 === 0) {
817
- await c.db.execute(`DELETE FROM test_data WHERE id = ${id}`);
834
+ await c.db.execute(
835
+ `DELETE FROM test_data WHERE id = ${id}`
836
+ );
818
837
  } else {
819
838
  const payload = makePayload2(768 + i % 7 * 96);
820
839
  await c.db.execute(
@@ -1142,6 +1161,9 @@ var connStateActor = actor({
1142
1161
  // fixtures/driver-test-suite/counter.ts
1143
1162
  var counter = actor({
1144
1163
  state: { count: 0 },
1164
+ events: {
1165
+ newCount: event()
1166
+ },
1145
1167
  actions: {
1146
1168
  increment: (c, x) => {
1147
1169
  c.state.count += x;
@@ -1168,6 +1190,9 @@ var counterConn = actor({
1168
1190
  connectionCount: 0
1169
1191
  },
1170
1192
  connState: { count: 0 },
1193
+ events: {
1194
+ newCount: event()
1195
+ },
1171
1196
  onConnect: (c, conn) => {
1172
1197
  c.state.connectionCount += 1;
1173
1198
  },
@@ -1414,6 +1439,20 @@ var kvActor = actor({
1414
1439
  value
1415
1440
  }));
1416
1441
  },
1442
+ listTextRange: async (c, start, end, options) => {
1443
+ const results = await c.kv.listRange(start, end, {
1444
+ keyType: "text",
1445
+ ...options
1446
+ });
1447
+ return results.map(([key, value]) => ({
1448
+ key,
1449
+ value
1450
+ }));
1451
+ },
1452
+ deleteTextRange: async (c, start, end) => {
1453
+ await c.kv.deleteRange(start, end);
1454
+ return true;
1455
+ },
1417
1456
  roundtripArrayBuffer: async (c, key, values) => {
1418
1457
  const buffer = new Uint8Array(values).buffer;
1419
1458
  await c.kv.put(key, buffer, { type: "arrayBuffer" });
@@ -1446,7 +1485,9 @@ var largePayloadActor = actor({
1446
1485
  getLargeResponse: (c, itemCount) => {
1447
1486
  const items = [];
1448
1487
  for (let i = 0; i < itemCount; i++) {
1449
- items.push(`Item ${i} with some additional text to increase size`);
1488
+ items.push(
1489
+ `Item ${i} with some additional text to increase size`
1490
+ );
1450
1491
  }
1451
1492
  return { items };
1452
1493
  },
@@ -1481,7 +1522,9 @@ var largePayloadConnActor = actor({
1481
1522
  getLargeResponse: (c, itemCount) => {
1482
1523
  const items = [];
1483
1524
  for (let i = 0; i < itemCount; i++) {
1484
- items.push(`Item ${i} with some additional text to increase size`);
1525
+ items.push(
1526
+ `Item ${i} with some additional text to increase size`
1527
+ );
1485
1528
  }
1486
1529
  return { items };
1487
1530
  },
@@ -1595,209 +1638,6 @@ var metadataActor = actor({
1595
1638
  }
1596
1639
  });
1597
1640
 
1598
- // fixtures/driver-test-suite/queue.ts
1599
- var queueSchemas = {
1600
- greeting: queue(),
1601
- self: queue(),
1602
- a: queue(),
1603
- b: queue(),
1604
- c: queue(),
1605
- one: queue(),
1606
- two: queue(),
1607
- missing: queue(),
1608
- abort: queue(),
1609
- tasks: queue(),
1610
- timeout: queue(),
1611
- nowait: queue(),
1612
- twice: queue()
1613
- };
1614
- var queueActor = actor({
1615
- state: {},
1616
- queues: queueSchemas,
1617
- actions: {
1618
- receiveOne: async (c, name, opts) => {
1619
- const message = await c.queue.next({
1620
- names: [name],
1621
- timeout: opts == null ? void 0 : opts.timeout
1622
- });
1623
- if (!message) {
1624
- return null;
1625
- }
1626
- return { name: message.name, body: message.body };
1627
- },
1628
- receiveMany: async (c, names, opts) => {
1629
- const messages = await c.queue.nextBatch({
1630
- names,
1631
- count: opts == null ? void 0 : opts.count,
1632
- timeout: opts == null ? void 0 : opts.timeout
1633
- });
1634
- return messages.map((message) => ({
1635
- name: message.name,
1636
- body: message.body
1637
- }));
1638
- },
1639
- receiveRequest: async (c, request) => {
1640
- const messages = await c.queue.nextBatch(request);
1641
- return messages.map((message) => ({
1642
- name: message.name,
1643
- body: message.body
1644
- }));
1645
- },
1646
- tryReceiveMany: async (c, request) => {
1647
- const messages = await c.queue.tryNextBatch(request);
1648
- return messages.map((message) => ({
1649
- name: message.name,
1650
- body: message.body
1651
- }));
1652
- },
1653
- receiveWithIterator: async (c, name) => {
1654
- for await (const message of c.queue.iter({ names: [name] })) {
1655
- return { name: message.name, body: message.body };
1656
- }
1657
- return null;
1658
- },
1659
- receiveWithAsyncIterator: async (c) => {
1660
- for await (const message of c.queue.iter()) {
1661
- return { name: message.name, body: message.body };
1662
- }
1663
- return null;
1664
- },
1665
- sendToSelf: async (c, name, body) => {
1666
- const client = c.client();
1667
- const handle = client.queueActor.getForId(c.actorId);
1668
- await handle.send(name, body);
1669
- return true;
1670
- },
1671
- waitForAbort: async (c) => {
1672
- setTimeout(() => {
1673
- c.destroy();
1674
- }, 10);
1675
- await c.queue.next({ names: ["abort"], timeout: 1e4 });
1676
- return true;
1677
- },
1678
- waitForSignalAbort: async (c) => {
1679
- const controller = new AbortController();
1680
- controller.abort();
1681
- try {
1682
- await c.queue.next({
1683
- names: ["abort"],
1684
- timeout: 1e4,
1685
- signal: controller.signal
1686
- });
1687
- return { ok: false };
1688
- } catch (error) {
1689
- const actorError = error;
1690
- return { group: actorError.group, code: actorError.code };
1691
- }
1692
- },
1693
- waitForActorAbortWithSignal: async (c) => {
1694
- const controller = new AbortController();
1695
- setTimeout(() => {
1696
- c.destroy();
1697
- }, 10);
1698
- try {
1699
- await c.queue.next({
1700
- names: ["abort"],
1701
- timeout: 1e4,
1702
- signal: controller.signal
1703
- });
1704
- return { ok: false };
1705
- } catch (error) {
1706
- const actorError = error;
1707
- return { group: actorError.group, code: actorError.code };
1708
- }
1709
- },
1710
- iterWithSignalAbort: async (c) => {
1711
- const controller = new AbortController();
1712
- controller.abort();
1713
- for await (const _message of c.queue.iter({
1714
- names: ["abort"],
1715
- signal: controller.signal
1716
- })) {
1717
- return { ok: false };
1718
- }
1719
- return { ok: true };
1720
- },
1721
- receiveAndComplete: async (c, name) => {
1722
- const message = await c.queue.next({
1723
- names: [name],
1724
- completable: true
1725
- });
1726
- if (!message) {
1727
- return null;
1728
- }
1729
- await message.complete({ echo: message.body });
1730
- return { name: message.name, body: message.body };
1731
- },
1732
- receiveWithoutComplete: async (c, name) => {
1733
- const message = await c.queue.next({
1734
- names: [name],
1735
- completable: true
1736
- });
1737
- if (!message) {
1738
- return null;
1739
- }
1740
- return { name: message.name, body: message.body };
1741
- },
1742
- receiveManualThenNextWithoutComplete: async (c, name) => {
1743
- const message = await c.queue.next({
1744
- names: [name],
1745
- completable: true
1746
- });
1747
- if (!message) {
1748
- return { ok: false, reason: "no_message" };
1749
- }
1750
- try {
1751
- await c.queue.next({ names: [name], timeout: 0 });
1752
- c.destroy();
1753
- return { ok: false, reason: "next_succeeded" };
1754
- } catch (error) {
1755
- c.destroy();
1756
- const actorError = error;
1757
- return { group: actorError.group, code: actorError.code };
1758
- }
1759
- },
1760
- receiveAndCompleteTwice: async (c, name) => {
1761
- const message = await c.queue.next({
1762
- names: [name],
1763
- completable: true
1764
- });
1765
- if (!message) {
1766
- return null;
1767
- }
1768
- await message.complete({ ok: true });
1769
- try {
1770
- await message.complete({ ok: true });
1771
- return { ok: false };
1772
- } catch (error) {
1773
- const actorError = error;
1774
- return { group: actorError.group, code: actorError.code };
1775
- }
1776
- },
1777
- receiveWithoutCompleteMethod: async (c, name) => {
1778
- const message = await c.queue.next({
1779
- names: [name],
1780
- completable: true
1781
- });
1782
- return {
1783
- hasComplete: message !== void 0 && typeof message.complete === "function"
1784
- };
1785
- }
1786
- }
1787
- });
1788
- var queueLimitedActor = actor({
1789
- state: {},
1790
- queues: {
1791
- message: queue(),
1792
- oversize: queue()
1793
- },
1794
- actions: {},
1795
- options: {
1796
- maxQueueSize: 1,
1797
- maxQueueMessageSize: 64
1798
- }
1799
- });
1800
-
1801
1641
  // fixtures/driver-test-suite/raw-http.ts
1802
1642
  import { Hono } from "hono";
1803
1643
  var rawHttpActor = actor({
@@ -2455,6 +2295,270 @@ var connErrorSerializationActor = actor({
2455
2295
  }
2456
2296
  });
2457
2297
 
2298
+ // fixtures/driver-test-suite/db-kv-stats.ts
2299
+ var FILE_TAGS = { 0: "main", 1: "journal", 2: "wal", 3: "shm" };
2300
+ function decodeKey(key) {
2301
+ if (key.length < 4 || key[0] !== 8 || key[1] !== 1) {
2302
+ return `unknown(${Array.from(key).join(",")})`;
2303
+ }
2304
+ const prefix = key[2];
2305
+ const fileTag = FILE_TAGS[key[3]] ?? `file${key[3]}`;
2306
+ if (prefix === 0) {
2307
+ return `meta:${fileTag}`;
2308
+ }
2309
+ if (prefix === 1 && key.length === 8) {
2310
+ const chunkIndex = key[4] << 24 | key[5] << 16 | key[6] << 8 | key[7];
2311
+ return `chunk:${fileTag}[${chunkIndex}]`;
2312
+ }
2313
+ return `unknown(${Array.from(key).join(",")})`;
2314
+ }
2315
+ function instrumentedKvStore(kv, stats, log) {
2316
+ return {
2317
+ get: async (key) => {
2318
+ stats.getBatchCalls++;
2319
+ stats.getBatchKeys++;
2320
+ log.push({ op: "get", keys: [decodeKey(key)] });
2321
+ const results = await kv.batchGet([key]);
2322
+ return results[0] ?? null;
2323
+ },
2324
+ getBatch: async (keys) => {
2325
+ stats.getBatchCalls++;
2326
+ stats.getBatchKeys += keys.length;
2327
+ log.push({ op: "getBatch", keys: keys.map(decodeKey) });
2328
+ return await kv.batchGet(keys);
2329
+ },
2330
+ put: async (key, value) => {
2331
+ stats.putBatchCalls++;
2332
+ stats.putBatchEntries++;
2333
+ log.push({ op: "put", keys: [decodeKey(key)] });
2334
+ await kv.batchPut([[key, value]]);
2335
+ },
2336
+ putBatch: async (entries) => {
2337
+ stats.putBatchCalls++;
2338
+ stats.putBatchEntries += entries.length;
2339
+ log.push({ op: "putBatch", keys: entries.map(([k]) => decodeKey(k)) });
2340
+ await kv.batchPut(entries);
2341
+ },
2342
+ deleteBatch: async (keys) => {
2343
+ stats.deleteBatchCalls++;
2344
+ log.push({ op: "deleteBatch", keys: keys.map(decodeKey) });
2345
+ await kv.batchDelete(keys);
2346
+ }
2347
+ };
2348
+ }
2349
+ var perActorData = /* @__PURE__ */ new Map();
2350
+ function getOrCreateData(actorId) {
2351
+ let d = perActorData.get(actorId);
2352
+ if (!d) {
2353
+ d = {
2354
+ stats: { getBatchCalls: 0, getBatchKeys: 0, putBatchCalls: 0, putBatchEntries: 0, deleteBatchCalls: 0 },
2355
+ log: []
2356
+ };
2357
+ perActorData.set(actorId, d);
2358
+ }
2359
+ return d;
2360
+ }
2361
+ var provider = {
2362
+ createClient: async (ctx) => {
2363
+ if (!ctx.sqliteVfs) {
2364
+ throw new Error("SqliteVfs instance not provided in context.");
2365
+ }
2366
+ const data = getOrCreateData(ctx.actorId);
2367
+ const kvStore = instrumentedKvStore(ctx.kv, data.stats, data.log);
2368
+ const db3 = await ctx.sqliteVfs.open(ctx.actorId, kvStore);
2369
+ let closed = false;
2370
+ const mutex = new AsyncMutex();
2371
+ const ensureOpen = () => {
2372
+ if (closed) throw new Error("database is closed");
2373
+ };
2374
+ return {
2375
+ execute: async (query, ...args) => {
2376
+ return await mutex.run(async () => {
2377
+ ensureOpen();
2378
+ if (args.length > 0) {
2379
+ const bindings = toSqliteBindings(args);
2380
+ const token = query.trimStart().slice(0, 16).toUpperCase();
2381
+ const returnsRows = token.startsWith("SELECT") || token.startsWith("PRAGMA") || token.startsWith("WITH");
2382
+ if (returnsRows) {
2383
+ const { rows, columns } = await db3.query(query, bindings);
2384
+ return rows.map((row) => {
2385
+ const rowObj = {};
2386
+ for (let i = 0; i < columns.length; i++) {
2387
+ rowObj[columns[i]] = row[i];
2388
+ }
2389
+ return rowObj;
2390
+ });
2391
+ }
2392
+ await db3.run(query, bindings);
2393
+ return [];
2394
+ }
2395
+ const results = [];
2396
+ let columnNames = null;
2397
+ await db3.exec(query, (row, columns) => {
2398
+ if (!columnNames) columnNames = columns;
2399
+ const rowObj = {};
2400
+ for (let i = 0; i < row.length; i++) {
2401
+ rowObj[columnNames[i]] = row[i];
2402
+ }
2403
+ results.push(rowObj);
2404
+ });
2405
+ return results;
2406
+ });
2407
+ },
2408
+ close: async () => {
2409
+ const shouldClose = await mutex.run(async () => {
2410
+ if (closed) return false;
2411
+ closed = true;
2412
+ return true;
2413
+ });
2414
+ if (shouldClose) {
2415
+ await db3.close();
2416
+ }
2417
+ }
2418
+ };
2419
+ },
2420
+ onMigrate: async (client) => {
2421
+ await client.execute(`
2422
+ CREATE TABLE IF NOT EXISTS counter (
2423
+ id INTEGER PRIMARY KEY,
2424
+ count INTEGER NOT NULL DEFAULT 0
2425
+ )
2426
+ `);
2427
+ await client.execute(`INSERT OR IGNORE INTO counter (id, count) VALUES (1, 0)`);
2428
+ },
2429
+ onDestroy: async (client) => {
2430
+ await client.close();
2431
+ }
2432
+ };
2433
+ var dbKvStatsActor = actor({
2434
+ state: {},
2435
+ db: provider,
2436
+ actions: {
2437
+ warmUp: async (c) => {
2438
+ await c.db.execute(`UPDATE counter SET count = count + 1 WHERE id = 1`);
2439
+ await c.db.execute(`UPDATE counter SET count = count + 1 WHERE id = 1`);
2440
+ const data = getOrCreateData(c.actorId);
2441
+ data.stats.getBatchCalls = 0;
2442
+ data.stats.getBatchKeys = 0;
2443
+ data.stats.putBatchCalls = 0;
2444
+ data.stats.putBatchEntries = 0;
2445
+ data.stats.deleteBatchCalls = 0;
2446
+ data.log.length = 0;
2447
+ },
2448
+ resetStats: (c) => {
2449
+ const data = getOrCreateData(c.actorId);
2450
+ data.stats.getBatchCalls = 0;
2451
+ data.stats.getBatchKeys = 0;
2452
+ data.stats.putBatchCalls = 0;
2453
+ data.stats.putBatchEntries = 0;
2454
+ data.stats.deleteBatchCalls = 0;
2455
+ data.log.length = 0;
2456
+ },
2457
+ getStats: (c) => {
2458
+ return { ...getOrCreateData(c.actorId).stats };
2459
+ },
2460
+ getLog: (c) => {
2461
+ return getOrCreateData(c.actorId).log;
2462
+ },
2463
+ increment: async (c) => {
2464
+ await c.db.execute(`UPDATE counter SET count = count + 1 WHERE id = 1`);
2465
+ },
2466
+ getCount: async (c) => {
2467
+ var _a;
2468
+ const rows = await c.db.execute(
2469
+ `SELECT count FROM counter WHERE id = 1`
2470
+ );
2471
+ return ((_a = rows[0]) == null ? void 0 : _a.count) ?? 0;
2472
+ },
2473
+ incrementAndRead: async (c) => {
2474
+ var _a;
2475
+ await c.db.execute(`UPDATE counter SET count = count + 1 WHERE id = 1`);
2476
+ const rows = await c.db.execute(
2477
+ `SELECT count FROM counter WHERE id = 1`
2478
+ );
2479
+ return ((_a = rows[0]) == null ? void 0 : _a.count) ?? 0;
2480
+ },
2481
+ insertWithIndex: async (c) => {
2482
+ await c.db.execute(`
2483
+ CREATE TABLE IF NOT EXISTS indexed_data (
2484
+ id INTEGER PRIMARY KEY,
2485
+ value TEXT NOT NULL
2486
+ )
2487
+ `);
2488
+ await c.db.execute(`
2489
+ CREATE INDEX IF NOT EXISTS idx_indexed_data_value ON indexed_data(value)
2490
+ `);
2491
+ await c.db.execute(
2492
+ `INSERT INTO indexed_data (value) VALUES (?)`,
2493
+ `row-${Date.now()}`
2494
+ );
2495
+ },
2496
+ rollbackTest: async (c) => {
2497
+ await c.db.execute(`
2498
+ CREATE TABLE IF NOT EXISTS rollback_test (
2499
+ id INTEGER PRIMARY KEY,
2500
+ value TEXT NOT NULL
2501
+ )
2502
+ `);
2503
+ await c.db.execute(`
2504
+ BEGIN;
2505
+ INSERT INTO rollback_test (value) VALUES ('should-not-persist');
2506
+ ROLLBACK;
2507
+ `);
2508
+ },
2509
+ multiStmtTx: async (c) => {
2510
+ await c.db.execute(`
2511
+ CREATE TABLE IF NOT EXISTS multi_stmt (
2512
+ id INTEGER PRIMARY KEY,
2513
+ value TEXT NOT NULL
2514
+ )
2515
+ `);
2516
+ await c.db.execute(`
2517
+ BEGIN;
2518
+ INSERT INTO multi_stmt (value) VALUES ('row-a');
2519
+ INSERT INTO multi_stmt (value) VALUES ('row-b');
2520
+ COMMIT;
2521
+ `);
2522
+ },
2523
+ bulkInsertLarge: async (c) => {
2524
+ await c.db.execute(`
2525
+ CREATE TABLE IF NOT EXISTS bulk_data (
2526
+ id INTEGER PRIMARY KEY,
2527
+ payload TEXT NOT NULL
2528
+ )
2529
+ `);
2530
+ const pad = "x".repeat(4e3);
2531
+ const stmts = ["BEGIN;"];
2532
+ for (let i = 0; i < 200; i++) {
2533
+ const escaped = `bulk-${i}-${pad}`.replace(/'/g, "''");
2534
+ stmts.push(`INSERT INTO bulk_data (payload) VALUES ('${escaped}');`);
2535
+ }
2536
+ stmts.push("COMMIT;");
2537
+ await c.db.execute(stmts.join("\n"));
2538
+ },
2539
+ getRowCount: async (c) => {
2540
+ var _a;
2541
+ const rows = await c.db.execute(
2542
+ `SELECT COUNT(*) as cnt FROM bulk_data`
2543
+ );
2544
+ return ((_a = rows[0]) == null ? void 0 : _a.cnt) ?? 0;
2545
+ },
2546
+ runIntegrityCheck: async (c) => {
2547
+ var _a;
2548
+ const rows = await c.db.execute(
2549
+ `PRAGMA integrity_check`
2550
+ );
2551
+ return ((_a = rows[0]) == null ? void 0 : _a.integrity_check) ?? "unknown";
2552
+ },
2553
+ triggerSleep: (c) => {
2554
+ c.sleep();
2555
+ }
2556
+ },
2557
+ options: {
2558
+ sleepTimeout: 100
2559
+ }
2560
+ });
2561
+
2458
2562
  // fixtures/driver-test-suite/registry.ts
2459
2563
  var registry = setup({
2460
2564
  use: {
@@ -2466,12 +2570,16 @@ var registry = setup({
2466
2570
  counterWithLifecycle,
2467
2571
  // From scheduled.ts
2468
2572
  scheduled,
2573
+ // From sandbox.ts
2574
+ // dockerSandboxActor,
2469
2575
  // From sleep.ts
2470
2576
  sleep,
2471
2577
  sleepWithLongRpc,
2472
2578
  sleepWithRawHttp,
2473
2579
  sleepWithRawWebSocket,
2474
2580
  sleepWithNoSleepOption,
2581
+ sleepWithPreventSleep,
2582
+ sleepWithWaitUntilMessage,
2475
2583
  // From error-handling.ts
2476
2584
  errorHandlingActor,
2477
2585
  customTimeoutActor,
@@ -2482,6 +2590,9 @@ var registry = setup({
2482
2590
  // From queue.ts
2483
2591
  queueActor,
2484
2592
  queueLimitedActor,
2593
+ manyQueueChildActor,
2594
+ manyQueueActionParentActor,
2595
+ manyQueueRunParentActor,
2485
2596
  // From action-inputs.ts
2486
2597
  inputActor,
2487
2598
  // From action-timeout.ts
@@ -2541,8 +2652,19 @@ var registry = setup({
2541
2652
  workflowCounterActor,
2542
2653
  workflowQueueActor,
2543
2654
  workflowAccessActor,
2655
+ workflowCompleteActor,
2656
+ workflowDestroyActor,
2657
+ workflowFailedStepActor,
2544
2658
  workflowSleepActor,
2545
2659
  workflowStopTeardownActor,
2660
+ workflowErrorHookActor,
2661
+ workflowErrorHookEffectsActor,
2662
+ workflowErrorHookSleepActor,
2663
+ workflowNestedLoopActor,
2664
+ workflowNestedJoinActor,
2665
+ workflowNestedRaceActor,
2666
+ workflowSpawnChildActor,
2667
+ workflowSpawnParentActor,
2546
2668
  // From actor-db-raw.ts
2547
2669
  dbActorRaw,
2548
2670
  // From actor-db-drizzle.ts
@@ -2560,7 +2682,9 @@ var registry = setup({
2560
2682
  startStopRaceActor,
2561
2683
  lifecycleObserver,
2562
2684
  // From conn-error-serialization.ts
2563
- connErrorSerializationActor
2685
+ connErrorSerializationActor,
2686
+ // From db-kv-stats.ts
2687
+ dbKvStatsActor
2564
2688
  }
2565
2689
  });
2566
2690