rivetkit 2.0.24-rc.1 → 2.0.25-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 (231) hide show
  1. package/dist/schemas/actor-persist/v1.ts +6 -0
  2. package/dist/schemas/actor-persist/v2.ts +9 -3
  3. package/dist/schemas/actor-persist/v3.ts +280 -0
  4. package/dist/schemas/client-protocol/v1.ts +6 -0
  5. package/dist/schemas/client-protocol/v2.ts +438 -0
  6. package/dist/schemas/file-system-driver/v1.ts +6 -0
  7. package/dist/schemas/file-system-driver/v2.ts +142 -0
  8. package/dist/tsup/actor/errors.cjs +2 -4
  9. package/dist/tsup/actor/errors.cjs.map +1 -1
  10. package/dist/tsup/actor/errors.d.cts +7 -10
  11. package/dist/tsup/actor/errors.d.ts +7 -10
  12. package/dist/tsup/actor/errors.js +9 -11
  13. package/dist/tsup/{actor-router-consts-B3Lu87yJ.d.cts → actor-router-consts-DzI2szci.d.cts} +5 -9
  14. package/dist/tsup/{actor-router-consts-B3Lu87yJ.d.ts → actor-router-consts-DzI2szci.d.ts} +5 -9
  15. package/dist/tsup/{chunk-ZTH3KYFH.cjs → chunk-3FG5OJ3G.cjs} +3 -3
  16. package/dist/tsup/{chunk-ZTH3KYFH.cjs.map → chunk-3FG5OJ3G.cjs.map} +1 -1
  17. package/dist/tsup/{chunk-BLK27ES3.js → chunk-6JN6W6G3.js} +44 -56
  18. package/dist/tsup/chunk-6JN6W6G3.js.map +1 -0
  19. package/dist/tsup/chunk-7IBNNGQ2.js +514 -0
  20. package/dist/tsup/chunk-7IBNNGQ2.js.map +1 -0
  21. package/dist/tsup/{chunk-36JJ4IQB.cjs → chunk-AZATXPR4.cjs} +4 -8
  22. package/dist/tsup/chunk-AZATXPR4.cjs.map +1 -0
  23. package/dist/tsup/chunk-B7MENRD5.cjs +5694 -0
  24. package/dist/tsup/chunk-B7MENRD5.cjs.map +1 -0
  25. package/dist/tsup/{chunk-BOMZS2TJ.js → chunk-BBVFDEYD.js} +9 -9
  26. package/dist/tsup/chunk-BBVFDEYD.js.map +1 -0
  27. package/dist/tsup/{chunk-KSRXX3Z4.cjs → chunk-D6762AOA.cjs} +20 -25
  28. package/dist/tsup/chunk-D6762AOA.cjs.map +1 -0
  29. package/dist/tsup/{chunk-2JYPS5YM.cjs → chunk-E63WZNMR.cjs} +6 -6
  30. package/dist/tsup/chunk-E63WZNMR.cjs.map +1 -0
  31. package/dist/tsup/{chunk-YBG6R7LX.js → chunk-EDGN4OC7.js} +3 -7
  32. package/dist/tsup/chunk-EDGN4OC7.js.map +1 -0
  33. package/dist/tsup/{chunk-BYMKMOBS.js → chunk-FLOQ3UWM.js} +1844 -1681
  34. package/dist/tsup/chunk-FLOQ3UWM.js.map +1 -0
  35. package/dist/tsup/{chunk-7L65NNWP.cjs → chunk-H7GV5DIW.cjs} +187 -185
  36. package/dist/tsup/chunk-H7GV5DIW.cjs.map +1 -0
  37. package/dist/tsup/{chunk-227FEWMB.js → chunk-HZYZ7JSF.js} +3322 -2251
  38. package/dist/tsup/chunk-HZYZ7JSF.js.map +1 -0
  39. package/dist/tsup/{chunk-FX7TWFQR.js → chunk-IDJK7ILQ.js} +2 -6
  40. package/dist/tsup/chunk-IDJK7ILQ.js.map +1 -0
  41. package/dist/tsup/{chunk-VHGY7PU5.cjs → chunk-ILFXA4AL.cjs} +1900 -1737
  42. package/dist/tsup/chunk-ILFXA4AL.cjs.map +1 -0
  43. package/dist/tsup/chunk-MV6M3FDL.cjs +514 -0
  44. package/dist/tsup/chunk-MV6M3FDL.cjs.map +1 -0
  45. package/dist/tsup/{chunk-PLUN2NQT.js → chunk-NWBKMCWC.js} +189 -187
  46. package/dist/tsup/chunk-NWBKMCWC.js.map +1 -0
  47. package/dist/tsup/{chunk-CD33GT6Z.js → chunk-QIHBDXTO.js} +2 -2
  48. package/dist/tsup/{chunk-G64QUEDJ.js → chunk-W6RDS6NW.js} +23 -28
  49. package/dist/tsup/chunk-W6RDS6NW.js.map +1 -0
  50. package/dist/tsup/{chunk-INNFK746.cjs → chunk-WQU4M4ZC.cjs} +10 -14
  51. package/dist/tsup/chunk-WQU4M4ZC.cjs.map +1 -0
  52. package/dist/tsup/{chunk-SHVX2QUR.cjs → chunk-XKZA47XS.cjs} +17 -17
  53. package/dist/tsup/chunk-XKZA47XS.cjs.map +1 -0
  54. package/dist/tsup/{chunk-HHFKKVLR.cjs → chunk-YHWIOWVA.cjs} +45 -57
  55. package/dist/tsup/chunk-YHWIOWVA.cjs.map +1 -0
  56. package/dist/tsup/{chunk-YBHYXIP6.js → chunk-YVL6IRUM.js} +3 -3
  57. package/dist/tsup/chunk-YVL6IRUM.js.map +1 -0
  58. package/dist/tsup/client/mod.cjs +9 -9
  59. package/dist/tsup/client/mod.d.cts +5 -7
  60. package/dist/tsup/client/mod.d.ts +5 -7
  61. package/dist/tsup/client/mod.js +8 -8
  62. package/dist/tsup/common/log.cjs +3 -3
  63. package/dist/tsup/common/log.js +2 -2
  64. package/dist/tsup/common/websocket.cjs +4 -4
  65. package/dist/tsup/common/websocket.js +3 -3
  66. package/dist/tsup/{conn-B3Vhbgnd.d.ts → config-BRDYDraU.d.cts} +1119 -1047
  67. package/dist/tsup/{conn-DJWL3nGx.d.cts → config-Bo-blHpJ.d.ts} +1119 -1047
  68. package/dist/tsup/driver-helpers/mod.cjs +5 -13
  69. package/dist/tsup/driver-helpers/mod.cjs.map +1 -1
  70. package/dist/tsup/driver-helpers/mod.d.cts +11 -9
  71. package/dist/tsup/driver-helpers/mod.d.ts +11 -9
  72. package/dist/tsup/driver-helpers/mod.js +14 -22
  73. package/dist/tsup/driver-test-suite/mod.cjs +474 -303
  74. package/dist/tsup/driver-test-suite/mod.cjs.map +1 -1
  75. package/dist/tsup/driver-test-suite/mod.d.cts +6 -9
  76. package/dist/tsup/driver-test-suite/mod.d.ts +6 -9
  77. package/dist/tsup/driver-test-suite/mod.js +1085 -914
  78. package/dist/tsup/driver-test-suite/mod.js.map +1 -1
  79. package/dist/tsup/inspector/mod.cjs +6 -6
  80. package/dist/tsup/inspector/mod.d.cts +5 -7
  81. package/dist/tsup/inspector/mod.d.ts +5 -7
  82. package/dist/tsup/inspector/mod.js +5 -5
  83. package/dist/tsup/mod.cjs +10 -16
  84. package/dist/tsup/mod.cjs.map +1 -1
  85. package/dist/tsup/mod.d.cts +23 -25
  86. package/dist/tsup/mod.d.ts +23 -25
  87. package/dist/tsup/mod.js +17 -23
  88. package/dist/tsup/test/mod.cjs +11 -11
  89. package/dist/tsup/test/mod.d.cts +4 -6
  90. package/dist/tsup/test/mod.d.ts +4 -6
  91. package/dist/tsup/test/mod.js +10 -10
  92. package/dist/tsup/utils.cjs +3 -5
  93. package/dist/tsup/utils.cjs.map +1 -1
  94. package/dist/tsup/utils.d.cts +1 -2
  95. package/dist/tsup/utils.d.ts +1 -2
  96. package/dist/tsup/utils.js +2 -4
  97. package/package.json +13 -6
  98. package/src/actor/config.ts +56 -44
  99. package/src/actor/conn/driver.ts +61 -0
  100. package/src/actor/conn/drivers/http.ts +17 -0
  101. package/src/actor/conn/drivers/raw-request.ts +24 -0
  102. package/src/actor/conn/drivers/raw-websocket.ts +65 -0
  103. package/src/actor/conn/drivers/websocket.ts +129 -0
  104. package/src/actor/conn/mod.ts +232 -0
  105. package/src/actor/conn/persisted.ts +81 -0
  106. package/src/actor/conn/state-manager.ts +196 -0
  107. package/src/actor/contexts/action.ts +23 -0
  108. package/src/actor/{context.ts → contexts/actor.ts} +19 -8
  109. package/src/actor/contexts/conn-init.ts +31 -0
  110. package/src/actor/contexts/conn.ts +48 -0
  111. package/src/actor/contexts/create-conn-state.ts +13 -0
  112. package/src/actor/contexts/on-before-connect.ts +13 -0
  113. package/src/actor/contexts/on-connect.ts +22 -0
  114. package/src/actor/contexts/request.ts +48 -0
  115. package/src/actor/contexts/websocket.ts +48 -0
  116. package/src/actor/definition.ts +3 -3
  117. package/src/actor/driver.ts +36 -5
  118. package/src/actor/errors.ts +19 -24
  119. package/src/actor/instance/connection-manager.ts +465 -0
  120. package/src/actor/instance/event-manager.ts +292 -0
  121. package/src/actor/instance/kv.ts +15 -0
  122. package/src/actor/instance/mod.ts +1107 -0
  123. package/src/actor/instance/persisted.ts +67 -0
  124. package/src/actor/instance/schedule-manager.ts +349 -0
  125. package/src/actor/instance/state-manager.ts +502 -0
  126. package/src/actor/mod.ts +13 -16
  127. package/src/actor/protocol/old.ts +131 -43
  128. package/src/actor/protocol/serde.ts +19 -4
  129. package/src/actor/router-endpoints.ts +61 -586
  130. package/src/actor/router-websocket-endpoints.ts +408 -0
  131. package/src/actor/router.ts +63 -197
  132. package/src/actor/schedule.ts +1 -1
  133. package/src/client/actor-conn.ts +183 -249
  134. package/src/client/actor-handle.ts +29 -6
  135. package/src/client/client.ts +0 -4
  136. package/src/client/config.ts +1 -4
  137. package/src/client/mod.ts +0 -1
  138. package/src/client/raw-utils.ts +3 -3
  139. package/src/client/utils.ts +85 -39
  140. package/src/common/actor-router-consts.ts +5 -12
  141. package/src/common/{inline-websocket-adapter2.ts → inline-websocket-adapter.ts} +26 -48
  142. package/src/common/log.ts +1 -1
  143. package/src/common/router.ts +28 -17
  144. package/src/common/utils.ts +2 -0
  145. package/src/driver-helpers/mod.ts +7 -10
  146. package/src/driver-helpers/utils.ts +18 -9
  147. package/src/driver-test-suite/mod.ts +26 -50
  148. package/src/driver-test-suite/test-inline-client-driver.ts +27 -51
  149. package/src/driver-test-suite/tests/actor-conn-hibernation.ts +150 -0
  150. package/src/driver-test-suite/tests/actor-conn-state.ts +1 -4
  151. package/src/driver-test-suite/tests/actor-conn.ts +5 -9
  152. package/src/driver-test-suite/tests/actor-destroy.ts +294 -0
  153. package/src/driver-test-suite/tests/actor-driver.ts +0 -7
  154. package/src/driver-test-suite/tests/actor-handle.ts +12 -12
  155. package/src/driver-test-suite/tests/actor-metadata.ts +1 -1
  156. package/src/driver-test-suite/tests/manager-driver.ts +1 -1
  157. package/src/driver-test-suite/tests/raw-http-direct-registry.ts +8 -8
  158. package/src/driver-test-suite/tests/raw-http-request-properties.ts +6 -5
  159. package/src/driver-test-suite/tests/raw-http.ts +5 -5
  160. package/src/driver-test-suite/tests/raw-websocket-direct-registry.ts +7 -7
  161. package/src/driver-test-suite/tests/request-access.ts +4 -4
  162. package/src/driver-test-suite/utils.ts +6 -10
  163. package/src/drivers/engine/actor-driver.ts +614 -424
  164. package/src/drivers/engine/mod.ts +0 -1
  165. package/src/drivers/file-system/actor.ts +24 -12
  166. package/src/drivers/file-system/global-state.ts +427 -37
  167. package/src/drivers/file-system/manager.ts +71 -83
  168. package/src/drivers/file-system/mod.ts +3 -0
  169. package/src/drivers/file-system/utils.ts +18 -8
  170. package/src/engine-process/mod.ts +38 -38
  171. package/src/inspector/utils.ts +7 -5
  172. package/src/manager/driver.ts +11 -4
  173. package/src/manager/gateway.ts +4 -29
  174. package/src/manager/protocol/mod.ts +0 -2
  175. package/src/manager/protocol/query.ts +0 -4
  176. package/src/manager/router.ts +67 -64
  177. package/src/manager-api/actors.ts +13 -0
  178. package/src/mod.ts +1 -3
  179. package/src/registry/mod.ts +20 -20
  180. package/src/registry/serve.ts +9 -14
  181. package/src/remote-manager-driver/actor-websocket-client.ts +1 -16
  182. package/src/remote-manager-driver/api-endpoints.ts +13 -1
  183. package/src/remote-manager-driver/api-utils.ts +8 -0
  184. package/src/remote-manager-driver/metadata.ts +58 -0
  185. package/src/remote-manager-driver/mod.ts +47 -62
  186. package/src/remote-manager-driver/ws-proxy.ts +1 -1
  187. package/src/schemas/actor-persist/mod.ts +1 -1
  188. package/src/schemas/actor-persist/versioned.ts +56 -31
  189. package/src/schemas/client-protocol/mod.ts +1 -1
  190. package/src/schemas/client-protocol/versioned.ts +41 -21
  191. package/src/schemas/client-protocol-zod/mod.ts +103 -0
  192. package/src/schemas/file-system-driver/mod.ts +1 -1
  193. package/src/schemas/file-system-driver/versioned.ts +42 -19
  194. package/src/serde.ts +33 -11
  195. package/src/test/mod.ts +7 -3
  196. package/src/utils/node.ts +173 -0
  197. package/src/utils.ts +0 -4
  198. package/dist/tsup/chunk-227FEWMB.js.map +0 -1
  199. package/dist/tsup/chunk-2JYPS5YM.cjs.map +0 -1
  200. package/dist/tsup/chunk-36JJ4IQB.cjs.map +0 -1
  201. package/dist/tsup/chunk-7L65NNWP.cjs.map +0 -1
  202. package/dist/tsup/chunk-BLK27ES3.js.map +0 -1
  203. package/dist/tsup/chunk-BOMZS2TJ.js.map +0 -1
  204. package/dist/tsup/chunk-BYMKMOBS.js.map +0 -1
  205. package/dist/tsup/chunk-FX7TWFQR.js.map +0 -1
  206. package/dist/tsup/chunk-G64QUEDJ.js.map +0 -1
  207. package/dist/tsup/chunk-HHFKKVLR.cjs.map +0 -1
  208. package/dist/tsup/chunk-INNFK746.cjs.map +0 -1
  209. package/dist/tsup/chunk-KSRXX3Z4.cjs.map +0 -1
  210. package/dist/tsup/chunk-O44LFKSB.cjs +0 -4623
  211. package/dist/tsup/chunk-O44LFKSB.cjs.map +0 -1
  212. package/dist/tsup/chunk-PLUN2NQT.js.map +0 -1
  213. package/dist/tsup/chunk-S4UJG7ZE.js +0 -1119
  214. package/dist/tsup/chunk-S4UJG7ZE.js.map +0 -1
  215. package/dist/tsup/chunk-SHVX2QUR.cjs.map +0 -1
  216. package/dist/tsup/chunk-VFB23BYZ.cjs +0 -1119
  217. package/dist/tsup/chunk-VFB23BYZ.cjs.map +0 -1
  218. package/dist/tsup/chunk-VHGY7PU5.cjs.map +0 -1
  219. package/dist/tsup/chunk-YBG6R7LX.js.map +0 -1
  220. package/dist/tsup/chunk-YBHYXIP6.js.map +0 -1
  221. package/src/actor/action.ts +0 -178
  222. package/src/actor/conn-drivers.ts +0 -216
  223. package/src/actor/conn-socket.ts +0 -8
  224. package/src/actor/conn.ts +0 -272
  225. package/src/actor/instance.ts +0 -2336
  226. package/src/actor/persisted.ts +0 -49
  227. package/src/actor/unstable-react.ts +0 -110
  228. package/src/driver-test-suite/tests/actor-reconnect.ts +0 -170
  229. package/src/drivers/engine/kv.ts +0 -3
  230. package/src/manager/hono-websocket-adapter.ts +0 -393
  231. /package/dist/tsup/{chunk-CD33GT6Z.js.map → chunk-QIHBDXTO.js.map} +0 -0
@@ -1,56 +1,55 @@
1
1
  import {
2
2
  getPort
3
- } from "../chunk-BOMZS2TJ.js";
3
+ } from "../chunk-BBVFDEYD.js";
4
4
  import {
5
5
  actor,
6
6
  createManagerRouter
7
- } from "../chunk-BYMKMOBS.js";
7
+ } from "../chunk-FLOQ3UWM.js";
8
8
  import {
9
9
  configureInspectorAccessToken,
10
10
  createActorInspectorClient,
11
11
  createManagerInspectorClient
12
- } from "../chunk-FX7TWFQR.js";
12
+ } from "../chunk-IDJK7ILQ.js";
13
13
  import {
14
14
  createClient
15
- } from "../chunk-YBHYXIP6.js";
15
+ } from "../chunk-YVL6IRUM.js";
16
16
  import {
17
17
  ActorError,
18
18
  createClientWithDriver
19
- } from "../chunk-227FEWMB.js";
20
- import "../chunk-YBG6R7LX.js";
19
+ } from "../chunk-HZYZ7JSF.js";
20
+ import "../chunk-EDGN4OC7.js";
21
21
  import {
22
22
  importWebSocket
23
- } from "../chunk-CD33GT6Z.js";
23
+ } from "../chunk-QIHBDXTO.js";
24
24
  import {
25
25
  ClientConfigSchema,
26
26
  RunnerConfigSchema
27
- } from "../chunk-S4UJG7ZE.js";
27
+ } from "../chunk-7IBNNGQ2.js";
28
28
  import {
29
29
  HEADER_ACTOR_ID,
30
30
  HEADER_ACTOR_QUERY,
31
31
  WS_PROTOCOL_ACTOR,
32
32
  WS_PROTOCOL_CONN_PARAMS,
33
33
  WS_PROTOCOL_ENCODING,
34
- WS_PROTOCOL_PATH,
34
+ WS_PROTOCOL_STANDARD,
35
35
  WS_PROTOCOL_TARGET,
36
- WS_PROTOCOL_TRANSPORT,
36
+ WS_TEST_PROTOCOL_PATH,
37
37
  assertUnreachable
38
- } from "../chunk-BLK27ES3.js";
38
+ } from "../chunk-6JN6W6G3.js";
39
39
  import {
40
40
  getLogger,
41
41
  promiseWithResolvers
42
- } from "../chunk-PLUN2NQT.js";
42
+ } from "../chunk-NWBKMCWC.js";
43
43
  import {
44
44
  INTERNAL_ERROR_CODE,
45
45
  INTERNAL_ERROR_DESCRIPTION
46
- } from "../chunk-G64QUEDJ.js";
46
+ } from "../chunk-W6RDS6NW.js";
47
47
 
48
48
  // src/driver-test-suite/mod.ts
49
49
  import { serve as honoServe } from "@hono/node-server";
50
50
  import { createNodeWebSocket } from "@hono/node-ws";
51
- import { bundleRequire } from "bundle-require";
52
51
  import invariant from "invariant";
53
- import { describe as describe21 } from "vitest";
52
+ import { describe as describe22 } from "vitest";
54
53
 
55
54
  // src/driver-test-suite/log.ts
56
55
  function logger() {
@@ -65,43 +64,26 @@ import { vi } from "vitest";
65
64
 
66
65
  // src/driver-test-suite/test-inline-client-driver.ts
67
66
  import * as cbor from "cbor-x";
68
- function createTestInlineClientDriver(endpoint, encoding, transport) {
67
+ function createTestInlineClientDriver(endpoint, encoding) {
69
68
  return {
70
69
  getForId(input) {
71
- return makeInlineRequest(
72
- endpoint,
73
- encoding,
74
- transport,
75
- "getForId",
76
- [input]
77
- );
70
+ return makeInlineRequest(endpoint, encoding, "getForId", [input]);
78
71
  },
79
72
  getWithKey(input) {
80
- return makeInlineRequest(
81
- endpoint,
82
- encoding,
83
- transport,
84
- "getWithKey",
85
- [input]
86
- );
73
+ return makeInlineRequest(endpoint, encoding, "getWithKey", [input]);
87
74
  },
88
75
  getOrCreateWithKey(input) {
89
- return makeInlineRequest(
90
- endpoint,
91
- encoding,
92
- transport,
93
- "getOrCreateWithKey",
94
- [input]
95
- );
76
+ return makeInlineRequest(endpoint, encoding, "getOrCreateWithKey", [
77
+ input
78
+ ]);
96
79
  },
97
80
  createActor(input) {
98
- return makeInlineRequest(
99
- endpoint,
100
- encoding,
101
- transport,
102
- "createActor",
103
- [input]
104
- );
81
+ return makeInlineRequest(endpoint, encoding, "createActor", [
82
+ input
83
+ ]);
84
+ },
85
+ listActors(input) {
86
+ return makeInlineRequest(endpoint, encoding, "listActors", [input]);
105
87
  },
106
88
  async sendRequest(actorId, actorRequest) {
107
89
  var _a;
@@ -153,7 +135,7 @@ function createTestInlineClientDriver(endpoint, encoding, transport) {
153
135
  }
154
136
  return response;
155
137
  },
156
- async openWebSocket(path, actorId, encoding2, params, connId, connToken) {
138
+ async openWebSocket(path, actorId, encoding2, params) {
157
139
  const WebSocket2 = await importWebSocket();
158
140
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
159
141
  const wsUrl = new URL(
@@ -165,20 +147,24 @@ function createTestInlineClientDriver(endpoint, encoding, transport) {
165
147
  });
166
148
  const wsProtocol = wsUrl.protocol === "https:" ? "wss:" : "ws:";
167
149
  const finalWsUrl = `${wsProtocol}//${wsUrl.host}${wsUrl.pathname}`;
168
- logger().debug({ msg: "connecting to websocket", url: finalWsUrl });
169
150
  const protocols = [];
151
+ protocols.push(WS_PROTOCOL_STANDARD);
170
152
  protocols.push(`${WS_PROTOCOL_TARGET}actor`);
171
- protocols.push(`${WS_PROTOCOL_ACTOR}${actorId}`);
153
+ protocols.push(`${WS_PROTOCOL_ACTOR}${encodeURIComponent(actorId)}`);
172
154
  protocols.push(`${WS_PROTOCOL_ENCODING}${encoding2}`);
173
- protocols.push(`${WS_PROTOCOL_TRANSPORT}${transport}`);
174
155
  protocols.push(
175
- `${WS_PROTOCOL_PATH}${encodeURIComponent(normalizedPath)}`
156
+ `${WS_TEST_PROTOCOL_PATH}${encodeURIComponent(normalizedPath)}`
176
157
  );
177
158
  if (params !== void 0) {
178
159
  protocols.push(
179
160
  `${WS_PROTOCOL_CONN_PARAMS}${encodeURIComponent(JSON.stringify(params))}`
180
161
  );
181
162
  }
163
+ logger().debug({
164
+ msg: "connecting to websocket",
165
+ url: finalWsUrl,
166
+ protocols
167
+ });
182
168
  const ws = new WebSocket2(finalWsUrl, protocols);
183
169
  return ws;
184
170
  },
@@ -204,7 +190,6 @@ function createTestInlineClientDriver(endpoint, encoding, transport) {
204
190
  // return makeInlineRequest<Response>(
205
191
  // endpoint,
206
192
  // encoding,
207
- // transport,
208
193
  // "action",
209
194
  // [undefined, actorQuery, encoding, params, name, args],
210
195
  // );
@@ -219,7 +204,6 @@ function createTestInlineClientDriver(endpoint, encoding, transport) {
219
204
  // return makeInlineRequest<string>(
220
205
  // endpoint,
221
206
  // encodingKind,
222
- // transport,
223
207
  // "resolveActorId",
224
208
  // [undefined, actorQuery, encodingKind, params],
225
209
  // );
@@ -341,7 +325,6 @@ function createTestInlineClientDriver(endpoint, encoding, transport) {
341
325
  // actorId,
342
326
  // encoding,
343
327
  // connectionId,
344
- // transport,
345
328
  // });
346
329
  //
347
330
  // const result = await fetch(
@@ -353,7 +336,6 @@ function createTestInlineClientDriver(endpoint, encoding, transport) {
353
336
  // },
354
337
  // body: JSON.stringify({
355
338
  // encoding,
356
- // transport,
357
339
  // method: "sendHttpMessage",
358
340
  // args: [
359
341
  // undefined,
@@ -424,7 +406,7 @@ function createTestInlineClientDriver(endpoint, encoding, transport) {
424
406
  // if (errorData.error) {
425
407
  // // Handle both error formats:
426
408
  // // 1. { error: { code, message, metadata } } - structured format
427
- // // 2. { error: "message" } - simple string format (from custom onFetch handlers)
409
+ // // 2. { error: "message" } - simple string format (from custom onRequest handlers)
428
410
  // if (typeof errorData.error === "object") {
429
411
  // throw new ClientActorError(
430
412
  // errorData.error.code,
@@ -433,7 +415,7 @@ function createTestInlineClientDriver(endpoint, encoding, transport) {
433
415
  // );
434
416
  // }
435
417
  // // For simple string errors, just return the response as-is
436
- // // This allows custom onFetch handlers to return their own error formats
418
+ // // This allows custom onRequest handlers to return their own error formats
437
419
  // }
438
420
  // } catch (e) {
439
421
  // // If it's not our error format, just return the response as-is
@@ -510,11 +492,10 @@ function createTestInlineClientDriver(endpoint, encoding, transport) {
510
492
  // },
511
493
  };
512
494
  }
513
- async function makeInlineRequest(endpoint, encoding, transport, method, args) {
495
+ async function makeInlineRequest(endpoint, encoding, method, args) {
514
496
  logger().debug({
515
497
  msg: "sending inline request",
516
498
  encoding,
517
- transport,
518
499
  method,
519
500
  args
520
501
  });
@@ -525,7 +506,6 @@ async function makeInlineRequest(endpoint, encoding, transport, method, args) {
525
506
  },
526
507
  body: cbor.encode({
527
508
  encoding,
528
- transport,
529
509
  method,
530
510
  args
531
511
  }),
@@ -562,26 +542,22 @@ async function setupDriverTest(c, driverTestConfig) {
562
542
  vi.setSystemTime(FAKE_TIME);
563
543
  }
564
544
  const { endpoint, namespace, runnerName, cleanup } = await driverTestConfig.start();
565
- c.onTestFinished(cleanup);
545
+ c.onTestFinished(() => {
546
+ logger().info("cleaning up test");
547
+ cleanup();
548
+ });
566
549
  let client;
567
550
  if (driverTestConfig.clientType === "http") {
568
551
  client = createClient({
569
552
  endpoint,
570
553
  namespace,
571
554
  runnerName,
572
- transport: driverTestConfig.transport,
573
555
  encoding: driverTestConfig.encoding
574
556
  });
575
557
  } else if (driverTestConfig.clientType === "inline") {
576
- const transport = driverTestConfig.transport ?? "websocket";
577
558
  const encoding = driverTestConfig.encoding ?? "bare";
578
- const managerDriver = createTestInlineClientDriver(
579
- endpoint,
580
- encoding,
581
- transport
582
- );
559
+ const managerDriver = createTestInlineClientDriver(endpoint, encoding);
583
560
  const runConfig = RunnerConfigSchema.parse({
584
- transport,
585
561
  encoding
586
562
  });
587
563
  client = createClientWithDriver(managerDriver, runConfig);
@@ -838,9 +814,7 @@ function runActorConnTests(driverTestConfig) {
838
814
  });
839
815
  });
840
816
  describe2("Lifecycle Hooks", () => {
841
- test2.skipIf(
842
- driverTestConfig.transport === "sse" && driverTestConfig.clientType === "inline"
843
- )("should trigger lifecycle hooks", async (c) => {
817
+ test2("should trigger lifecycle hooks", async (c) => {
844
818
  const { client } = await setupDriverTest(c, driverTestConfig);
845
819
  const connHandle = client.counterWithLifecycle.getOrCreate(
846
820
  ["test-lifecycle"],
@@ -851,7 +825,7 @@ function runActorConnTests(driverTestConfig) {
851
825
  const connection = connHandle.connect();
852
826
  const events = await connection.getEvents();
853
827
  expect2(events).toEqual([
854
- "onStart",
828
+ "onWake",
855
829
  "onBeforeConnect",
856
830
  "onConnect"
857
831
  ]);
@@ -865,18 +839,18 @@ function runActorConnTests(driverTestConfig) {
865
839
  expect2(finalEvents).toBeOneOf([
866
840
  // Still active
867
841
  [
868
- "onStart",
842
+ "onWake",
869
843
  "onBeforeConnect",
870
844
  "onConnect",
871
845
  "onDisconnect"
872
846
  ],
873
847
  // Went to sleep and woke back up
874
848
  [
875
- "onStart",
849
+ "onWake",
876
850
  "onBeforeConnect",
877
851
  "onConnect",
878
852
  "onDisconnect",
879
- "onStart"
853
+ "onWake"
880
854
  ]
881
855
  ]);
882
856
  },
@@ -972,9 +946,7 @@ function runActorConnStateTests(driverTestConfig) {
972
946
  });
973
947
  });
974
948
  describe3("Connection Lifecycle", () => {
975
- test3.skipIf(
976
- driverTestConfig.transport === "sse" && driverTestConfig.clientType === "inline"
977
- )("should track connection and disconnection events", async (c) => {
949
+ test3("should track connection and disconnection events", async (c) => {
978
950
  const { client } = await setupDriverTest(c, driverTestConfig);
979
951
  const debugHandle = client.connStateActor.getOrCreate(
980
952
  void 0,
@@ -1075,18 +1047,203 @@ function runActorConnStateTests(driverTestConfig) {
1075
1047
  });
1076
1048
  }
1077
1049
 
1050
+ // src/driver-test-suite/tests/actor-destroy.ts
1051
+ import { describe as describe4, expect as expect4, test as test4, vi as vi4 } from "vitest";
1052
+ function runActorDestroyTests(driverTestConfig) {
1053
+ describe4("Actor Destroy Tests", () => {
1054
+ test4("actor destroy clears state (without connect)", async (c) => {
1055
+ const { client } = await setupDriverTest(c, driverTestConfig);
1056
+ const actorKey = "test-destroy-without-connect";
1057
+ const observer = client.destroyObserver.getOrCreate(["observer"]);
1058
+ await observer.reset();
1059
+ const destroyActor = client.destroyActor.getOrCreate([actorKey]);
1060
+ await destroyActor.setValue(42);
1061
+ const value = await destroyActor.getValue();
1062
+ expect4(value).toBe(42);
1063
+ const actorId = await destroyActor.resolve();
1064
+ await destroyActor.destroy();
1065
+ await vi4.waitFor(async () => {
1066
+ const wasDestroyed = await observer.wasDestroyed(actorKey);
1067
+ expect4(wasDestroyed, "actor onDestroy not called").toBeTruthy();
1068
+ });
1069
+ await vi4.waitFor(async () => {
1070
+ let actorRunning = false;
1071
+ try {
1072
+ await client.destroyActor.getForId(actorId).getValue();
1073
+ actorRunning = true;
1074
+ } catch (err) {
1075
+ expect4(err.group).toBe("actor");
1076
+ expect4(err.code).toBe("not_found");
1077
+ }
1078
+ expect4(actorRunning, "actor still running").toBeFalsy();
1079
+ });
1080
+ let existsById = false;
1081
+ try {
1082
+ await client.destroyActor.getForId(actorId).getValue();
1083
+ existsById = true;
1084
+ } catch (err) {
1085
+ expect4(err.group).toBe("actor");
1086
+ expect4(err.code).toBe("not_found");
1087
+ }
1088
+ expect4(
1089
+ existsById,
1090
+ "actor should not exist after destroy"
1091
+ ).toBeFalsy();
1092
+ let existsByKey = false;
1093
+ try {
1094
+ await client.destroyActor.get(["test-destroy-without-connect"]).resolve();
1095
+ existsByKey = true;
1096
+ } catch (err) {
1097
+ expect4(err.group).toBe("actor");
1098
+ expect4(err.code).toBe("not_found");
1099
+ }
1100
+ expect4(
1101
+ existsByKey,
1102
+ "actor should not exist after destroy"
1103
+ ).toBeFalsy();
1104
+ const newActor = client.destroyActor.getOrCreate([
1105
+ "test-destroy-without-connect"
1106
+ ]);
1107
+ const newValue = await newActor.getValue();
1108
+ expect4(newValue).toBe(0);
1109
+ });
1110
+ test4("actor destroy clears state (with connect)", async (c) => {
1111
+ const { client } = await setupDriverTest(c, driverTestConfig);
1112
+ const actorKey = "test-destroy-with-connect";
1113
+ const observer = client.destroyObserver.getOrCreate(["observer"]);
1114
+ await observer.reset();
1115
+ const destroyActorHandle = client.destroyActor.getOrCreate([
1116
+ actorKey
1117
+ ]);
1118
+ const actorId = await destroyActorHandle.resolve();
1119
+ const destroyActor = destroyActorHandle.connect();
1120
+ await destroyActor.setValue(99);
1121
+ const value = await destroyActor.getValue();
1122
+ expect4(value).toBe(99);
1123
+ await destroyActor.destroy();
1124
+ await destroyActor.dispose();
1125
+ await vi4.waitFor(async () => {
1126
+ const wasDestroyed = await observer.wasDestroyed(actorKey);
1127
+ expect4(wasDestroyed, "actor onDestroy not called").toBeTruthy();
1128
+ });
1129
+ await vi4.waitFor(async () => {
1130
+ let actorRunning = false;
1131
+ try {
1132
+ await client.destroyActor.getForId(actorId).getValue();
1133
+ actorRunning = true;
1134
+ } catch (err) {
1135
+ expect4(err.group).toBe("actor");
1136
+ expect4(err.code).toBe("not_found");
1137
+ }
1138
+ expect4(actorRunning, "actor still running").toBeFalsy();
1139
+ });
1140
+ let existsById = false;
1141
+ try {
1142
+ await client.destroyActor.getForId(actorId).getValue();
1143
+ existsById = true;
1144
+ } catch (err) {
1145
+ expect4(err.group).toBe("actor");
1146
+ expect4(err.code).toBe("not_found");
1147
+ }
1148
+ expect4(
1149
+ existsById,
1150
+ "actor should not exist after destroy"
1151
+ ).toBeFalsy();
1152
+ let existsByKey = false;
1153
+ try {
1154
+ await client.destroyActor.get(["test-destroy-with-connect"]).resolve();
1155
+ existsByKey = true;
1156
+ } catch (err) {
1157
+ expect4(err.group).toBe("actor");
1158
+ expect4(err.code).toBe("not_found");
1159
+ }
1160
+ expect4(
1161
+ existsByKey,
1162
+ "actor should not exist after destroy"
1163
+ ).toBeFalsy();
1164
+ const newActor = client.destroyActor.getOrCreate([
1165
+ "test-destroy-with-connect"
1166
+ ]);
1167
+ const newValue = await newActor.getValue();
1168
+ expect4(newValue).toBe(0);
1169
+ });
1170
+ test4("actor destroy allows recreation via getOrCreate with resolve", async (c) => {
1171
+ const { client } = await setupDriverTest(c, driverTestConfig);
1172
+ const actorKey = "test-destroy-getorcreate-resolve";
1173
+ const observer = client.destroyObserver.getOrCreate(["observer"]);
1174
+ await observer.reset();
1175
+ const destroyActor = client.destroyActor.getOrCreate([actorKey]);
1176
+ await destroyActor.setValue(123);
1177
+ const value = await destroyActor.getValue();
1178
+ expect4(value).toBe(123);
1179
+ const actorId = await destroyActor.resolve();
1180
+ await destroyActor.destroy();
1181
+ await vi4.waitFor(async () => {
1182
+ const wasDestroyed = await observer.wasDestroyed(actorKey);
1183
+ expect4(wasDestroyed, "actor onDestroy not called").toBeTruthy();
1184
+ });
1185
+ await vi4.waitFor(async () => {
1186
+ let actorRunning = false;
1187
+ try {
1188
+ await client.destroyActor.getForId(actorId).getValue();
1189
+ actorRunning = true;
1190
+ } catch (err) {
1191
+ expect4(err.group).toBe("actor");
1192
+ expect4(err.code).toBe("not_found");
1193
+ }
1194
+ expect4(actorRunning, "actor still running").toBeFalsy();
1195
+ });
1196
+ const newHandle = client.destroyActor.getOrCreate([actorKey]);
1197
+ const newActorId = await newHandle.resolve();
1198
+ const newValue = await newHandle.getValue();
1199
+ expect4(newValue).toBe(0);
1200
+ });
1201
+ test4("actor destroy allows recreation via create", async (c) => {
1202
+ const { client } = await setupDriverTest(c, driverTestConfig);
1203
+ const actorKey = "test-destroy-create";
1204
+ const observer = client.destroyObserver.getOrCreate(["observer"]);
1205
+ await observer.reset();
1206
+ const initialHandle = await client.destroyActor.create([actorKey]);
1207
+ await initialHandle.setValue(456);
1208
+ const value = await initialHandle.getValue();
1209
+ expect4(value).toBe(456);
1210
+ const actorId = await initialHandle.resolve();
1211
+ await initialHandle.destroy();
1212
+ await vi4.waitFor(async () => {
1213
+ const wasDestroyed = await observer.wasDestroyed(actorKey);
1214
+ expect4(wasDestroyed, "actor onDestroy not called").toBeTruthy();
1215
+ });
1216
+ await vi4.waitFor(async () => {
1217
+ let actorRunning = false;
1218
+ try {
1219
+ await client.destroyActor.getForId(actorId).getValue();
1220
+ actorRunning = true;
1221
+ } catch (err) {
1222
+ expect4(err.group).toBe("actor");
1223
+ expect4(err.code).toBe("not_found");
1224
+ }
1225
+ expect4(actorRunning, "actor still running").toBeFalsy();
1226
+ });
1227
+ const newHandle = await client.destroyActor.create([actorKey]);
1228
+ const newActorId = await newHandle.resolve();
1229
+ const newValue = await newHandle.getValue();
1230
+ expect4(newValue).toBe(0);
1231
+ });
1232
+ });
1233
+ }
1234
+
1078
1235
  // src/driver-test-suite/tests/actor-driver.ts
1079
- import { describe as describe7 } from "vitest";
1236
+ import { describe as describe8 } from "vitest";
1080
1237
 
1081
1238
  // src/driver-test-suite/tests/actor-schedule.ts
1082
- import { describe as describe4, expect as expect4, test as test4 } from "vitest";
1239
+ import { describe as describe5, expect as expect5, test as test5 } from "vitest";
1083
1240
  function runActorScheduleTests(driverTestConfig) {
1084
1241
  var _a;
1085
- describe4.skipIf((_a = driverTestConfig.skip) == null ? void 0 : _a.schedule)(
1242
+ describe5.skipIf((_a = driverTestConfig.skip) == null ? void 0 : _a.schedule)(
1086
1243
  "Actor Schedule Tests",
1087
1244
  () => {
1088
- describe4("Scheduled Alarms", () => {
1089
- test4("executes c.schedule.at() with specific timestamp", async (c) => {
1245
+ describe5("Scheduled Alarms", () => {
1246
+ test5("executes c.schedule.at() with specific timestamp", async (c) => {
1090
1247
  const { client } = await setupDriverTest(
1091
1248
  c,
1092
1249
  driverTestConfig
@@ -1097,10 +1254,10 @@ function runActorScheduleTests(driverTestConfig) {
1097
1254
  await waitFor(driverTestConfig, 500);
1098
1255
  const lastRun = await scheduled.getLastRun();
1099
1256
  const scheduledCount = await scheduled.getScheduledCount();
1100
- expect4(lastRun).toBeGreaterThan(0);
1101
- expect4(scheduledCount).toBe(1);
1257
+ expect5(lastRun).toBeGreaterThan(0);
1258
+ expect5(scheduledCount).toBe(1);
1102
1259
  });
1103
- test4("executes c.schedule.after() with delay", async (c) => {
1260
+ test5("executes c.schedule.after() with delay", async (c) => {
1104
1261
  const { client } = await setupDriverTest(
1105
1262
  c,
1106
1263
  driverTestConfig
@@ -1110,10 +1267,10 @@ function runActorScheduleTests(driverTestConfig) {
1110
1267
  await waitFor(driverTestConfig, 500);
1111
1268
  const lastRun = await scheduled.getLastRun();
1112
1269
  const scheduledCount = await scheduled.getScheduledCount();
1113
- expect4(lastRun).toBeGreaterThan(0);
1114
- expect4(scheduledCount).toBe(1);
1270
+ expect5(lastRun).toBeGreaterThan(0);
1271
+ expect5(scheduledCount).toBe(1);
1115
1272
  });
1116
- test4("multiple scheduled tasks execute in order", async (c) => {
1273
+ test5("multiple scheduled tasks execute in order", async (c) => {
1117
1274
  const { client } = await setupDriverTest(
1118
1275
  c,
1119
1276
  driverTestConfig
@@ -1125,13 +1282,13 @@ function runActorScheduleTests(driverTestConfig) {
1125
1282
  await scheduled.scheduleTaskAfterWithId("third", 1250);
1126
1283
  await waitFor(driverTestConfig, 500);
1127
1284
  const history1 = await scheduled.getTaskHistory();
1128
- expect4(history1).toEqual(["first"]);
1285
+ expect5(history1).toEqual(["first"]);
1129
1286
  await waitFor(driverTestConfig, 500);
1130
1287
  const history2 = await scheduled.getTaskHistory();
1131
- expect4(history2).toEqual(["first", "second"]);
1288
+ expect5(history2).toEqual(["first", "second"]);
1132
1289
  await waitFor(driverTestConfig, 500);
1133
1290
  const history3 = await scheduled.getTaskHistory();
1134
- expect4(history3).toEqual(["first", "second", "third"]);
1291
+ expect5(history3).toEqual(["first", "second", "third"]);
1135
1292
  });
1136
1293
  });
1137
1294
  }
@@ -1139,16 +1296,16 @@ function runActorScheduleTests(driverTestConfig) {
1139
1296
  }
1140
1297
 
1141
1298
  // src/driver-test-suite/tests/actor-sleep.ts
1142
- import { describe as describe5, expect as expect5, test as test5 } from "vitest";
1299
+ import { describe as describe6, expect as expect6, test as test6 } from "vitest";
1143
1300
 
1144
1301
  // fixtures/driver-test-suite/sleep.ts
1145
1302
  var SLEEP_TIMEOUT = 1e3;
1146
1303
  var sleep = actor({
1147
1304
  state: { startCount: 0, sleepCount: 0 },
1148
- onStart: (c) => {
1305
+ onWake: (c) => {
1149
1306
  c.state.startCount += 1;
1150
1307
  },
1151
- onStop: (c) => {
1308
+ onSleep: (c) => {
1152
1309
  c.state.sleepCount += 1;
1153
1310
  },
1154
1311
  actions: {
@@ -1175,10 +1332,10 @@ var sleep = actor({
1175
1332
  var sleepWithLongRpc = actor({
1176
1333
  state: { startCount: 0, sleepCount: 0 },
1177
1334
  createVars: () => ({}),
1178
- onStart: (c) => {
1335
+ onWake: (c) => {
1179
1336
  c.state.startCount += 1;
1180
1337
  },
1181
- onStop: (c) => {
1338
+ onSleep: (c) => {
1182
1339
  c.state.sleepCount += 1;
1183
1340
  },
1184
1341
  actions: {
@@ -1206,13 +1363,13 @@ var sleepWithLongRpc = actor({
1206
1363
  });
1207
1364
  var sleepWithRawHttp = actor({
1208
1365
  state: { startCount: 0, sleepCount: 0, requestCount: 0 },
1209
- onStart: (c) => {
1366
+ onWake: (c) => {
1210
1367
  c.state.startCount += 1;
1211
1368
  },
1212
- onStop: (c) => {
1369
+ onSleep: (c) => {
1213
1370
  c.state.sleepCount += 1;
1214
1371
  },
1215
- onFetch: async (c, request) => {
1372
+ onRequest: async (c, request) => {
1216
1373
  c.state.requestCount += 1;
1217
1374
  const url = new URL(request.url);
1218
1375
  if (url.pathname === "/long-request") {
@@ -1243,13 +1400,13 @@ var sleepWithRawHttp = actor({
1243
1400
  });
1244
1401
  var sleepWithRawWebSocket = actor({
1245
1402
  state: { startCount: 0, sleepCount: 0, connectionCount: 0 },
1246
- onStart: (c) => {
1403
+ onWake: (c) => {
1247
1404
  c.state.startCount += 1;
1248
1405
  },
1249
- onStop: (c) => {
1406
+ onSleep: (c) => {
1250
1407
  c.state.sleepCount += 1;
1251
1408
  },
1252
- onWebSocket: (c, websocket, opts) => {
1409
+ onWebSocket: (c, websocket) => {
1253
1410
  c.state.connectionCount += 1;
1254
1411
  c.log.info({
1255
1412
  msg: "websocket connected",
@@ -1306,10 +1463,10 @@ var sleepWithRawWebSocket = actor({
1306
1463
  });
1307
1464
  var sleepWithNoSleepOption = actor({
1308
1465
  state: { startCount: 0, sleepCount: 0 },
1309
- onStart: (c) => {
1466
+ onWake: (c) => {
1310
1467
  c.state.startCount += 1;
1311
1468
  },
1312
- onStop: (c) => {
1469
+ onSleep: (c) => {
1313
1470
  c.state.sleepCount += 1;
1314
1471
  },
1315
1472
  actions: {
@@ -1329,30 +1486,30 @@ var sleepWithNoSleepOption = actor({
1329
1486
  // src/driver-test-suite/tests/actor-sleep.ts
1330
1487
  function runActorSleepTests(driverTestConfig) {
1331
1488
  var _a;
1332
- describe5.skipIf((_a = driverTestConfig.skip) == null ? void 0 : _a.sleep)("Actor Sleep Tests", () => {
1333
- test5("actor sleep persists state", async (c) => {
1489
+ describe6.skipIf((_a = driverTestConfig.skip) == null ? void 0 : _a.sleep)("Actor Sleep Tests", () => {
1490
+ test6("actor sleep persists state", async (c) => {
1334
1491
  const { client } = await setupDriverTest(c, driverTestConfig);
1335
1492
  const sleepActor = client.sleep.getOrCreate();
1336
1493
  {
1337
1494
  const { startCount, sleepCount } = await sleepActor.getCounts();
1338
- expect5(sleepCount).toBe(0);
1339
- expect5(startCount).toBe(1);
1495
+ expect6(sleepCount).toBe(0);
1496
+ expect6(startCount).toBe(1);
1340
1497
  }
1341
1498
  await sleepActor.triggerSleep();
1342
1499
  await waitFor(driverTestConfig, 250);
1343
1500
  {
1344
1501
  const { startCount, sleepCount } = await sleepActor.getCounts();
1345
- expect5(sleepCount).toBe(1);
1346
- expect5(startCount).toBe(2);
1502
+ expect6(sleepCount).toBe(1);
1503
+ expect6(startCount).toBe(2);
1347
1504
  }
1348
1505
  });
1349
- test5("actor sleep persists state with connect", async (c) => {
1506
+ test6("actor sleep persists state with connect", async (c) => {
1350
1507
  const { client } = await setupDriverTest(c, driverTestConfig);
1351
1508
  const sleepActor = client.sleep.getOrCreate().connect();
1352
1509
  {
1353
1510
  const { startCount, sleepCount } = await sleepActor.getCounts();
1354
- expect5(sleepCount).toBe(0);
1355
- expect5(startCount).toBe(1);
1511
+ expect6(sleepCount).toBe(0);
1512
+ expect6(startCount).toBe(1);
1356
1513
  }
1357
1514
  await sleepActor.triggerSleep();
1358
1515
  await sleepActor.dispose();
@@ -1360,108 +1517,108 @@ function runActorSleepTests(driverTestConfig) {
1360
1517
  const sleepActor2 = client.sleep.getOrCreate();
1361
1518
  {
1362
1519
  const { startCount, sleepCount } = await sleepActor2.getCounts();
1363
- expect5(sleepCount).toBe(1);
1364
- expect5(startCount).toBe(2);
1520
+ expect6(sleepCount).toBe(1);
1521
+ expect6(startCount).toBe(2);
1365
1522
  }
1366
1523
  });
1367
- test5("actor automatically sleeps after timeout", async (c) => {
1524
+ test6("actor automatically sleeps after timeout", async (c) => {
1368
1525
  const { client } = await setupDriverTest(c, driverTestConfig);
1369
1526
  const sleepActor = client.sleep.getOrCreate();
1370
1527
  {
1371
1528
  const { startCount, sleepCount } = await sleepActor.getCounts();
1372
- expect5(sleepCount).toBe(0);
1373
- expect5(startCount).toBe(1);
1529
+ expect6(sleepCount).toBe(0);
1530
+ expect6(startCount).toBe(1);
1374
1531
  }
1375
1532
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
1376
1533
  {
1377
1534
  const { startCount, sleepCount } = await sleepActor.getCounts();
1378
- expect5(sleepCount).toBe(1);
1379
- expect5(startCount).toBe(2);
1535
+ expect6(sleepCount).toBe(1);
1536
+ expect6(startCount).toBe(2);
1380
1537
  }
1381
1538
  });
1382
- test5("actor automatically sleeps after timeout with connect", async (c) => {
1539
+ test6("actor automatically sleeps after timeout with connect", async (c) => {
1383
1540
  const { client } = await setupDriverTest(c, driverTestConfig);
1384
1541
  const sleepActor = client.sleep.getOrCreate().connect();
1385
1542
  {
1386
1543
  const { startCount, sleepCount } = await sleepActor.getCounts();
1387
- expect5(sleepCount).toBe(0);
1388
- expect5(startCount).toBe(1);
1544
+ expect6(sleepCount).toBe(0);
1545
+ expect6(startCount).toBe(1);
1389
1546
  }
1390
1547
  await sleepActor.dispose();
1391
1548
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
1392
1549
  const sleepActor2 = client.sleep.getOrCreate();
1393
1550
  {
1394
1551
  const { startCount, sleepCount } = await sleepActor2.getCounts();
1395
- expect5(sleepCount).toBe(1);
1396
- expect5(startCount).toBe(2);
1552
+ expect6(sleepCount).toBe(1);
1553
+ expect6(startCount).toBe(2);
1397
1554
  }
1398
1555
  });
1399
- test5("rpc calls keep actor awake", async (c) => {
1556
+ test6("rpc calls keep actor awake", async (c) => {
1400
1557
  const { client } = await setupDriverTest(c, driverTestConfig);
1401
1558
  const sleepActor = client.sleep.getOrCreate();
1402
1559
  {
1403
1560
  const { startCount, sleepCount } = await sleepActor.getCounts();
1404
- expect5(sleepCount).toBe(0);
1405
- expect5(startCount).toBe(1);
1561
+ expect6(sleepCount).toBe(0);
1562
+ expect6(startCount).toBe(1);
1406
1563
  }
1407
1564
  await waitFor(driverTestConfig, SLEEP_TIMEOUT - 250);
1408
1565
  {
1409
1566
  const { startCount, sleepCount } = await sleepActor.getCounts();
1410
- expect5(sleepCount).toBe(0);
1411
- expect5(startCount).toBe(1);
1567
+ expect6(sleepCount).toBe(0);
1568
+ expect6(startCount).toBe(1);
1412
1569
  }
1413
1570
  await waitFor(driverTestConfig, SLEEP_TIMEOUT - 250);
1414
1571
  {
1415
1572
  const { startCount, sleepCount } = await sleepActor.getCounts();
1416
- expect5(sleepCount).toBe(0);
1417
- expect5(startCount).toBe(1);
1573
+ expect6(sleepCount).toBe(0);
1574
+ expect6(startCount).toBe(1);
1418
1575
  }
1419
1576
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
1420
1577
  {
1421
1578
  const { startCount, sleepCount } = await sleepActor.getCounts();
1422
- expect5(sleepCount).toBe(1);
1423
- expect5(startCount).toBe(2);
1579
+ expect6(sleepCount).toBe(1);
1580
+ expect6(startCount).toBe(2);
1424
1581
  }
1425
1582
  });
1426
- test5("alarms keep actor awake", async (c) => {
1583
+ test6("alarms keep actor awake", async (c) => {
1427
1584
  const { client } = await setupDriverTest(c, driverTestConfig);
1428
1585
  const sleepActor = client.sleep.getOrCreate();
1429
1586
  {
1430
1587
  const { startCount, sleepCount } = await sleepActor.getCounts();
1431
- expect5(sleepCount).toBe(0);
1432
- expect5(startCount).toBe(1);
1588
+ expect6(sleepCount).toBe(0);
1589
+ expect6(startCount).toBe(1);
1433
1590
  }
1434
1591
  await sleepActor.setAlarm(SLEEP_TIMEOUT - 250);
1435
1592
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
1436
1593
  {
1437
1594
  const { startCount, sleepCount } = await sleepActor.getCounts();
1438
- expect5(sleepCount).toBe(0);
1439
- expect5(startCount).toBe(1);
1595
+ expect6(sleepCount).toBe(0);
1596
+ expect6(startCount).toBe(1);
1440
1597
  }
1441
1598
  });
1442
- test5("alarms wake actors", async (c) => {
1599
+ test6("alarms wake actors", async (c) => {
1443
1600
  const { client } = await setupDriverTest(c, driverTestConfig);
1444
1601
  const sleepActor = client.sleep.getOrCreate();
1445
1602
  {
1446
1603
  const { startCount, sleepCount } = await sleepActor.getCounts();
1447
- expect5(sleepCount).toBe(0);
1448
- expect5(startCount).toBe(1);
1604
+ expect6(sleepCount).toBe(0);
1605
+ expect6(startCount).toBe(1);
1449
1606
  }
1450
1607
  await sleepActor.setAlarm(SLEEP_TIMEOUT + 250);
1451
1608
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 200);
1452
1609
  {
1453
1610
  const { startCount, sleepCount } = await sleepActor.getCounts();
1454
- expect5(sleepCount).toBe(1);
1455
- expect5(startCount).toBe(2);
1611
+ expect6(sleepCount).toBe(1);
1612
+ expect6(startCount).toBe(2);
1456
1613
  }
1457
1614
  });
1458
- test5("long running rpcs keep actor awake", async (c) => {
1615
+ test6("long running rpcs keep actor awake", async (c) => {
1459
1616
  const { client } = await setupDriverTest(c, driverTestConfig);
1460
1617
  const sleepActor = client.sleepWithLongRpc.getOrCreate().connect();
1461
1618
  {
1462
1619
  const { startCount, sleepCount } = await sleepActor.getCounts();
1463
- expect5(sleepCount).toBe(0);
1464
- expect5(startCount).toBe(1);
1620
+ expect6(sleepCount).toBe(0);
1621
+ expect6(startCount).toBe(1);
1465
1622
  }
1466
1623
  const waitPromise = new Promise(
1467
1624
  (resolve) => sleepActor.once("waiting", resolve)
@@ -1473,19 +1630,19 @@ function runActorSleepTests(driverTestConfig) {
1473
1630
  await longRunningPromise;
1474
1631
  {
1475
1632
  const { startCount, sleepCount } = await sleepActor.getCounts();
1476
- expect5(sleepCount).toBe(0);
1477
- expect5(startCount).toBe(1);
1633
+ expect6(sleepCount).toBe(0);
1634
+ expect6(startCount).toBe(1);
1478
1635
  }
1479
1636
  await sleepActor.dispose();
1480
1637
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
1481
1638
  const sleepActor2 = client.sleepWithLongRpc.getOrCreate();
1482
1639
  {
1483
1640
  const { startCount, sleepCount } = await sleepActor2.getCounts();
1484
- expect5(sleepCount).toBe(1);
1485
- expect5(startCount).toBe(2);
1641
+ expect6(sleepCount).toBe(1);
1642
+ expect6(startCount).toBe(2);
1486
1643
  }
1487
1644
  });
1488
- test5("active raw websockets keep actor awake", async (c) => {
1645
+ test6("active raw websockets keep actor awake", async (c) => {
1489
1646
  const { client, endpoint: baseUrl } = await setupDriverTest(
1490
1647
  c,
1491
1648
  driverTestConfig
@@ -1493,8 +1650,8 @@ function runActorSleepTests(driverTestConfig) {
1493
1650
  const sleepActor = client.sleepWithRawWebSocket.getOrCreate();
1494
1651
  {
1495
1652
  const { startCount, sleepCount } = await sleepActor.getCounts();
1496
- expect5(sleepCount).toBe(0);
1497
- expect5(startCount).toBe(1);
1653
+ expect6(sleepCount).toBe(0);
1654
+ expect6(startCount).toBe(1);
1498
1655
  }
1499
1656
  const ws = await sleepActor.websocket();
1500
1657
  await new Promise((resolve, reject) => {
@@ -1519,17 +1676,17 @@ function runActorSleepTests(driverTestConfig) {
1519
1676
  }
1520
1677
  };
1521
1678
  });
1522
- expect5(counts.sleepCount).toBe(0);
1523
- expect5(counts.startCount).toBe(1);
1679
+ expect6(counts.sleepCount).toBe(0);
1680
+ expect6(counts.startCount).toBe(1);
1524
1681
  ws.close();
1525
1682
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
1526
1683
  {
1527
1684
  const { startCount, sleepCount } = await sleepActor.getCounts();
1528
- expect5(sleepCount).toBe(1);
1529
- expect5(startCount).toBe(2);
1685
+ expect6(sleepCount).toBe(1);
1686
+ expect6(startCount).toBe(2);
1530
1687
  }
1531
1688
  });
1532
- test5("active raw fetch requests keep actor awake", async (c) => {
1689
+ test6("active raw fetch requests keep actor awake", async (c) => {
1533
1690
  const { client, endpoint: baseUrl } = await setupDriverTest(
1534
1691
  c,
1535
1692
  driverTestConfig
@@ -1537,8 +1694,8 @@ function runActorSleepTests(driverTestConfig) {
1537
1694
  const sleepActor = client.sleepWithRawHttp.getOrCreate();
1538
1695
  {
1539
1696
  const { startCount, sleepCount } = await sleepActor.getCounts();
1540
- expect5(sleepCount).toBe(0);
1541
- expect5(startCount).toBe(1);
1697
+ expect6(sleepCount).toBe(0);
1698
+ expect6(startCount).toBe(1);
1542
1699
  }
1543
1700
  const fetchDuration = SLEEP_TIMEOUT + 250;
1544
1701
  const fetchPromise = sleepActor.fetch(
@@ -1546,67 +1703,67 @@ function runActorSleepTests(driverTestConfig) {
1546
1703
  );
1547
1704
  const response = await fetchPromise;
1548
1705
  const result = await response.json();
1549
- expect5(result.completed).toBe(true);
1706
+ expect6(result.completed).toBe(true);
1550
1707
  {
1551
1708
  const { startCount, sleepCount, requestCount } = await sleepActor.getCounts();
1552
- expect5(sleepCount).toBe(0);
1553
- expect5(startCount).toBe(1);
1554
- expect5(requestCount).toBe(1);
1709
+ expect6(sleepCount).toBe(0);
1710
+ expect6(startCount).toBe(1);
1711
+ expect6(requestCount).toBe(1);
1555
1712
  }
1556
1713
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
1557
1714
  {
1558
1715
  const { startCount, sleepCount } = await sleepActor.getCounts();
1559
- expect5(sleepCount).toBe(1);
1560
- expect5(startCount).toBe(2);
1716
+ expect6(sleepCount).toBe(1);
1717
+ expect6(startCount).toBe(2);
1561
1718
  }
1562
1719
  });
1563
- test5("noSleep option disables sleeping", async (c) => {
1720
+ test6("noSleep option disables sleeping", async (c) => {
1564
1721
  const { client } = await setupDriverTest(c, driverTestConfig);
1565
1722
  const sleepActor = client.sleepWithNoSleepOption.getOrCreate();
1566
1723
  {
1567
1724
  const { startCount, sleepCount } = await sleepActor.getCounts();
1568
- expect5(sleepCount).toBe(0);
1569
- expect5(startCount).toBe(1);
1725
+ expect6(sleepCount).toBe(0);
1726
+ expect6(startCount).toBe(1);
1570
1727
  }
1571
1728
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
1572
1729
  {
1573
1730
  const { startCount, sleepCount } = await sleepActor.getCounts();
1574
- expect5(sleepCount).toBe(0);
1575
- expect5(startCount).toBe(1);
1731
+ expect6(sleepCount).toBe(0);
1732
+ expect6(startCount).toBe(1);
1576
1733
  }
1577
1734
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
1578
1735
  {
1579
1736
  const { startCount, sleepCount } = await sleepActor.getCounts();
1580
- expect5(sleepCount).toBe(0);
1581
- expect5(startCount).toBe(1);
1737
+ expect6(sleepCount).toBe(0);
1738
+ expect6(startCount).toBe(1);
1582
1739
  }
1583
1740
  });
1584
1741
  });
1585
1742
  }
1586
1743
 
1587
1744
  // src/driver-test-suite/tests/actor-state.ts
1588
- import { describe as describe6, expect as expect6, test as test6 } from "vitest";
1745
+ import { describe as describe7, expect as expect7, test as test7 } from "vitest";
1589
1746
  function runActorStateTests(driverTestConfig) {
1590
- describe6("Actor State Tests", () => {
1591
- describe6("State Persistence", () => {
1592
- test6("persists state between actor instances", async (c) => {
1747
+ describe7("Actor State Tests", () => {
1748
+ describe7("State Persistence", () => {
1749
+ test7("persists state between actor instances", async (c) => {
1593
1750
  const { client } = await setupDriverTest(c, driverTestConfig);
1594
1751
  const counterInstance = client.counter.getOrCreate();
1595
1752
  const initialCount = await counterInstance.increment(5);
1596
- expect6(initialCount).toBe(5);
1753
+ expect7(initialCount).toBe(5);
1597
1754
  const sameInstance = client.counter.getOrCreate();
1598
1755
  const persistedCount = await sameInstance.increment(3);
1599
- expect6(persistedCount).toBe(8);
1756
+ expect7(persistedCount).toBe(8);
1600
1757
  });
1601
- test6("restores state after actor disconnect/reconnect", async (c) => {
1758
+ test7("restores state after actor disconnect/reconnect", async (c) => {
1602
1759
  const { client } = await setupDriverTest(c, driverTestConfig);
1603
1760
  const counterInstance = client.counter.getOrCreate();
1604
1761
  await counterInstance.increment(5);
1605
1762
  const reconnectedInstance = client.counter.getOrCreate();
1606
1763
  const persistedCount = await reconnectedInstance.increment(0);
1607
- expect6(persistedCount).toBe(5);
1764
+ expect7(persistedCount).toBe(5);
1608
1765
  });
1609
- test6("maintains separate state for different actors", async (c) => {
1766
+ test7("maintains separate state for different actors", async (c) => {
1610
1767
  const { client } = await setupDriverTest(c, driverTestConfig);
1611
1768
  const counterA = client.counter.getOrCreate(["counter-a"]);
1612
1769
  await counterA.increment(5);
@@ -1614,8 +1771,8 @@ function runActorStateTests(driverTestConfig) {
1614
1771
  await counterB.increment(10);
1615
1772
  const countA = await counterA.increment(0);
1616
1773
  const countB = await counterB.increment(0);
1617
- expect6(countA).toBe(5);
1618
- expect6(countB).toBe(10);
1774
+ expect7(countA).toBe(5);
1775
+ expect7(countB).toBe(10);
1619
1776
  });
1620
1777
  });
1621
1778
  });
@@ -1623,94 +1780,90 @@ function runActorStateTests(driverTestConfig) {
1623
1780
 
1624
1781
  // src/driver-test-suite/tests/actor-driver.ts
1625
1782
  function runActorDriverTests(driverTestConfig) {
1626
- describe7("Actor Driver Tests", () => {
1783
+ describe8("Actor Driver Tests", () => {
1627
1784
  runActorStateTests(driverTestConfig);
1628
1785
  runActorScheduleTests(driverTestConfig);
1629
- });
1630
- }
1631
- function runActorDriverTestsWithTransport(driverTestConfig) {
1632
- describe7("Actor Driver Tests", () => {
1633
1786
  runActorSleepTests(driverTestConfig);
1634
1787
  });
1635
1788
  }
1636
1789
 
1637
1790
  // src/driver-test-suite/tests/actor-error-handling.ts
1638
- import { describe as describe8, expect as expect7, test as test7 } from "vitest";
1791
+ import { describe as describe9, expect as expect8, test as test8 } from "vitest";
1639
1792
  function runActorErrorHandlingTests(driverTestConfig) {
1640
- describe8("Actor Error Handling Tests", () => {
1641
- describe8("UserError Handling", () => {
1642
- test7("should handle simple UserError with message", async (c) => {
1793
+ describe9("Actor Error Handling Tests", () => {
1794
+ describe9("UserError Handling", () => {
1795
+ test8("should handle simple UserError with message", async (c) => {
1643
1796
  const { client } = await setupDriverTest(c, driverTestConfig);
1644
1797
  const handle = client.errorHandlingActor.getOrCreate();
1645
1798
  try {
1646
1799
  await handle.throwSimpleError();
1647
- expect7(true).toBe(false);
1800
+ expect8(true).toBe(false);
1648
1801
  } catch (error) {
1649
- expect7(error.message).toBe("Simple error message");
1650
- expect7(error.code).toBe("user_error");
1651
- expect7(error.metadata).toBeUndefined();
1802
+ expect8(error.message).toBe("Simple error message");
1803
+ expect8(error.code).toBe("user_error");
1804
+ expect8(error.metadata).toBeUndefined();
1652
1805
  }
1653
1806
  });
1654
- test7("should handle detailed UserError with code and metadata", async (c) => {
1807
+ test8("should handle detailed UserError with code and metadata", async (c) => {
1655
1808
  const { client } = await setupDriverTest(c, driverTestConfig);
1656
1809
  const handle = client.errorHandlingActor.getOrCreate();
1657
1810
  try {
1658
1811
  await handle.throwDetailedError();
1659
- expect7(true).toBe(false);
1812
+ expect8(true).toBe(false);
1660
1813
  } catch (error) {
1661
- expect7(error.message).toBe("Detailed error message");
1662
- expect7(error.code).toBe("detailed_error");
1663
- expect7(error.metadata).toBeDefined();
1664
- expect7(error.metadata.reason).toBe("test");
1665
- expect7(error.metadata.timestamp).toBeDefined();
1814
+ expect8(error.message).toBe("Detailed error message");
1815
+ expect8(error.code).toBe("detailed_error");
1816
+ expect8(error.metadata).toBeDefined();
1817
+ expect8(error.metadata.reason).toBe("test");
1818
+ expect8(error.metadata.timestamp).toBeDefined();
1666
1819
  }
1667
1820
  });
1668
1821
  });
1669
- describe8("Internal Error Handling", () => {
1670
- test7("should convert internal errors to safe format", async (c) => {
1822
+ describe9("Internal Error Handling", () => {
1823
+ test8("should convert internal errors to safe format", async (c) => {
1671
1824
  const { client } = await setupDriverTest(c, driverTestConfig);
1672
1825
  const handle = client.errorHandlingActor.getOrCreate();
1673
1826
  try {
1674
1827
  await handle.throwInternalError();
1675
- expect7(true).toBe(false);
1828
+ expect8(true).toBe(false);
1676
1829
  } catch (error) {
1677
- expect7(error.code).toBe(INTERNAL_ERROR_CODE);
1678
- expect7(error.message).toBe(INTERNAL_ERROR_DESCRIPTION);
1830
+ expect8(error.code).toBe(INTERNAL_ERROR_CODE);
1831
+ expect8(error.message).toBe(INTERNAL_ERROR_DESCRIPTION);
1679
1832
  }
1680
1833
  });
1681
1834
  });
1682
- describe8.skip("Action Timeout", () => {
1683
- test7("should handle action timeouts with custom duration", async (c) => {
1835
+ describe9.skip("Action Timeout", () => {
1836
+ test8("should handle action timeouts with custom duration", async (c) => {
1684
1837
  const { client } = await setupDriverTest(c, driverTestConfig);
1685
1838
  const handle = client.errorHandlingActor.getOrCreate();
1686
1839
  const timeoutPromise = handle.timeoutAction();
1687
1840
  try {
1688
1841
  await timeoutPromise;
1689
- expect7(true).toBe(false);
1842
+ expect8(true).toBe(false);
1690
1843
  } catch (error) {
1691
- expect7(error.message).toMatch(/timed out/i);
1844
+ expect8(error.message).toMatch(/timed out/i);
1692
1845
  }
1693
1846
  });
1694
- test7("should successfully run actions within timeout", async (c) => {
1847
+ test8("should successfully run actions within timeout", async (c) => {
1695
1848
  const { client } = await setupDriverTest(c, driverTestConfig);
1696
1849
  const handle = client.errorHandlingActor.getOrCreate();
1697
1850
  const result = await handle.delayedAction(200);
1698
- expect7(result).toBe("Completed after 200ms");
1851
+ expect8(result).toBe("Completed after 200ms");
1699
1852
  });
1700
- test7("should respect different timeouts for different actors", async (c) => {
1853
+ test8("should respect different timeouts for different actors", async (c) => {
1701
1854
  const { client } = await setupDriverTest(c, driverTestConfig);
1702
1855
  try {
1703
1856
  await client.customTimeoutActor.getOrCreate().slowAction();
1704
- expect7(true).toBe(false);
1857
+ expect8(true).toBe(false);
1705
1858
  } catch (error) {
1706
- expect7(error.message).toMatch(/timed out/i);
1859
+ expect8(error.message).toMatch(/timed out/i);
1707
1860
  }
1708
1861
  const quickResult = await client.customTimeoutActor.getOrCreate().quickAction();
1709
- expect7(quickResult).toBe("Quick action completed");
1862
+ expect8(quickResult).toBe("Quick action completed");
1710
1863
  });
1711
1864
  });
1712
- describe8("Error Recovery", () => {
1713
- test7("should continue working after errors", async (c) => {
1865
+ describe9("Error Recovery", () => {
1866
+ test8("should continue working after errors", async (c) => {
1714
1867
  const { client } = await setupDriverTest(c, driverTestConfig);
1715
1868
  const handle = client.errorHandlingActor.getOrCreate();
1716
1869
  try {
@@ -1718,27 +1871,27 @@ function runActorErrorHandlingTests(driverTestConfig) {
1718
1871
  } catch (error) {
1719
1872
  }
1720
1873
  const result = await handle.successfulAction();
1721
- expect7(result).toBe("success");
1874
+ expect8(result).toBe("success");
1722
1875
  });
1723
1876
  });
1724
1877
  });
1725
1878
  }
1726
1879
 
1727
1880
  // src/driver-test-suite/tests/actor-handle.ts
1728
- import { describe as describe9, expect as expect8, test as test8 } from "vitest";
1881
+ import { describe as describe10, expect as expect9, test as test9 } from "vitest";
1729
1882
  function runActorHandleTests(driverTestConfig) {
1730
- describe9("Actor Handle Tests", () => {
1731
- describe9("Access Methods", () => {
1732
- test8("should use .get() to access a actor", async (c) => {
1883
+ describe10("Actor Handle Tests", () => {
1884
+ describe10("Access Methods", () => {
1885
+ test9("should use .get() to access a actor", async (c) => {
1733
1886
  const { client } = await setupDriverTest(c, driverTestConfig);
1734
1887
  await client.counter.create(["test-get-handle"]);
1735
1888
  const handle = client.counter.get(["test-get-handle"]);
1736
1889
  const count = await handle.increment(5);
1737
- expect8(count).toBe(5);
1890
+ expect9(count).toBe(5);
1738
1891
  const retrievedCount = await handle.getCount();
1739
- expect8(retrievedCount).toBe(5);
1892
+ expect9(retrievedCount).toBe(5);
1740
1893
  });
1741
- test8("should use .getForId() to access a actor by ID", async (c) => {
1894
+ test9("should use .getForId() to access a actor by ID", async (c) => {
1742
1895
  const { client } = await setupDriverTest(c, driverTestConfig);
1743
1896
  const handle = client.counter.getOrCreate([
1744
1897
  "test-get-for-id-handle"
@@ -1747,73 +1900,73 @@ function runActorHandleTests(driverTestConfig) {
1747
1900
  const actorId = await handle.resolve();
1748
1901
  const idHandle = client.counter.getForId(actorId);
1749
1902
  const count = await idHandle.getCount();
1750
- expect8(count).toBe(3);
1903
+ expect9(count).toBe(3);
1751
1904
  const newCount = await idHandle.increment(4);
1752
- expect8(newCount).toBe(7);
1905
+ expect9(newCount).toBe(7);
1753
1906
  });
1754
- test8("should use .getOrCreate() to access or create a actor", async (c) => {
1907
+ test9("should use .getOrCreate() to access or create a actor", async (c) => {
1755
1908
  const { client } = await setupDriverTest(c, driverTestConfig);
1756
1909
  const handle = client.counter.getOrCreate([
1757
1910
  "test-get-or-create-handle"
1758
1911
  ]);
1759
1912
  const count = await handle.increment(7);
1760
- expect8(count).toBe(7);
1913
+ expect9(count).toBe(7);
1761
1914
  const sameHandle = client.counter.getOrCreate([
1762
1915
  "test-get-or-create-handle"
1763
1916
  ]);
1764
1917
  const retrievedCount = await sameHandle.getCount();
1765
- expect8(retrievedCount).toBe(7);
1918
+ expect9(retrievedCount).toBe(7);
1766
1919
  });
1767
- test8("should use (await create()) to create and return a handle", async (c) => {
1920
+ test9("should use (await create()) to create and return a handle", async (c) => {
1768
1921
  const { client } = await setupDriverTest(c, driverTestConfig);
1769
1922
  const handle = await client.counter.create([
1770
1923
  "test-create-handle"
1771
1924
  ]);
1772
1925
  const count = await handle.increment(9);
1773
- expect8(count).toBe(9);
1926
+ expect9(count).toBe(9);
1774
1927
  const retrievedCount = await handle.getCount();
1775
- expect8(retrievedCount).toBe(9);
1928
+ expect9(retrievedCount).toBe(9);
1776
1929
  });
1777
- test8("errors when calling create twice with the same key", async (c) => {
1930
+ test9("errors when calling create twice with the same key", async (c) => {
1778
1931
  const { client } = await setupDriverTest(c, driverTestConfig);
1779
1932
  const key = ["duplicate-create-handle", crypto.randomUUID()];
1780
1933
  await client.counter.create(key);
1781
1934
  try {
1782
1935
  await client.counter.create(key);
1783
- expect8.fail("did not error on duplicate create");
1936
+ expect9.fail("did not error on duplicate create");
1784
1937
  } catch (err) {
1785
- expect8(err.group).toBe("actor");
1786
- expect8(err.code).toBe("already_exists");
1938
+ expect9(err.group).toBe("actor");
1939
+ expect9(err.code).toBe("duplicate_key");
1787
1940
  }
1788
1941
  });
1789
- test8(".get().resolve() errors for non-existent actor", async (c) => {
1942
+ test9(".get().resolve() errors for non-existent actor", async (c) => {
1790
1943
  const { client } = await setupDriverTest(c, driverTestConfig);
1791
1944
  const missingId = `nonexistent-${crypto.randomUUID()}`;
1792
1945
  try {
1793
1946
  await client.counter.get([missingId]).resolve();
1794
- expect8.fail(
1947
+ expect9.fail(
1795
1948
  "did not error for get().resolve() on missing actor"
1796
1949
  );
1797
1950
  } catch (err) {
1798
- expect8(err.group).toBe("actor");
1799
- expect8(err.code).toBe("not_found");
1951
+ expect9(err.group).toBe("actor");
1952
+ expect9(err.code).toBe("not_found");
1800
1953
  }
1801
1954
  });
1802
1955
  });
1803
- describe9("Action Functionality", () => {
1804
- test8("should call actions directly on the handle", async (c) => {
1956
+ describe10("Action Functionality", () => {
1957
+ test9("should call actions directly on the handle", async (c) => {
1805
1958
  const { client } = await setupDriverTest(c, driverTestConfig);
1806
1959
  const handle = client.counter.getOrCreate([
1807
1960
  "test-action-handle"
1808
1961
  ]);
1809
1962
  const count1 = await handle.increment(3);
1810
- expect8(count1).toBe(3);
1963
+ expect9(count1).toBe(3);
1811
1964
  const count2 = await handle.increment(5);
1812
- expect8(count2).toBe(8);
1965
+ expect9(count2).toBe(8);
1813
1966
  const retrievedCount = await handle.getCount();
1814
- expect8(retrievedCount).toBe(8);
1967
+ expect9(retrievedCount).toBe(8);
1815
1968
  });
1816
- test8("should handle independent handles to the same actor", async (c) => {
1969
+ test9("should handle independent handles to the same actor", async (c) => {
1817
1970
  const { client } = await setupDriverTest(c, driverTestConfig);
1818
1971
  const handle1 = client.counter.getOrCreate([
1819
1972
  "test-multiple-handles"
@@ -1821,82 +1974,82 @@ function runActorHandleTests(driverTestConfig) {
1821
1974
  const handle2 = client.counter.get(["test-multiple-handles"]);
1822
1975
  await handle1.increment(3);
1823
1976
  const count = await handle2.getCount();
1824
- expect8(count).toBe(3);
1977
+ expect9(count).toBe(3);
1825
1978
  const finalCount = await handle2.increment(4);
1826
- expect8(finalCount).toBe(7);
1979
+ expect9(finalCount).toBe(7);
1827
1980
  const checkCount = await handle1.getCount();
1828
- expect8(checkCount).toBe(7);
1981
+ expect9(checkCount).toBe(7);
1829
1982
  });
1830
- test8("should resolve a actor's ID", async (c) => {
1983
+ test9("should resolve a actor's ID", async (c) => {
1831
1984
  const { client } = await setupDriverTest(c, driverTestConfig);
1832
1985
  const handle = client.counter.getOrCreate(["test-resolve-id"]);
1833
1986
  await handle.increment(1);
1834
1987
  const actorId = await handle.resolve();
1835
- expect8(typeof actorId).toBe("string");
1836
- expect8(actorId).not.toBe("");
1988
+ expect9(typeof actorId).toBe("string");
1989
+ expect9(actorId).not.toBe("");
1837
1990
  const idHandle = client.counter.getForId(actorId);
1838
1991
  const count = await idHandle.getCount();
1839
- expect8(count).toBe(1);
1992
+ expect9(count).toBe(1);
1840
1993
  });
1841
1994
  });
1842
- describe9("Lifecycle Hooks", () => {
1843
- test8("should trigger lifecycle hooks on actor creation", async (c) => {
1995
+ describe10("Lifecycle Hooks", () => {
1996
+ test9("should trigger lifecycle hooks on actor creation", async (c) => {
1844
1997
  const { client } = await setupDriverTest(c, driverTestConfig);
1845
1998
  const handle = client.counterWithLifecycle.getOrCreate([
1846
1999
  "test-lifecycle-handle"
1847
2000
  ]);
1848
2001
  const initialEvents = await handle.getEvents();
1849
- expect8(initialEvents).toContain("onStart");
2002
+ expect9(initialEvents).toContain("onWake");
1850
2003
  const sameHandle = client.counterWithLifecycle.getOrCreate([
1851
2004
  "test-lifecycle-handle"
1852
2005
  ]);
1853
2006
  const events = await sameHandle.getEvents();
1854
- expect8(events).toContain("onStart");
1855
- expect8(events.filter((e) => e === "onStart").length).toBe(1);
2007
+ expect9(events).toContain("onWake");
2008
+ expect9(events.filter((e) => e === "onWake").length).toBe(1);
1856
2009
  });
1857
- test8("should trigger lifecycle hooks for each Action call", async (c) => {
2010
+ test9("should trigger lifecycle hooks for each Action call", async (c) => {
1858
2011
  const { client } = await setupDriverTest(c, driverTestConfig);
1859
2012
  const viewHandle = client.counterWithLifecycle.getOrCreate([
1860
2013
  "test-lifecycle-action"
1861
2014
  ]);
1862
2015
  const initialEvents = await viewHandle.getEvents();
1863
- expect8(initialEvents).toContain("onStart");
1864
- expect8(initialEvents).not.toContain("onBeforeConnect");
1865
- expect8(initialEvents).not.toContain("onConnect");
1866
- expect8(initialEvents).not.toContain("onDisconnect");
2016
+ expect9(initialEvents).toContain("onWake");
2017
+ expect9(initialEvents).not.toContain("onBeforeConnect");
2018
+ expect9(initialEvents).not.toContain("onConnect");
2019
+ expect9(initialEvents).not.toContain("onDisconnect");
1867
2020
  const trackingHandle = client.counterWithLifecycle.getOrCreate(
1868
2021
  ["test-lifecycle-action"],
1869
2022
  { params: { trackLifecycle: true } }
1870
2023
  );
1871
2024
  await trackingHandle.increment(5);
1872
2025
  const eventsAfterAction = await viewHandle.getEvents();
1873
- expect8(eventsAfterAction).toContain("onBeforeConnect");
1874
- expect8(eventsAfterAction).toContain("onConnect");
1875
- expect8(eventsAfterAction).toContain("onDisconnect");
1876
- expect8(
2026
+ expect9(eventsAfterAction).toContain("onBeforeConnect");
2027
+ expect9(eventsAfterAction).toContain("onConnect");
2028
+ expect9(eventsAfterAction).toContain("onDisconnect");
2029
+ expect9(
1877
2030
  eventsAfterAction.filter((e) => e === "onBeforeConnect").length
1878
2031
  ).toBe(1);
1879
- expect8(
2032
+ expect9(
1880
2033
  eventsAfterAction.filter((e) => e === "onConnect").length
1881
2034
  ).toBe(1);
1882
- expect8(
2035
+ expect9(
1883
2036
  eventsAfterAction.filter((e) => e === "onDisconnect").length
1884
2037
  ).toBe(1);
1885
2038
  await trackingHandle.increment(10);
1886
2039
  const eventsAfterSecondAction = await viewHandle.getEvents();
1887
- expect8(
2040
+ expect9(
1888
2041
  eventsAfterSecondAction.filter(
1889
2042
  (e) => e === "onBeforeConnect"
1890
2043
  ).length
1891
2044
  ).toBe(2);
1892
- expect8(
2045
+ expect9(
1893
2046
  eventsAfterSecondAction.filter((e) => e === "onConnect").length
1894
2047
  ).toBe(2);
1895
- expect8(
2048
+ expect9(
1896
2049
  eventsAfterSecondAction.filter((e) => e === "onDisconnect").length
1897
2050
  ).toBe(2);
1898
2051
  });
1899
- test8("should trigger lifecycle hooks for each Action call across multiple handles", async (c) => {
2052
+ test9("should trigger lifecycle hooks for each Action call across multiple handles", async (c) => {
1900
2053
  const { client } = await setupDriverTest(c, driverTestConfig);
1901
2054
  const viewHandle = client.counterWithLifecycle.getOrCreate([
1902
2055
  "test-lifecycle-multi-handle"
@@ -1912,12 +2065,12 @@ function runActorHandleTests(driverTestConfig) {
1912
2065
  await trackingHandle1.increment(5);
1913
2066
  await trackingHandle2.increment(10);
1914
2067
  const events = await viewHandle.getEvents();
1915
- expect8(events.filter((e) => e === "onStart").length).toBe(1);
1916
- expect8(
2068
+ expect9(events.filter((e) => e === "onWake").length).toBe(1);
2069
+ expect9(
1917
2070
  events.filter((e) => e === "onBeforeConnect").length
1918
2071
  ).toBe(2);
1919
- expect8(events.filter((e) => e === "onConnect").length).toBe(2);
1920
- expect8(events.filter((e) => e === "onDisconnect").length).toBe(
2072
+ expect9(events.filter((e) => e === "onConnect").length).toBe(2);
2073
+ expect9(events.filter((e) => e === "onDisconnect").length).toBe(
1921
2074
  2
1922
2075
  );
1923
2076
  });
@@ -1925,28 +2078,181 @@ function runActorHandleTests(driverTestConfig) {
1925
2078
  });
1926
2079
  }
1927
2080
 
2081
+ // src/driver-test-suite/tests/actor-conn-hibernation.ts
2082
+ import { describe as describe11, expect as expect10, test as test10, vi as vi5 } from "vitest";
2083
+
2084
+ // fixtures/driver-test-suite/hibernation.ts
2085
+ var HIBERNATION_SLEEP_TIMEOUT = 500;
2086
+ var hibernationActor = actor({
2087
+ state: {
2088
+ sleepCount: 0,
2089
+ wakeCount: 0
2090
+ },
2091
+ createConnState: (c) => {
2092
+ return {
2093
+ count: 0,
2094
+ connectCount: 0,
2095
+ disconnectCount: 0
2096
+ };
2097
+ },
2098
+ onWake: (c) => {
2099
+ c.state.wakeCount += 1;
2100
+ },
2101
+ onSleep: (c) => {
2102
+ c.state.sleepCount += 1;
2103
+ },
2104
+ onConnect: (c, conn) => {
2105
+ conn.state.connectCount += 1;
2106
+ },
2107
+ onDisconnect: (c, conn) => {
2108
+ conn.state.disconnectCount += 1;
2109
+ },
2110
+ actions: {
2111
+ // Basic RPC that returns a simple value
2112
+ ping: (c) => {
2113
+ return "pong";
2114
+ },
2115
+ // Increment the connection's count
2116
+ connIncrement: (c) => {
2117
+ c.conn.state.count += 1;
2118
+ return c.conn.state.count;
2119
+ },
2120
+ // Get the connection's count
2121
+ getConnCount: (c) => {
2122
+ return c.conn.state.count;
2123
+ },
2124
+ // Get the connection's lifecycle counts
2125
+ getConnLifecycleCounts: (c) => {
2126
+ return {
2127
+ connectCount: c.conn.state.connectCount,
2128
+ disconnectCount: c.conn.state.disconnectCount
2129
+ };
2130
+ },
2131
+ // Get all connection IDs
2132
+ getConnectionIds: (c) => {
2133
+ return c.conns.entries().map((x) => x[0]).toArray();
2134
+ },
2135
+ // Get actor sleep/wake counts
2136
+ getActorCounts: (c) => {
2137
+ return {
2138
+ sleepCount: c.state.sleepCount,
2139
+ wakeCount: c.state.wakeCount
2140
+ };
2141
+ },
2142
+ // Trigger sleep
2143
+ triggerSleep: (c) => {
2144
+ c.sleep();
2145
+ }
2146
+ },
2147
+ options: {
2148
+ sleepTimeout: HIBERNATION_SLEEP_TIMEOUT
2149
+ }
2150
+ });
2151
+
2152
+ // src/driver-test-suite/tests/actor-conn-hibernation.ts
2153
+ function runActorConnHibernationTests(driverTestConfig) {
2154
+ var _a;
2155
+ describe11.skipIf((_a = driverTestConfig.skip) == null ? void 0 : _a.hibernation)(
2156
+ "Connection Hibernation",
2157
+ () => {
2158
+ test10("basic conn hibernation", async (c) => {
2159
+ const { client } = await setupDriverTest(c, driverTestConfig);
2160
+ const hibernatingActor = client.hibernationActor.getOrCreate().connect();
2161
+ const ping1 = await hibernatingActor.ping();
2162
+ expect10(ping1).toBe("pong");
2163
+ await hibernatingActor.triggerSleep();
2164
+ await waitFor(
2165
+ driverTestConfig,
2166
+ HIBERNATION_SLEEP_TIMEOUT + 100
2167
+ );
2168
+ const ping2 = await hibernatingActor.ping();
2169
+ expect10(ping2).toBe("pong");
2170
+ await hibernatingActor.dispose();
2171
+ });
2172
+ test10("conn state persists through hibernation", async (c) => {
2173
+ const { client } = await setupDriverTest(c, driverTestConfig);
2174
+ const hibernatingActor = client.hibernationActor.getOrCreate().connect();
2175
+ const count1 = await hibernatingActor.connIncrement();
2176
+ expect10(count1).toBe(1);
2177
+ const count2 = await hibernatingActor.connIncrement();
2178
+ expect10(count2).toBe(2);
2179
+ const initialLifecycle = await hibernatingActor.getConnLifecycleCounts();
2180
+ expect10(initialLifecycle.connectCount).toBe(1);
2181
+ expect10(initialLifecycle.disconnectCount).toBe(0);
2182
+ const initialActorCounts = await hibernatingActor.getActorCounts();
2183
+ expect10(initialActorCounts.wakeCount).toBe(1);
2184
+ expect10(initialActorCounts.sleepCount).toBe(0);
2185
+ await hibernatingActor.triggerSleep();
2186
+ await waitFor(
2187
+ driverTestConfig,
2188
+ HIBERNATION_SLEEP_TIMEOUT + 100
2189
+ );
2190
+ const count3 = await hibernatingActor.getConnCount();
2191
+ expect10(count3).toBe(2);
2192
+ const finalLifecycle = await hibernatingActor.getConnLifecycleCounts();
2193
+ expect10(finalLifecycle.connectCount).toBe(1);
2194
+ expect10(finalLifecycle.disconnectCount).toBe(0);
2195
+ const finalActorCounts = await hibernatingActor.getActorCounts();
2196
+ expect10(finalActorCounts.wakeCount).toBe(2);
2197
+ expect10(finalActorCounts.sleepCount).toBe(1);
2198
+ await hibernatingActor.dispose();
2199
+ });
2200
+ test10("closing connection during hibernation", async (c) => {
2201
+ const { client } = await setupDriverTest(c, driverTestConfig);
2202
+ const conn1 = client.hibernationActor.getOrCreate().connect();
2203
+ await conn1.ping();
2204
+ const connectionIds = await conn1.getConnectionIds();
2205
+ expect10(connectionIds.length).toBe(1);
2206
+ const conn1Id = connectionIds[0];
2207
+ await conn1.triggerSleep();
2208
+ await waitFor(
2209
+ driverTestConfig,
2210
+ HIBERNATION_SLEEP_TIMEOUT + 100
2211
+ );
2212
+ await conn1.dispose();
2213
+ await waitFor(driverTestConfig, 250);
2214
+ const conn2 = client.hibernationActor.getOrCreate().connect();
2215
+ await vi5.waitFor(
2216
+ async () => {
2217
+ const newConnectionIds = await conn2.getConnectionIds();
2218
+ expect10(newConnectionIds.length).toBe(1);
2219
+ expect10(newConnectionIds[0]).not.toBe(conn1Id);
2220
+ },
2221
+ {
2222
+ timeout: 5e3,
2223
+ interval: 100
2224
+ }
2225
+ );
2226
+ const lifecycle = await conn2.getConnLifecycleCounts();
2227
+ expect10(lifecycle.disconnectCount).toBe(0);
2228
+ await conn2.dispose();
2229
+ });
2230
+ }
2231
+ );
2232
+ }
2233
+
1928
2234
  // src/driver-test-suite/tests/actor-inline-client.ts
1929
- import { describe as describe10, expect as expect9, test as test9 } from "vitest";
2235
+ import { describe as describe12, expect as expect11, test as test11 } from "vitest";
1930
2236
  function runActorInlineClientTests(driverTestConfig) {
1931
- describe10("Actor Inline Client Tests", () => {
1932
- describe10("Stateless Client Calls", () => {
1933
- test9("should make stateless calls to other actors", async (c) => {
2237
+ describe12("Actor Inline Client Tests", () => {
2238
+ describe12("Stateless Client Calls", () => {
2239
+ test11("should make stateless calls to other actors", async (c) => {
1934
2240
  const { client } = await setupDriverTest(c, driverTestConfig);
1935
2241
  const inlineClientHandle = client.inlineClientActor.getOrCreate(
1936
2242
  ["inline-client-test"]
1937
2243
  );
1938
2244
  const result = await inlineClientHandle.callCounterIncrement(5);
1939
- expect9(result).toBe(5);
2245
+ expect11(result).toBe(5);
1940
2246
  const counterState = await inlineClientHandle.getCounterState();
1941
- expect9(counterState).toBe(5);
2247
+ expect11(counterState).toBe(5);
1942
2248
  const messages = await inlineClientHandle.getMessages();
1943
- expect9(messages).toHaveLength(2);
1944
- expect9(messages[0]).toContain(
2249
+ expect11(messages).toHaveLength(2);
2250
+ expect11(messages[0]).toContain(
1945
2251
  "Called counter.increment(5), result: 5"
1946
2252
  );
1947
- expect9(messages[1]).toContain("Got counter state: 5");
2253
+ expect11(messages[1]).toContain("Got counter state: 5");
1948
2254
  });
1949
- test9("should handle multiple stateless calls", async (c) => {
2255
+ test11("should handle multiple stateless calls", async (c) => {
1950
2256
  const { client } = await setupDriverTest(c, driverTestConfig);
1951
2257
  const inlineClientHandle = client.inlineClientActor.getOrCreate(
1952
2258
  ["inline-client-multi"]
@@ -1955,58 +2261,58 @@ function runActorInlineClientTests(driverTestConfig) {
1955
2261
  const result1 = await inlineClientHandle.callCounterIncrement(3);
1956
2262
  const result2 = await inlineClientHandle.callCounterIncrement(7);
1957
2263
  const finalState = await inlineClientHandle.getCounterState();
1958
- expect9(result1).toBe(3);
1959
- expect9(result2).toBe(10);
1960
- expect9(finalState).toBe(10);
2264
+ expect11(result1).toBe(3);
2265
+ expect11(result2).toBe(10);
2266
+ expect11(finalState).toBe(10);
1961
2267
  const messages = await inlineClientHandle.getMessages();
1962
- expect9(messages).toHaveLength(3);
1963
- expect9(messages[0]).toContain(
2268
+ expect11(messages).toHaveLength(3);
2269
+ expect11(messages[0]).toContain(
1964
2270
  "Called counter.increment(3), result: 3"
1965
2271
  );
1966
- expect9(messages[1]).toContain(
2272
+ expect11(messages[1]).toContain(
1967
2273
  "Called counter.increment(7), result: 10"
1968
2274
  );
1969
- expect9(messages[2]).toContain("Got counter state: 10");
2275
+ expect11(messages[2]).toContain("Got counter state: 10");
1970
2276
  });
1971
2277
  });
1972
- describe10("Stateful Client Calls", () => {
1973
- test9("should connect to other actors and receive events", async (c) => {
2278
+ describe12("Stateful Client Calls", () => {
2279
+ test11("should connect to other actors and receive events", async (c) => {
1974
2280
  const { client } = await setupDriverTest(c, driverTestConfig);
1975
2281
  const inlineClientHandle = client.inlineClientActor.getOrCreate(
1976
2282
  ["inline-client-stateful"]
1977
2283
  );
1978
2284
  await inlineClientHandle.clearMessages();
1979
2285
  const result = await inlineClientHandle.connectToCounterAndIncrement(4);
1980
- expect9(result.result1).toBe(4);
1981
- expect9(result.result2).toBe(12);
1982
- expect9(result.events).toEqual([4, 12]);
2286
+ expect11(result.result1).toBe(4);
2287
+ expect11(result.result2).toBe(12);
2288
+ expect11(result.events).toEqual([4, 12]);
1983
2289
  const messages = await inlineClientHandle.getMessages();
1984
- expect9(messages).toHaveLength(1);
1985
- expect9(messages[0]).toContain(
2290
+ expect11(messages).toHaveLength(1);
2291
+ expect11(messages[0]).toContain(
1986
2292
  "Connected to counter, incremented by 4 and 8"
1987
2293
  );
1988
- expect9(messages[0]).toContain("results: 4, 12");
1989
- expect9(messages[0]).toContain("events: [4,12]");
2294
+ expect11(messages[0]).toContain("results: 4, 12");
2295
+ expect11(messages[0]).toContain("events: [4,12]");
1990
2296
  });
1991
- test9("should handle stateful connection independently", async (c) => {
2297
+ test11("should handle stateful connection independently", async (c) => {
1992
2298
  const { client } = await setupDriverTest(c, driverTestConfig);
1993
2299
  const inlineClientHandle = client.inlineClientActor.getOrCreate(
1994
2300
  ["inline-client-independent"]
1995
2301
  );
1996
2302
  await inlineClientHandle.clearMessages();
1997
2303
  const result = await inlineClientHandle.connectToCounterAndIncrement(2);
1998
- expect9(result.result1).toBe(2);
1999
- expect9(result.result2).toBe(6);
2000
- expect9(result.events).toEqual([2, 6]);
2304
+ expect11(result.result1).toBe(2);
2305
+ expect11(result.result2).toBe(6);
2306
+ expect11(result.events).toEqual([2, 6]);
2001
2307
  const messages = await inlineClientHandle.getMessages();
2002
- expect9(messages).toHaveLength(1);
2003
- expect9(messages[0]).toContain(
2308
+ expect11(messages).toHaveLength(1);
2309
+ expect11(messages[0]).toContain(
2004
2310
  "Connected to counter, incremented by 2 and 4"
2005
2311
  );
2006
2312
  });
2007
2313
  });
2008
- describe10("Mixed Client Usage", () => {
2009
- test9("should handle both stateless and stateful calls", async (c) => {
2314
+ describe12("Mixed Client Usage", () => {
2315
+ test11("should handle both stateless and stateful calls", async (c) => {
2010
2316
  const { client } = await setupDriverTest(c, driverTestConfig);
2011
2317
  const inlineClientHandle = client.inlineClientActor.getOrCreate(
2012
2318
  ["inline-client-mixed"]
@@ -2014,17 +2320,17 @@ function runActorInlineClientTests(driverTestConfig) {
2014
2320
  await inlineClientHandle.clearMessages();
2015
2321
  await inlineClientHandle.callCounterIncrement(1);
2016
2322
  const statelessResult = await inlineClientHandle.getCounterState();
2017
- expect9(statelessResult).toBe(1);
2323
+ expect11(statelessResult).toBe(1);
2018
2324
  const statefulResult = await inlineClientHandle.connectToCounterAndIncrement(3);
2019
- expect9(statefulResult.result1).toBe(3);
2020
- expect9(statefulResult.result2).toBe(9);
2325
+ expect11(statefulResult.result1).toBe(3);
2326
+ expect11(statefulResult.result2).toBe(9);
2021
2327
  const messages = await inlineClientHandle.getMessages();
2022
- expect9(messages).toHaveLength(3);
2023
- expect9(messages[0]).toContain(
2328
+ expect11(messages).toHaveLength(3);
2329
+ expect11(messages[0]).toContain(
2024
2330
  "Called counter.increment(1), result: 1"
2025
2331
  );
2026
- expect9(messages[1]).toContain("Got counter state: 1");
2027
- expect9(messages[2]).toContain(
2332
+ expect11(messages[1]).toContain("Got counter state: 1");
2333
+ expect11(messages[2]).toContain(
2028
2334
  "Connected to counter, incremented by 3 and 6"
2029
2335
  );
2030
2336
  });
@@ -2033,11 +2339,11 @@ function runActorInlineClientTests(driverTestConfig) {
2033
2339
  }
2034
2340
 
2035
2341
  // src/driver-test-suite/tests/actor-inspector.ts
2036
- import { describe as describe11, expect as expect10, test as test10 } from "vitest";
2342
+ import { describe as describe13, expect as expect12, test as test12 } from "vitest";
2037
2343
  function runActorInspectorTests(driverTestConfig) {
2038
- describe11.skip("Actor Inspector Tests", () => {
2039
- describe11("Manager Inspector", () => {
2040
- test10("should respond to ping", async (c) => {
2344
+ describe13.skip("Actor Inspector Tests", () => {
2345
+ describe13("Manager Inspector", () => {
2346
+ test12("should respond to ping", async (c) => {
2041
2347
  const { endpoint } = await setupDriverTest(c, driverTestConfig);
2042
2348
  const http = createManagerInspectorClient(
2043
2349
  `${endpoint}/inspect`,
@@ -2048,11 +2354,11 @@ function runActorInspectorTests(driverTestConfig) {
2048
2354
  }
2049
2355
  );
2050
2356
  const response = await http.ping.$get();
2051
- expect10(response.status).toBe(200);
2357
+ expect12(response.status).toBe(200);
2052
2358
  const data = await response.json();
2053
- expect10(data).toEqual({ message: "pong" });
2359
+ expect12(data).toEqual({ message: "pong" });
2054
2360
  });
2055
- test10("should get actors with pagination", async (c) => {
2361
+ test12("should get actors with pagination", async (c) => {
2056
2362
  const { client, endpoint } = await setupDriverTest(
2057
2363
  c,
2058
2364
  driverTestConfig
@@ -2070,16 +2376,16 @@ function runActorInspectorTests(driverTestConfig) {
2070
2376
  const response = await http.actors.$get({
2071
2377
  query: { limit: "1" }
2072
2378
  });
2073
- expect10(response.status).toBe(200);
2379
+ expect12(response.status).toBe(200);
2074
2380
  const data = await response.json();
2075
- expect10(data).toEqual(
2076
- expect10.arrayContaining([
2077
- expect10.objectContaining({ key: ["test-actor-1"] })
2381
+ expect12(data).toEqual(
2382
+ expect12.arrayContaining([
2383
+ expect12.objectContaining({ key: ["test-actor-1"] })
2078
2384
  ])
2079
2385
  );
2080
- expect10(data.length).toBe(1);
2386
+ expect12(data.length).toBe(1);
2081
2387
  });
2082
- test10("should get all actors with pagination", async (c) => {
2388
+ test12("should get all actors with pagination", async (c) => {
2083
2389
  const { client, endpoint } = await setupDriverTest(
2084
2390
  c,
2085
2391
  driverTestConfig
@@ -2099,22 +2405,22 @@ function runActorInspectorTests(driverTestConfig) {
2099
2405
  const response = await http.actors.$get({
2100
2406
  query: { limit: "5" }
2101
2407
  });
2102
- expect10(response.status).toBe(200);
2408
+ expect12(response.status).toBe(200);
2103
2409
  const data = await response.json();
2104
- expect10(data).toEqual(
2105
- expect10.arrayContaining([
2106
- expect10.objectContaining({
2107
- id: expect10.any(String),
2410
+ expect12(data).toEqual(
2411
+ expect12.arrayContaining([
2412
+ expect12.objectContaining({
2413
+ id: expect12.any(String),
2108
2414
  key: actorKey1
2109
2415
  }),
2110
- expect10.objectContaining({
2111
- id: expect10.any(String),
2416
+ expect12.objectContaining({
2417
+ id: expect12.any(String),
2112
2418
  key: actorKey2
2113
2419
  })
2114
2420
  ])
2115
2421
  );
2116
2422
  });
2117
- test10("should handle invalid limit parameter", async (c) => {
2423
+ test12("should handle invalid limit parameter", async (c) => {
2118
2424
  const { endpoint } = await setupDriverTest(c, driverTestConfig);
2119
2425
  const http = createManagerInspectorClient(
2120
2426
  `${endpoint}/inspect`,
@@ -2127,9 +2433,9 @@ function runActorInspectorTests(driverTestConfig) {
2127
2433
  const response = await http.actors.$get({
2128
2434
  query: { limit: "0" }
2129
2435
  });
2130
- expect10(response.status).toBe(400);
2436
+ expect12(response.status).toBe(400);
2131
2437
  });
2132
- test10("should create a new actor", async (c) => {
2438
+ test12("should create a new actor", async (c) => {
2133
2439
  const { endpoint } = await setupDriverTest(c, driverTestConfig);
2134
2440
  const http = createManagerInspectorClient(
2135
2441
  `${endpoint}/inspect`,
@@ -2146,17 +2452,17 @@ function runActorInspectorTests(driverTestConfig) {
2146
2452
  input: {}
2147
2453
  }
2148
2454
  });
2149
- expect10(response.status).toBe(201);
2455
+ expect12(response.status).toBe(201);
2150
2456
  const data = await response.json();
2151
- expect10(data).toEqual(
2152
- expect10.objectContaining({
2153
- id: expect10.any(String),
2457
+ expect12(data).toEqual(
2458
+ expect12.objectContaining({
2459
+ id: expect12.any(String),
2154
2460
  name: "default",
2155
2461
  key: ["test-create-actor"]
2156
2462
  })
2157
2463
  );
2158
2464
  });
2159
- test10("should get builds", async (c) => {
2465
+ test12("should get builds", async (c) => {
2160
2466
  const { endpoint } = await setupDriverTest(c, driverTestConfig);
2161
2467
  const http = createManagerInspectorClient(
2162
2468
  `${endpoint}/inspect`,
@@ -2167,15 +2473,15 @@ function runActorInspectorTests(driverTestConfig) {
2167
2473
  }
2168
2474
  );
2169
2475
  const response = await http.builds.$get();
2170
- expect10(response.status).toBe(200);
2476
+ expect12(response.status).toBe(200);
2171
2477
  const data = await response.json();
2172
- expect10(data).toEqual(
2173
- expect10.arrayContaining([
2174
- expect10.objectContaining({ name: expect10.any(String) })
2478
+ expect12(data).toEqual(
2479
+ expect12.arrayContaining([
2480
+ expect12.objectContaining({ name: expect12.any(String) })
2175
2481
  ])
2176
2482
  );
2177
2483
  });
2178
- test10("should get actor by id", async (c) => {
2484
+ test12("should get actor by id", async (c) => {
2179
2485
  const { client, endpoint } = await setupDriverTest(
2180
2486
  c,
2181
2487
  driverTestConfig
@@ -2193,11 +2499,11 @@ function runActorInspectorTests(driverTestConfig) {
2193
2499
  const response = await http.actor[":id"].$get({
2194
2500
  param: { id: actorId }
2195
2501
  });
2196
- expect10(response.status).toBe(200);
2502
+ expect12(response.status).toBe(200);
2197
2503
  const data = await response.json();
2198
- expect10(data).toHaveProperty("id", actorId);
2504
+ expect12(data).toHaveProperty("id", actorId);
2199
2505
  });
2200
- test10("should return 404 for non-existent actor", async (c) => {
2506
+ test12("should return 404 for non-existent actor", async (c) => {
2201
2507
  const { endpoint } = await setupDriverTest(c, driverTestConfig);
2202
2508
  const http = createManagerInspectorClient(
2203
2509
  `${endpoint}/inspect`,
@@ -2210,11 +2516,11 @@ function runActorInspectorTests(driverTestConfig) {
2210
2516
  const response = await http.actor[":id"].$get({
2211
2517
  param: { id: "non-existent-id" }
2212
2518
  });
2213
- expect10(response.status).toBe(404);
2519
+ expect12(response.status).toBe(404);
2214
2520
  const data = await response.json();
2215
- expect10(data).toEqual({ error: "Actor not found" });
2521
+ expect12(data).toEqual({ error: "Actor not found" });
2216
2522
  });
2217
- test10("should get bootstrap data", async (c) => {
2523
+ test12("should get bootstrap data", async (c) => {
2218
2524
  const { client, endpoint } = await setupDriverTest(
2219
2525
  c,
2220
2526
  driverTestConfig
@@ -2230,11 +2536,11 @@ function runActorInspectorTests(driverTestConfig) {
2230
2536
  }
2231
2537
  );
2232
2538
  const response = await http.bootstrap.$get();
2233
- expect10(response.status).toBe(200);
2539
+ expect12(response.status).toBe(200);
2234
2540
  const data = await response.json();
2235
- expect10(data.actors).toEqual(
2236
- expect10.arrayContaining([
2237
- expect10.objectContaining({
2541
+ expect12(data.actors).toEqual(
2542
+ expect12.arrayContaining([
2543
+ expect12.objectContaining({
2238
2544
  key: ["test-bootstrap"],
2239
2545
  name: "counter"
2240
2546
  })
@@ -2242,8 +2548,8 @@ function runActorInspectorTests(driverTestConfig) {
2242
2548
  );
2243
2549
  });
2244
2550
  });
2245
- describe11("Actor Inspector", () => {
2246
- test10("should handle actor not found", async (c) => {
2551
+ describe13("Actor Inspector", () => {
2552
+ test12("should handle actor not found", async (c) => {
2247
2553
  const { endpoint } = await setupDriverTest(c, driverTestConfig);
2248
2554
  const actorId = "non-existing";
2249
2555
  const http = createActorInspectorClient(
@@ -2258,9 +2564,9 @@ function runActorInspectorTests(driverTestConfig) {
2258
2564
  }
2259
2565
  );
2260
2566
  const response = await http.ping.$get();
2261
- expect10(response.ok).toBe(false);
2567
+ expect12(response.ok).toBe(false);
2262
2568
  });
2263
- test10("should respond to ping", async (c) => {
2569
+ test12("should respond to ping", async (c) => {
2264
2570
  const { client, endpoint } = await setupDriverTest(
2265
2571
  c,
2266
2572
  driverTestConfig
@@ -2279,11 +2585,11 @@ function runActorInspectorTests(driverTestConfig) {
2279
2585
  }
2280
2586
  );
2281
2587
  const response = await http.ping.$get();
2282
- expect10(response.status).toBe(200);
2588
+ expect12(response.status).toBe(200);
2283
2589
  const data = await response.json();
2284
- expect10(data).toEqual({ message: "pong" });
2590
+ expect12(data).toEqual({ message: "pong" });
2285
2591
  });
2286
- test10("should get actor state", async (c) => {
2592
+ test12("should get actor state", async (c) => {
2287
2593
  const { client, endpoint } = await setupDriverTest(
2288
2594
  c,
2289
2595
  driverTestConfig
@@ -2303,16 +2609,16 @@ function runActorInspectorTests(driverTestConfig) {
2303
2609
  }
2304
2610
  );
2305
2611
  const response = await http.state.$get();
2306
- expect10(response.status).toBe(200);
2612
+ expect12(response.status).toBe(200);
2307
2613
  const data = await response.json();
2308
- expect10(data).toEqual({
2614
+ expect12(data).toEqual({
2309
2615
  enabled: true,
2310
- state: expect10.objectContaining({
2616
+ state: expect12.objectContaining({
2311
2617
  count: 5
2312
2618
  })
2313
2619
  });
2314
2620
  });
2315
- test10("should update actor state with replace", async (c) => {
2621
+ test12("should update actor state with replace", async (c) => {
2316
2622
  const { client, endpoint } = await setupDriverTest(
2317
2623
  c,
2318
2624
  driverTestConfig
@@ -2337,14 +2643,14 @@ function runActorInspectorTests(driverTestConfig) {
2337
2643
  replace: { count: 10 }
2338
2644
  }
2339
2645
  });
2340
- expect10(response.status).toBe(200);
2646
+ expect12(response.status).toBe(200);
2341
2647
  const data = await response.json();
2342
- expect10(data).toEqual({
2648
+ expect12(data).toEqual({
2343
2649
  enabled: true,
2344
2650
  state: { count: 10 }
2345
2651
  });
2346
2652
  });
2347
- test10("should update actor state with patch", async (c) => {
2653
+ test12("should update actor state with patch", async (c) => {
2348
2654
  const { client, endpoint } = await setupDriverTest(
2349
2655
  c,
2350
2656
  driverTestConfig
@@ -2376,16 +2682,16 @@ function runActorInspectorTests(driverTestConfig) {
2376
2682
  ]
2377
2683
  }
2378
2684
  });
2379
- expect10(response.status).toBe(200);
2685
+ expect12(response.status).toBe(200);
2380
2686
  const data = await response.json();
2381
- expect10(data).toEqual({
2687
+ expect12(data).toEqual({
2382
2688
  enabled: true,
2383
- state: expect10.objectContaining({
2689
+ state: expect12.objectContaining({
2384
2690
  count: 7
2385
2691
  })
2386
2692
  });
2387
2693
  });
2388
- test10("should get actor connections", async (c) => {
2694
+ test12("should get actor connections", async (c) => {
2389
2695
  const { client, endpoint } = await setupDriverTest(
2390
2696
  c,
2391
2697
  driverTestConfig
@@ -2408,17 +2714,17 @@ function runActorInspectorTests(driverTestConfig) {
2408
2714
  }
2409
2715
  );
2410
2716
  const response = await http.connections.$get();
2411
- expect10(response.status).toBe(200);
2717
+ expect12(response.status).toBe(200);
2412
2718
  const data = await response.json();
2413
- expect10(data.connections).toEqual(
2414
- expect10.arrayContaining([
2415
- expect10.objectContaining({
2416
- id: expect10.any(String)
2719
+ expect12(data.connections).toEqual(
2720
+ expect12.arrayContaining([
2721
+ expect12.objectContaining({
2722
+ id: expect12.any(String)
2417
2723
  })
2418
2724
  ])
2419
2725
  );
2420
2726
  });
2421
- test10("should get actor events", async (c) => {
2727
+ test12("should get actor events", async (c) => {
2422
2728
  const { client, endpoint } = await setupDriverTest(
2423
2729
  c,
2424
2730
  driverTestConfig
@@ -2439,18 +2745,18 @@ function runActorInspectorTests(driverTestConfig) {
2439
2745
  }
2440
2746
  );
2441
2747
  const response = await http.events.$get();
2442
- expect10(response.status).toBe(200);
2748
+ expect12(response.status).toBe(200);
2443
2749
  const data = await response.json();
2444
- expect10(data.events).toEqual(
2445
- expect10.arrayContaining([
2446
- expect10.objectContaining({
2750
+ expect12(data.events).toEqual(
2751
+ expect12.arrayContaining([
2752
+ expect12.objectContaining({
2447
2753
  type: "broadcast",
2448
- id: expect10.any(String)
2754
+ id: expect12.any(String)
2449
2755
  })
2450
2756
  ])
2451
2757
  );
2452
2758
  });
2453
- test10("should clear actor events", async (c) => {
2759
+ test12("should clear actor events", async (c) => {
2454
2760
  const { client, endpoint } = await setupDriverTest(
2455
2761
  c,
2456
2762
  driverTestConfig
@@ -2474,21 +2780,21 @@ function runActorInspectorTests(driverTestConfig) {
2474
2780
  );
2475
2781
  {
2476
2782
  const response2 = await http.events.$get();
2477
- expect10(response2.status).toBe(200);
2783
+ expect12(response2.status).toBe(200);
2478
2784
  const data = await response2.json();
2479
- expect10(data.events).toEqual(
2480
- expect10.arrayContaining([
2481
- expect10.objectContaining({
2785
+ expect12(data.events).toEqual(
2786
+ expect12.arrayContaining([
2787
+ expect12.objectContaining({
2482
2788
  type: "broadcast",
2483
- id: expect10.any(String)
2789
+ id: expect12.any(String)
2484
2790
  })
2485
2791
  ])
2486
2792
  );
2487
2793
  }
2488
2794
  const response = await http.events.clear.$post();
2489
- expect10(response.status).toBe(200);
2795
+ expect12(response.status).toBe(200);
2490
2796
  });
2491
- test10("should get actor rpcs", async (c) => {
2797
+ test12("should get actor rpcs", async (c) => {
2492
2798
  const { client, endpoint } = await setupDriverTest(
2493
2799
  c,
2494
2800
  driverTestConfig
@@ -2507,15 +2813,15 @@ function runActorInspectorTests(driverTestConfig) {
2507
2813
  }
2508
2814
  );
2509
2815
  const response = await http.rpcs.$get();
2510
- expect10(response.status).toBe(200);
2816
+ expect12(response.status).toBe(200);
2511
2817
  const data = await response.json();
2512
- expect10(data).toEqual(
2513
- expect10.objectContaining({
2514
- rpcs: expect10.arrayContaining(["increment", "getCount"])
2818
+ expect12(data).toEqual(
2819
+ expect12.objectContaining({
2820
+ rpcs: expect12.arrayContaining(["increment", "getCount"])
2515
2821
  })
2516
2822
  );
2517
2823
  });
2518
- test10.skip("should get actor database info", async (c) => {
2824
+ test12.skip("should get actor database info", async (c) => {
2519
2825
  const { client, endpoint } = await setupDriverTest(
2520
2826
  c,
2521
2827
  driverTestConfig
@@ -2534,18 +2840,18 @@ function runActorInspectorTests(driverTestConfig) {
2534
2840
  }
2535
2841
  );
2536
2842
  const response = await http.db.$get();
2537
- expect10(response.status).toBe(200);
2843
+ expect12(response.status).toBe(200);
2538
2844
  const data = await response.json();
2539
- expect10(data).toHaveProperty("enabled");
2540
- expect10(typeof data.enabled).toBe("boolean");
2845
+ expect12(data).toHaveProperty("enabled");
2846
+ expect12(typeof data.enabled).toBe("boolean");
2541
2847
  if (data.enabled) {
2542
- expect10(data).toHaveProperty("db");
2543
- expect10(Array.isArray(data.db)).toBe(true);
2848
+ expect12(data).toHaveProperty("db");
2849
+ expect12(Array.isArray(data.db)).toBe(true);
2544
2850
  } else {
2545
- expect10(data.db).toBe(null);
2851
+ expect12(data.db).toBe(null);
2546
2852
  }
2547
2853
  });
2548
- test10.skip("should execute database query when database is enabled", async (c) => {
2854
+ test12.skip("should execute database query when database is enabled", async (c) => {
2549
2855
  const { client, endpoint } = await setupDriverTest(
2550
2856
  c,
2551
2857
  driverTestConfig
@@ -2572,9 +2878,9 @@ function runActorInspectorTests(driverTestConfig) {
2572
2878
  params: []
2573
2879
  }
2574
2880
  });
2575
- expect10(queryResponse.status).toBe(200);
2881
+ expect12(queryResponse.status).toBe(200);
2576
2882
  const queryData = await queryResponse.json();
2577
- expect10(queryData).toHaveProperty("result");
2883
+ expect12(queryData).toHaveProperty("result");
2578
2884
  } else {
2579
2885
  const queryResponse = await http.db.$post({
2580
2886
  json: {
@@ -2582,9 +2888,9 @@ function runActorInspectorTests(driverTestConfig) {
2582
2888
  params: []
2583
2889
  }
2584
2890
  });
2585
- expect10(queryResponse.status).toBe(200);
2891
+ expect12(queryResponse.status).toBe(200);
2586
2892
  const queryData = await queryResponse.json();
2587
- expect10(queryData).toEqual({ enabled: false });
2893
+ expect12(queryData).toEqual({ enabled: false });
2588
2894
  }
2589
2895
  });
2590
2896
  });
@@ -2592,25 +2898,25 @@ function runActorInspectorTests(driverTestConfig) {
2592
2898
  }
2593
2899
 
2594
2900
  // src/driver-test-suite/tests/actor-metadata.ts
2595
- import { describe as describe12, expect as expect11, test as test11 } from "vitest";
2901
+ import { describe as describe14, expect as expect13, test as test13 } from "vitest";
2596
2902
  function runActorMetadataTests(driverTestConfig) {
2597
- describe12("Actor Metadata Tests", () => {
2598
- describe12("Actor Name", () => {
2599
- test11("should provide access to actor name", async (c) => {
2903
+ describe14("Actor Metadata Tests", () => {
2904
+ describe14("Actor Name", () => {
2905
+ test13("should provide access to actor name", async (c) => {
2600
2906
  const { client } = await setupDriverTest(c, driverTestConfig);
2601
2907
  const handle = client.metadataActor.getOrCreate();
2602
2908
  const actorName = await handle.getActorName();
2603
- expect11(actorName).toBe("metadataActor");
2909
+ expect13(actorName).toBe("metadataActor");
2604
2910
  });
2605
- test11("should preserve actor name in state during onStart", async (c) => {
2911
+ test13("should preserve actor name in state during onWake", async (c) => {
2606
2912
  const { client } = await setupDriverTest(c, driverTestConfig);
2607
2913
  const handle = client.metadataActor.getOrCreate();
2608
2914
  const storedName = await handle.getStoredActorName();
2609
- expect11(storedName).toBe("metadataActor");
2915
+ expect13(storedName).toBe("metadataActor");
2610
2916
  });
2611
2917
  });
2612
- describe12("Actor Tags", () => {
2613
- test11("should provide access to tags", async (c) => {
2918
+ describe14("Actor Tags", () => {
2919
+ test13("should provide access to tags", async (c) => {
2614
2920
  const { client } = await setupDriverTest(c, driverTestConfig);
2615
2921
  const handle = client.metadataActor.getOrCreate();
2616
2922
  await handle.setupTestTags({
@@ -2618,12 +2924,12 @@ function runActorMetadataTests(driverTestConfig) {
2618
2924
  purpose: "metadata-test"
2619
2925
  });
2620
2926
  const tags = await handle.getTags();
2621
- expect11(tags).toHaveProperty("env");
2622
- expect11(tags.env).toBe("test");
2623
- expect11(tags).toHaveProperty("purpose");
2624
- expect11(tags.purpose).toBe("metadata-test");
2927
+ expect13(tags).toHaveProperty("env");
2928
+ expect13(tags.env).toBe("test");
2929
+ expect13(tags).toHaveProperty("purpose");
2930
+ expect13(tags.purpose).toBe("metadata-test");
2625
2931
  });
2626
- test11("should allow accessing individual tags", async (c) => {
2932
+ test13("should allow accessing individual tags", async (c) => {
2627
2933
  const { client } = await setupDriverTest(c, driverTestConfig);
2628
2934
  const handle = client.metadataActor.getOrCreate();
2629
2935
  await handle.setupTestTags({
@@ -2633,217 +2939,110 @@ function runActorMetadataTests(driverTestConfig) {
2633
2939
  const category = await handle.getTag("category");
2634
2940
  const version = await handle.getTag("version");
2635
2941
  const nonexistent = await handle.getTag("nonexistent");
2636
- expect11(category).toBe("test-actor");
2637
- expect11(version).toBe("1.0");
2638
- expect11(nonexistent).toBeNull();
2942
+ expect13(category).toBe("test-actor");
2943
+ expect13(version).toBe("1.0");
2944
+ expect13(nonexistent).toBeNull();
2639
2945
  });
2640
2946
  });
2641
- describe12("Metadata Structure", () => {
2642
- test11("should provide complete metadata object", async (c) => {
2947
+ describe14("Metadata Structure", () => {
2948
+ test13("should provide complete metadata object", async (c) => {
2643
2949
  const { client } = await setupDriverTest(c, driverTestConfig);
2644
2950
  const handle = client.metadataActor.getOrCreate();
2645
2951
  await handle.setupTestTags({ type: "metadata-test" });
2646
2952
  await handle.setupTestRegion("us-west-1");
2647
2953
  const metadata = await handle.getMetadata();
2648
- expect11(metadata).toHaveProperty("name");
2649
- expect11(metadata.name).toBe("metadataActor");
2650
- expect11(metadata).toHaveProperty("tags");
2651
- expect11(metadata.tags).toHaveProperty("type");
2652
- expect11(metadata.tags.type).toBe("metadata-test");
2653
- expect11(metadata).toHaveProperty("region");
2654
- expect11(metadata.region).toBe("us-west-1");
2954
+ expect13(metadata).toHaveProperty("name");
2955
+ expect13(metadata.name).toBe("metadataActor");
2956
+ expect13(metadata).toHaveProperty("tags");
2957
+ expect13(metadata.tags).toHaveProperty("type");
2958
+ expect13(metadata.tags.type).toBe("metadata-test");
2959
+ expect13(metadata).toHaveProperty("region");
2960
+ expect13(metadata.region).toBe("us-west-1");
2655
2961
  });
2656
2962
  });
2657
- describe12("Region Information", () => {
2658
- test11("should retrieve region information", async (c) => {
2963
+ describe14("Region Information", () => {
2964
+ test13("should retrieve region information", async (c) => {
2659
2965
  const { client } = await setupDriverTest(c, driverTestConfig);
2660
2966
  const handle = client.metadataActor.getOrCreate();
2661
2967
  await handle.setupTestRegion("eu-central-1");
2662
2968
  const region = await handle.getRegion();
2663
- expect11(region).toBe("eu-central-1");
2969
+ expect13(region).toBe("eu-central-1");
2664
2970
  });
2665
2971
  });
2666
2972
  });
2667
2973
  }
2668
2974
 
2669
2975
  // src/driver-test-suite/tests/actor-onstatechange.ts
2670
- import { describe as describe13, expect as expect12, test as test12 } from "vitest";
2976
+ import { describe as describe15, expect as expect14, test as test14 } from "vitest";
2671
2977
  function runActorOnStateChangeTests(driverTestConfig) {
2672
- describe13("Actor onStateChange Tests", () => {
2673
- test12("triggers onStateChange when state is modified", async (c) => {
2978
+ describe15("Actor onStateChange Tests", () => {
2979
+ test14("triggers onStateChange when state is modified", async (c) => {
2674
2980
  const { client } = await setupDriverTest(c, driverTestConfig);
2675
2981
  const actor2 = client.onStateChangeActor.getOrCreate();
2676
2982
  await actor2.setValue(10);
2677
2983
  const changeCount = await actor2.getChangeCount();
2678
- expect12(changeCount).toBe(1);
2984
+ expect14(changeCount).toBe(1);
2679
2985
  });
2680
- test12("triggers onChange multiple times for multiple state changes", async (c) => {
2986
+ test14("triggers onChange multiple times for multiple state changes", async (c) => {
2681
2987
  const { client } = await setupDriverTest(c, driverTestConfig);
2682
2988
  const actor2 = client.onStateChangeActor.getOrCreate();
2683
2989
  await actor2.incrementMultiple(3);
2684
2990
  const changeCount = await actor2.getChangeCount();
2685
- expect12(changeCount).toBe(3);
2991
+ expect14(changeCount).toBe(3);
2686
2992
  });
2687
- test12("does NOT trigger onChange for read-only actions", async (c) => {
2993
+ test14("does NOT trigger onChange for read-only actions", async (c) => {
2688
2994
  const { client } = await setupDriverTest(c, driverTestConfig);
2689
2995
  const actor2 = client.onStateChangeActor.getOrCreate();
2690
2996
  await actor2.setValue(5);
2691
2997
  const value = await actor2.getValue();
2692
- expect12(value).toBe(5);
2998
+ expect14(value).toBe(5);
2693
2999
  const changeCount = await actor2.getChangeCount();
2694
- expect12(changeCount).toBe(1);
3000
+ expect14(changeCount).toBe(1);
2695
3001
  });
2696
- test12("does NOT trigger onChange for computed values", async (c) => {
3002
+ test14("does NOT trigger onChange for computed values", async (c) => {
2697
3003
  const { client } = await setupDriverTest(c, driverTestConfig);
2698
3004
  const actor2 = client.onStateChangeActor.getOrCreate();
2699
3005
  await actor2.setValue(3);
2700
3006
  {
2701
3007
  const changeCount = await actor2.getChangeCount();
2702
- expect12(changeCount).toBe(1);
3008
+ expect14(changeCount).toBe(1);
2703
3009
  }
2704
3010
  const doubled = await actor2.getDoubled();
2705
- expect12(doubled).toBe(6);
3011
+ expect14(doubled).toBe(6);
2706
3012
  {
2707
3013
  const changeCount = await actor2.getChangeCount();
2708
- expect12(changeCount).toBe(1);
3014
+ expect14(changeCount).toBe(1);
2709
3015
  }
2710
3016
  });
2711
- test12("simple: connect, call action, dispose does NOT trigger onChange", async (c) => {
3017
+ test14("simple: connect, call action, dispose does NOT trigger onChange", async (c) => {
2712
3018
  const { client } = await setupDriverTest(c, driverTestConfig);
2713
3019
  const actor2 = client.onStateChangeActor.getOrCreate();
2714
3020
  const connection = await actor2.connect();
2715
3021
  const value = await connection.getValue();
2716
- expect12(value).toBe(0);
3022
+ expect14(value).toBe(0);
2717
3023
  await connection.dispose();
2718
3024
  const changeCount = await actor2.getChangeCount();
2719
- expect12(changeCount).toBe(0);
3025
+ expect14(changeCount).toBe(0);
2720
3026
  });
2721
3027
  });
2722
3028
  }
2723
3029
 
2724
- // src/driver-test-suite/tests/actor-reconnect.ts
2725
- import { describe as describe14, expect as expect13, test as test13, vi as vi4 } from "vitest";
2726
- function runActorReconnectTests(driverTestConfig) {
2727
- describe14("Actor Reconnection Tests", () => {
2728
- test13("should reconnect and preserve connection state after non-clean disconnect", async (c) => {
2729
- const { client, endpoint } = await setupDriverTest(
2730
- c,
2731
- driverTestConfig
2732
- );
2733
- const handle = client.counterConn.getOrCreate(["test-reconnect"]);
2734
- const connection = handle.connect();
2735
- await connection.increment(5);
2736
- const connCount1 = await connection.getConnectionCount();
2737
- expect13(connCount1).toBe(1);
2738
- const connRaw = connection;
2739
- await forceUncleanDisconnect(
2740
- endpoint,
2741
- connRaw.actorId,
2742
- connRaw.connectionId
2743
- );
2744
- await vi4.waitFor(
2745
- async () => {
2746
- const countAfterReconnect = await connection.getCount();
2747
- expect13(countAfterReconnect).toBe(5);
2748
- },
2749
- { timeout: 5e3, interval: 100 }
2750
- );
2751
- const connCount2 = await connection.getConnectionCount();
2752
- expect13(connCount2).toBe(1);
2753
- const newCount = await connection.getCount();
2754
- expect13(newCount).toBe(5);
2755
- await connection.dispose();
2756
- });
2757
- test13("should not preserve connection state after clean disconnect", async (c) => {
2758
- const { client } = await setupDriverTest(c, driverTestConfig);
2759
- const handle = client.counterConn.getOrCreate([
2760
- "test-clean-disconnect"
2761
- ]);
2762
- const connection = handle.connect();
2763
- await connection.increment(10);
2764
- const connCount1 = await connection.getConnectionCount();
2765
- expect13(connCount1).toBe(1);
2766
- await connection.dispose();
2767
- await vi4.waitFor(
2768
- async () => {
2769
- const handle2 = client.counterConn.get([
2770
- "test-clean-disconnect"
2771
- ]);
2772
- const connCount = await handle2.getConnectionCount();
2773
- expect13(connCount).toBe(1);
2774
- },
2775
- { timeout: 5e3 }
2776
- );
2777
- const connection2 = handle.connect();
2778
- const countNewConnection = await connection2.getCount();
2779
- expect13(countNewConnection).toBe(0);
2780
- const connCount3 = await connection2.getConnectionCount();
2781
- expect13(connCount3).toBe(1);
2782
- await connection2.dispose();
2783
- });
2784
- test13("should handle multiple non-clean disconnects and reconnects", async (c) => {
2785
- const { client, endpoint } = await setupDriverTest(
2786
- c,
2787
- driverTestConfig
2788
- );
2789
- const handle = client.counterConn.getOrCreate([
2790
- "test-multiple-reconnect"
2791
- ]);
2792
- const connection = handle.connect();
2793
- await connection.setCount(100);
2794
- for (let i = 0; i < 3; i++) {
2795
- await connection.increment(1);
2796
- const connRaw = connection;
2797
- await forceUncleanDisconnect(
2798
- endpoint,
2799
- connRaw.actorId,
2800
- connRaw.connectionId
2801
- );
2802
- await vi4.waitFor(
2803
- async () => {
2804
- const countAfter = await connection.getCount();
2805
- expect13(countAfter).toBe(101 + i);
2806
- },
2807
- { timeout: 5e3 }
2808
- );
2809
- const connCount = await connection.getConnectionCount();
2810
- expect13(connCount).toBe(1);
2811
- }
2812
- const finalCount = await connection.getCount();
2813
- expect13(finalCount).toBe(103);
2814
- await connection.dispose();
2815
- });
2816
- });
2817
- }
2818
- async function forceUncleanDisconnect(endpoint, actorId, connId) {
2819
- const response = await fetch(
2820
- `${endpoint}/.test/force-disconnect?actor=${actorId}&conn=${connId}`,
2821
- {
2822
- method: "POST"
2823
- }
2824
- );
2825
- if (!response.ok) {
2826
- const text = await response.text();
2827
- throw new Error(`Failed to force disconnect: ${text}`);
2828
- }
2829
- }
2830
-
2831
3030
  // src/driver-test-suite/tests/actor-vars.ts
2832
- import { describe as describe15, expect as expect14, test as test14 } from "vitest";
3031
+ import { describe as describe16, expect as expect15, test as test15 } from "vitest";
2833
3032
  function runActorVarsTests(driverTestConfig) {
2834
- describe15("Actor Variables", () => {
2835
- describe15("Static vars", () => {
2836
- test14("should provide access to static vars", async (c) => {
3033
+ describe16("Actor Variables", () => {
3034
+ describe16("Static vars", () => {
3035
+ test15("should provide access to static vars", async (c) => {
2837
3036
  const { client } = await setupDriverTest(c, driverTestConfig);
2838
3037
  const instance = client.staticVarActor.getOrCreate();
2839
3038
  const result = await instance.getVars();
2840
- expect14(result).toEqual({ counter: 42, name: "test-actor" });
3039
+ expect15(result).toEqual({ counter: 42, name: "test-actor" });
2841
3040
  const name = await instance.getName();
2842
- expect14(name).toBe("test-actor");
3041
+ expect15(name).toBe("test-actor");
2843
3042
  });
2844
3043
  });
2845
- describe15("Deep cloning of static vars", () => {
2846
- test14("should deep clone static vars between actor instances", async (c) => {
3044
+ describe16("Deep cloning of static vars", () => {
3045
+ test15("should deep clone static vars between actor instances", async (c) => {
2847
3046
  const { client } = await setupDriverTest(c, driverTestConfig);
2848
3047
  const instance1 = client.nestedVarActor.getOrCreate([
2849
3048
  "instance1"
@@ -2852,100 +3051,100 @@ function runActorVarsTests(driverTestConfig) {
2852
3051
  "instance2"
2853
3052
  ]);
2854
3053
  const modifiedVars = await instance1.modifyNested();
2855
- expect14(modifiedVars.nested.value).toBe("modified");
2856
- expect14(modifiedVars.nested.array).toContain(4);
2857
- expect14(modifiedVars.nested.obj.key).toBe("new-value");
3054
+ expect15(modifiedVars.nested.value).toBe("modified");
3055
+ expect15(modifiedVars.nested.array).toContain(4);
3056
+ expect15(modifiedVars.nested.obj.key).toBe("new-value");
2858
3057
  const instance2Vars = await instance2.getVars();
2859
- expect14(instance2Vars.nested.value).toBe("original");
2860
- expect14(instance2Vars.nested.array).toEqual([1, 2, 3]);
2861
- expect14(instance2Vars.nested.obj.key).toBe("value");
3058
+ expect15(instance2Vars.nested.value).toBe("original");
3059
+ expect15(instance2Vars.nested.array).toEqual([1, 2, 3]);
3060
+ expect15(instance2Vars.nested.obj.key).toBe("value");
2862
3061
  });
2863
3062
  });
2864
- describe15("createVars", () => {
2865
- test14("should support dynamic vars creation", async (c) => {
3063
+ describe16("createVars", () => {
3064
+ test15("should support dynamic vars creation", async (c) => {
2866
3065
  const { client } = await setupDriverTest(c, driverTestConfig);
2867
3066
  const instance = client.dynamicVarActor.getOrCreate();
2868
3067
  const vars = await instance.getVars();
2869
- expect14(vars).toHaveProperty("random");
2870
- expect14(vars).toHaveProperty("computed");
2871
- expect14(typeof vars.random).toBe("number");
2872
- expect14(typeof vars.computed).toBe("string");
2873
- expect14(vars.computed).toMatch(/^Actor-\d+$/);
3068
+ expect15(vars).toHaveProperty("random");
3069
+ expect15(vars).toHaveProperty("computed");
3070
+ expect15(typeof vars.random).toBe("number");
3071
+ expect15(typeof vars.computed).toBe("string");
3072
+ expect15(vars.computed).toMatch(/^Actor-\d+$/);
2874
3073
  });
2875
- test14("should create different vars for different instances", async (c) => {
3074
+ test15("should create different vars for different instances", async (c) => {
2876
3075
  const { client } = await setupDriverTest(c, driverTestConfig);
2877
3076
  const instance1 = client.uniqueVarActor.getOrCreate(["test1"]);
2878
3077
  const instance2 = client.uniqueVarActor.getOrCreate(["test2"]);
2879
3078
  const vars1 = await instance1.getVars();
2880
3079
  const vars2 = await instance2.getVars();
2881
- expect14(vars1.id).not.toBe(vars2.id);
3080
+ expect15(vars1.id).not.toBe(vars2.id);
2882
3081
  });
2883
3082
  });
2884
- describe15("Driver Context", () => {
2885
- test14("should provide access to driver context", async (c) => {
3083
+ describe16("Driver Context", () => {
3084
+ test15("should provide access to driver context", async (c) => {
2886
3085
  const { client } = await setupDriverTest(c, driverTestConfig);
2887
3086
  const instance = client.driverCtxActor.getOrCreate();
2888
3087
  const vars = await instance.getVars();
2889
- expect14(vars).toHaveProperty("hasDriverCtx");
3088
+ expect15(vars).toHaveProperty("hasDriverCtx");
2890
3089
  });
2891
3090
  });
2892
3091
  });
2893
3092
  }
2894
3093
 
2895
3094
  // src/driver-test-suite/tests/manager-driver.ts
2896
- import { describe as describe16, expect as expect15, test as test15 } from "vitest";
3095
+ import { describe as describe17, expect as expect16, test as test16 } from "vitest";
2897
3096
  function runManagerDriverTests(driverTestConfig) {
2898
- describe16("Manager Driver Tests", () => {
2899
- describe16("Client Connection Methods", () => {
2900
- test15("connect() - finds or creates a actor", async (c) => {
3097
+ describe17("Manager Driver Tests", () => {
3098
+ describe17("Client Connection Methods", () => {
3099
+ test16("connect() - finds or creates a actor", async (c) => {
2901
3100
  const { client } = await setupDriverTest(c, driverTestConfig);
2902
3101
  const counterA = client.counter.getOrCreate();
2903
3102
  await counterA.increment(5);
2904
3103
  const counterAAgain = client.counter.getOrCreate();
2905
3104
  const count = await counterAAgain.increment(0);
2906
- expect15(count).toBe(5);
3105
+ expect16(count).toBe(5);
2907
3106
  const counterB = client.counter.getOrCreate([
2908
3107
  "counter-b",
2909
3108
  "testing"
2910
3109
  ]);
2911
3110
  await counterB.increment(10);
2912
3111
  const countB = await counterB.increment(0);
2913
- expect15(countB).toBe(10);
3112
+ expect16(countB).toBe(10);
2914
3113
  });
2915
- test15("throws ActorAlreadyExists when creating duplicate actors", async (c) => {
3114
+ test16("throws ActorAlreadyExists when creating duplicate actors", async (c) => {
2916
3115
  const { client } = await setupDriverTest(c, driverTestConfig);
2917
3116
  const uniqueKey = ["duplicate-actor-test", crypto.randomUUID()];
2918
3117
  const counter = client.counter.getOrCreate(uniqueKey);
2919
3118
  await counter.increment(5);
2920
3119
  try {
2921
3120
  await client.counter.create(uniqueKey);
2922
- expect15.fail("did not error on duplicate create");
3121
+ expect16.fail("did not error on duplicate create");
2923
3122
  } catch (err) {
2924
- expect15(err.group).toBe("actor");
2925
- expect15(err.code).toBe("already_exists");
3123
+ expect16(err.group).toBe("actor");
3124
+ expect16(err.code).toBe("duplicate_key");
2926
3125
  }
2927
3126
  const count = await counter.increment(0);
2928
- expect15(count).toBe(5);
3127
+ expect16(count).toBe(5);
2929
3128
  });
2930
3129
  });
2931
- describe16("Connection Options", () => {
2932
- test15("get without create prevents actor creation", async (c) => {
3130
+ describe17("Connection Options", () => {
3131
+ test16("get without create prevents actor creation", async (c) => {
2933
3132
  const { client } = await setupDriverTest(c, driverTestConfig);
2934
3133
  const nonexistentId = `nonexistent-${crypto.randomUUID()}`;
2935
3134
  try {
2936
3135
  await client.counter.get([nonexistentId]).resolve();
2937
- expect15.fail("did not error for get");
3136
+ expect16.fail("did not error for get");
2938
3137
  } catch (err) {
2939
- expect15(err.group).toBe("actor");
2940
- expect15(err.code).toBe("not_found");
3138
+ expect16(err.group).toBe("actor");
3139
+ expect16(err.code).toBe("not_found");
2941
3140
  }
2942
3141
  const createdCounter = client.counter.getOrCreate(nonexistentId);
2943
3142
  await createdCounter.increment(3);
2944
3143
  const retrievedCounter = client.counter.get(nonexistentId);
2945
3144
  const count = await retrievedCounter.increment(0);
2946
- expect15(count).toBe(3);
3145
+ expect16(count).toBe(3);
2947
3146
  });
2948
- test15("connection params are passed to actors", async (c) => {
3147
+ test16("connection params are passed to actors", async (c) => {
2949
3148
  const { client } = await setupDriverTest(c, driverTestConfig);
2950
3149
  const counter = client.counter.getOrCreate(void 0, {
2951
3150
  params: {
@@ -2956,20 +3155,20 @@ function runManagerDriverTests(driverTestConfig) {
2956
3155
  });
2957
3156
  await counter.increment(1);
2958
3157
  const count = await counter.increment(0);
2959
- expect15(count).toBe(1);
3158
+ expect16(count).toBe(1);
2960
3159
  });
2961
3160
  });
2962
- describe16("Actor Creation & Retrieval", () => {
2963
- test15("creates and retrieves actors by ID", async (c) => {
3161
+ describe17("Actor Creation & Retrieval", () => {
3162
+ test16("creates and retrieves actors by ID", async (c) => {
2964
3163
  const { client } = await setupDriverTest(c, driverTestConfig);
2965
3164
  const uniqueId = `test-counter-${crypto.randomUUID()}`;
2966
3165
  const counter = client.counter.getOrCreate([uniqueId]);
2967
3166
  await counter.increment(10);
2968
3167
  const retrievedCounter = client.counter.getOrCreate([uniqueId]);
2969
3168
  const count = await retrievedCounter.increment(0);
2970
- expect15(count).toBe(10);
3169
+ expect16(count).toBe(10);
2971
3170
  });
2972
- test15("passes input to actor during creation", async (c) => {
3171
+ test16("passes input to actor during creation", async (c) => {
2973
3172
  const { client } = await setupDriverTest(c, driverTestConfig);
2974
3173
  const testInput = {
2975
3174
  name: "test-actor",
@@ -2980,17 +3179,17 @@ function runManagerDriverTests(driverTestConfig) {
2980
3179
  input: testInput
2981
3180
  });
2982
3181
  const inputs = await actor2.getInputs();
2983
- expect15(inputs.initialInput).toEqual(testInput);
2984
- expect15(inputs.onCreateInput).toEqual(testInput);
3182
+ expect16(inputs.initialInput).toEqual(testInput);
3183
+ expect16(inputs.onCreateInput).toEqual(testInput);
2985
3184
  });
2986
- test15("input is undefined when not provided", async (c) => {
3185
+ test16("input is undefined when not provided", async (c) => {
2987
3186
  const { client } = await setupDriverTest(c, driverTestConfig);
2988
3187
  const actor2 = await client.inputActor.create();
2989
3188
  const inputs = await actor2.getInputs();
2990
- expect15(inputs.initialInput).toBeUndefined();
2991
- expect15(inputs.onCreateInput).toBeUndefined();
3189
+ expect16(inputs.initialInput).toBeUndefined();
3190
+ expect16(inputs.onCreateInput).toBeUndefined();
2992
3191
  });
2993
- test15("getOrCreate passes input to actor during creation", async (c) => {
3192
+ test16("getOrCreate passes input to actor during creation", async (c) => {
2994
3193
  const { client } = await setupDriverTest(c, driverTestConfig);
2995
3194
  const uniqueKey = [`input-test-${crypto.randomUUID()}`];
2996
3195
  const testInput = {
@@ -3002,16 +3201,16 @@ function runManagerDriverTests(driverTestConfig) {
3002
3201
  createWithInput: testInput
3003
3202
  });
3004
3203
  const inputs = await actor2.getInputs();
3005
- expect15(inputs.initialInput).toEqual(testInput);
3006
- expect15(inputs.onCreateInput).toEqual(testInput);
3204
+ expect16(inputs.initialInput).toEqual(testInput);
3205
+ expect16(inputs.onCreateInput).toEqual(testInput);
3007
3206
  const existingActor = client.inputActor.getOrCreate(uniqueKey);
3008
3207
  const existingInputs = await existingActor.getInputs();
3009
- expect15(existingInputs.initialInput).toEqual(testInput);
3010
- expect15(existingInputs.onCreateInput).toEqual(testInput);
3208
+ expect16(existingInputs.initialInput).toEqual(testInput);
3209
+ expect16(existingInputs.onCreateInput).toEqual(testInput);
3011
3210
  });
3012
3211
  });
3013
- describe16("Key Matching", () => {
3014
- test15("matches actors only with exactly the same keys", async (c) => {
3212
+ describe17("Key Matching", () => {
3213
+ test16("matches actors only with exactly the same keys", async (c) => {
3015
3214
  const { client } = await setupDriverTest(c, driverTestConfig);
3016
3215
  const originalCounter = client.counter.getOrCreate([
3017
3216
  "counter-match",
@@ -3025,20 +3224,20 @@ function runManagerDriverTests(driverTestConfig) {
3025
3224
  "us-east"
3026
3225
  ]);
3027
3226
  const exactMatchCount = await exactMatchCounter.increment(0);
3028
- expect15(exactMatchCount).toBe(10);
3227
+ expect16(exactMatchCount).toBe(10);
3029
3228
  const subsetMatchCounter = client.counter.getOrCreate([
3030
3229
  "counter-match",
3031
3230
  "test"
3032
3231
  ]);
3033
3232
  const subsetMatchCount = await subsetMatchCounter.increment(0);
3034
- expect15(subsetMatchCount).toBe(0);
3233
+ expect16(subsetMatchCount).toBe(0);
3035
3234
  const singleKeyCounter = client.counter.getOrCreate([
3036
3235
  "counter-match"
3037
3236
  ]);
3038
3237
  const singleKeyCount = await singleKeyCounter.increment(0);
3039
- expect15(singleKeyCount).toBe(0);
3238
+ expect16(singleKeyCount).toBe(0);
3040
3239
  });
3041
- test15("string key matches array with single string key", async (c) => {
3240
+ test16("string key matches array with single string key", async (c) => {
3042
3241
  const { client } = await setupDriverTest(c, driverTestConfig);
3043
3242
  const stringKeyCounter = client.counter.getOrCreate("string-key-test");
3044
3243
  await stringKeyCounter.increment(7);
@@ -3046,20 +3245,20 @@ function runManagerDriverTests(driverTestConfig) {
3046
3245
  "string-key-test"
3047
3246
  ]);
3048
3247
  const count = await arrayKeyCounter.increment(0);
3049
- expect15(count).toBe(7);
3248
+ expect16(count).toBe(7);
3050
3249
  });
3051
- test15("undefined key matches empty array key and no key", async (c) => {
3250
+ test16("undefined key matches empty array key and no key", async (c) => {
3052
3251
  const { client } = await setupDriverTest(c, driverTestConfig);
3053
3252
  const undefinedKeyCounter = client.counter.getOrCreate(void 0);
3054
3253
  await undefinedKeyCounter.increment(12);
3055
3254
  const emptyArrayKeyCounter = client.counter.getOrCreate([]);
3056
3255
  const emptyArrayCount = await emptyArrayKeyCounter.increment(0);
3057
- expect15(emptyArrayCount).toBe(12);
3256
+ expect16(emptyArrayCount).toBe(12);
3058
3257
  const noKeyCounter = client.counter.getOrCreate();
3059
3258
  const noKeyCount = await noKeyCounter.increment(0);
3060
- expect15(noKeyCount).toBe(12);
3259
+ expect16(noKeyCount).toBe(12);
3061
3260
  });
3062
- test15("no keys does not match actors with keys", async (c) => {
3261
+ test16("no keys does not match actors with keys", async (c) => {
3063
3262
  const { client } = await setupDriverTest(c, driverTestConfig);
3064
3263
  const keyedCounter = client.counter.getOrCreate([
3065
3264
  "counter-with-keys",
@@ -3068,9 +3267,9 @@ function runManagerDriverTests(driverTestConfig) {
3068
3267
  await keyedCounter.increment(15);
3069
3268
  const noKeysCounter = client.counter.getOrCreate();
3070
3269
  const count = await noKeysCounter.increment(10);
3071
- expect15(count).toBe(10);
3270
+ expect16(count).toBe(10);
3072
3271
  });
3073
- test15("actors with keys match actors with no keys", async (c) => {
3272
+ test16("actors with keys match actors with no keys", async (c) => {
3074
3273
  const { client } = await setupDriverTest(c, driverTestConfig);
3075
3274
  const noKeysCounter = client.counter.getOrCreate();
3076
3275
  await noKeysCounter.increment(25);
@@ -3079,11 +3278,11 @@ function runManagerDriverTests(driverTestConfig) {
3079
3278
  "prod"
3080
3279
  ]);
3081
3280
  const keyedCount = await keyedCounter.increment(0);
3082
- expect15(keyedCount).toBe(0);
3281
+ expect16(keyedCount).toBe(0);
3083
3282
  });
3084
3283
  });
3085
- describe16("Multiple Actor Instances", () => {
3086
- test15("creates multiple actor instances of the same type", async (c) => {
3284
+ describe17("Multiple Actor Instances", () => {
3285
+ test16("creates multiple actor instances of the same type", async (c) => {
3087
3286
  const { client } = await setupDriverTest(c, driverTestConfig);
3088
3287
  const instance1 = client.counter.getOrCreate(["multi-1"]);
3089
3288
  const instance2 = client.counter.getOrCreate(["multi-2"]);
@@ -3094,35 +3293,35 @@ function runManagerDriverTests(driverTestConfig) {
3094
3293
  const retrieved1 = client.counter.getOrCreate(["multi-1"]);
3095
3294
  const retrieved2 = client.counter.getOrCreate(["multi-2"]);
3096
3295
  const retrieved3 = client.counter.getOrCreate(["multi-3"]);
3097
- expect15(await retrieved1.increment(0)).toBe(1);
3098
- expect15(await retrieved2.increment(0)).toBe(2);
3099
- expect15(await retrieved3.increment(0)).toBe(3);
3296
+ expect16(await retrieved1.increment(0)).toBe(1);
3297
+ expect16(await retrieved2.increment(0)).toBe(2);
3298
+ expect16(await retrieved3.increment(0)).toBe(3);
3100
3299
  });
3101
- test15("handles default instance with no explicit ID", async (c) => {
3300
+ test16("handles default instance with no explicit ID", async (c) => {
3102
3301
  const { client } = await setupDriverTest(c, driverTestConfig);
3103
3302
  const defaultCounter = client.counter.getOrCreate();
3104
3303
  await defaultCounter.increment(5);
3105
3304
  const sameDefaultCounter = client.counter.getOrCreate();
3106
3305
  const count = await sameDefaultCounter.increment(0);
3107
- expect15(count).toBe(5);
3306
+ expect16(count).toBe(5);
3108
3307
  });
3109
3308
  });
3110
3309
  });
3111
3310
  }
3112
3311
 
3113
3312
  // src/driver-test-suite/tests/raw-http.ts
3114
- import { describe as describe17, expect as expect16, test as test16 } from "vitest";
3313
+ import { describe as describe18, expect as expect17, test as test17 } from "vitest";
3115
3314
  function runRawHttpTests(driverTestConfig) {
3116
- describe17("raw http", () => {
3117
- test16("should handle raw HTTP GET requests", async (c) => {
3315
+ describe18("raw http", () => {
3316
+ test17("should handle raw HTTP GET requests", async (c) => {
3118
3317
  const { client } = await setupDriverTest(c, driverTestConfig);
3119
3318
  const actor2 = client.rawHttpActor.getOrCreate(["test"]);
3120
3319
  const helloResponse = await actor2.fetch("api/hello");
3121
- expect16(helloResponse.ok).toBe(true);
3320
+ expect17(helloResponse.ok).toBe(true);
3122
3321
  const helloData = await helloResponse.json();
3123
- expect16(helloData).toEqual({ message: "Hello from actor!" });
3322
+ expect17(helloData).toEqual({ message: "Hello from actor!" });
3124
3323
  });
3125
- test16("should handle raw HTTP POST requests with echo", async (c) => {
3324
+ test17("should handle raw HTTP POST requests with echo", async (c) => {
3126
3325
  const { client } = await setupDriverTest(c, driverTestConfig);
3127
3326
  const actor2 = client.rawHttpActor.getOrCreate(["test"]);
3128
3327
  const testData = { test: "data", number: 123 };
@@ -3133,22 +3332,22 @@ function runRawHttpTests(driverTestConfig) {
3133
3332
  },
3134
3333
  body: JSON.stringify(testData)
3135
3334
  });
3136
- expect16(echoResponse.ok).toBe(true);
3335
+ expect17(echoResponse.ok).toBe(true);
3137
3336
  const echoData = await echoResponse.json();
3138
- expect16(echoData).toEqual(testData);
3337
+ expect17(echoData).toEqual(testData);
3139
3338
  });
3140
- test16("should track state across raw HTTP requests", async (c) => {
3339
+ test17("should track state across raw HTTP requests", async (c) => {
3141
3340
  const { client } = await setupDriverTest(c, driverTestConfig);
3142
3341
  const actor2 = client.rawHttpActor.getOrCreate(["state-test"]);
3143
3342
  await actor2.fetch("api/hello");
3144
3343
  await actor2.fetch("api/hello");
3145
3344
  await actor2.fetch("api/state");
3146
3345
  const stateResponse = await actor2.fetch("api/state");
3147
- expect16(stateResponse.ok).toBe(true);
3346
+ expect17(stateResponse.ok).toBe(true);
3148
3347
  const stateData = await stateResponse.json();
3149
- expect16(stateData.requestCount).toBe(4);
3348
+ expect17(stateData.requestCount).toBe(4);
3150
3349
  });
3151
- test16("should pass headers correctly", async (c) => {
3350
+ test17("should pass headers correctly", async (c) => {
3152
3351
  const { client } = await setupDriverTest(c, driverTestConfig);
3153
3352
  const actor2 = client.rawHttpActor.getOrCreate(["headers-test"]);
3154
3353
  const customHeaders = {
@@ -3158,44 +3357,44 @@ function runRawHttpTests(driverTestConfig) {
3158
3357
  const response = await actor2.fetch("api/headers", {
3159
3358
  headers: customHeaders
3160
3359
  });
3161
- expect16(response.ok).toBe(true);
3360
+ expect17(response.ok).toBe(true);
3162
3361
  const headers = await response.json();
3163
- expect16(headers["x-custom-header"]).toBe("test-value");
3164
- expect16(headers["x-another-header"]).toBe("another-value");
3362
+ expect17(headers["x-custom-header"]).toBe("test-value");
3363
+ expect17(headers["x-another-header"]).toBe("another-value");
3165
3364
  });
3166
- test16("should return 404 for unhandled paths", async (c) => {
3365
+ test17("should return 404 for unhandled paths", async (c) => {
3167
3366
  const { client } = await setupDriverTest(c, driverTestConfig);
3168
3367
  const actor2 = client.rawHttpActor.getOrCreate(["404-test"]);
3169
3368
  const response = await actor2.fetch("api/nonexistent");
3170
- expect16(response.ok).toBe(false);
3171
- expect16(response.status).toBe(404);
3369
+ expect17(response.ok).toBe(false);
3370
+ expect17(response.status).toBe(404);
3172
3371
  });
3173
- test16("should return 404 when no onFetch handler defined", async (c) => {
3372
+ test17("should return 404 when no onRequest handler defined", async (c) => {
3174
3373
  const { client } = await setupDriverTest(c, driverTestConfig);
3175
3374
  const actor2 = client.rawHttpNoHandlerActor.getOrCreate([
3176
3375
  "no-handler"
3177
3376
  ]);
3178
3377
  const response = await actor2.fetch("api/anything");
3179
- expect16(response.ok).toBe(false);
3180
- expect16(response.status).toBe(404);
3378
+ expect17(response.ok).toBe(false);
3379
+ expect17(response.status).toBe(404);
3181
3380
  });
3182
- test16("should return 500 error when onFetch returns void", async (c) => {
3381
+ test17("should return 500 error when onRequest returns void", async (c) => {
3183
3382
  const { client } = await setupDriverTest(c, driverTestConfig);
3184
3383
  const actor2 = client.rawHttpVoidReturnActor.getOrCreate([
3185
3384
  "void-return"
3186
3385
  ]);
3187
3386
  const response = await actor2.fetch("api/anything");
3188
- expect16(response.ok).toBe(false);
3189
- expect16(response.status).toBe(500);
3387
+ expect17(response.ok).toBe(false);
3388
+ expect17(response.status).toBe(500);
3190
3389
  try {
3191
3390
  const errorData = await response.json();
3192
- expect16(errorData.message).toContain(
3193
- "onFetch handler must return a Response"
3391
+ expect17(errorData.message).toContain(
3392
+ "onRequest handler must return a Response"
3194
3393
  );
3195
3394
  } catch {
3196
3395
  }
3197
3396
  });
3198
- test16("should handle different HTTP methods", async (c) => {
3397
+ test17("should handle different HTTP methods", async (c) => {
3199
3398
  const { client } = await setupDriverTest(c, driverTestConfig);
3200
3399
  const actor2 = client.rawHttpActor.getOrCreate(["methods-test"]);
3201
3400
  const methods = ["GET", "POST", "PUT", "DELETE", "PATCH"];
@@ -3205,17 +3404,17 @@ function runRawHttpTests(driverTestConfig) {
3205
3404
  body: ["POST", "PUT", "PATCH"].includes(method) ? JSON.stringify({ method }) : void 0
3206
3405
  });
3207
3406
  if (method === "POST") {
3208
- expect16(response.ok).toBe(true);
3407
+ expect17(response.ok).toBe(true);
3209
3408
  const data = await response.json();
3210
- expect16(data).toEqual({ method });
3409
+ expect17(data).toEqual({ method });
3211
3410
  } else if (method === "GET") {
3212
- expect16(response.status).toBe(404);
3411
+ expect17(response.status).toBe(404);
3213
3412
  } else {
3214
- expect16(response.status).toBe(404);
3413
+ expect17(response.status).toBe(404);
3215
3414
  }
3216
3415
  }
3217
3416
  });
3218
- test16("should handle binary data", async (c) => {
3417
+ test17("should handle binary data", async (c) => {
3219
3418
  const { client } = await setupDriverTest(c, driverTestConfig);
3220
3419
  const actor2 = client.rawHttpActor.getOrCreate(["binary-test"]);
3221
3420
  const binaryData = new Uint8Array([1, 2, 3, 4, 5]);
@@ -3226,82 +3425,82 @@ function runRawHttpTests(driverTestConfig) {
3226
3425
  },
3227
3426
  body: binaryData
3228
3427
  });
3229
- expect16(response.ok).toBe(true);
3428
+ expect17(response.ok).toBe(true);
3230
3429
  const responseBuffer = await response.arrayBuffer();
3231
3430
  const responseArray = new Uint8Array(responseBuffer);
3232
- expect16(Array.from(responseArray)).toEqual([1, 2, 3, 4, 5]);
3431
+ expect17(Array.from(responseArray)).toEqual([1, 2, 3, 4, 5]);
3233
3432
  });
3234
- test16("should work with Hono router using createVars", async (c) => {
3433
+ test17("should work with Hono router using createVars", async (c) => {
3235
3434
  const { client } = await setupDriverTest(c, driverTestConfig);
3236
3435
  const actor2 = client.rawHttpHonoActor.getOrCreate(["hono-test"]);
3237
3436
  const rootResponse = await actor2.fetch("/");
3238
- expect16(rootResponse.ok).toBe(true);
3437
+ expect17(rootResponse.ok).toBe(true);
3239
3438
  const rootData = await rootResponse.json();
3240
- expect16(rootData).toEqual({ message: "Welcome to Hono actor!" });
3439
+ expect17(rootData).toEqual({ message: "Welcome to Hono actor!" });
3241
3440
  const usersResponse = await actor2.fetch("/users");
3242
- expect16(usersResponse.ok).toBe(true);
3441
+ expect17(usersResponse.ok).toBe(true);
3243
3442
  const users = await usersResponse.json();
3244
- expect16(users).toEqual([
3443
+ expect17(users).toEqual([
3245
3444
  { id: 1, name: "Alice" },
3246
3445
  { id: 2, name: "Bob" }
3247
3446
  ]);
3248
3447
  const userResponse = await actor2.fetch("/users/1");
3249
- expect16(userResponse.ok).toBe(true);
3448
+ expect17(userResponse.ok).toBe(true);
3250
3449
  const user = await userResponse.json();
3251
- expect16(user).toEqual({ id: 1, name: "Alice" });
3450
+ expect17(user).toEqual({ id: 1, name: "Alice" });
3252
3451
  const newUser = { name: "Charlie" };
3253
3452
  const createResponse = await actor2.fetch("/users", {
3254
3453
  method: "POST",
3255
3454
  headers: { "Content-Type": "application/json" },
3256
3455
  body: JSON.stringify(newUser)
3257
3456
  });
3258
- expect16(createResponse.ok).toBe(true);
3259
- expect16(createResponse.status).toBe(201);
3457
+ expect17(createResponse.ok).toBe(true);
3458
+ expect17(createResponse.status).toBe(201);
3260
3459
  const createdUser = await createResponse.json();
3261
- expect16(createdUser).toEqual({ id: 3, name: "Charlie" });
3460
+ expect17(createdUser).toEqual({ id: 3, name: "Charlie" });
3262
3461
  const updateData = { name: "Alice Updated" };
3263
3462
  const updateResponse = await actor2.fetch("/users/1", {
3264
3463
  method: "PUT",
3265
3464
  headers: { "Content-Type": "application/json" },
3266
3465
  body: JSON.stringify(updateData)
3267
3466
  });
3268
- expect16(updateResponse.ok).toBe(true);
3467
+ expect17(updateResponse.ok).toBe(true);
3269
3468
  const updatedUser = await updateResponse.json();
3270
- expect16(updatedUser).toEqual({ id: 1, name: "Alice Updated" });
3469
+ expect17(updatedUser).toEqual({ id: 1, name: "Alice Updated" });
3271
3470
  const deleteResponse = await actor2.fetch("/users/2", {
3272
3471
  method: "DELETE"
3273
3472
  });
3274
- expect16(deleteResponse.ok).toBe(true);
3473
+ expect17(deleteResponse.ok).toBe(true);
3275
3474
  const deleteResult = await deleteResponse.json();
3276
- expect16(deleteResult).toEqual({ message: "User 2 deleted" });
3475
+ expect17(deleteResult).toEqual({ message: "User 2 deleted" });
3277
3476
  const notFoundResponse = await actor2.fetch("/api/unknown");
3278
- expect16(notFoundResponse.ok).toBe(false);
3279
- expect16(notFoundResponse.status).toBe(404);
3477
+ expect17(notFoundResponse.ok).toBe(false);
3478
+ expect17(notFoundResponse.status).toBe(404);
3280
3479
  });
3281
- test16("should handle paths with and without leading slashes", async (c) => {
3480
+ test17("should handle paths with and without leading slashes", async (c) => {
3282
3481
  const { client } = await setupDriverTest(c, driverTestConfig);
3283
3482
  const actor2 = client.rawHttpActor.getOrCreate(["path-test"]);
3284
3483
  const responseWithoutSlash = await actor2.fetch("api/hello");
3285
- expect16(responseWithoutSlash.ok).toBe(true);
3484
+ expect17(responseWithoutSlash.ok).toBe(true);
3286
3485
  const dataWithoutSlash = await responseWithoutSlash.json();
3287
- expect16(dataWithoutSlash).toEqual({ message: "Hello from actor!" });
3486
+ expect17(dataWithoutSlash).toEqual({ message: "Hello from actor!" });
3288
3487
  const responseWithSlash = await actor2.fetch("/api/hello");
3289
- expect16(responseWithSlash.ok).toBe(true);
3488
+ expect17(responseWithSlash.ok).toBe(true);
3290
3489
  const dataWithSlash = await responseWithSlash.json();
3291
- expect16(dataWithSlash).toEqual({ message: "Hello from actor!" });
3490
+ expect17(dataWithSlash).toEqual({ message: "Hello from actor!" });
3292
3491
  });
3293
- test16("should not create double slashes in request URLs", async (c) => {
3492
+ test17("should not create double slashes in request URLs", async (c) => {
3294
3493
  const { client } = await setupDriverTest(c, driverTestConfig);
3295
3494
  const actor2 = client.rawHttpHonoActor.getOrCreate(["url-test"]);
3296
3495
  const response = await actor2.fetch("/users");
3297
- expect16(response.ok).toBe(true);
3496
+ expect17(response.ok).toBe(true);
3298
3497
  const data = await response.json();
3299
- expect16(data).toEqual([
3498
+ expect17(data).toEqual([
3300
3499
  { id: 1, name: "Alice" },
3301
3500
  { id: 2, name: "Bob" }
3302
3501
  ]);
3303
3502
  });
3304
- test16("should handle forwarded requests correctly without double slashes", async (c) => {
3503
+ test17("should handle forwarded requests correctly without double slashes", async (c) => {
3305
3504
  const { client } = await setupDriverTest(c, driverTestConfig);
3306
3505
  const actor2 = client.rawHttpHonoActor.getOrCreate(["forward-test"]);
3307
3506
  const truncatedPath = "/users";
@@ -3313,14 +3512,14 @@ function runRawHttpTests(driverTestConfig) {
3313
3512
  truncatedPath,
3314
3513
  newRequest
3315
3514
  );
3316
- expect16(response.ok).toBe(true);
3515
+ expect17(response.ok).toBe(true);
3317
3516
  const users = await response.json();
3318
- expect16(users).toEqual([
3517
+ expect17(users).toEqual([
3319
3518
  { id: 1, name: "Alice" },
3320
3519
  { id: 2, name: "Bob" }
3321
3520
  ]);
3322
3521
  });
3323
- test16("example fix: should properly forward requests using just Request object", async (c) => {
3522
+ test17("example fix: should properly forward requests using just Request object", async (c) => {
3324
3523
  const { client } = await setupDriverTest(c, driverTestConfig);
3325
3524
  const actor2 = client.rawHttpHonoActor.getOrCreate(["forward-fix"]);
3326
3525
  const truncatedPath = "/users/1";
@@ -3329,11 +3528,11 @@ function runRawHttpTests(driverTestConfig) {
3329
3528
  method: "GET"
3330
3529
  });
3331
3530
  const response = await actor2.fetch(newRequest);
3332
- expect16(response.ok).toBe(true);
3531
+ expect17(response.ok).toBe(true);
3333
3532
  const user = await response.json();
3334
- expect16(user).toEqual({ id: 1, name: "Alice" });
3533
+ expect17(user).toEqual({ id: 1, name: "Alice" });
3335
3534
  });
3336
- test16("should support standard fetch API with URL and Request objects", async (c) => {
3535
+ test17("should support standard fetch API with URL and Request objects", async (c) => {
3337
3536
  const { client } = await setupDriverTest(c, driverTestConfig);
3338
3537
  const actor2 = client.rawHttpActor.getOrCreate(["fetch-api-test"]);
3339
3538
  const url = new URL("/api/echo", "http://example.com");
@@ -3342,18 +3541,18 @@ function runRawHttpTests(driverTestConfig) {
3342
3541
  headers: { "Content-Type": "application/json" },
3343
3542
  body: JSON.stringify({ from: "URL object" })
3344
3543
  });
3345
- expect16(urlResponse.ok).toBe(true);
3544
+ expect17(urlResponse.ok).toBe(true);
3346
3545
  const urlData = await urlResponse.json();
3347
- expect16(urlData).toEqual({ from: "URL object" });
3546
+ expect17(urlData).toEqual({ from: "URL object" });
3348
3547
  const request = new Request("http://example.com/api/echo", {
3349
3548
  method: "POST",
3350
3549
  headers: { "Content-Type": "application/json" },
3351
3550
  body: JSON.stringify({ from: "Request object" })
3352
3551
  });
3353
3552
  const requestResponse = await actor2.fetch(request);
3354
- expect16(requestResponse.ok).toBe(true);
3553
+ expect17(requestResponse.ok).toBe(true);
3355
3554
  const requestData = await requestResponse.json();
3356
- expect16(requestData).toEqual({ from: "Request object" });
3555
+ expect17(requestData).toEqual({ from: "Request object" });
3357
3556
  const request2 = new Request("http://example.com/api/headers", {
3358
3557
  method: "GET",
3359
3558
  headers: { "X-Original": "request-header" }
@@ -3361,19 +3560,19 @@ function runRawHttpTests(driverTestConfig) {
3361
3560
  const overrideResponse = await actor2.fetch(request2, {
3362
3561
  headers: { "X-Override": "init-header" }
3363
3562
  });
3364
- expect16(overrideResponse.ok).toBe(true);
3563
+ expect17(overrideResponse.ok).toBe(true);
3365
3564
  const headers = await overrideResponse.json();
3366
- expect16(headers["x-override"]).toBe("init-header");
3367
- expect16(headers["x-original"]).toBe("request-header");
3565
+ expect17(headers["x-override"]).toBe("init-header");
3566
+ expect17(headers["x-original"]).toBe("request-header");
3368
3567
  });
3369
3568
  });
3370
3569
  }
3371
3570
 
3372
3571
  // src/driver-test-suite/tests/raw-http-request-properties.ts
3373
- import { describe as describe18, expect as expect17, test as test17 } from "vitest";
3572
+ import { describe as describe19, expect as expect18, test as test18 } from "vitest";
3374
3573
  function runRawHttpRequestPropertiesTests(driverTestConfig) {
3375
- describe18("raw http request properties", () => {
3376
- test17("should pass all Request properties correctly to onFetch", async (c) => {
3574
+ describe19("raw http request properties", () => {
3575
+ test18("should pass all Request properties correctly to onRequest", async (c) => {
3377
3576
  const { client } = await setupDriverTest(c, driverTestConfig);
3378
3577
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3379
3578
  "test"
@@ -3387,22 +3586,22 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3387
3586
  },
3388
3587
  body: JSON.stringify({ test: "data" })
3389
3588
  });
3390
- expect17(response.ok).toBe(true);
3589
+ expect18(response.ok).toBe(true);
3391
3590
  const data = await response.json();
3392
- expect17(data.url).toContain("/test/path?foo=bar&baz=qux");
3393
- expect17(data.pathname).toBe("/test/path");
3394
- expect17(data.search).toBe("?foo=bar&baz=qux");
3395
- expect17(data.searchParams).toEqual({
3591
+ expect18(data.url).toContain("/test/path?foo=bar&baz=qux");
3592
+ expect18(data.pathname).toBe("/test/path");
3593
+ expect18(data.search).toBe("?foo=bar&baz=qux");
3594
+ expect18(data.searchParams).toEqual({
3396
3595
  foo: "bar",
3397
3596
  baz: "qux"
3398
3597
  });
3399
- expect17(data.method).toBe("POST");
3400
- expect17(data.headers["content-type"]).toBe("application/json");
3401
- expect17(data.headers["x-custom-header"]).toBe("custom-value");
3402
- expect17(data.headers["authorization"]).toBe("Bearer test-token");
3403
- expect17(data.body).toEqual({ test: "data" });
3598
+ expect18(data.method).toBe("POST");
3599
+ expect18(data.headers["content-type"]).toBe("application/json");
3600
+ expect18(data.headers["x-custom-header"]).toBe("custom-value");
3601
+ expect18(data.headers["authorization"]).toBe("Bearer test-token");
3602
+ expect18(data.body).toEqual({ test: "data" });
3404
3603
  });
3405
- test17("should handle GET requests with no body", async (c) => {
3604
+ test18("should handle GET requests with no body", async (c) => {
3406
3605
  const { client } = await setupDriverTest(c, driverTestConfig);
3407
3606
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3408
3607
  "test"
@@ -3410,12 +3609,12 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3410
3609
  const response = await actor2.fetch("test/get", {
3411
3610
  method: "GET"
3412
3611
  });
3413
- expect17(response.ok).toBe(true);
3612
+ expect18(response.ok).toBe(true);
3414
3613
  const data = await response.json();
3415
- expect17(data.method).toBe("GET");
3416
- expect17(data.body).toBeNull();
3614
+ expect18(data.method).toBe("GET");
3615
+ expect18(data.body).toBeNull();
3417
3616
  });
3418
- test17("should handle different content types", async (c) => {
3617
+ test18("should handle different content types", async (c) => {
3419
3618
  const { client } = await setupDriverTest(c, driverTestConfig);
3420
3619
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3421
3620
  "test"
@@ -3430,12 +3629,12 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3430
3629
  },
3431
3630
  body: formData.toString()
3432
3631
  });
3433
- expect17(formResponse.ok).toBe(true);
3632
+ expect18(formResponse.ok).toBe(true);
3434
3633
  const formResult = await formResponse.json();
3435
- expect17(formResult.headers["content-type"]).toBe(
3634
+ expect18(formResult.headers["content-type"]).toBe(
3436
3635
  "application/x-www-form-urlencoded"
3437
3636
  );
3438
- expect17(formResult.bodyText).toBe("field1=value1&field2=value2");
3637
+ expect18(formResult.bodyText).toBe("field1=value1&field2=value2");
3439
3638
  const textResponse = await actor2.fetch("test/text", {
3440
3639
  method: "POST",
3441
3640
  headers: {
@@ -3443,12 +3642,12 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3443
3642
  },
3444
3643
  body: "Hello, World!"
3445
3644
  });
3446
- expect17(textResponse.ok).toBe(true);
3645
+ expect18(textResponse.ok).toBe(true);
3447
3646
  const textResult = await textResponse.json();
3448
- expect17(textResult.headers["content-type"]).toBe("text/plain");
3449
- expect17(textResult.bodyText).toBe("Hello, World!");
3647
+ expect18(textResult.headers["content-type"]).toBe("text/plain");
3648
+ expect18(textResult.bodyText).toBe("Hello, World!");
3450
3649
  });
3451
- test17("should preserve all header casing and values", async (c) => {
3650
+ test18("should preserve all header casing and values", async (c) => {
3452
3651
  const { client } = await setupDriverTest(c, driverTestConfig);
3453
3652
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3454
3653
  "test"
@@ -3462,38 +3661,38 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3462
3661
  "X-Request-ID": "12345"
3463
3662
  }
3464
3663
  });
3465
- expect17(response.ok).toBe(true);
3664
+ expect18(response.ok).toBe(true);
3466
3665
  const data = await response.json();
3467
- expect17(data.headers["accept"]).toBe("application/json");
3468
- expect17(data.headers["accept-language"]).toBe("en-US,en;q=0.9");
3469
- expect17(data.headers["cache-control"]).toBe("no-cache");
3470
- expect17(data.headers["user-agent"]).toBeTruthy();
3471
- expect17(data.headers["x-request-id"]).toBe("12345");
3666
+ expect18(data.headers["accept"]).toBe("application/json");
3667
+ expect18(data.headers["accept-language"]).toBe("en-US,en;q=0.9");
3668
+ expect18(data.headers["cache-control"]).toBe("no-cache");
3669
+ expect18(data.headers["user-agent"]).toBeTruthy();
3670
+ expect18(data.headers["x-request-id"]).toBe("12345");
3472
3671
  });
3473
- test17("should handle empty and special URL paths", async (c) => {
3672
+ test18("should handle empty and special URL paths", async (c) => {
3474
3673
  const { client } = await setupDriverTest(c, driverTestConfig);
3475
3674
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3476
3675
  "test"
3477
3676
  ]);
3478
3677
  const rootResponse = await actor2.fetch("");
3479
- expect17(rootResponse.ok).toBe(true);
3678
+ expect18(rootResponse.ok).toBe(true);
3480
3679
  const rootData = await rootResponse.json();
3481
- expect17(rootData.pathname).toBe("/");
3680
+ expect18(rootData.pathname).toBe("/");
3482
3681
  const specialResponse = await actor2.fetch(
3483
3682
  "test/path%20with%20spaces/and%2Fslashes"
3484
3683
  );
3485
- expect17(specialResponse.ok).toBe(true);
3684
+ expect18(specialResponse.ok).toBe(true);
3486
3685
  const specialData = await specialResponse.json();
3487
- expect17(specialData.pathname).toMatch(
3686
+ expect18(specialData.pathname).toMatch(
3488
3687
  /path.*with.*spaces.*and.*slashes/
3489
3688
  );
3490
3689
  const fragmentResponse = await actor2.fetch("test/path#fragment");
3491
- expect17(fragmentResponse.ok).toBe(true);
3690
+ expect18(fragmentResponse.ok).toBe(true);
3492
3691
  const fragmentData = await fragmentResponse.json();
3493
- expect17(fragmentData.pathname).toBe("/test/path");
3494
- expect17(fragmentData.hash).toBe("");
3692
+ expect18(fragmentData.pathname).toBe("/test/path");
3693
+ expect18(fragmentData.hash).toBe("");
3495
3694
  });
3496
- test17("should handle request properties for all HTTP methods", async (c) => {
3695
+ test18("should handle request properties for all HTTP methods", async (c) => {
3497
3696
  const { client } = await setupDriverTest(c, driverTestConfig);
3498
3697
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3499
3698
  "test"
@@ -3517,21 +3716,21 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3517
3716
  }
3518
3717
  );
3519
3718
  if (method === "HEAD") {
3520
- expect17(response.status).toBe(200);
3719
+ expect18(response.status).toBe(200);
3521
3720
  const text = await response.text();
3522
- expect17(text).toBe("");
3721
+ expect18(text).toBe("");
3523
3722
  } else if (method === "OPTIONS") {
3524
- expect17(response.status).toBe(204);
3723
+ expect18(response.status).toBe(204);
3525
3724
  const text = await response.text();
3526
- expect17(text).toBe("");
3725
+ expect18(text).toBe("");
3527
3726
  } else {
3528
- expect17(response.ok).toBe(true);
3727
+ expect18(response.ok).toBe(true);
3529
3728
  const data = await response.json();
3530
- expect17(data.method).toBe(method);
3729
+ expect18(data.method).toBe(method);
3531
3730
  }
3532
3731
  }
3533
3732
  });
3534
- test17("should handle complex query parameters", async (c) => {
3733
+ test18("should handle complex query parameters", async (c) => {
3535
3734
  const { client } = await setupDriverTest(c, driverTestConfig);
3536
3735
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3537
3736
  "test"
@@ -3539,13 +3738,13 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3539
3738
  const response = await actor2.fetch(
3540
3739
  "test?key=value1&key=value2&array[]=1&array[]=2&nested[prop]=val"
3541
3740
  );
3542
- expect17(response.ok).toBe(true);
3741
+ expect18(response.ok).toBe(true);
3543
3742
  const data = await response.json();
3544
- expect17(data.searchParams.key).toBe("value2");
3545
- expect17(data.searchParams["array[]"]).toBe("2");
3546
- expect17(data.searchParams["nested[prop]"]).toBe("val");
3743
+ expect18(data.searchParams.key).toBe("value2");
3744
+ expect18(data.searchParams["array[]"]).toBe("2");
3745
+ expect18(data.searchParams["nested[prop]"]).toBe("val");
3547
3746
  });
3548
- test17("should handle multipart form data", async (c) => {
3747
+ test18("should handle multipart form data", async (c) => {
3549
3748
  const { client } = await setupDriverTest(c, driverTestConfig);
3550
3749
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3551
3750
  "test"
@@ -3569,27 +3768,27 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3569
3768
  },
3570
3769
  body
3571
3770
  });
3572
- expect17(response.ok).toBe(true);
3771
+ expect18(response.ok).toBe(true);
3573
3772
  const data = await response.json();
3574
- expect17(data.headers["content-type"]).toContain(
3773
+ expect18(data.headers["content-type"]).toContain(
3575
3774
  "multipart/form-data"
3576
3775
  );
3577
- expect17(data.bodyText).toContain("field1");
3578
- expect17(data.bodyText).toContain("value1");
3776
+ expect18(data.bodyText).toContain("field1");
3777
+ expect18(data.bodyText).toContain("value1");
3579
3778
  });
3580
- test17("should handle very long URLs", async (c) => {
3779
+ test18("should handle very long URLs", async (c) => {
3581
3780
  const { client } = await setupDriverTest(c, driverTestConfig);
3582
3781
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3583
3782
  "test"
3584
3783
  ]);
3585
3784
  const longValue = "x".repeat(1e3);
3586
3785
  const response = await actor2.fetch(`test/long?param=${longValue}`);
3587
- expect17(response.ok).toBe(true);
3786
+ expect18(response.ok).toBe(true);
3588
3787
  const data = await response.json();
3589
- expect17(data.searchParams.param).toBe(longValue);
3590
- expect17(data.search.length).toBeGreaterThan(1e3);
3788
+ expect18(data.searchParams.param).toBe(longValue);
3789
+ expect18(data.search.length).toBeGreaterThan(1e3);
3591
3790
  });
3592
- test17("should handle large request bodies", async (c) => {
3791
+ test18.skip("should handle large request bodies", async (c) => {
3593
3792
  const { client } = await setupDriverTest(c, driverTestConfig);
3594
3793
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3595
3794
  "test"
@@ -3606,11 +3805,11 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3606
3805
  },
3607
3806
  body: JSON.stringify(largeArray)
3608
3807
  });
3609
- expect17(response.ok).toBe(true);
3808
+ expect18(response.ok).toBe(true);
3610
3809
  const data = await response.json();
3611
- expect17(data.body).toHaveLength(1e4);
3810
+ expect18(data.body).toHaveLength(1e4);
3612
3811
  });
3613
- test17("should handle missing content-type header", async (c) => {
3812
+ test18("should handle missing content-type header", async (c) => {
3614
3813
  const { client } = await setupDriverTest(c, driverTestConfig);
3615
3814
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3616
3815
  "test"
@@ -3619,11 +3818,11 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3619
3818
  method: "POST",
3620
3819
  body: "plain text without content-type"
3621
3820
  });
3622
- expect17(response.ok).toBe(true);
3821
+ expect18(response.ok).toBe(true);
3623
3822
  const data = await response.json();
3624
- expect17(data.bodyText).toBe("plain text without content-type");
3823
+ expect18(data.bodyText).toBe("plain text without content-type");
3625
3824
  });
3626
- test17("should handle empty request body", async (c) => {
3825
+ test18("should handle empty request body", async (c) => {
3627
3826
  const { client } = await setupDriverTest(c, driverTestConfig);
3628
3827
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3629
3828
  "test"
@@ -3635,12 +3834,9 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3635
3834
  },
3636
3835
  body: ""
3637
3836
  });
3638
- expect17(response.ok).toBe(true);
3639
- const data = await response.json();
3640
- expect17(data.body).toBeNull();
3641
- expect17(data.bodyText).toBe("");
3837
+ expect18(response.ok).toBe(true);
3642
3838
  });
3643
- test17("should handle custom HTTP methods", async (c) => {
3839
+ test18("should handle custom HTTP methods", async (c) => {
3644
3840
  const { client } = await setupDriverTest(c, driverTestConfig);
3645
3841
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3646
3842
  "test"
@@ -3651,12 +3847,12 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3651
3847
  });
3652
3848
  if (response.ok) {
3653
3849
  const data = await response.json();
3654
- expect17(data.method).toBe("CUSTOM");
3850
+ expect18(data.method).toBe("CUSTOM");
3655
3851
  }
3656
3852
  } catch (error) {
3657
3853
  }
3658
3854
  });
3659
- test17("should handle cookies in headers", async (c) => {
3855
+ test18("should handle cookies in headers", async (c) => {
3660
3856
  const { client } = await setupDriverTest(c, driverTestConfig);
3661
3857
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3662
3858
  "test"
@@ -3666,13 +3862,13 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3666
3862
  Cookie: "session=abc123; user=test; preferences=dark_mode"
3667
3863
  }
3668
3864
  });
3669
- expect17(response.ok).toBe(true);
3865
+ expect18(response.ok).toBe(true);
3670
3866
  const data = await response.json();
3671
- expect17(data.headers.cookie).toBe(
3867
+ expect18(data.headers.cookie).toBe(
3672
3868
  "session=abc123; user=test; preferences=dark_mode"
3673
3869
  );
3674
3870
  });
3675
- test17("should handle URL encoding properly", async (c) => {
3871
+ test18("should handle URL encoding properly", async (c) => {
3676
3872
  const { client } = await setupDriverTest(c, driverTestConfig);
3677
3873
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3678
3874
  "test"
@@ -3680,13 +3876,13 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3680
3876
  const response = await actor2.fetch(
3681
3877
  "test/encoded?special=%20%21%40%23%24%25%5E%26&unicode=%E2%9C%93&email=test%40example.com"
3682
3878
  );
3683
- expect17(response.ok).toBe(true);
3879
+ expect18(response.ok).toBe(true);
3684
3880
  const data = await response.json();
3685
- expect17(data.searchParams.special).toBe(" !@#$%^&");
3686
- expect17(data.searchParams.unicode).toBe("\u2713");
3687
- expect17(data.searchParams.email).toBe("test@example.com");
3881
+ expect18(data.searchParams.special).toBe(" !@#$%^&");
3882
+ expect18(data.searchParams.unicode).toBe("\u2713");
3883
+ expect18(data.searchParams.email).toBe("test@example.com");
3688
3884
  });
3689
- test17("should handle concurrent requests maintaining separate contexts", async (c) => {
3885
+ test18("should handle concurrent requests maintaining separate contexts", async (c) => {
3690
3886
  const { client } = await setupDriverTest(c, driverTestConfig);
3691
3887
  const actor2 = client.rawHttpRequestPropertiesActor.getOrCreate([
3692
3888
  "test"
@@ -3710,24 +3906,24 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
3710
3906
  const results = await Promise.all(
3711
3907
  responses.map((r) => r.json())
3712
3908
  );
3713
- expect17(results[0].searchParams.id).toBe("1");
3714
- expect17(results[0].method).toBe("POST");
3715
- expect17(results[0].body).toEqual({ request: 1 });
3716
- expect17(results[1].searchParams.id).toBe("2");
3717
- expect17(results[1].method).toBe("PUT");
3718
- expect17(results[1].body).toEqual({ request: 2 });
3719
- expect17(results[2].searchParams.id).toBe("3");
3720
- expect17(results[2].method).toBe("DELETE");
3721
- expect17(results[2].body).toBeNull();
3909
+ expect18(results[0].searchParams.id).toBe("1");
3910
+ expect18(results[0].method).toBe("POST");
3911
+ expect18(results[0].body).toEqual({ request: 1 });
3912
+ expect18(results[1].searchParams.id).toBe("2");
3913
+ expect18(results[1].method).toBe("PUT");
3914
+ expect18(results[1].body).toEqual({ request: 2 });
3915
+ expect18(results[2].searchParams.id).toBe("3");
3916
+ expect18(results[2].method).toBe("DELETE");
3917
+ expect18(results[2].body).toBeNull();
3722
3918
  });
3723
3919
  });
3724
3920
  }
3725
3921
 
3726
3922
  // src/driver-test-suite/tests/raw-websocket.ts
3727
- import { describe as describe19, expect as expect18, test as test18 } from "vitest";
3923
+ import { describe as describe20, expect as expect19, test as test19 } from "vitest";
3728
3924
  function runRawWebSocketTests(driverTestConfig) {
3729
- describe19("raw websocket", () => {
3730
- test18("should establish raw WebSocket connection", async (c) => {
3925
+ describe20("raw websocket", () => {
3926
+ test19("should establish raw WebSocket connection", async (c) => {
3731
3927
  const { client } = await setupDriverTest(c, driverTestConfig);
3732
3928
  const actor2 = client.rawWebSocketActor.getOrCreate(["basic"]);
3733
3929
  const ws = await actor2.websocket();
@@ -3754,11 +3950,11 @@ function runRawWebSocketTests(driverTestConfig) {
3754
3950
  );
3755
3951
  ws.addEventListener("close", reject);
3756
3952
  });
3757
- expect18(welcomeMessage.type).toBe("welcome");
3758
- expect18(welcomeMessage.connectionCount).toBe(1);
3953
+ expect19(welcomeMessage.type).toBe("welcome");
3954
+ expect19(welcomeMessage.connectionCount).toBe(1);
3759
3955
  ws.close();
3760
3956
  });
3761
- test18("should echo messages", async (c) => {
3957
+ test19("should echo messages", async (c) => {
3762
3958
  const { client } = await setupDriverTest(c, driverTestConfig);
3763
3959
  const actor2 = client.rawWebSocketActor.getOrCreate(["echo"]);
3764
3960
  const ws = await actor2.websocket();
@@ -3786,10 +3982,10 @@ function runRawWebSocketTests(driverTestConfig) {
3786
3982
  );
3787
3983
  ws.addEventListener("close", reject);
3788
3984
  });
3789
- expect18(echoMessage).toEqual(testMessage);
3985
+ expect19(echoMessage).toEqual(testMessage);
3790
3986
  ws.close();
3791
3987
  });
3792
- test18("should handle ping/pong protocol", async (c) => {
3988
+ test19("should handle ping/pong protocol", async (c) => {
3793
3989
  const { client } = await setupDriverTest(c, driverTestConfig);
3794
3990
  const actor2 = client.rawWebSocketActor.getOrCreate(["ping"]);
3795
3991
  const ws = await actor2.websocket();
@@ -3815,11 +4011,11 @@ function runRawWebSocketTests(driverTestConfig) {
3815
4011
  });
3816
4012
  ws.addEventListener("close", reject);
3817
4013
  });
3818
- expect18(pongMessage.type).toBe("pong");
3819
- expect18(pongMessage.timestamp).toBeDefined();
4014
+ expect19(pongMessage.type).toBe("pong");
4015
+ expect19(pongMessage.timestamp).toBeDefined();
3820
4016
  ws.close();
3821
4017
  });
3822
- test18("should track stats across connections", async (c) => {
4018
+ test19("should track stats across connections", async (c) => {
3823
4019
  const { client } = await setupDriverTest(c, driverTestConfig);
3824
4020
  const actor1 = client.rawWebSocketActor.getOrCreate(["stats"]);
3825
4021
  const ws1 = await actor1.websocket();
@@ -3863,15 +4059,15 @@ function runRawWebSocketTests(driverTestConfig) {
3863
4059
  });
3864
4060
  ws1.send(JSON.stringify({ type: "getStats" }));
3865
4061
  const stats = await statsPromise;
3866
- expect18(stats.connectionCount).toBe(2);
3867
- expect18(stats.messageCount).toBe(4);
4062
+ expect19(stats.connectionCount).toBe(2);
4063
+ expect19(stats.messageCount).toBe(4);
3868
4064
  const actionStats = await actor1.getStats();
3869
- expect18(actionStats.connectionCount).toBe(2);
3870
- expect18(actionStats.messageCount).toBe(4);
4065
+ expect19(actionStats.connectionCount).toBe(2);
4066
+ expect19(actionStats.messageCount).toBe(4);
3871
4067
  ws1.close();
3872
4068
  ws2.close();
3873
4069
  });
3874
- test18("should handle binary data", async (c) => {
4070
+ test19("should handle binary data", async (c) => {
3875
4071
  const { client } = await setupDriverTest(c, driverTestConfig);
3876
4072
  const actor2 = client.rawWebSocketBinaryActor.getOrCreate([
3877
4073
  "binary"
@@ -3904,7 +4100,7 @@ function runRawWebSocketTests(driverTestConfig) {
3904
4100
  const smallData = new Uint8Array([1, 2, 3, 4, 5]);
3905
4101
  ws.send(smallData);
3906
4102
  const smallReversed = await receiveBinaryMessage();
3907
- expect18(Array.from(smallReversed)).toEqual([5, 4, 3, 2, 1]);
4103
+ expect19(Array.from(smallReversed)).toEqual([5, 4, 3, 2, 1]);
3908
4104
  const largeData = new Uint8Array(1024);
3909
4105
  for (let i = 0; i < largeData.length; i++) {
3910
4106
  largeData[i] = i % 256;
@@ -3912,13 +4108,13 @@ function runRawWebSocketTests(driverTestConfig) {
3912
4108
  ws.send(largeData);
3913
4109
  const largeReversed = await receiveBinaryMessage();
3914
4110
  for (let i = 0; i < largeData.length; i++) {
3915
- expect18(largeReversed[i]).toBe(
4111
+ expect19(largeReversed[i]).toBe(
3916
4112
  largeData[largeData.length - 1 - i]
3917
4113
  );
3918
4114
  }
3919
4115
  ws.close();
3920
4116
  });
3921
- test18("should work with custom paths", async (c) => {
4117
+ test19("should work with custom paths", async (c) => {
3922
4118
  const { client } = await setupDriverTest(c, driverTestConfig);
3923
4119
  const actor2 = client.rawWebSocketActor.getOrCreate(["paths"]);
3924
4120
  const ws = await actor2.websocket("custom/path");
@@ -3938,10 +4134,10 @@ function runRawWebSocketTests(driverTestConfig) {
3938
4134
  { once: true }
3939
4135
  );
3940
4136
  });
3941
- expect18(welcomeMessage.type).toBe("welcome");
4137
+ expect19(welcomeMessage.type).toBe("welcome");
3942
4138
  ws.close();
3943
4139
  });
3944
- test18("should handle connection close properly", async (c) => {
4140
+ test19("should handle connection close properly", async (c) => {
3945
4141
  const { client } = await setupDriverTest(c, driverTestConfig);
3946
4142
  const actor2 = client.rawWebSocketActor.getOrCreate(["close-test"]);
3947
4143
  const ws = await actor2.websocket();
@@ -3954,7 +4150,7 @@ function runRawWebSocketTests(driverTestConfig) {
3954
4150
  });
3955
4151
  }
3956
4152
  const initialStats = await actor2.getStats();
3957
- expect18(initialStats.connectionCount).toBe(1);
4153
+ expect19(initialStats.connectionCount).toBe(1);
3958
4154
  const closePromise = new Promise((resolve) => {
3959
4155
  ws.addEventListener("close", () => resolve(), { once: true });
3960
4156
  });
@@ -3968,9 +4164,9 @@ function runRawWebSocketTests(driverTestConfig) {
3968
4164
  }
3969
4165
  await new Promise((resolve) => setTimeout(resolve, 50));
3970
4166
  }
3971
- expect18(finalStats == null ? void 0 : finalStats.connectionCount).toBe(0);
4167
+ expect19(finalStats == null ? void 0 : finalStats.connectionCount).toBe(0);
3972
4168
  });
3973
- test18("should properly handle onWebSocket open and close events", async (c) => {
4169
+ test19("should properly handle onWebSocket open and close events", async (c) => {
3974
4170
  const { client } = await setupDriverTest(c, driverTestConfig);
3975
4171
  const actor2 = client.rawWebSocketActor.getOrCreate([
3976
4172
  "open-close-test"
@@ -3990,8 +4186,8 @@ function runRawWebSocketTests(driverTestConfig) {
3990
4186
  );
3991
4187
  ws1.addEventListener("close", reject);
3992
4188
  });
3993
- expect18(welcome1.type).toBe("welcome");
3994
- expect18(welcome1.connectionCount).toBe(1);
4189
+ expect19(welcome1.type).toBe("welcome");
4190
+ expect19(welcome1.connectionCount).toBe(1);
3995
4191
  const ws2 = await actor2.websocket();
3996
4192
  await new Promise((resolve, reject) => {
3997
4193
  ws2.addEventListener("open", () => resolve(), { once: true });
@@ -4007,10 +4203,10 @@ function runRawWebSocketTests(driverTestConfig) {
4007
4203
  );
4008
4204
  ws2.addEventListener("close", reject);
4009
4205
  });
4010
- expect18(welcome2.type).toBe("welcome");
4011
- expect18(welcome2.connectionCount).toBe(2);
4206
+ expect19(welcome2.type).toBe("welcome");
4207
+ expect19(welcome2.connectionCount).toBe(2);
4012
4208
  const midStats = await actor2.getStats();
4013
- expect18(midStats.connectionCount).toBe(2);
4209
+ expect19(midStats.connectionCount).toBe(2);
4014
4210
  ws1.close();
4015
4211
  await new Promise((resolve) => {
4016
4212
  ws1.addEventListener("close", () => resolve(), { once: true });
@@ -4023,7 +4219,7 @@ function runRawWebSocketTests(driverTestConfig) {
4023
4219
  }
4024
4220
  await new Promise((resolve) => setTimeout(resolve, 50));
4025
4221
  }
4026
- expect18(afterFirstClose == null ? void 0 : afterFirstClose.connectionCount).toBe(1);
4222
+ expect19(afterFirstClose == null ? void 0 : afterFirstClose.connectionCount).toBe(1);
4027
4223
  ws2.close();
4028
4224
  await new Promise((resolve) => {
4029
4225
  ws2.addEventListener("close", () => resolve(), { once: true });
@@ -4036,9 +4232,9 @@ function runRawWebSocketTests(driverTestConfig) {
4036
4232
  }
4037
4233
  await new Promise((resolve) => setTimeout(resolve, 50));
4038
4234
  }
4039
- expect18(finalStats == null ? void 0 : finalStats.connectionCount).toBe(0);
4235
+ expect19(finalStats == null ? void 0 : finalStats.connectionCount).toBe(0);
4040
4236
  });
4041
- test18("should handle query parameters in websocket paths", async (c) => {
4237
+ test19("should handle query parameters in websocket paths", async (c) => {
4042
4238
  const { client } = await setupDriverTest(c, driverTestConfig);
4043
4239
  const actor2 = client.rawWebSocketActor.getOrCreate([
4044
4240
  "query-params"
@@ -4061,19 +4257,19 @@ function runRawWebSocketTests(driverTestConfig) {
4061
4257
  });
4062
4258
  ws.send(JSON.stringify({ type: "getRequestInfo" }));
4063
4259
  const requestInfo = await requestInfoPromise;
4064
- expect18(requestInfo.url).toContain("api/v1/stream");
4065
- expect18(requestInfo.url).toContain("token=abc123");
4066
- expect18(requestInfo.url).toContain("user=test");
4260
+ expect19(requestInfo.url).toContain("api/v1/stream");
4261
+ expect19(requestInfo.url).toContain("token=abc123");
4262
+ expect19(requestInfo.url).toContain("user=test");
4067
4263
  ws.close();
4068
4264
  });
4069
4265
  });
4070
4266
  }
4071
4267
 
4072
4268
  // src/driver-test-suite/tests/request-access.ts
4073
- import { describe as describe20, expect as expect19, test as test19 } from "vitest";
4269
+ import { describe as describe21, expect as expect20, test as test20 } from "vitest";
4074
4270
  function runRequestAccessTests(driverTestConfig) {
4075
- describe20("Request Access in Lifecycle Hooks", () => {
4076
- test19("should have access to request object in onBeforeConnect and createConnState", async (c) => {
4271
+ describe21("Request Access in Lifecycle Hooks", () => {
4272
+ test20("should have access to request object in onBeforeConnect and createConnState", async (c) => {
4077
4273
  const { client } = await setupDriverTest(c, driverTestConfig);
4078
4274
  const handle = client.requestAccessActor.getOrCreate(
4079
4275
  ["test-request"],
@@ -4084,23 +4280,23 @@ function runRequestAccessTests(driverTestConfig) {
4084
4280
  const connection = handle.connect();
4085
4281
  const requestInfo = await connection.getRequestInfo();
4086
4282
  if (driverTestConfig.clientType === "http") {
4087
- expect19(requestInfo.onBeforeConnect.hasRequest).toBe(true);
4088
- expect19(requestInfo.onBeforeConnect.requestUrl).toBeDefined();
4089
- expect19(requestInfo.onBeforeConnect.requestMethod).toBeDefined();
4090
- expect19(
4283
+ expect20(requestInfo.onBeforeConnect.hasRequest).toBe(true);
4284
+ expect20(requestInfo.onBeforeConnect.requestUrl).toBeDefined();
4285
+ expect20(requestInfo.onBeforeConnect.requestMethod).toBeDefined();
4286
+ expect20(
4091
4287
  requestInfo.onBeforeConnect.requestHeaders
4092
4288
  ).toBeDefined();
4093
- expect19(requestInfo.createConnState.hasRequest).toBe(true);
4094
- expect19(requestInfo.createConnState.requestUrl).toBeDefined();
4095
- expect19(requestInfo.createConnState.requestMethod).toBeDefined();
4096
- expect19(
4289
+ expect20(requestInfo.createConnState.hasRequest).toBe(true);
4290
+ expect20(requestInfo.createConnState.requestUrl).toBeDefined();
4291
+ expect20(requestInfo.createConnState.requestMethod).toBeDefined();
4292
+ expect20(
4097
4293
  requestInfo.createConnState.requestHeaders
4098
4294
  ).toBeDefined();
4099
4295
  } else {
4100
4296
  }
4101
4297
  await connection.dispose();
4102
4298
  });
4103
- test19("should not have request when trackRequest is false", async (c) => {
4299
+ test20("should not have request when trackRequest is false", async (c) => {
4104
4300
  const { client } = await setupDriverTest(c, driverTestConfig);
4105
4301
  const handle = client.requestAccessActor.getOrCreate(
4106
4302
  ["test-no-request"],
@@ -4110,21 +4306,21 @@ function runRequestAccessTests(driverTestConfig) {
4110
4306
  );
4111
4307
  const connection = handle.connect();
4112
4308
  const requestInfo = await connection.getRequestInfo();
4113
- expect19(requestInfo.onBeforeConnect.hasRequest).toBe(false);
4114
- expect19(requestInfo.onBeforeConnect.requestUrl).toBeNull();
4115
- expect19(requestInfo.onBeforeConnect.requestMethod).toBeNull();
4116
- expect19(
4309
+ expect20(requestInfo.onBeforeConnect.hasRequest).toBe(false);
4310
+ expect20(requestInfo.onBeforeConnect.requestUrl).toBeNull();
4311
+ expect20(requestInfo.onBeforeConnect.requestMethod).toBeNull();
4312
+ expect20(
4117
4313
  Object.keys(requestInfo.onBeforeConnect.requestHeaders)
4118
4314
  ).toHaveLength(0);
4119
- expect19(requestInfo.createConnState.hasRequest).toBe(false);
4120
- expect19(requestInfo.createConnState.requestUrl).toBeNull();
4121
- expect19(requestInfo.createConnState.requestMethod).toBeNull();
4122
- expect19(
4315
+ expect20(requestInfo.createConnState.hasRequest).toBe(false);
4316
+ expect20(requestInfo.createConnState.requestUrl).toBeNull();
4317
+ expect20(requestInfo.createConnState.requestMethod).toBeNull();
4318
+ expect20(
4123
4319
  Object.keys(requestInfo.createConnState.requestHeaders)
4124
4320
  ).toHaveLength(0);
4125
4321
  await connection.dispose();
4126
4322
  });
4127
- test19("should capture request headers and method", async (c) => {
4323
+ test20("should capture request headers and method", async (c) => {
4128
4324
  const { client } = await setupDriverTest(c, driverTestConfig);
4129
4325
  const handle = client.requestAccessActor.getOrCreate(
4130
4326
  ["test-headers"],
@@ -4135,18 +4331,18 @@ function runRequestAccessTests(driverTestConfig) {
4135
4331
  const connection = handle.connect();
4136
4332
  const requestInfo = await connection.getRequestInfo();
4137
4333
  if (driverTestConfig.clientType === "http") {
4138
- expect19(requestInfo.onBeforeConnect.hasRequest).toBe(true);
4139
- expect19(requestInfo.onBeforeConnect.requestMethod).toBeTruthy();
4140
- expect19(requestInfo.onBeforeConnect.requestUrl).toBeTruthy();
4141
- expect19(requestInfo.onBeforeConnect.requestHeaders).toBeTruthy();
4142
- expect19(typeof requestInfo.onBeforeConnect.requestHeaders).toBe(
4334
+ expect20(requestInfo.onBeforeConnect.hasRequest).toBe(true);
4335
+ expect20(requestInfo.onBeforeConnect.requestMethod).toBeTruthy();
4336
+ expect20(requestInfo.onBeforeConnect.requestUrl).toBeTruthy();
4337
+ expect20(requestInfo.onBeforeConnect.requestHeaders).toBeTruthy();
4338
+ expect20(typeof requestInfo.onBeforeConnect.requestHeaders).toBe(
4143
4339
  "object"
4144
4340
  );
4145
- expect19(requestInfo.createConnState.hasRequest).toBe(true);
4146
- expect19(requestInfo.createConnState.requestMethod).toBeTruthy();
4147
- expect19(requestInfo.createConnState.requestUrl).toBeTruthy();
4148
- expect19(requestInfo.createConnState.requestHeaders).toBeTruthy();
4149
- expect19(typeof requestInfo.createConnState.requestHeaders).toBe(
4341
+ expect20(requestInfo.createConnState.hasRequest).toBe(true);
4342
+ expect20(requestInfo.createConnState.requestMethod).toBeTruthy();
4343
+ expect20(requestInfo.createConnState.requestUrl).toBeTruthy();
4344
+ expect20(requestInfo.createConnState.requestHeaders).toBeTruthy();
4345
+ expect20(typeof requestInfo.createConnState.requestHeaders).toBe(
4150
4346
  "object"
4151
4347
  );
4152
4348
  } else {
@@ -4161,11 +4357,10 @@ function runDriverTests(driverTestConfigPartial) {
4161
4357
  var _a;
4162
4358
  const clientTypes = ((_a = driverTestConfigPartial.skip) == null ? void 0 : _a.inline) ? ["http"] : ["http", "inline"];
4163
4359
  for (const clientType of clientTypes) {
4164
- describe21(`client type (${clientType})`, () => {
4360
+ describe22(`client type (${clientType})`, () => {
4165
4361
  const encodings = ["bare", "cbor", "json"];
4166
4362
  for (const encoding of encodings) {
4167
- describe21(`encoding (${encoding})`, () => {
4168
- var _a2;
4363
+ describe22(`encoding (${encoding})`, () => {
4169
4364
  const driverTestConfig = {
4170
4365
  ...driverTestConfigPartial,
4171
4366
  clientType,
@@ -4173,31 +4368,11 @@ function runDriverTests(driverTestConfigPartial) {
4173
4368
  };
4174
4369
  runActorDriverTests(driverTestConfig);
4175
4370
  runManagerDriverTests(driverTestConfig);
4176
- const transports = ((_a2 = driverTestConfig.skip) == null ? void 0 : _a2.sse) ? ["websocket"] : ["websocket", "sse"];
4177
- for (const transport of transports) {
4178
- describe21(`transport (${transport})`, () => {
4179
- runActorConnTests({
4180
- ...driverTestConfig,
4181
- transport
4182
- });
4183
- runActorConnStateTests({
4184
- ...driverTestConfig,
4185
- transport
4186
- });
4187
- runActorReconnectTests({
4188
- ...driverTestConfig,
4189
- transport
4190
- });
4191
- runRequestAccessTests({
4192
- ...driverTestConfig,
4193
- transport
4194
- });
4195
- runActorDriverTestsWithTransport({
4196
- ...driverTestConfig,
4197
- transport
4198
- });
4199
- });
4200
- }
4371
+ runActorConnTests(driverTestConfig);
4372
+ runActorConnStateTests(driverTestConfig);
4373
+ runActorConnHibernationTests(driverTestConfig);
4374
+ runActorDestroyTests(driverTestConfig);
4375
+ runRequestAccessTests(driverTestConfig);
4201
4376
  runActorHandleTests(driverTestConfig);
4202
4377
  runActionFeaturesTests(driverTestConfig);
4203
4378
  runActorVarsTests(driverTestConfig);
@@ -4215,11 +4390,7 @@ function runDriverTests(driverTestConfigPartial) {
4215
4390
  }
4216
4391
  }
4217
4392
  async function createTestRuntime(registryPath, driverFactory) {
4218
- const {
4219
- mod: { registry }
4220
- } = await bundleRequire({
4221
- filepath: registryPath
4222
- });
4393
+ const { registry } = await import(registryPath);
4223
4394
  registry.config.test.enabled = true;
4224
4395
  const {
4225
4396
  driver,