rivetkit 2.1.3 → 2.1.4

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 (112) hide show
  1. package/dist/browser/client.d.ts +11 -0
  2. package/dist/browser/client.js +1 -1
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.js +1 -1
  5. package/dist/browser/inspector/client.js.map +1 -1
  6. package/dist/inspector.tar.gz +0 -0
  7. package/dist/tsup/{chunk-R64EFI6F.cjs → chunk-3B6PCYJB.cjs} +280 -115
  8. package/dist/tsup/chunk-3B6PCYJB.cjs.map +1 -0
  9. package/dist/tsup/{chunk-6LHZQSWJ.js → chunk-3GTO6H3E.js} +8 -4
  10. package/dist/tsup/chunk-3GTO6H3E.js.map +1 -0
  11. package/dist/tsup/{chunk-ZSJ2OTY4.cjs → chunk-4KSHPFXF.cjs} +2 -2
  12. package/dist/tsup/{chunk-ZSJ2OTY4.cjs.map → chunk-4KSHPFXF.cjs.map} +1 -1
  13. package/dist/tsup/{chunk-OAOF23ZY.js → chunk-5UEFNG7P.js} +2 -2
  14. package/dist/tsup/{chunk-MAXIXG56.js → chunk-ANKZ2FS6.js} +2 -4
  15. package/dist/tsup/chunk-ANKZ2FS6.js.map +1 -0
  16. package/dist/tsup/{chunk-DADGS67O.cjs → chunk-AQD4CBZ2.cjs} +4 -4
  17. package/dist/tsup/{chunk-DADGS67O.cjs.map → chunk-AQD4CBZ2.cjs.map} +1 -1
  18. package/dist/tsup/{chunk-YET3IZD6.js → chunk-DZXDUGLL.js} +2 -2
  19. package/dist/tsup/{chunk-YET3IZD6.js.map → chunk-DZXDUGLL.js.map} +1 -1
  20. package/dist/tsup/{chunk-5AZ6UPEF.cjs → chunk-GXRVSSVD.cjs} +24 -20
  21. package/dist/tsup/chunk-GXRVSSVD.cjs.map +1 -0
  22. package/dist/tsup/{chunk-IJAGZS57.cjs → chunk-H5TSEPN4.cjs} +30 -30
  23. package/dist/tsup/{chunk-IJAGZS57.cjs.map → chunk-H5TSEPN4.cjs.map} +1 -1
  24. package/dist/tsup/{chunk-POUBQA6Z.js → chunk-HBYEYBIC.js} +2 -2
  25. package/dist/tsup/{chunk-BMNB6YRQ.cjs → chunk-HKOSZKKZ.cjs} +212 -305
  26. package/dist/tsup/chunk-HKOSZKKZ.cjs.map +1 -0
  27. package/dist/tsup/{chunk-N7ASEZ2Y.js → chunk-I6PL6QIY.js} +5 -5
  28. package/dist/tsup/{chunk-GNGRMP5E.js → chunk-KTWY3K6Z.js} +18 -11
  29. package/dist/tsup/chunk-KTWY3K6Z.js.map +1 -0
  30. package/dist/tsup/{chunk-KSZZRTOD.cjs → chunk-LK36OGGO.cjs} +3 -5
  31. package/dist/tsup/chunk-LK36OGGO.cjs.map +1 -0
  32. package/dist/tsup/{chunk-YLDDENCZ.js → chunk-M6H4XIF4.js} +126 -219
  33. package/dist/tsup/chunk-M6H4XIF4.js.map +1 -0
  34. package/dist/tsup/{chunk-U6VWVHVW.cjs → chunk-QPADHLDU.cjs} +3 -3
  35. package/dist/tsup/{chunk-U6VWVHVW.cjs.map → chunk-QPADHLDU.cjs.map} +1 -1
  36. package/dist/tsup/{chunk-6T3WSP5M.js → chunk-TEFYRRAK.js} +4 -4
  37. package/dist/tsup/{chunk-HPAX7L72.cjs → chunk-TEUL4UYN.cjs} +152 -152
  38. package/dist/tsup/{chunk-HPAX7L72.cjs.map → chunk-TEUL4UYN.cjs.map} +1 -1
  39. package/dist/tsup/{chunk-QUDLEWGD.js → chunk-UDMRZR6A.js} +212 -47
  40. package/dist/tsup/chunk-UDMRZR6A.js.map +1 -0
  41. package/dist/tsup/{chunk-T6MM5RTW.cjs → chunk-UWAGLDT6.cjs} +250 -243
  42. package/dist/tsup/chunk-UWAGLDT6.cjs.map +1 -0
  43. package/dist/tsup/client/mod.cjs +6 -6
  44. package/dist/tsup/client/mod.d.cts +2 -2
  45. package/dist/tsup/client/mod.d.ts +2 -2
  46. package/dist/tsup/client/mod.js +5 -5
  47. package/dist/tsup/common/log.cjs +2 -2
  48. package/dist/tsup/common/log.js +1 -1
  49. package/dist/tsup/common/websocket.cjs +3 -3
  50. package/dist/tsup/common/websocket.js +2 -2
  51. package/dist/tsup/{config-P3XujgRr.d.ts → config-Qj-zLJPc.d.ts} +11 -0
  52. package/dist/tsup/{config-_gfywqqI.d.cts → config-iPj5l1bL.d.cts} +11 -0
  53. package/dist/tsup/{context-uNA4TRn3.d.ts → context-CQCMuHND.d.ts} +1 -1
  54. package/dist/tsup/{context-Bxd8Cx4H.d.cts → context-DzvH1PBK.d.cts} +1 -1
  55. package/dist/tsup/{driver-CPGHKXyh.d.ts → driver-Jo8v-kbU.d.ts} +1 -1
  56. package/dist/tsup/driver-helpers/mod.cjs +4 -4
  57. package/dist/tsup/driver-helpers/mod.d.cts +4 -4
  58. package/dist/tsup/driver-helpers/mod.d.ts +4 -4
  59. package/dist/tsup/driver-helpers/mod.js +3 -3
  60. package/dist/tsup/{driver-BcLvZcKl.d.cts → driver-iV8J-WMv.d.cts} +1 -1
  61. package/dist/tsup/driver-test-suite/mod.cjs +196 -60
  62. package/dist/tsup/driver-test-suite/mod.cjs.map +1 -1
  63. package/dist/tsup/driver-test-suite/mod.d.cts +2 -2
  64. package/dist/tsup/driver-test-suite/mod.d.ts +2 -2
  65. package/dist/tsup/driver-test-suite/mod.js +971 -835
  66. package/dist/tsup/driver-test-suite/mod.js.map +1 -1
  67. package/dist/tsup/inspector/mod.cjs +3 -3
  68. package/dist/tsup/inspector/mod.js +2 -2
  69. package/dist/tsup/mod.cjs +8 -8
  70. package/dist/tsup/mod.d.cts +5 -5
  71. package/dist/tsup/mod.d.ts +5 -5
  72. package/dist/tsup/mod.js +7 -7
  73. package/dist/tsup/serve-test-suite/mod.cjs +182 -100
  74. package/dist/tsup/serve-test-suite/mod.cjs.map +1 -1
  75. package/dist/tsup/serve-test-suite/mod.js +93 -11
  76. package/dist/tsup/serve-test-suite/mod.js.map +1 -1
  77. package/dist/tsup/test/mod.cjs +10 -10
  78. package/dist/tsup/test/mod.d.cts +1 -1
  79. package/dist/tsup/test/mod.d.ts +1 -1
  80. package/dist/tsup/test/mod.js +6 -6
  81. package/dist/tsup/utils.cjs +2 -2
  82. package/dist/tsup/utils.js +1 -1
  83. package/dist/tsup/workflow/mod.cjs +5 -5
  84. package/dist/tsup/workflow/mod.d.cts +3 -3
  85. package/dist/tsup/workflow/mod.d.ts +3 -3
  86. package/dist/tsup/workflow/mod.js +4 -4
  87. package/package.json +5 -5
  88. package/src/actor/config.ts +0 -2
  89. package/src/actor/instance/mod.ts +17 -4
  90. package/src/actor/router.ts +9 -6
  91. package/src/driver-test-suite/mod.ts +3 -0
  92. package/src/driver-test-suite/tests/actor-driver.ts +4 -0
  93. package/src/driver-test-suite/tests/actor-lifecycle.ts +157 -0
  94. package/src/driver-test-suite/tests/conn-error-serialization.ts +64 -0
  95. package/src/drivers/engine/actor-driver.ts +47 -15
  96. package/src/manager/router.ts +20 -6
  97. package/src/{registry → utils}/serve.ts +38 -4
  98. package/src/workflow/context.ts +4 -0
  99. package/dist/tsup/chunk-5AZ6UPEF.cjs.map +0 -1
  100. package/dist/tsup/chunk-6LHZQSWJ.js.map +0 -1
  101. package/dist/tsup/chunk-BMNB6YRQ.cjs.map +0 -1
  102. package/dist/tsup/chunk-GNGRMP5E.js.map +0 -1
  103. package/dist/tsup/chunk-KSZZRTOD.cjs.map +0 -1
  104. package/dist/tsup/chunk-MAXIXG56.js.map +0 -1
  105. package/dist/tsup/chunk-QUDLEWGD.js.map +0 -1
  106. package/dist/tsup/chunk-R64EFI6F.cjs.map +0 -1
  107. package/dist/tsup/chunk-T6MM5RTW.cjs.map +0 -1
  108. package/dist/tsup/chunk-YLDDENCZ.js.map +0 -1
  109. /package/dist/tsup/{chunk-OAOF23ZY.js.map → chunk-5UEFNG7P.js.map} +0 -0
  110. /package/dist/tsup/{chunk-POUBQA6Z.js.map → chunk-HBYEYBIC.js.map} +0 -0
  111. /package/dist/tsup/{chunk-N7ASEZ2Y.js.map → chunk-I6PL6QIY.js.map} +0 -0
  112. /package/dist/tsup/{chunk-6T3WSP5M.js.map → chunk-TEFYRRAK.js.map} +0 -0
@@ -4,20 +4,20 @@ import {
4
4
  SLEEP_TIMEOUT,
5
5
  WORKFLOW_QUEUE_NAME,
6
6
  logger
7
- } from "../chunk-6T3WSP5M.js";
8
- import "../chunk-6LHZQSWJ.js";
9
- import "../chunk-POUBQA6Z.js";
10
- import "../chunk-YLDDENCZ.js";
11
- import "../chunk-GNGRMP5E.js";
7
+ } from "../chunk-TEFYRRAK.js";
8
+ import "../chunk-3GTO6H3E.js";
9
+ import "../chunk-HBYEYBIC.js";
10
+ import "../chunk-M6H4XIF4.js";
11
+ import "../chunk-KTWY3K6Z.js";
12
12
  import {
13
13
  ActorError,
14
14
  ClientConfigSchema,
15
15
  createClient,
16
16
  createClientWithDriver
17
- } from "../chunk-N7ASEZ2Y.js";
17
+ } from "../chunk-I6PL6QIY.js";
18
18
  import {
19
19
  importWebSocket
20
- } from "../chunk-OAOF23ZY.js";
20
+ } from "../chunk-5UEFNG7P.js";
21
21
  import "../chunk-KJSYAUOM.js";
22
22
  import "../chunk-N4KRDJ56.js";
23
23
  import {
@@ -29,14 +29,14 @@ import {
29
29
  WS_PROTOCOL_TARGET,
30
30
  WS_TEST_PROTOCOL_PATH,
31
31
  buildManagerRouter
32
- } from "../chunk-QUDLEWGD.js";
32
+ } from "../chunk-UDMRZR6A.js";
33
33
  import "../chunk-LXUQ667X.js";
34
34
  import {
35
35
  assertUnreachable
36
- } from "../chunk-MAXIXG56.js";
36
+ } from "../chunk-ANKZ2FS6.js";
37
37
  import {
38
38
  noopNext
39
- } from "../chunk-YET3IZD6.js";
39
+ } from "../chunk-DZXDUGLL.js";
40
40
  import {
41
41
  INTERNAL_ERROR_CODE,
42
42
  INTERNAL_ERROR_DESCRIPTION
@@ -47,7 +47,7 @@ import "../chunk-424PT5DM.js";
47
47
  import { serve as honoServe } from "@hono/node-server";
48
48
  import { createNodeWebSocket } from "@hono/node-ws";
49
49
  import invariant2 from "invariant";
50
- import { describe as describe29 } from "vitest";
50
+ import { describe as describe31 } from "vitest";
51
51
 
52
52
  // src/driver-test-suite/tests/action-features.ts
53
53
  import { describe, expect, test } from "vitest";
@@ -1642,11 +1642,49 @@ function runActorDbTests(driverTestConfig) {
1642
1642
  });
1643
1643
  }
1644
1644
 
1645
+ // src/driver-test-suite/tests/conn-error-serialization.ts
1646
+ import { describe as describe7, expect as expect7, test as test7 } from "vitest";
1647
+ function runConnErrorSerializationTests(driverTestConfig) {
1648
+ describe7("Connection Error Serialization Tests", () => {
1649
+ test7("error thrown in createConnState preserves group and code through WebSocket serialization", async (c) => {
1650
+ const { client } = await setupDriverTest(c, driverTestConfig);
1651
+ const actorKey = `test-error-serialization-${Date.now()}`;
1652
+ const actor = client.connErrorSerializationActor.getOrCreate(
1653
+ [actorKey],
1654
+ { params: { shouldThrow: true } }
1655
+ );
1656
+ const conn = actor.connect();
1657
+ let caughtError;
1658
+ try {
1659
+ await conn.getValue();
1660
+ } catch (err) {
1661
+ caughtError = err;
1662
+ }
1663
+ expect7(caughtError).toBeDefined();
1664
+ expect7(caughtError.group).toBe("connection");
1665
+ expect7(caughtError.code).toBe("custom_error");
1666
+ await conn.dispose();
1667
+ });
1668
+ test7("successful createConnState does not throw error", async (c) => {
1669
+ const { client } = await setupDriverTest(c, driverTestConfig);
1670
+ const actorKey = `test-no-error-${Date.now()}`;
1671
+ const actor = client.connErrorSerializationActor.getOrCreate(
1672
+ [actorKey],
1673
+ { params: { shouldThrow: false } }
1674
+ );
1675
+ const conn = actor.connect();
1676
+ const value = await conn.getValue();
1677
+ expect7(value).toBe(0);
1678
+ await conn.dispose();
1679
+ });
1680
+ });
1681
+ }
1682
+
1645
1683
  // src/driver-test-suite/tests/actor-destroy.ts
1646
- import { describe as describe7, expect as expect7, test as test7, vi as vi5 } from "vitest";
1684
+ import { describe as describe8, expect as expect8, test as test8, vi as vi5 } from "vitest";
1647
1685
  function runActorDestroyTests(driverTestConfig) {
1648
- describe7("Actor Destroy Tests", () => {
1649
- test7("actor destroy clears state (without connect)", async (c) => {
1686
+ describe8("Actor Destroy Tests", () => {
1687
+ test8("actor destroy clears state (without connect)", async (c) => {
1650
1688
  const { client } = await setupDriverTest(c, driverTestConfig);
1651
1689
  const actorKey = "test-destroy-without-connect";
1652
1690
  const observer = client.destroyObserver.getOrCreate(["observer"]);
@@ -1654,12 +1692,12 @@ function runActorDestroyTests(driverTestConfig) {
1654
1692
  const destroyActor = client.destroyActor.getOrCreate([actorKey]);
1655
1693
  await destroyActor.setValue(42);
1656
1694
  const value = await destroyActor.getValue();
1657
- expect7(value).toBe(42);
1695
+ expect8(value).toBe(42);
1658
1696
  const actorId = await destroyActor.resolve();
1659
1697
  await destroyActor.destroy();
1660
1698
  await vi5.waitFor(async () => {
1661
1699
  const wasDestroyed = await observer.wasDestroyed(actorKey);
1662
- expect7(wasDestroyed, "actor onDestroy not called").toBeTruthy();
1700
+ expect8(wasDestroyed, "actor onDestroy not called").toBeTruthy();
1663
1701
  });
1664
1702
  await vi5.waitFor(async () => {
1665
1703
  let actorRunning = false;
@@ -1667,20 +1705,20 @@ function runActorDestroyTests(driverTestConfig) {
1667
1705
  await client.destroyActor.getForId(actorId).getValue();
1668
1706
  actorRunning = true;
1669
1707
  } catch (err) {
1670
- expect7(err.group).toBe("actor");
1671
- expect7(err.code).toBe("not_found");
1708
+ expect8(err.group).toBe("actor");
1709
+ expect8(err.code).toBe("not_found");
1672
1710
  }
1673
- expect7(actorRunning, "actor still running").toBeFalsy();
1711
+ expect8(actorRunning, "actor still running").toBeFalsy();
1674
1712
  });
1675
1713
  let existsById = false;
1676
1714
  try {
1677
1715
  await client.destroyActor.getForId(actorId).getValue();
1678
1716
  existsById = true;
1679
1717
  } catch (err) {
1680
- expect7(err.group).toBe("actor");
1681
- expect7(err.code).toBe("not_found");
1718
+ expect8(err.group).toBe("actor");
1719
+ expect8(err.code).toBe("not_found");
1682
1720
  }
1683
- expect7(
1721
+ expect8(
1684
1722
  existsById,
1685
1723
  "actor should not exist after destroy"
1686
1724
  ).toBeFalsy();
@@ -1689,10 +1727,10 @@ function runActorDestroyTests(driverTestConfig) {
1689
1727
  await client.destroyActor.get(["test-destroy-without-connect"]).resolve();
1690
1728
  existsByKey = true;
1691
1729
  } catch (err) {
1692
- expect7(err.group).toBe("actor");
1693
- expect7(err.code).toBe("not_found");
1730
+ expect8(err.group).toBe("actor");
1731
+ expect8(err.code).toBe("not_found");
1694
1732
  }
1695
- expect7(
1733
+ expect8(
1696
1734
  existsByKey,
1697
1735
  "actor should not exist after destroy"
1698
1736
  ).toBeFalsy();
@@ -1700,9 +1738,9 @@ function runActorDestroyTests(driverTestConfig) {
1700
1738
  "test-destroy-without-connect"
1701
1739
  ]);
1702
1740
  const newValue = await newActor.getValue();
1703
- expect7(newValue).toBe(0);
1741
+ expect8(newValue).toBe(0);
1704
1742
  });
1705
- test7("actor destroy clears state (with connect)", async (c) => {
1743
+ test8("actor destroy clears state (with connect)", async (c) => {
1706
1744
  const { client } = await setupDriverTest(c, driverTestConfig);
1707
1745
  const actorKey = "test-destroy-with-connect";
1708
1746
  const observer = client.destroyObserver.getOrCreate(["observer"]);
@@ -1714,12 +1752,12 @@ function runActorDestroyTests(driverTestConfig) {
1714
1752
  const destroyActor = destroyActorHandle.connect();
1715
1753
  await destroyActor.setValue(99);
1716
1754
  const value = await destroyActor.getValue();
1717
- expect7(value).toBe(99);
1755
+ expect8(value).toBe(99);
1718
1756
  await destroyActor.destroy();
1719
1757
  await destroyActor.dispose();
1720
1758
  await vi5.waitFor(async () => {
1721
1759
  const wasDestroyed = await observer.wasDestroyed(actorKey);
1722
- expect7(wasDestroyed, "actor onDestroy not called").toBeTruthy();
1760
+ expect8(wasDestroyed, "actor onDestroy not called").toBeTruthy();
1723
1761
  });
1724
1762
  await vi5.waitFor(async () => {
1725
1763
  let actorRunning = false;
@@ -1727,20 +1765,20 @@ function runActorDestroyTests(driverTestConfig) {
1727
1765
  await client.destroyActor.getForId(actorId).getValue();
1728
1766
  actorRunning = true;
1729
1767
  } catch (err) {
1730
- expect7(err.group).toBe("actor");
1731
- expect7(err.code).toBe("not_found");
1768
+ expect8(err.group).toBe("actor");
1769
+ expect8(err.code).toBe("not_found");
1732
1770
  }
1733
- expect7(actorRunning, "actor still running").toBeFalsy();
1771
+ expect8(actorRunning, "actor still running").toBeFalsy();
1734
1772
  });
1735
1773
  let existsById = false;
1736
1774
  try {
1737
1775
  await client.destroyActor.getForId(actorId).getValue();
1738
1776
  existsById = true;
1739
1777
  } catch (err) {
1740
- expect7(err.group).toBe("actor");
1741
- expect7(err.code).toBe("not_found");
1778
+ expect8(err.group).toBe("actor");
1779
+ expect8(err.code).toBe("not_found");
1742
1780
  }
1743
- expect7(
1781
+ expect8(
1744
1782
  existsById,
1745
1783
  "actor should not exist after destroy"
1746
1784
  ).toBeFalsy();
@@ -1749,10 +1787,10 @@ function runActorDestroyTests(driverTestConfig) {
1749
1787
  await client.destroyActor.get(["test-destroy-with-connect"]).resolve();
1750
1788
  existsByKey = true;
1751
1789
  } catch (err) {
1752
- expect7(err.group).toBe("actor");
1753
- expect7(err.code).toBe("not_found");
1790
+ expect8(err.group).toBe("actor");
1791
+ expect8(err.code).toBe("not_found");
1754
1792
  }
1755
- expect7(
1793
+ expect8(
1756
1794
  existsByKey,
1757
1795
  "actor should not exist after destroy"
1758
1796
  ).toBeFalsy();
@@ -1760,9 +1798,9 @@ function runActorDestroyTests(driverTestConfig) {
1760
1798
  "test-destroy-with-connect"
1761
1799
  ]);
1762
1800
  const newValue = await newActor.getValue();
1763
- expect7(newValue).toBe(0);
1801
+ expect8(newValue).toBe(0);
1764
1802
  });
1765
- test7("actor destroy allows recreation via getOrCreate with resolve", async (c) => {
1803
+ test8("actor destroy allows recreation via getOrCreate with resolve", async (c) => {
1766
1804
  const { client } = await setupDriverTest(c, driverTestConfig);
1767
1805
  const actorKey = "test-destroy-getorcreate-resolve";
1768
1806
  const observer = client.destroyObserver.getOrCreate(["observer"]);
@@ -1770,12 +1808,12 @@ function runActorDestroyTests(driverTestConfig) {
1770
1808
  const destroyActor = client.destroyActor.getOrCreate([actorKey]);
1771
1809
  await destroyActor.setValue(123);
1772
1810
  const value = await destroyActor.getValue();
1773
- expect7(value).toBe(123);
1811
+ expect8(value).toBe(123);
1774
1812
  const actorId = await destroyActor.resolve();
1775
1813
  await destroyActor.destroy();
1776
1814
  await vi5.waitFor(async () => {
1777
1815
  const wasDestroyed = await observer.wasDestroyed(actorKey);
1778
- expect7(wasDestroyed, "actor onDestroy not called").toBeTruthy();
1816
+ expect8(wasDestroyed, "actor onDestroy not called").toBeTruthy();
1779
1817
  });
1780
1818
  await vi5.waitFor(async () => {
1781
1819
  let actorRunning = false;
@@ -1783,17 +1821,17 @@ function runActorDestroyTests(driverTestConfig) {
1783
1821
  await client.destroyActor.getForId(actorId).getValue();
1784
1822
  actorRunning = true;
1785
1823
  } catch (err) {
1786
- expect7(err.group).toBe("actor");
1787
- expect7(err.code).toBe("not_found");
1824
+ expect8(err.group).toBe("actor");
1825
+ expect8(err.code).toBe("not_found");
1788
1826
  }
1789
- expect7(actorRunning, "actor still running").toBeFalsy();
1827
+ expect8(actorRunning, "actor still running").toBeFalsy();
1790
1828
  });
1791
1829
  const newHandle = client.destroyActor.getOrCreate([actorKey]);
1792
1830
  const newActorId = await newHandle.resolve();
1793
1831
  const newValue = await newHandle.getValue();
1794
- expect7(newValue).toBe(0);
1832
+ expect8(newValue).toBe(0);
1795
1833
  });
1796
- test7("actor destroy allows recreation via create", async (c) => {
1834
+ test8("actor destroy allows recreation via create", async (c) => {
1797
1835
  const { client } = await setupDriverTest(c, driverTestConfig);
1798
1836
  const actorKey = "test-destroy-create";
1799
1837
  const observer = client.destroyObserver.getOrCreate(["observer"]);
@@ -1801,12 +1839,12 @@ function runActorDestroyTests(driverTestConfig) {
1801
1839
  const initialHandle = await client.destroyActor.create([actorKey]);
1802
1840
  await initialHandle.setValue(456);
1803
1841
  const value = await initialHandle.getValue();
1804
- expect7(value).toBe(456);
1842
+ expect8(value).toBe(456);
1805
1843
  const actorId = await initialHandle.resolve();
1806
1844
  await initialHandle.destroy();
1807
1845
  await vi5.waitFor(async () => {
1808
1846
  const wasDestroyed = await observer.wasDestroyed(actorKey);
1809
- expect7(wasDestroyed, "actor onDestroy not called").toBeTruthy();
1847
+ expect8(wasDestroyed, "actor onDestroy not called").toBeTruthy();
1810
1848
  });
1811
1849
  await vi5.waitFor(async () => {
1812
1850
  let actorRunning = false;
@@ -1814,31 +1852,127 @@ function runActorDestroyTests(driverTestConfig) {
1814
1852
  await client.destroyActor.getForId(actorId).getValue();
1815
1853
  actorRunning = true;
1816
1854
  } catch (err) {
1817
- expect7(err.group).toBe("actor");
1818
- expect7(err.code).toBe("not_found");
1855
+ expect8(err.group).toBe("actor");
1856
+ expect8(err.code).toBe("not_found");
1819
1857
  }
1820
- expect7(actorRunning, "actor still running").toBeFalsy();
1858
+ expect8(actorRunning, "actor still running").toBeFalsy();
1821
1859
  });
1822
1860
  const newHandle = await client.destroyActor.create([actorKey]);
1823
1861
  const newActorId = await newHandle.resolve();
1824
1862
  const newValue = await newHandle.getValue();
1825
- expect7(newValue).toBe(0);
1863
+ expect8(newValue).toBe(0);
1826
1864
  });
1827
1865
  });
1828
1866
  }
1829
1867
 
1830
1868
  // src/driver-test-suite/tests/actor-driver.ts
1831
- import { describe as describe11 } from "vitest";
1869
+ import { describe as describe13 } from "vitest";
1870
+
1871
+ // src/driver-test-suite/tests/actor-lifecycle.ts
1872
+ import { describe as describe9, expect as expect9, test as test9 } from "vitest";
1873
+ function runActorLifecycleTests(driverTestConfig) {
1874
+ describe9("Actor Lifecycle Tests", () => {
1875
+ test9("actor stop during start waits for start to complete", async (c) => {
1876
+ const { client } = await setupDriverTest(c, driverTestConfig);
1877
+ const actorKey = `test-stop-during-start-${Date.now()}`;
1878
+ const actor = client.startStopRaceActor.getOrCreate([actorKey]);
1879
+ const pingPromise = actor.ping();
1880
+ const actorId = await actor.resolve();
1881
+ await actor.destroy();
1882
+ const result = await pingPromise;
1883
+ expect9(result).toBe("pong");
1884
+ let destroyed = false;
1885
+ try {
1886
+ await client.startStopRaceActor.getForId(actorId).ping();
1887
+ } catch (err) {
1888
+ destroyed = true;
1889
+ expect9(err.group).toBe("actor");
1890
+ expect9(err.code).toBe("not_found");
1891
+ }
1892
+ expect9(destroyed).toBe(true);
1893
+ });
1894
+ test9("actor stop before actor instantiation completes cleans up handler", async (c) => {
1895
+ const { client } = await setupDriverTest(c, driverTestConfig);
1896
+ const actorKey = `test-stop-before-instantiation-${Date.now()}`;
1897
+ const actors = Array.from(
1898
+ { length: 5 },
1899
+ (_, i) => client.startStopRaceActor.getOrCreate([
1900
+ `${actorKey}-${i}`
1901
+ ])
1902
+ );
1903
+ const ids = await Promise.all(actors.map((a) => a.resolve()));
1904
+ await Promise.all(actors.map((a) => a.destroy()));
1905
+ for (const id of ids) {
1906
+ let destroyed = false;
1907
+ try {
1908
+ await client.startStopRaceActor.getForId(id).ping();
1909
+ } catch (err) {
1910
+ destroyed = true;
1911
+ expect9(err.group).toBe("actor");
1912
+ expect9(err.code).toBe("not_found");
1913
+ }
1914
+ expect9(destroyed, `actor ${id} should be destroyed`).toBe(
1915
+ true
1916
+ );
1917
+ }
1918
+ });
1919
+ test9("onBeforeActorStart completes before stop proceeds", async (c) => {
1920
+ const { client } = await setupDriverTest(c, driverTestConfig);
1921
+ const actorKey = `test-before-actor-start-${Date.now()}`;
1922
+ const actor = client.startStopRaceActor.getOrCreate([actorKey]);
1923
+ const statePromise = actor.getState();
1924
+ await actor.destroy();
1925
+ const state = await statePromise;
1926
+ expect9(state.initialized).toBe(true);
1927
+ expect9(state.startCompleted).toBe(true);
1928
+ });
1929
+ test9("multiple rapid create/destroy cycles handle race correctly", async (c) => {
1930
+ const { client } = await setupDriverTest(c, driverTestConfig);
1931
+ for (let i = 0; i < 10; i++) {
1932
+ const actorKey = `test-rapid-cycle-${Date.now()}-${i}`;
1933
+ const actor = client.startStopRaceActor.getOrCreate([
1934
+ actorKey
1935
+ ]);
1936
+ const resolvePromise = actor.resolve();
1937
+ const destroyPromise = actor.destroy();
1938
+ await Promise.all([resolvePromise, destroyPromise]);
1939
+ }
1940
+ expect9(true).toBe(true);
1941
+ });
1942
+ test9("actor stop called with no actor instance cleans up handler", async (c) => {
1943
+ const { client } = await setupDriverTest(c, driverTestConfig);
1944
+ const actorKey = `test-cleanup-no-instance-${Date.now()}`;
1945
+ const actor = client.startStopRaceActor.getOrCreate([actorKey]);
1946
+ const id = await actor.resolve();
1947
+ await actor.destroy();
1948
+ const newActor = client.startStopRaceActor.getOrCreate([
1949
+ actorKey
1950
+ ]);
1951
+ const result = await newActor.ping();
1952
+ expect9(result).toBe("pong");
1953
+ await newActor.destroy();
1954
+ });
1955
+ test9("onDestroy is called even when actor is destroyed during start", async (c) => {
1956
+ const { client } = await setupDriverTest(c, driverTestConfig);
1957
+ const actorKey = `test-ondestroy-during-start-${Date.now()}`;
1958
+ const actor = client.startStopRaceActor.getOrCreate([actorKey]);
1959
+ const statePromise = actor.getState();
1960
+ await actor.destroy();
1961
+ const state = await statePromise;
1962
+ expect9(state.destroyCalled).toBe(true);
1963
+ });
1964
+ });
1965
+ }
1832
1966
 
1833
1967
  // src/driver-test-suite/tests/actor-schedule.ts
1834
- import { describe as describe8, expect as expect8, test as test8 } from "vitest";
1968
+ import { describe as describe10, expect as expect10, test as test10 } from "vitest";
1835
1969
  function runActorScheduleTests(driverTestConfig) {
1836
1970
  var _a;
1837
- describe8.skipIf((_a = driverTestConfig.skip) == null ? void 0 : _a.schedule)(
1971
+ describe10.skipIf((_a = driverTestConfig.skip) == null ? void 0 : _a.schedule)(
1838
1972
  "Actor Schedule Tests",
1839
1973
  () => {
1840
- describe8("Scheduled Alarms", () => {
1841
- test8("executes c.schedule.at() with specific timestamp", async (c) => {
1974
+ describe10("Scheduled Alarms", () => {
1975
+ test10("executes c.schedule.at() with specific timestamp", async (c) => {
1842
1976
  const { client } = await setupDriverTest(
1843
1977
  c,
1844
1978
  driverTestConfig
@@ -1849,10 +1983,10 @@ function runActorScheduleTests(driverTestConfig) {
1849
1983
  await waitFor(driverTestConfig, 500);
1850
1984
  const lastRun = await scheduled.getLastRun();
1851
1985
  const scheduledCount = await scheduled.getScheduledCount();
1852
- expect8(lastRun).toBeGreaterThan(0);
1853
- expect8(scheduledCount).toBe(1);
1986
+ expect10(lastRun).toBeGreaterThan(0);
1987
+ expect10(scheduledCount).toBe(1);
1854
1988
  });
1855
- test8("executes c.schedule.after() with delay", async (c) => {
1989
+ test10("executes c.schedule.after() with delay", async (c) => {
1856
1990
  const { client } = await setupDriverTest(
1857
1991
  c,
1858
1992
  driverTestConfig
@@ -1862,10 +1996,10 @@ function runActorScheduleTests(driverTestConfig) {
1862
1996
  await waitFor(driverTestConfig, 500);
1863
1997
  const lastRun = await scheduled.getLastRun();
1864
1998
  const scheduledCount = await scheduled.getScheduledCount();
1865
- expect8(lastRun).toBeGreaterThan(0);
1866
- expect8(scheduledCount).toBe(1);
1999
+ expect10(lastRun).toBeGreaterThan(0);
2000
+ expect10(scheduledCount).toBe(1);
1867
2001
  });
1868
- test8("multiple scheduled tasks execute in order", async (c) => {
2002
+ test10("multiple scheduled tasks execute in order", async (c) => {
1869
2003
  const { client } = await setupDriverTest(
1870
2004
  c,
1871
2005
  driverTestConfig
@@ -1877,16 +2011,16 @@ function runActorScheduleTests(driverTestConfig) {
1877
2011
  await scheduled.scheduleTaskAfterWithId("third", 1250);
1878
2012
  await waitFor(driverTestConfig, 500);
1879
2013
  const history1 = await scheduled.getTaskHistory();
1880
- expect8(history1[0]).toBe("first");
2014
+ expect10(history1[0]).toBe("first");
1881
2015
  await waitFor(driverTestConfig, 500);
1882
2016
  const history2 = await scheduled.getTaskHistory();
1883
- expect8(history2.slice(0, 2)).toEqual([
2017
+ expect10(history2.slice(0, 2)).toEqual([
1884
2018
  "first",
1885
2019
  "second"
1886
2020
  ]);
1887
2021
  await waitFor(driverTestConfig, 500);
1888
2022
  const history3 = await scheduled.getTaskHistory();
1889
- expect8(history3).toEqual(["first", "second", "third"]);
2023
+ expect10(history3).toEqual(["first", "second", "third"]);
1890
2024
  });
1891
2025
  });
1892
2026
  }
@@ -1894,33 +2028,33 @@ function runActorScheduleTests(driverTestConfig) {
1894
2028
  }
1895
2029
 
1896
2030
  // src/driver-test-suite/tests/actor-sleep.ts
1897
- import { describe as describe9, expect as expect9, test as test9 } from "vitest";
2031
+ import { describe as describe11, expect as expect11, test as test11 } from "vitest";
1898
2032
  function runActorSleepTests(driverTestConfig) {
1899
2033
  var _a;
1900
- describe9.skipIf((_a = driverTestConfig.skip) == null ? void 0 : _a.sleep)("Actor Sleep Tests", () => {
1901
- test9("actor sleep persists state", async (c) => {
2034
+ describe11.skipIf((_a = driverTestConfig.skip) == null ? void 0 : _a.sleep)("Actor Sleep Tests", () => {
2035
+ test11("actor sleep persists state", async (c) => {
1902
2036
  const { client } = await setupDriverTest(c, driverTestConfig);
1903
2037
  const sleepActor = client.sleep.getOrCreate();
1904
2038
  {
1905
2039
  const { startCount, sleepCount } = await sleepActor.getCounts();
1906
- expect9(sleepCount).toBe(0);
1907
- expect9(startCount).toBe(1);
2040
+ expect11(sleepCount).toBe(0);
2041
+ expect11(startCount).toBe(1);
1908
2042
  }
1909
2043
  await sleepActor.triggerSleep();
1910
2044
  await waitFor(driverTestConfig, 250);
1911
2045
  {
1912
2046
  const { startCount, sleepCount } = await sleepActor.getCounts();
1913
- expect9(sleepCount).toBe(1);
1914
- expect9(startCount).toBe(2);
2047
+ expect11(sleepCount).toBe(1);
2048
+ expect11(startCount).toBe(2);
1915
2049
  }
1916
2050
  });
1917
- test9("actor sleep persists state with connect", async (c) => {
2051
+ test11("actor sleep persists state with connect", async (c) => {
1918
2052
  const { client } = await setupDriverTest(c, driverTestConfig);
1919
2053
  const sleepActor = client.sleep.getOrCreate().connect();
1920
2054
  {
1921
2055
  const { startCount, sleepCount } = await sleepActor.getCounts();
1922
- expect9(sleepCount).toBe(0);
1923
- expect9(startCount).toBe(1);
2056
+ expect11(sleepCount).toBe(0);
2057
+ expect11(startCount).toBe(1);
1924
2058
  }
1925
2059
  await sleepActor.triggerSleep();
1926
2060
  await sleepActor.dispose();
@@ -1928,108 +2062,108 @@ function runActorSleepTests(driverTestConfig) {
1928
2062
  const sleepActor2 = client.sleep.getOrCreate();
1929
2063
  {
1930
2064
  const { startCount, sleepCount } = await sleepActor2.getCounts();
1931
- expect9(sleepCount).toBe(1);
1932
- expect9(startCount).toBe(2);
2065
+ expect11(sleepCount).toBe(1);
2066
+ expect11(startCount).toBe(2);
1933
2067
  }
1934
2068
  });
1935
- test9("actor automatically sleeps after timeout", async (c) => {
2069
+ test11("actor automatically sleeps after timeout", async (c) => {
1936
2070
  const { client } = await setupDriverTest(c, driverTestConfig);
1937
2071
  const sleepActor = client.sleep.getOrCreate();
1938
2072
  {
1939
2073
  const { startCount, sleepCount } = await sleepActor.getCounts();
1940
- expect9(sleepCount).toBe(0);
1941
- expect9(startCount).toBe(1);
2074
+ expect11(sleepCount).toBe(0);
2075
+ expect11(startCount).toBe(1);
1942
2076
  }
1943
2077
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
1944
2078
  {
1945
2079
  const { startCount, sleepCount } = await sleepActor.getCounts();
1946
- expect9(sleepCount).toBe(1);
1947
- expect9(startCount).toBe(2);
2080
+ expect11(sleepCount).toBe(1);
2081
+ expect11(startCount).toBe(2);
1948
2082
  }
1949
2083
  });
1950
- test9("actor automatically sleeps after timeout with connect", async (c) => {
2084
+ test11("actor automatically sleeps after timeout with connect", async (c) => {
1951
2085
  const { client } = await setupDriverTest(c, driverTestConfig);
1952
2086
  const sleepActor = client.sleep.getOrCreate().connect();
1953
2087
  {
1954
2088
  const { startCount, sleepCount } = await sleepActor.getCounts();
1955
- expect9(sleepCount).toBe(0);
1956
- expect9(startCount).toBe(1);
2089
+ expect11(sleepCount).toBe(0);
2090
+ expect11(startCount).toBe(1);
1957
2091
  }
1958
2092
  await sleepActor.dispose();
1959
2093
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
1960
2094
  const sleepActor2 = client.sleep.getOrCreate();
1961
2095
  {
1962
2096
  const { startCount, sleepCount } = await sleepActor2.getCounts();
1963
- expect9(sleepCount).toBe(1);
1964
- expect9(startCount).toBe(2);
2097
+ expect11(sleepCount).toBe(1);
2098
+ expect11(startCount).toBe(2);
1965
2099
  }
1966
2100
  });
1967
- test9("rpc calls keep actor awake", async (c) => {
2101
+ test11("rpc calls keep actor awake", async (c) => {
1968
2102
  const { client } = await setupDriverTest(c, driverTestConfig);
1969
2103
  const sleepActor = client.sleep.getOrCreate();
1970
2104
  {
1971
2105
  const { startCount, sleepCount } = await sleepActor.getCounts();
1972
- expect9(sleepCount).toBe(0);
1973
- expect9(startCount).toBe(1);
2106
+ expect11(sleepCount).toBe(0);
2107
+ expect11(startCount).toBe(1);
1974
2108
  }
1975
2109
  await waitFor(driverTestConfig, SLEEP_TIMEOUT - 250);
1976
2110
  {
1977
2111
  const { startCount, sleepCount } = await sleepActor.getCounts();
1978
- expect9(sleepCount).toBe(0);
1979
- expect9(startCount).toBe(1);
2112
+ expect11(sleepCount).toBe(0);
2113
+ expect11(startCount).toBe(1);
1980
2114
  }
1981
2115
  await waitFor(driverTestConfig, SLEEP_TIMEOUT - 250);
1982
2116
  {
1983
2117
  const { startCount, sleepCount } = await sleepActor.getCounts();
1984
- expect9(sleepCount).toBe(0);
1985
- expect9(startCount).toBe(1);
2118
+ expect11(sleepCount).toBe(0);
2119
+ expect11(startCount).toBe(1);
1986
2120
  }
1987
2121
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
1988
2122
  {
1989
2123
  const { startCount, sleepCount } = await sleepActor.getCounts();
1990
- expect9(sleepCount).toBe(1);
1991
- expect9(startCount).toBe(2);
2124
+ expect11(sleepCount).toBe(1);
2125
+ expect11(startCount).toBe(2);
1992
2126
  }
1993
2127
  });
1994
- test9("alarms keep actor awake", async (c) => {
2128
+ test11("alarms keep actor awake", async (c) => {
1995
2129
  const { client } = await setupDriverTest(c, driverTestConfig);
1996
2130
  const sleepActor = client.sleep.getOrCreate();
1997
2131
  {
1998
2132
  const { startCount, sleepCount } = await sleepActor.getCounts();
1999
- expect9(sleepCount).toBe(0);
2000
- expect9(startCount).toBe(1);
2133
+ expect11(sleepCount).toBe(0);
2134
+ expect11(startCount).toBe(1);
2001
2135
  }
2002
2136
  await sleepActor.setAlarm(SLEEP_TIMEOUT - 250);
2003
2137
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
2004
2138
  {
2005
2139
  const { startCount, sleepCount } = await sleepActor.getCounts();
2006
- expect9(sleepCount).toBe(0);
2007
- expect9(startCount).toBe(1);
2140
+ expect11(sleepCount).toBe(0);
2141
+ expect11(startCount).toBe(1);
2008
2142
  }
2009
2143
  });
2010
- test9("alarms wake actors", async (c) => {
2144
+ test11("alarms wake actors", async (c) => {
2011
2145
  const { client } = await setupDriverTest(c, driverTestConfig);
2012
2146
  const sleepActor = client.sleep.getOrCreate();
2013
2147
  {
2014
2148
  const { startCount, sleepCount } = await sleepActor.getCounts();
2015
- expect9(sleepCount).toBe(0);
2016
- expect9(startCount).toBe(1);
2149
+ expect11(sleepCount).toBe(0);
2150
+ expect11(startCount).toBe(1);
2017
2151
  }
2018
2152
  await sleepActor.setAlarm(SLEEP_TIMEOUT + 250);
2019
2153
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 200);
2020
2154
  {
2021
2155
  const { startCount, sleepCount } = await sleepActor.getCounts();
2022
- expect9(sleepCount).toBe(1);
2023
- expect9(startCount).toBe(2);
2156
+ expect11(sleepCount).toBe(1);
2157
+ expect11(startCount).toBe(2);
2024
2158
  }
2025
2159
  });
2026
- test9("long running rpcs keep actor awake", async (c) => {
2160
+ test11("long running rpcs keep actor awake", async (c) => {
2027
2161
  const { client } = await setupDriverTest(c, driverTestConfig);
2028
2162
  const sleepActor = client.sleepWithLongRpc.getOrCreate().connect();
2029
2163
  {
2030
2164
  const { startCount, sleepCount } = await sleepActor.getCounts();
2031
- expect9(sleepCount).toBe(0);
2032
- expect9(startCount).toBe(1);
2165
+ expect11(sleepCount).toBe(0);
2166
+ expect11(startCount).toBe(1);
2033
2167
  }
2034
2168
  const waitPromise = new Promise(
2035
2169
  (resolve) => sleepActor.once("waiting", resolve)
@@ -2041,19 +2175,19 @@ function runActorSleepTests(driverTestConfig) {
2041
2175
  await longRunningPromise;
2042
2176
  {
2043
2177
  const { startCount, sleepCount } = await sleepActor.getCounts();
2044
- expect9(sleepCount).toBe(0);
2045
- expect9(startCount).toBe(1);
2178
+ expect11(sleepCount).toBe(0);
2179
+ expect11(startCount).toBe(1);
2046
2180
  }
2047
2181
  await sleepActor.dispose();
2048
2182
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
2049
2183
  const sleepActor2 = client.sleepWithLongRpc.getOrCreate();
2050
2184
  {
2051
2185
  const { startCount, sleepCount } = await sleepActor2.getCounts();
2052
- expect9(sleepCount).toBe(1);
2053
- expect9(startCount).toBe(2);
2186
+ expect11(sleepCount).toBe(1);
2187
+ expect11(startCount).toBe(2);
2054
2188
  }
2055
2189
  });
2056
- test9("active raw websockets keep actor awake", async (c) => {
2190
+ test11("active raw websockets keep actor awake", async (c) => {
2057
2191
  const { client, endpoint: baseUrl } = await setupDriverTest(
2058
2192
  c,
2059
2193
  driverTestConfig
@@ -2061,8 +2195,8 @@ function runActorSleepTests(driverTestConfig) {
2061
2195
  const sleepActor = client.sleepWithRawWebSocket.getOrCreate();
2062
2196
  {
2063
2197
  const { startCount, sleepCount } = await sleepActor.getCounts();
2064
- expect9(sleepCount).toBe(0);
2065
- expect9(startCount).toBe(1);
2198
+ expect11(sleepCount).toBe(0);
2199
+ expect11(startCount).toBe(1);
2066
2200
  }
2067
2201
  const ws = await sleepActor.webSocket();
2068
2202
  await new Promise((resolve, reject) => {
@@ -2087,17 +2221,17 @@ function runActorSleepTests(driverTestConfig) {
2087
2221
  }
2088
2222
  };
2089
2223
  });
2090
- expect9(counts.sleepCount).toBe(0);
2091
- expect9(counts.startCount).toBe(1);
2224
+ expect11(counts.sleepCount).toBe(0);
2225
+ expect11(counts.startCount).toBe(1);
2092
2226
  ws.close();
2093
2227
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
2094
2228
  {
2095
2229
  const { startCount, sleepCount } = await sleepActor.getCounts();
2096
- expect9(sleepCount).toBe(1);
2097
- expect9(startCount).toBe(2);
2230
+ expect11(sleepCount).toBe(1);
2231
+ expect11(startCount).toBe(2);
2098
2232
  }
2099
2233
  });
2100
- test9("active raw fetch requests keep actor awake", async (c) => {
2234
+ test11("active raw fetch requests keep actor awake", async (c) => {
2101
2235
  const { client, endpoint: baseUrl } = await setupDriverTest(
2102
2236
  c,
2103
2237
  driverTestConfig
@@ -2105,8 +2239,8 @@ function runActorSleepTests(driverTestConfig) {
2105
2239
  const sleepActor = client.sleepWithRawHttp.getOrCreate();
2106
2240
  {
2107
2241
  const { startCount, sleepCount } = await sleepActor.getCounts();
2108
- expect9(sleepCount).toBe(0);
2109
- expect9(startCount).toBe(1);
2242
+ expect11(sleepCount).toBe(0);
2243
+ expect11(startCount).toBe(1);
2110
2244
  }
2111
2245
  const fetchDuration = SLEEP_TIMEOUT + 250;
2112
2246
  const fetchPromise = sleepActor.fetch(
@@ -2114,67 +2248,67 @@ function runActorSleepTests(driverTestConfig) {
2114
2248
  );
2115
2249
  const response = await fetchPromise;
2116
2250
  const result = await response.json();
2117
- expect9(result.completed).toBe(true);
2251
+ expect11(result.completed).toBe(true);
2118
2252
  {
2119
2253
  const { startCount, sleepCount, requestCount } = await sleepActor.getCounts();
2120
- expect9(sleepCount).toBe(0);
2121
- expect9(startCount).toBe(1);
2122
- expect9(requestCount).toBe(1);
2254
+ expect11(sleepCount).toBe(0);
2255
+ expect11(startCount).toBe(1);
2256
+ expect11(requestCount).toBe(1);
2123
2257
  }
2124
2258
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
2125
2259
  {
2126
2260
  const { startCount, sleepCount } = await sleepActor.getCounts();
2127
- expect9(sleepCount).toBe(1);
2128
- expect9(startCount).toBe(2);
2261
+ expect11(sleepCount).toBe(1);
2262
+ expect11(startCount).toBe(2);
2129
2263
  }
2130
2264
  });
2131
- test9("noSleep option disables sleeping", async (c) => {
2265
+ test11("noSleep option disables sleeping", async (c) => {
2132
2266
  const { client } = await setupDriverTest(c, driverTestConfig);
2133
2267
  const sleepActor = client.sleepWithNoSleepOption.getOrCreate();
2134
2268
  {
2135
2269
  const { startCount, sleepCount } = await sleepActor.getCounts();
2136
- expect9(sleepCount).toBe(0);
2137
- expect9(startCount).toBe(1);
2270
+ expect11(sleepCount).toBe(0);
2271
+ expect11(startCount).toBe(1);
2138
2272
  }
2139
2273
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
2140
2274
  {
2141
2275
  const { startCount, sleepCount } = await sleepActor.getCounts();
2142
- expect9(sleepCount).toBe(0);
2143
- expect9(startCount).toBe(1);
2276
+ expect11(sleepCount).toBe(0);
2277
+ expect11(startCount).toBe(1);
2144
2278
  }
2145
2279
  await waitFor(driverTestConfig, SLEEP_TIMEOUT + 250);
2146
2280
  {
2147
2281
  const { startCount, sleepCount } = await sleepActor.getCounts();
2148
- expect9(sleepCount).toBe(0);
2149
- expect9(startCount).toBe(1);
2282
+ expect11(sleepCount).toBe(0);
2283
+ expect11(startCount).toBe(1);
2150
2284
  }
2151
2285
  });
2152
2286
  });
2153
2287
  }
2154
2288
 
2155
2289
  // src/driver-test-suite/tests/actor-state.ts
2156
- import { describe as describe10, expect as expect10, test as test10 } from "vitest";
2290
+ import { describe as describe12, expect as expect12, test as test12 } from "vitest";
2157
2291
  function runActorStateTests(driverTestConfig) {
2158
- describe10("Actor State Tests", () => {
2159
- describe10("State Persistence", () => {
2160
- test10("persists state between actor instances", async (c) => {
2292
+ describe12("Actor State Tests", () => {
2293
+ describe12("State Persistence", () => {
2294
+ test12("persists state between actor instances", async (c) => {
2161
2295
  const { client } = await setupDriverTest(c, driverTestConfig);
2162
2296
  const counterInstance = client.counter.getOrCreate();
2163
2297
  const initialCount = await counterInstance.increment(5);
2164
- expect10(initialCount).toBe(5);
2298
+ expect12(initialCount).toBe(5);
2165
2299
  const sameInstance = client.counter.getOrCreate();
2166
2300
  const persistedCount = await sameInstance.increment(3);
2167
- expect10(persistedCount).toBe(8);
2301
+ expect12(persistedCount).toBe(8);
2168
2302
  });
2169
- test10("restores state after actor disconnect/reconnect", async (c) => {
2303
+ test12("restores state after actor disconnect/reconnect", async (c) => {
2170
2304
  const { client } = await setupDriverTest(c, driverTestConfig);
2171
2305
  const counterInstance = client.counter.getOrCreate();
2172
2306
  await counterInstance.increment(5);
2173
2307
  const reconnectedInstance = client.counter.getOrCreate();
2174
2308
  const persistedCount = await reconnectedInstance.increment(0);
2175
- expect10(persistedCount).toBe(5);
2309
+ expect12(persistedCount).toBe(5);
2176
2310
  });
2177
- test10("maintains separate state for different actors", async (c) => {
2311
+ test12("maintains separate state for different actors", async (c) => {
2178
2312
  const { client } = await setupDriverTest(c, driverTestConfig);
2179
2313
  const counterA = client.counter.getOrCreate(["counter-a"]);
2180
2314
  await counterA.increment(5);
@@ -2182,8 +2316,8 @@ function runActorStateTests(driverTestConfig) {
2182
2316
  await counterB.increment(10);
2183
2317
  const countA = await counterA.increment(0);
2184
2318
  const countB = await counterB.increment(0);
2185
- expect10(countA).toBe(5);
2186
- expect10(countB).toBe(10);
2319
+ expect12(countA).toBe(5);
2320
+ expect12(countB).toBe(10);
2187
2321
  });
2188
2322
  });
2189
2323
  });
@@ -2191,90 +2325,91 @@ function runActorStateTests(driverTestConfig) {
2191
2325
 
2192
2326
  // src/driver-test-suite/tests/actor-driver.ts
2193
2327
  function runActorDriverTests(driverTestConfig) {
2194
- describe11("Actor Driver Tests", () => {
2328
+ describe13("Actor Driver Tests", () => {
2195
2329
  runActorStateTests(driverTestConfig);
2196
2330
  runActorScheduleTests(driverTestConfig);
2197
2331
  runActorSleepTests(driverTestConfig);
2332
+ runActorLifecycleTests(driverTestConfig);
2198
2333
  });
2199
2334
  }
2200
2335
 
2201
2336
  // src/driver-test-suite/tests/actor-error-handling.ts
2202
- import { describe as describe12, expect as expect11, test as test11 } from "vitest";
2337
+ import { describe as describe14, expect as expect13, test as test13 } from "vitest";
2203
2338
  function runActorErrorHandlingTests(driverTestConfig) {
2204
- describe12("Actor Error Handling Tests", () => {
2205
- describe12("UserError Handling", () => {
2206
- test11("should handle simple UserError with message", async (c) => {
2339
+ describe14("Actor Error Handling Tests", () => {
2340
+ describe14("UserError Handling", () => {
2341
+ test13("should handle simple UserError with message", async (c) => {
2207
2342
  const { client } = await setupDriverTest(c, driverTestConfig);
2208
2343
  const handle = client.errorHandlingActor.getOrCreate();
2209
2344
  try {
2210
2345
  await handle.throwSimpleError();
2211
- expect11(true).toBe(false);
2346
+ expect13(true).toBe(false);
2212
2347
  } catch (error) {
2213
- expect11(error.message).toBe("Simple error message");
2214
- expect11(error.code).toBe("user_error");
2215
- expect11(error.metadata).toBeUndefined();
2348
+ expect13(error.message).toBe("Simple error message");
2349
+ expect13(error.code).toBe("user_error");
2350
+ expect13(error.metadata).toBeUndefined();
2216
2351
  }
2217
2352
  });
2218
- test11("should handle detailed UserError with code and metadata", async (c) => {
2353
+ test13("should handle detailed UserError with code and metadata", async (c) => {
2219
2354
  const { client } = await setupDriverTest(c, driverTestConfig);
2220
2355
  const handle = client.errorHandlingActor.getOrCreate();
2221
2356
  try {
2222
2357
  await handle.throwDetailedError();
2223
- expect11(true).toBe(false);
2358
+ expect13(true).toBe(false);
2224
2359
  } catch (error) {
2225
- expect11(error.message).toBe("Detailed error message");
2226
- expect11(error.code).toBe("detailed_error");
2227
- expect11(error.metadata).toBeDefined();
2228
- expect11(error.metadata.reason).toBe("test");
2229
- expect11(error.metadata.timestamp).toBeDefined();
2360
+ expect13(error.message).toBe("Detailed error message");
2361
+ expect13(error.code).toBe("detailed_error");
2362
+ expect13(error.metadata).toBeDefined();
2363
+ expect13(error.metadata.reason).toBe("test");
2364
+ expect13(error.metadata.timestamp).toBeDefined();
2230
2365
  }
2231
2366
  });
2232
2367
  });
2233
- describe12("Internal Error Handling", () => {
2234
- test11("should convert internal errors to safe format", async (c) => {
2368
+ describe14("Internal Error Handling", () => {
2369
+ test13("should convert internal errors to safe format", async (c) => {
2235
2370
  const { client } = await setupDriverTest(c, driverTestConfig);
2236
2371
  const handle = client.errorHandlingActor.getOrCreate();
2237
2372
  try {
2238
2373
  await handle.throwInternalError();
2239
- expect11(true).toBe(false);
2374
+ expect13(true).toBe(false);
2240
2375
  } catch (error) {
2241
- expect11(error.code).toBe(INTERNAL_ERROR_CODE);
2242
- expect11(error.message).toBe(INTERNAL_ERROR_DESCRIPTION);
2376
+ expect13(error.code).toBe(INTERNAL_ERROR_CODE);
2377
+ expect13(error.message).toBe(INTERNAL_ERROR_DESCRIPTION);
2243
2378
  }
2244
2379
  });
2245
2380
  });
2246
- describe12.skip("Action Timeout", () => {
2247
- test11("should handle action timeouts with custom duration", async (c) => {
2381
+ describe14.skip("Action Timeout", () => {
2382
+ test13("should handle action timeouts with custom duration", async (c) => {
2248
2383
  const { client } = await setupDriverTest(c, driverTestConfig);
2249
2384
  const handle = client.errorHandlingActor.getOrCreate();
2250
2385
  const timeoutPromise = handle.timeoutAction();
2251
2386
  try {
2252
2387
  await timeoutPromise;
2253
- expect11(true).toBe(false);
2388
+ expect13(true).toBe(false);
2254
2389
  } catch (error) {
2255
- expect11(error.message).toMatch(/timed out/i);
2390
+ expect13(error.message).toMatch(/timed out/i);
2256
2391
  }
2257
2392
  });
2258
- test11("should successfully run actions within timeout", async (c) => {
2393
+ test13("should successfully run actions within timeout", async (c) => {
2259
2394
  const { client } = await setupDriverTest(c, driverTestConfig);
2260
2395
  const handle = client.errorHandlingActor.getOrCreate();
2261
2396
  const result = await handle.delayedAction(200);
2262
- expect11(result).toBe("Completed after 200ms");
2397
+ expect13(result).toBe("Completed after 200ms");
2263
2398
  });
2264
- test11("should respect different timeouts for different actors", async (c) => {
2399
+ test13("should respect different timeouts for different actors", async (c) => {
2265
2400
  const { client } = await setupDriverTest(c, driverTestConfig);
2266
2401
  try {
2267
2402
  await client.customTimeoutActor.getOrCreate().slowAction();
2268
- expect11(true).toBe(false);
2403
+ expect13(true).toBe(false);
2269
2404
  } catch (error) {
2270
- expect11(error.message).toMatch(/timed out/i);
2405
+ expect13(error.message).toMatch(/timed out/i);
2271
2406
  }
2272
2407
  const quickResult = await client.customTimeoutActor.getOrCreate().quickAction();
2273
- expect11(quickResult).toBe("Quick action completed");
2408
+ expect13(quickResult).toBe("Quick action completed");
2274
2409
  });
2275
2410
  });
2276
- describe12("Error Recovery", () => {
2277
- test11("should continue working after errors", async (c) => {
2411
+ describe14("Error Recovery", () => {
2412
+ test13("should continue working after errors", async (c) => {
2278
2413
  const { client } = await setupDriverTest(c, driverTestConfig);
2279
2414
  const handle = client.errorHandlingActor.getOrCreate();
2280
2415
  try {
@@ -2282,27 +2417,27 @@ function runActorErrorHandlingTests(driverTestConfig) {
2282
2417
  } catch (error) {
2283
2418
  }
2284
2419
  const result = await handle.successfulAction();
2285
- expect11(result).toBe("success");
2420
+ expect13(result).toBe("success");
2286
2421
  });
2287
2422
  });
2288
2423
  });
2289
2424
  }
2290
2425
 
2291
2426
  // src/driver-test-suite/tests/actor-handle.ts
2292
- import { describe as describe13, expect as expect12, test as test12 } from "vitest";
2427
+ import { describe as describe15, expect as expect14, test as test14 } from "vitest";
2293
2428
  function runActorHandleTests(driverTestConfig) {
2294
- describe13("Actor Handle Tests", () => {
2295
- describe13("Access Methods", () => {
2296
- test12("should use .get() to access a actor", async (c) => {
2429
+ describe15("Actor Handle Tests", () => {
2430
+ describe15("Access Methods", () => {
2431
+ test14("should use .get() to access a actor", async (c) => {
2297
2432
  const { client } = await setupDriverTest(c, driverTestConfig);
2298
2433
  await client.counter.create(["test-get-handle"]);
2299
2434
  const handle = client.counter.get(["test-get-handle"]);
2300
2435
  const count = await handle.increment(5);
2301
- expect12(count).toBe(5);
2436
+ expect14(count).toBe(5);
2302
2437
  const retrievedCount = await handle.getCount();
2303
- expect12(retrievedCount).toBe(5);
2438
+ expect14(retrievedCount).toBe(5);
2304
2439
  });
2305
- test12("should use .getForId() to access a actor by ID", async (c) => {
2440
+ test14("should use .getForId() to access a actor by ID", async (c) => {
2306
2441
  const { client } = await setupDriverTest(c, driverTestConfig);
2307
2442
  const handle = client.counter.getOrCreate([
2308
2443
  "test-get-for-id-handle"
@@ -2311,73 +2446,73 @@ function runActorHandleTests(driverTestConfig) {
2311
2446
  const actorId = await handle.resolve();
2312
2447
  const idHandle = client.counter.getForId(actorId);
2313
2448
  const count = await idHandle.getCount();
2314
- expect12(count).toBe(3);
2449
+ expect14(count).toBe(3);
2315
2450
  const newCount = await idHandle.increment(4);
2316
- expect12(newCount).toBe(7);
2451
+ expect14(newCount).toBe(7);
2317
2452
  });
2318
- test12("should use .getOrCreate() to access or create a actor", async (c) => {
2453
+ test14("should use .getOrCreate() to access or create a actor", async (c) => {
2319
2454
  const { client } = await setupDriverTest(c, driverTestConfig);
2320
2455
  const handle = client.counter.getOrCreate([
2321
2456
  "test-get-or-create-handle"
2322
2457
  ]);
2323
2458
  const count = await handle.increment(7);
2324
- expect12(count).toBe(7);
2459
+ expect14(count).toBe(7);
2325
2460
  const sameHandle = client.counter.getOrCreate([
2326
2461
  "test-get-or-create-handle"
2327
2462
  ]);
2328
2463
  const retrievedCount = await sameHandle.getCount();
2329
- expect12(retrievedCount).toBe(7);
2464
+ expect14(retrievedCount).toBe(7);
2330
2465
  });
2331
- test12("should use (await create()) to create and return a handle", async (c) => {
2466
+ test14("should use (await create()) to create and return a handle", async (c) => {
2332
2467
  const { client } = await setupDriverTest(c, driverTestConfig);
2333
2468
  const handle = await client.counter.create([
2334
2469
  "test-create-handle"
2335
2470
  ]);
2336
2471
  const count = await handle.increment(9);
2337
- expect12(count).toBe(9);
2472
+ expect14(count).toBe(9);
2338
2473
  const retrievedCount = await handle.getCount();
2339
- expect12(retrievedCount).toBe(9);
2474
+ expect14(retrievedCount).toBe(9);
2340
2475
  });
2341
- test12("errors when calling create twice with the same key", async (c) => {
2476
+ test14("errors when calling create twice with the same key", async (c) => {
2342
2477
  const { client } = await setupDriverTest(c, driverTestConfig);
2343
2478
  const key = ["duplicate-create-handle", crypto.randomUUID()];
2344
2479
  await client.counter.create(key);
2345
2480
  try {
2346
2481
  await client.counter.create(key);
2347
- expect12.fail("did not error on duplicate create");
2482
+ expect14.fail("did not error on duplicate create");
2348
2483
  } catch (err) {
2349
- expect12(err.group).toBe("actor");
2350
- expect12(err.code).toBe("duplicate_key");
2484
+ expect14(err.group).toBe("actor");
2485
+ expect14(err.code).toBe("duplicate_key");
2351
2486
  }
2352
2487
  });
2353
- test12(".get().resolve() errors for non-existent actor", async (c) => {
2488
+ test14(".get().resolve() errors for non-existent actor", async (c) => {
2354
2489
  const { client } = await setupDriverTest(c, driverTestConfig);
2355
2490
  const missingId = `nonexistent-${crypto.randomUUID()}`;
2356
2491
  try {
2357
2492
  await client.counter.get([missingId]).resolve();
2358
- expect12.fail(
2493
+ expect14.fail(
2359
2494
  "did not error for get().resolve() on missing actor"
2360
2495
  );
2361
2496
  } catch (err) {
2362
- expect12(err.group).toBe("actor");
2363
- expect12(err.code).toBe("not_found");
2497
+ expect14(err.group).toBe("actor");
2498
+ expect14(err.code).toBe("not_found");
2364
2499
  }
2365
2500
  });
2366
2501
  });
2367
- describe13("Action Functionality", () => {
2368
- test12("should call actions directly on the handle", async (c) => {
2502
+ describe15("Action Functionality", () => {
2503
+ test14("should call actions directly on the handle", async (c) => {
2369
2504
  const { client } = await setupDriverTest(c, driverTestConfig);
2370
2505
  const handle = client.counter.getOrCreate([
2371
2506
  "test-action-handle"
2372
2507
  ]);
2373
2508
  const count1 = await handle.increment(3);
2374
- expect12(count1).toBe(3);
2509
+ expect14(count1).toBe(3);
2375
2510
  const count2 = await handle.increment(5);
2376
- expect12(count2).toBe(8);
2511
+ expect14(count2).toBe(8);
2377
2512
  const retrievedCount = await handle.getCount();
2378
- expect12(retrievedCount).toBe(8);
2513
+ expect14(retrievedCount).toBe(8);
2379
2514
  });
2380
- test12("should handle independent handles to the same actor", async (c) => {
2515
+ test14("should handle independent handles to the same actor", async (c) => {
2381
2516
  const { client } = await setupDriverTest(c, driverTestConfig);
2382
2517
  const handle1 = client.counter.getOrCreate([
2383
2518
  "test-multiple-handles"
@@ -2385,82 +2520,82 @@ function runActorHandleTests(driverTestConfig) {
2385
2520
  const handle2 = client.counter.get(["test-multiple-handles"]);
2386
2521
  await handle1.increment(3);
2387
2522
  const count = await handle2.getCount();
2388
- expect12(count).toBe(3);
2523
+ expect14(count).toBe(3);
2389
2524
  const finalCount = await handle2.increment(4);
2390
- expect12(finalCount).toBe(7);
2525
+ expect14(finalCount).toBe(7);
2391
2526
  const checkCount = await handle1.getCount();
2392
- expect12(checkCount).toBe(7);
2527
+ expect14(checkCount).toBe(7);
2393
2528
  });
2394
- test12("should resolve a actor's ID", async (c) => {
2529
+ test14("should resolve a actor's ID", async (c) => {
2395
2530
  const { client } = await setupDriverTest(c, driverTestConfig);
2396
2531
  const handle = client.counter.getOrCreate(["test-resolve-id"]);
2397
2532
  await handle.increment(1);
2398
2533
  const actorId = await handle.resolve();
2399
- expect12(typeof actorId).toBe("string");
2400
- expect12(actorId).not.toBe("");
2534
+ expect14(typeof actorId).toBe("string");
2535
+ expect14(actorId).not.toBe("");
2401
2536
  const idHandle = client.counter.getForId(actorId);
2402
2537
  const count = await idHandle.getCount();
2403
- expect12(count).toBe(1);
2538
+ expect14(count).toBe(1);
2404
2539
  });
2405
2540
  });
2406
- describe13("Lifecycle Hooks", () => {
2407
- test12("should trigger lifecycle hooks on actor creation", async (c) => {
2541
+ describe15("Lifecycle Hooks", () => {
2542
+ test14("should trigger lifecycle hooks on actor creation", async (c) => {
2408
2543
  const { client } = await setupDriverTest(c, driverTestConfig);
2409
2544
  const handle = client.counterWithLifecycle.getOrCreate([
2410
2545
  "test-lifecycle-handle"
2411
2546
  ]);
2412
2547
  const initialEvents = await handle.getEvents();
2413
- expect12(initialEvents).toContain("onWake");
2548
+ expect14(initialEvents).toContain("onWake");
2414
2549
  const sameHandle = client.counterWithLifecycle.getOrCreate([
2415
2550
  "test-lifecycle-handle"
2416
2551
  ]);
2417
2552
  const events = await sameHandle.getEvents();
2418
- expect12(events).toContain("onWake");
2419
- expect12(events.filter((e) => e === "onWake").length).toBe(1);
2553
+ expect14(events).toContain("onWake");
2554
+ expect14(events.filter((e) => e === "onWake").length).toBe(1);
2420
2555
  });
2421
- test12("should trigger lifecycle hooks for each Action call", async (c) => {
2556
+ test14("should trigger lifecycle hooks for each Action call", async (c) => {
2422
2557
  const { client } = await setupDriverTest(c, driverTestConfig);
2423
2558
  const viewHandle = client.counterWithLifecycle.getOrCreate([
2424
2559
  "test-lifecycle-action"
2425
2560
  ]);
2426
2561
  const initialEvents = await viewHandle.getEvents();
2427
- expect12(initialEvents).toContain("onWake");
2428
- expect12(initialEvents).not.toContain("onBeforeConnect");
2429
- expect12(initialEvents).not.toContain("onConnect");
2430
- expect12(initialEvents).not.toContain("onDisconnect");
2562
+ expect14(initialEvents).toContain("onWake");
2563
+ expect14(initialEvents).not.toContain("onBeforeConnect");
2564
+ expect14(initialEvents).not.toContain("onConnect");
2565
+ expect14(initialEvents).not.toContain("onDisconnect");
2431
2566
  const trackingHandle = client.counterWithLifecycle.getOrCreate(
2432
2567
  ["test-lifecycle-action"],
2433
2568
  { params: { trackLifecycle: true } }
2434
2569
  );
2435
2570
  await trackingHandle.increment(5);
2436
2571
  const eventsAfterAction = await viewHandle.getEvents();
2437
- expect12(eventsAfterAction).toContain("onBeforeConnect");
2438
- expect12(eventsAfterAction).toContain("onConnect");
2439
- expect12(eventsAfterAction).toContain("onDisconnect");
2440
- expect12(
2572
+ expect14(eventsAfterAction).toContain("onBeforeConnect");
2573
+ expect14(eventsAfterAction).toContain("onConnect");
2574
+ expect14(eventsAfterAction).toContain("onDisconnect");
2575
+ expect14(
2441
2576
  eventsAfterAction.filter((e) => e === "onBeforeConnect").length
2442
2577
  ).toBe(1);
2443
- expect12(
2578
+ expect14(
2444
2579
  eventsAfterAction.filter((e) => e === "onConnect").length
2445
2580
  ).toBe(1);
2446
- expect12(
2581
+ expect14(
2447
2582
  eventsAfterAction.filter((e) => e === "onDisconnect").length
2448
2583
  ).toBe(1);
2449
2584
  await trackingHandle.increment(10);
2450
2585
  const eventsAfterSecondAction = await viewHandle.getEvents();
2451
- expect12(
2586
+ expect14(
2452
2587
  eventsAfterSecondAction.filter(
2453
2588
  (e) => e === "onBeforeConnect"
2454
2589
  ).length
2455
2590
  ).toBe(2);
2456
- expect12(
2591
+ expect14(
2457
2592
  eventsAfterSecondAction.filter((e) => e === "onConnect").length
2458
2593
  ).toBe(2);
2459
- expect12(
2594
+ expect14(
2460
2595
  eventsAfterSecondAction.filter((e) => e === "onDisconnect").length
2461
2596
  ).toBe(2);
2462
2597
  });
2463
- test12("should trigger lifecycle hooks for each Action call across multiple handles", async (c) => {
2598
+ test14("should trigger lifecycle hooks for each Action call across multiple handles", async (c) => {
2464
2599
  const { client } = await setupDriverTest(c, driverTestConfig);
2465
2600
  const viewHandle = client.counterWithLifecycle.getOrCreate([
2466
2601
  "test-lifecycle-multi-handle"
@@ -2476,12 +2611,12 @@ function runActorHandleTests(driverTestConfig) {
2476
2611
  await trackingHandle1.increment(5);
2477
2612
  await trackingHandle2.increment(10);
2478
2613
  const events = await viewHandle.getEvents();
2479
- expect12(events.filter((e) => e === "onWake").length).toBe(1);
2480
- expect12(
2614
+ expect14(events.filter((e) => e === "onWake").length).toBe(1);
2615
+ expect14(
2481
2616
  events.filter((e) => e === "onBeforeConnect").length
2482
2617
  ).toBe(2);
2483
- expect12(events.filter((e) => e === "onConnect").length).toBe(2);
2484
- expect12(events.filter((e) => e === "onDisconnect").length).toBe(
2618
+ expect14(events.filter((e) => e === "onConnect").length).toBe(2);
2619
+ expect14(events.filter((e) => e === "onDisconnect").length).toBe(
2485
2620
  2
2486
2621
  );
2487
2622
  });
@@ -2490,27 +2625,27 @@ function runActorHandleTests(driverTestConfig) {
2490
2625
  }
2491
2626
 
2492
2627
  // src/driver-test-suite/tests/actor-inline-client.ts
2493
- import { describe as describe14, expect as expect13, test as test13 } from "vitest";
2628
+ import { describe as describe16, expect as expect15, test as test15 } from "vitest";
2494
2629
  function runActorInlineClientTests(driverTestConfig) {
2495
- describe14("Actor Inline Client Tests", () => {
2496
- describe14("Stateless Client Calls", () => {
2497
- test13("should make stateless calls to other actors", async (c) => {
2630
+ describe16("Actor Inline Client Tests", () => {
2631
+ describe16("Stateless Client Calls", () => {
2632
+ test15("should make stateless calls to other actors", async (c) => {
2498
2633
  const { client } = await setupDriverTest(c, driverTestConfig);
2499
2634
  const inlineClientHandle = client.inlineClientActor.getOrCreate(
2500
2635
  ["inline-client-test"]
2501
2636
  );
2502
2637
  const result = await inlineClientHandle.callCounterIncrement(5);
2503
- expect13(result).toBe(5);
2638
+ expect15(result).toBe(5);
2504
2639
  const counterState = await inlineClientHandle.getCounterState();
2505
- expect13(counterState).toBe(5);
2640
+ expect15(counterState).toBe(5);
2506
2641
  const messages = await inlineClientHandle.getMessages();
2507
- expect13(messages).toHaveLength(2);
2508
- expect13(messages[0]).toContain(
2642
+ expect15(messages).toHaveLength(2);
2643
+ expect15(messages[0]).toContain(
2509
2644
  "Called counter.increment(5), result: 5"
2510
2645
  );
2511
- expect13(messages[1]).toContain("Got counter state: 5");
2646
+ expect15(messages[1]).toContain("Got counter state: 5");
2512
2647
  });
2513
- test13("should handle multiple stateless calls", async (c) => {
2648
+ test15("should handle multiple stateless calls", async (c) => {
2514
2649
  const { client } = await setupDriverTest(c, driverTestConfig);
2515
2650
  const inlineClientHandle = client.inlineClientActor.getOrCreate(
2516
2651
  ["inline-client-multi"]
@@ -2519,58 +2654,58 @@ function runActorInlineClientTests(driverTestConfig) {
2519
2654
  const result1 = await inlineClientHandle.callCounterIncrement(3);
2520
2655
  const result2 = await inlineClientHandle.callCounterIncrement(7);
2521
2656
  const finalState = await inlineClientHandle.getCounterState();
2522
- expect13(result1).toBe(3);
2523
- expect13(result2).toBe(10);
2524
- expect13(finalState).toBe(10);
2657
+ expect15(result1).toBe(3);
2658
+ expect15(result2).toBe(10);
2659
+ expect15(finalState).toBe(10);
2525
2660
  const messages = await inlineClientHandle.getMessages();
2526
- expect13(messages).toHaveLength(3);
2527
- expect13(messages[0]).toContain(
2661
+ expect15(messages).toHaveLength(3);
2662
+ expect15(messages[0]).toContain(
2528
2663
  "Called counter.increment(3), result: 3"
2529
2664
  );
2530
- expect13(messages[1]).toContain(
2665
+ expect15(messages[1]).toContain(
2531
2666
  "Called counter.increment(7), result: 10"
2532
2667
  );
2533
- expect13(messages[2]).toContain("Got counter state: 10");
2668
+ expect15(messages[2]).toContain("Got counter state: 10");
2534
2669
  });
2535
2670
  });
2536
- describe14("Stateful Client Calls", () => {
2537
- test13("should connect to other actors and receive events", async (c) => {
2671
+ describe16("Stateful Client Calls", () => {
2672
+ test15("should connect to other actors and receive events", async (c) => {
2538
2673
  const { client } = await setupDriverTest(c, driverTestConfig);
2539
2674
  const inlineClientHandle = client.inlineClientActor.getOrCreate(
2540
2675
  ["inline-client-stateful"]
2541
2676
  );
2542
2677
  await inlineClientHandle.clearMessages();
2543
2678
  const result = await inlineClientHandle.connectToCounterAndIncrement(4);
2544
- expect13(result.result1).toBe(4);
2545
- expect13(result.result2).toBe(12);
2546
- expect13(result.events).toEqual([4, 12]);
2679
+ expect15(result.result1).toBe(4);
2680
+ expect15(result.result2).toBe(12);
2681
+ expect15(result.events).toEqual([4, 12]);
2547
2682
  const messages = await inlineClientHandle.getMessages();
2548
- expect13(messages).toHaveLength(1);
2549
- expect13(messages[0]).toContain(
2683
+ expect15(messages).toHaveLength(1);
2684
+ expect15(messages[0]).toContain(
2550
2685
  "Connected to counter, incremented by 4 and 8"
2551
2686
  );
2552
- expect13(messages[0]).toContain("results: 4, 12");
2553
- expect13(messages[0]).toContain("events: [4,12]");
2687
+ expect15(messages[0]).toContain("results: 4, 12");
2688
+ expect15(messages[0]).toContain("events: [4,12]");
2554
2689
  });
2555
- test13("should handle stateful connection independently", async (c) => {
2690
+ test15("should handle stateful connection independently", async (c) => {
2556
2691
  const { client } = await setupDriverTest(c, driverTestConfig);
2557
2692
  const inlineClientHandle = client.inlineClientActor.getOrCreate(
2558
2693
  ["inline-client-independent"]
2559
2694
  );
2560
2695
  await inlineClientHandle.clearMessages();
2561
2696
  const result = await inlineClientHandle.connectToCounterAndIncrement(2);
2562
- expect13(result.result1).toBe(2);
2563
- expect13(result.result2).toBe(6);
2564
- expect13(result.events).toEqual([2, 6]);
2697
+ expect15(result.result1).toBe(2);
2698
+ expect15(result.result2).toBe(6);
2699
+ expect15(result.events).toEqual([2, 6]);
2565
2700
  const messages = await inlineClientHandle.getMessages();
2566
- expect13(messages).toHaveLength(1);
2567
- expect13(messages[0]).toContain(
2701
+ expect15(messages).toHaveLength(1);
2702
+ expect15(messages[0]).toContain(
2568
2703
  "Connected to counter, incremented by 2 and 4"
2569
2704
  );
2570
2705
  });
2571
2706
  });
2572
- describe14("Mixed Client Usage", () => {
2573
- test13("should handle both stateless and stateful calls", async (c) => {
2707
+ describe16("Mixed Client Usage", () => {
2708
+ test15("should handle both stateless and stateful calls", async (c) => {
2574
2709
  const { client } = await setupDriverTest(c, driverTestConfig);
2575
2710
  const inlineClientHandle = client.inlineClientActor.getOrCreate(
2576
2711
  ["inline-client-mixed"]
@@ -2578,17 +2713,17 @@ function runActorInlineClientTests(driverTestConfig) {
2578
2713
  await inlineClientHandle.clearMessages();
2579
2714
  await inlineClientHandle.callCounterIncrement(1);
2580
2715
  const statelessResult = await inlineClientHandle.getCounterState();
2581
- expect13(statelessResult).toBe(1);
2716
+ expect15(statelessResult).toBe(1);
2582
2717
  const statefulResult = await inlineClientHandle.connectToCounterAndIncrement(3);
2583
- expect13(statefulResult.result1).toBe(3);
2584
- expect13(statefulResult.result2).toBe(9);
2718
+ expect15(statefulResult.result1).toBe(3);
2719
+ expect15(statefulResult.result2).toBe(9);
2585
2720
  const messages = await inlineClientHandle.getMessages();
2586
- expect13(messages).toHaveLength(3);
2587
- expect13(messages[0]).toContain(
2721
+ expect15(messages).toHaveLength(3);
2722
+ expect15(messages[0]).toContain(
2588
2723
  "Called counter.increment(1), result: 1"
2589
2724
  );
2590
- expect13(messages[1]).toContain("Got counter state: 1");
2591
- expect13(messages[2]).toContain(
2725
+ expect15(messages[1]).toContain("Got counter state: 1");
2726
+ expect15(messages[2]).toContain(
2592
2727
  "Connected to counter, incremented by 3 and 6"
2593
2728
  );
2594
2729
  });
@@ -2597,10 +2732,10 @@ function runActorInlineClientTests(driverTestConfig) {
2597
2732
  }
2598
2733
 
2599
2734
  // src/driver-test-suite/tests/actor-inspector.ts
2600
- import { describe as describe15, expect as expect14, test as test14 } from "vitest";
2735
+ import { describe as describe17, expect as expect16, test as test16 } from "vitest";
2601
2736
  function runActorInspectorTests(driverTestConfig) {
2602
- describe15("Actor Inspector HTTP API", () => {
2603
- test14("GET /inspector/state returns actor state", async (c) => {
2737
+ describe17("Actor Inspector HTTP API", () => {
2738
+ test16("GET /inspector/state returns actor state", async (c) => {
2604
2739
  const { client } = await setupDriverTest(c, driverTestConfig);
2605
2740
  const handle = client.counter.getOrCreate(["inspector-state"]);
2606
2741
  await handle.increment(5);
@@ -2608,11 +2743,11 @@ function runActorInspectorTests(driverTestConfig) {
2608
2743
  const response = await fetch(`${gatewayUrl}/inspector/state`, {
2609
2744
  headers: { Authorization: "Bearer token" }
2610
2745
  });
2611
- expect14(response.status).toBe(200);
2746
+ expect16(response.status).toBe(200);
2612
2747
  const data = await response.json();
2613
- expect14(data).toEqual({ state: { count: 5 } });
2748
+ expect16(data).toEqual({ state: { count: 5 } });
2614
2749
  });
2615
- test14("PATCH /inspector/state updates actor state", async (c) => {
2750
+ test16("PATCH /inspector/state updates actor state", async (c) => {
2616
2751
  const { client } = await setupDriverTest(c, driverTestConfig);
2617
2752
  const handle = client.counter.getOrCreate([
2618
2753
  "inspector-set-state"
@@ -2630,13 +2765,13 @@ function runActorInspectorTests(driverTestConfig) {
2630
2765
  body: JSON.stringify({ state: { count: 42 } })
2631
2766
  }
2632
2767
  );
2633
- expect14(patchResponse.status).toBe(200);
2768
+ expect16(patchResponse.status).toBe(200);
2634
2769
  const patchData = await patchResponse.json();
2635
- expect14(patchData).toEqual({ ok: true });
2770
+ expect16(patchData).toEqual({ ok: true });
2636
2771
  const count = await handle.getCount();
2637
- expect14(count).toBe(42);
2772
+ expect16(count).toBe(42);
2638
2773
  });
2639
- test14("GET /inspector/connections returns connections list", async (c) => {
2774
+ test16("GET /inspector/connections returns connections list", async (c) => {
2640
2775
  const { client } = await setupDriverTest(c, driverTestConfig);
2641
2776
  const handle = client.counter.getOrCreate([
2642
2777
  "inspector-connections"
@@ -2649,12 +2784,12 @@ function runActorInspectorTests(driverTestConfig) {
2649
2784
  headers: { Authorization: "Bearer token" }
2650
2785
  }
2651
2786
  );
2652
- expect14(response.status).toBe(200);
2787
+ expect16(response.status).toBe(200);
2653
2788
  const data = await response.json();
2654
- expect14(data).toHaveProperty("connections");
2655
- expect14(Array.isArray(data.connections)).toBe(true);
2789
+ expect16(data).toHaveProperty("connections");
2790
+ expect16(Array.isArray(data.connections)).toBe(true);
2656
2791
  });
2657
- test14("GET /inspector/rpcs returns available actions", async (c) => {
2792
+ test16("GET /inspector/rpcs returns available actions", async (c) => {
2658
2793
  const { client } = await setupDriverTest(c, driverTestConfig);
2659
2794
  const handle = client.counter.getOrCreate(["inspector-rpcs"]);
2660
2795
  await handle.increment(0);
@@ -2662,14 +2797,14 @@ function runActorInspectorTests(driverTestConfig) {
2662
2797
  const response = await fetch(`${gatewayUrl}/inspector/rpcs`, {
2663
2798
  headers: { Authorization: "Bearer token" }
2664
2799
  });
2665
- expect14(response.status).toBe(200);
2800
+ expect16(response.status).toBe(200);
2666
2801
  const data = await response.json();
2667
- expect14(data).toHaveProperty("rpcs");
2668
- expect14(data.rpcs).toContain("increment");
2669
- expect14(data.rpcs).toContain("getCount");
2670
- expect14(data.rpcs).toContain("setCount");
2802
+ expect16(data).toHaveProperty("rpcs");
2803
+ expect16(data.rpcs).toContain("increment");
2804
+ expect16(data.rpcs).toContain("getCount");
2805
+ expect16(data.rpcs).toContain("setCount");
2671
2806
  });
2672
- test14("POST /inspector/action/:name executes an action", async (c) => {
2807
+ test16("POST /inspector/action/:name executes an action", async (c) => {
2673
2808
  const { client } = await setupDriverTest(c, driverTestConfig);
2674
2809
  const handle = client.counter.getOrCreate([
2675
2810
  "inspector-action"
@@ -2687,13 +2822,13 @@ function runActorInspectorTests(driverTestConfig) {
2687
2822
  body: JSON.stringify({ args: [5] })
2688
2823
  }
2689
2824
  );
2690
- expect14(response.status).toBe(200);
2825
+ expect16(response.status).toBe(200);
2691
2826
  const data = await response.json();
2692
- expect14(data.output).toBe(15);
2827
+ expect16(data.output).toBe(15);
2693
2828
  const count = await handle.getCount();
2694
- expect14(count).toBe(15);
2829
+ expect16(count).toBe(15);
2695
2830
  });
2696
- test14("GET /inspector/queue returns queue status", async (c) => {
2831
+ test16("GET /inspector/queue returns queue status", async (c) => {
2697
2832
  const { client } = await setupDriverTest(c, driverTestConfig);
2698
2833
  const handle = client.counter.getOrCreate(["inspector-queue"]);
2699
2834
  await handle.increment(0);
@@ -2704,18 +2839,18 @@ function runActorInspectorTests(driverTestConfig) {
2704
2839
  headers: { Authorization: "Bearer token" }
2705
2840
  }
2706
2841
  );
2707
- expect14(response.status).toBe(200);
2842
+ expect16(response.status).toBe(200);
2708
2843
  const data = await response.json();
2709
- expect14(data).toHaveProperty("size");
2710
- expect14(data).toHaveProperty("maxSize");
2711
- expect14(data).toHaveProperty("truncated");
2712
- expect14(data).toHaveProperty("messages");
2713
- expect14(typeof data.size).toBe("number");
2714
- expect14(typeof data.maxSize).toBe("number");
2715
- expect14(typeof data.truncated).toBe("boolean");
2716
- expect14(Array.isArray(data.messages)).toBe(true);
2717
- });
2718
- test14("GET /inspector/traces returns trace data", async (c) => {
2844
+ expect16(data).toHaveProperty("size");
2845
+ expect16(data).toHaveProperty("maxSize");
2846
+ expect16(data).toHaveProperty("truncated");
2847
+ expect16(data).toHaveProperty("messages");
2848
+ expect16(typeof data.size).toBe("number");
2849
+ expect16(typeof data.maxSize).toBe("number");
2850
+ expect16(typeof data.truncated).toBe("boolean");
2851
+ expect16(Array.isArray(data.messages)).toBe(true);
2852
+ });
2853
+ test16("GET /inspector/traces returns trace data", async (c) => {
2719
2854
  const { client } = await setupDriverTest(c, driverTestConfig);
2720
2855
  const handle = client.counter.getOrCreate([
2721
2856
  "inspector-traces"
@@ -2728,13 +2863,13 @@ function runActorInspectorTests(driverTestConfig) {
2728
2863
  headers: { Authorization: "Bearer token" }
2729
2864
  }
2730
2865
  );
2731
- expect14(response.status).toBe(200);
2866
+ expect16(response.status).toBe(200);
2732
2867
  const data = await response.json();
2733
- expect14(data).toHaveProperty("otlp");
2734
- expect14(data).toHaveProperty("clamped");
2735
- expect14(typeof data.clamped).toBe("boolean");
2868
+ expect16(data).toHaveProperty("otlp");
2869
+ expect16(data).toHaveProperty("clamped");
2870
+ expect16(typeof data.clamped).toBe("boolean");
2736
2871
  });
2737
- test14("GET /inspector/workflow-history returns workflow status", async (c) => {
2872
+ test16("GET /inspector/workflow-history returns workflow status", async (c) => {
2738
2873
  const { client } = await setupDriverTest(c, driverTestConfig);
2739
2874
  const handle = client.counter.getOrCreate([
2740
2875
  "inspector-workflow"
@@ -2747,14 +2882,14 @@ function runActorInspectorTests(driverTestConfig) {
2747
2882
  headers: { Authorization: "Bearer token" }
2748
2883
  }
2749
2884
  );
2750
- expect14(response.status).toBe(200);
2885
+ expect16(response.status).toBe(200);
2751
2886
  const data = await response.json();
2752
- expect14(data).toHaveProperty("history");
2753
- expect14(data).toHaveProperty("isWorkflowEnabled");
2754
- expect14(data.isWorkflowEnabled).toBe(false);
2755
- expect14(data.history).toBeNull();
2887
+ expect16(data).toHaveProperty("history");
2888
+ expect16(data).toHaveProperty("isWorkflowEnabled");
2889
+ expect16(data.isWorkflowEnabled).toBe(false);
2890
+ expect16(data.history).toBeNull();
2756
2891
  });
2757
- test14("GET /inspector/summary returns full actor snapshot", async (c) => {
2892
+ test16("GET /inspector/summary returns full actor snapshot", async (c) => {
2758
2893
  const { client } = await setupDriverTest(c, driverTestConfig);
2759
2894
  const handle = client.counter.getOrCreate([
2760
2895
  "inspector-summary"
@@ -2767,18 +2902,18 @@ function runActorInspectorTests(driverTestConfig) {
2767
2902
  headers: { Authorization: "Bearer token" }
2768
2903
  }
2769
2904
  );
2770
- expect14(response.status).toBe(200);
2905
+ expect16(response.status).toBe(200);
2771
2906
  const data = await response.json();
2772
- expect14(data.state).toEqual({ count: 7 });
2773
- expect14(Array.isArray(data.connections)).toBe(true);
2774
- expect14(data.rpcs).toContain("increment");
2775
- expect14(typeof data.queueSize).toBe("number");
2776
- expect14(data.isStateEnabled).toBe(true);
2777
- expect14(typeof data.isDatabaseEnabled).toBe("boolean");
2778
- expect14(data.isWorkflowEnabled).toBe(false);
2779
- expect14(data.workflowHistory).toBeNull();
2780
- });
2781
- test14("inspector endpoints require auth in non-dev mode", async (c) => {
2907
+ expect16(data.state).toEqual({ count: 7 });
2908
+ expect16(Array.isArray(data.connections)).toBe(true);
2909
+ expect16(data.rpcs).toContain("increment");
2910
+ expect16(typeof data.queueSize).toBe("number");
2911
+ expect16(data.isStateEnabled).toBe(true);
2912
+ expect16(typeof data.isDatabaseEnabled).toBe("boolean");
2913
+ expect16(data.isWorkflowEnabled).toBe(false);
2914
+ expect16(data.workflowHistory).toBeNull();
2915
+ });
2916
+ test16("inspector endpoints require auth in non-dev mode", async (c) => {
2782
2917
  const { client } = await setupDriverTest(c, driverTestConfig);
2783
2918
  const handle = client.counter.getOrCreate([
2784
2919
  "inspector-auth"
@@ -2788,16 +2923,16 @@ function runActorInspectorTests(driverTestConfig) {
2788
2923
  const response = await fetch(`${gatewayUrl}/inspector/state`, {
2789
2924
  headers: { Authorization: "Bearer wrong-token" }
2790
2925
  });
2791
- expect14(response.status).toBe(401);
2926
+ expect16(response.status).toBe(401);
2792
2927
  });
2793
2928
  });
2794
2929
  }
2795
2930
 
2796
2931
  // src/driver-test-suite/tests/actor-kv.ts
2797
- import { describe as describe16, expect as expect15, test as test15 } from "vitest";
2932
+ import { describe as describe18, expect as expect17, test as test17 } from "vitest";
2798
2933
  function runActorKvTests(driverTestConfig) {
2799
- describe16("Actor KV Tests", () => {
2800
- test15("supports text encoding and decoding", async (c) => {
2934
+ describe18("Actor KV Tests", () => {
2935
+ test17("supports text encoding and decoding", async (c) => {
2801
2936
  const { client: rawClient } = await setupDriverTest(
2802
2937
  c,
2803
2938
  driverTestConfig
@@ -2806,17 +2941,17 @@ function runActorKvTests(driverTestConfig) {
2806
2941
  const kvHandle = client.kvActor.getOrCreate(["kv-text"]);
2807
2942
  await kvHandle.putText("greeting", "hello");
2808
2943
  const value = await kvHandle.getText("greeting");
2809
- expect15(value).toBe("hello");
2944
+ expect17(value).toBe("hello");
2810
2945
  await kvHandle.putText("prefix-a", "alpha");
2811
2946
  await kvHandle.putText("prefix-b", "beta");
2812
2947
  const results = await kvHandle.listText("prefix-");
2813
2948
  const sorted = results.sort((a, b) => a.key.localeCompare(b.key));
2814
- expect15(sorted).toEqual([
2949
+ expect17(sorted).toEqual([
2815
2950
  { key: "prefix-a", value: "alpha" },
2816
2951
  { key: "prefix-b", value: "beta" }
2817
2952
  ]);
2818
2953
  });
2819
- test15(
2954
+ test17(
2820
2955
  "supports arrayBuffer encoding and decoding",
2821
2956
  async (c) => {
2822
2957
  const { client: rawClient } = await setupDriverTest(
@@ -2835,32 +2970,32 @@ function runActorKvTests(driverTestConfig) {
2835
2970
  23,
2836
2971
  42
2837
2972
  ]);
2838
- expect15(values).toEqual([4, 8, 15, 16, 23, 42]);
2973
+ expect17(values).toEqual([4, 8, 15, 16, 23, 42]);
2839
2974
  }
2840
2975
  );
2841
2976
  });
2842
2977
  }
2843
2978
 
2844
2979
  // src/driver-test-suite/tests/actor-metadata.ts
2845
- import { describe as describe17, expect as expect16, test as test16 } from "vitest";
2980
+ import { describe as describe19, expect as expect18, test as test18 } from "vitest";
2846
2981
  function runActorMetadataTests(driverTestConfig) {
2847
- describe17("Actor Metadata Tests", () => {
2848
- describe17("Actor Name", () => {
2849
- test16("should provide access to actor name", async (c) => {
2982
+ describe19("Actor Metadata Tests", () => {
2983
+ describe19("Actor Name", () => {
2984
+ test18("should provide access to actor name", async (c) => {
2850
2985
  const { client } = await setupDriverTest(c, driverTestConfig);
2851
2986
  const handle = client.metadataActor.getOrCreate();
2852
2987
  const actorName = await handle.getActorName();
2853
- expect16(actorName).toBe("metadataActor");
2988
+ expect18(actorName).toBe("metadataActor");
2854
2989
  });
2855
- test16("should preserve actor name in state during onWake", async (c) => {
2990
+ test18("should preserve actor name in state during onWake", async (c) => {
2856
2991
  const { client } = await setupDriverTest(c, driverTestConfig);
2857
2992
  const handle = client.metadataActor.getOrCreate();
2858
2993
  const storedName = await handle.getStoredActorName();
2859
- expect16(storedName).toBe("metadataActor");
2994
+ expect18(storedName).toBe("metadataActor");
2860
2995
  });
2861
2996
  });
2862
- describe17("Actor Tags", () => {
2863
- test16("should provide access to tags", async (c) => {
2997
+ describe19("Actor Tags", () => {
2998
+ test18("should provide access to tags", async (c) => {
2864
2999
  const { client } = await setupDriverTest(c, driverTestConfig);
2865
3000
  const handle = client.metadataActor.getOrCreate();
2866
3001
  await handle.setupTestTags({
@@ -2868,12 +3003,12 @@ function runActorMetadataTests(driverTestConfig) {
2868
3003
  purpose: "metadata-test"
2869
3004
  });
2870
3005
  const tags = await handle.getTags();
2871
- expect16(tags).toHaveProperty("env");
2872
- expect16(tags.env).toBe("test");
2873
- expect16(tags).toHaveProperty("purpose");
2874
- expect16(tags.purpose).toBe("metadata-test");
3006
+ expect18(tags).toHaveProperty("env");
3007
+ expect18(tags.env).toBe("test");
3008
+ expect18(tags).toHaveProperty("purpose");
3009
+ expect18(tags.purpose).toBe("metadata-test");
2875
3010
  });
2876
- test16("should allow accessing individual tags", async (c) => {
3011
+ test18("should allow accessing individual tags", async (c) => {
2877
3012
  const { client } = await setupDriverTest(c, driverTestConfig);
2878
3013
  const handle = client.metadataActor.getOrCreate();
2879
3014
  await handle.setupTestTags({
@@ -2883,128 +3018,128 @@ function runActorMetadataTests(driverTestConfig) {
2883
3018
  const category = await handle.getTag("category");
2884
3019
  const version = await handle.getTag("version");
2885
3020
  const nonexistent = await handle.getTag("nonexistent");
2886
- expect16(category).toBe("test-actor");
2887
- expect16(version).toBe("1.0");
2888
- expect16(nonexistent).toBeNull();
3021
+ expect18(category).toBe("test-actor");
3022
+ expect18(version).toBe("1.0");
3023
+ expect18(nonexistent).toBeNull();
2889
3024
  });
2890
3025
  });
2891
- describe17("Metadata Structure", () => {
2892
- test16("should provide complete metadata object", async (c) => {
3026
+ describe19("Metadata Structure", () => {
3027
+ test18("should provide complete metadata object", async (c) => {
2893
3028
  const { client } = await setupDriverTest(c, driverTestConfig);
2894
3029
  const handle = client.metadataActor.getOrCreate();
2895
3030
  await handle.setupTestTags({ type: "metadata-test" });
2896
3031
  await handle.setupTestRegion("us-west-1");
2897
3032
  const metadata = await handle.getMetadata();
2898
- expect16(metadata).toHaveProperty("name");
2899
- expect16(metadata.name).toBe("metadataActor");
2900
- expect16(metadata).toHaveProperty("tags");
2901
- expect16(metadata.tags).toHaveProperty("type");
2902
- expect16(metadata.tags.type).toBe("metadata-test");
2903
- expect16(metadata).toHaveProperty("region");
2904
- expect16(metadata.region).toBe("us-west-1");
3033
+ expect18(metadata).toHaveProperty("name");
3034
+ expect18(metadata.name).toBe("metadataActor");
3035
+ expect18(metadata).toHaveProperty("tags");
3036
+ expect18(metadata.tags).toHaveProperty("type");
3037
+ expect18(metadata.tags.type).toBe("metadata-test");
3038
+ expect18(metadata).toHaveProperty("region");
3039
+ expect18(metadata.region).toBe("us-west-1");
2905
3040
  });
2906
3041
  });
2907
- describe17("Region Information", () => {
2908
- test16("should retrieve region information", async (c) => {
3042
+ describe19("Region Information", () => {
3043
+ test18("should retrieve region information", async (c) => {
2909
3044
  const { client } = await setupDriverTest(c, driverTestConfig);
2910
3045
  const handle = client.metadataActor.getOrCreate();
2911
3046
  await handle.setupTestRegion("eu-central-1");
2912
3047
  const region = await handle.getRegion();
2913
- expect16(region).toBe("eu-central-1");
3048
+ expect18(region).toBe("eu-central-1");
2914
3049
  });
2915
3050
  });
2916
3051
  });
2917
3052
  }
2918
3053
 
2919
3054
  // src/driver-test-suite/tests/actor-onstatechange.ts
2920
- import { describe as describe18, expect as expect17, test as test17 } from "vitest";
3055
+ import { describe as describe20, expect as expect19, test as test19 } from "vitest";
2921
3056
  function runActorOnStateChangeTests(driverTestConfig) {
2922
- describe18("Actor onStateChange Tests", () => {
2923
- test17("triggers onStateChange when state is modified", async (c) => {
3057
+ describe20("Actor onStateChange Tests", () => {
3058
+ test19("triggers onStateChange when state is modified", async (c) => {
2924
3059
  const { client } = await setupDriverTest(c, driverTestConfig);
2925
3060
  const actor = client.onStateChangeActor.getOrCreate();
2926
3061
  await actor.setValue(10);
2927
3062
  const changeCount = await actor.getChangeCount();
2928
- expect17(changeCount).toBe(1);
3063
+ expect19(changeCount).toBe(1);
2929
3064
  });
2930
- test17("triggers onChange multiple times for multiple state changes", async (c) => {
3065
+ test19("triggers onChange multiple times for multiple state changes", async (c) => {
2931
3066
  const { client } = await setupDriverTest(c, driverTestConfig);
2932
3067
  const actor = client.onStateChangeActor.getOrCreate();
2933
3068
  await actor.incrementMultiple(3);
2934
3069
  const changeCount = await actor.getChangeCount();
2935
- expect17(changeCount).toBe(3);
3070
+ expect19(changeCount).toBe(3);
2936
3071
  });
2937
- test17("does NOT trigger onChange for read-only actions", async (c) => {
3072
+ test19("does NOT trigger onChange for read-only actions", async (c) => {
2938
3073
  const { client } = await setupDriverTest(c, driverTestConfig);
2939
3074
  const actor = client.onStateChangeActor.getOrCreate();
2940
3075
  await actor.setValue(5);
2941
3076
  const value = await actor.getValue();
2942
- expect17(value).toBe(5);
3077
+ expect19(value).toBe(5);
2943
3078
  const changeCount = await actor.getChangeCount();
2944
- expect17(changeCount).toBe(1);
3079
+ expect19(changeCount).toBe(1);
2945
3080
  });
2946
- test17("does NOT trigger onChange for computed values", async (c) => {
3081
+ test19("does NOT trigger onChange for computed values", async (c) => {
2947
3082
  const { client } = await setupDriverTest(c, driverTestConfig);
2948
3083
  const actor = client.onStateChangeActor.getOrCreate();
2949
3084
  await actor.setValue(3);
2950
3085
  {
2951
3086
  const changeCount = await actor.getChangeCount();
2952
- expect17(changeCount).toBe(1);
3087
+ expect19(changeCount).toBe(1);
2953
3088
  }
2954
3089
  const doubled = await actor.getDoubled();
2955
- expect17(doubled).toBe(6);
3090
+ expect19(doubled).toBe(6);
2956
3091
  {
2957
3092
  const changeCount = await actor.getChangeCount();
2958
- expect17(changeCount).toBe(1);
3093
+ expect19(changeCount).toBe(1);
2959
3094
  }
2960
3095
  });
2961
- test17("simple: connect, call action, dispose does NOT trigger onChange", async (c) => {
3096
+ test19("simple: connect, call action, dispose does NOT trigger onChange", async (c) => {
2962
3097
  const { client } = await setupDriverTest(c, driverTestConfig);
2963
3098
  const actor = client.onStateChangeActor.getOrCreate();
2964
3099
  const connection = await actor.connect();
2965
3100
  const value = await connection.getValue();
2966
- expect17(value).toBe(0);
3101
+ expect19(value).toBe(0);
2967
3102
  await connection.dispose();
2968
3103
  const changeCount = await actor.getChangeCount();
2969
- expect17(changeCount).toBe(0);
3104
+ expect19(changeCount).toBe(0);
2970
3105
  });
2971
3106
  });
2972
3107
  }
2973
3108
 
2974
3109
  // src/driver-test-suite/tests/actor-queue.ts
2975
- import { describe as describe19, expect as expect18, test as test18 } from "vitest";
3110
+ import { describe as describe21, expect as expect20, test as test20 } from "vitest";
2976
3111
  function runActorQueueTests(driverTestConfig) {
2977
- describe19("Actor Queue Tests", () => {
2978
- test18("client can send to actor queue", async (c) => {
3112
+ describe21("Actor Queue Tests", () => {
3113
+ test20("client can send to actor queue", async (c) => {
2979
3114
  const { client } = await setupDriverTest(c, driverTestConfig);
2980
3115
  const handle = client.queueActor.getOrCreate(["client-send"]);
2981
3116
  await handle.send("greeting", { hello: "world" });
2982
3117
  const message = await handle.receiveOne("greeting");
2983
- expect18(message).toEqual({
3118
+ expect20(message).toEqual({
2984
3119
  name: "greeting",
2985
3120
  body: { hello: "world" }
2986
3121
  });
2987
3122
  });
2988
- test18("actor can send to its own queue", async (c) => {
3123
+ test20("actor can send to its own queue", async (c) => {
2989
3124
  const { client } = await setupDriverTest(c, driverTestConfig);
2990
3125
  const handle = client.queueActor.getOrCreate(["self-send"]);
2991
3126
  await handle.sendToSelf("self", { value: 42 });
2992
3127
  const message = await handle.receiveOne("self");
2993
- expect18(message).toEqual({ name: "self", body: { value: 42 } });
3128
+ expect20(message).toEqual({ name: "self", body: { value: 42 } });
2994
3129
  });
2995
- test18("nextBatch supports name arrays and counts", async (c) => {
3130
+ test20("nextBatch supports name arrays and counts", async (c) => {
2996
3131
  const { client } = await setupDriverTest(c, driverTestConfig);
2997
3132
  const handle = client.queueActor.getOrCreate(["receive-array"]);
2998
3133
  await handle.send("a", 1);
2999
3134
  await handle.send("b", 2);
3000
3135
  await handle.send("c", 3);
3001
3136
  const messages = await handle.receiveMany(["a", "b"], { count: 2 });
3002
- expect18(messages).toEqual([
3137
+ expect20(messages).toEqual([
3003
3138
  { name: "a", body: 1 },
3004
3139
  { name: "b", body: 2 }
3005
3140
  ]);
3006
3141
  });
3007
- test18("nextBatch supports request objects", async (c) => {
3142
+ test20("nextBatch supports request objects", async (c) => {
3008
3143
  const { client } = await setupDriverTest(c, driverTestConfig);
3009
3144
  const handle = client.queueActor.getOrCreate(["receive-request"]);
3010
3145
  await handle.send("one", "first");
@@ -3013,12 +3148,12 @@ function runActorQueueTests(driverTestConfig) {
3013
3148
  names: ["one", "two"],
3014
3149
  count: 2
3015
3150
  });
3016
- expect18(messages).toEqual([
3151
+ expect20(messages).toEqual([
3017
3152
  { name: "one", body: "first" },
3018
3153
  { name: "two", body: "second" }
3019
3154
  ]);
3020
3155
  });
3021
- test18("nextBatch defaults to all names when names is omitted", async (c) => {
3156
+ test20("nextBatch defaults to all names when names is omitted", async (c) => {
3022
3157
  const { client } = await setupDriverTest(c, driverTestConfig);
3023
3158
  const handle = client.queueActor.getOrCreate([
3024
3159
  "receive-request-all"
@@ -3026,66 +3161,66 @@ function runActorQueueTests(driverTestConfig) {
3026
3161
  await handle.send("one", "first");
3027
3162
  await handle.send("two", "second");
3028
3163
  const messages = await handle.receiveRequest({ count: 2 });
3029
- expect18(messages).toEqual([
3164
+ expect20(messages).toEqual([
3030
3165
  { name: "one", body: "first" },
3031
3166
  { name: "two", body: "second" }
3032
3167
  ]);
3033
3168
  });
3034
- test18("next timeout returns empty array", async (c) => {
3169
+ test20("next timeout returns empty array", async (c) => {
3035
3170
  const { client } = await setupDriverTest(c, driverTestConfig);
3036
3171
  const handle = client.queueActor.getOrCreate(["receive-timeout"]);
3037
3172
  const promise = handle.receiveMany(["missing"], { timeout: 50 });
3038
3173
  await waitFor(driverTestConfig, 60);
3039
3174
  const messages = await promise;
3040
- expect18(messages).toEqual([]);
3175
+ expect20(messages).toEqual([]);
3041
3176
  });
3042
- test18("tryNextBatch does not wait and returns empty array", async (c) => {
3177
+ test20("tryNextBatch does not wait and returns empty array", async (c) => {
3043
3178
  const { client } = await setupDriverTest(c, driverTestConfig);
3044
3179
  const handle = client.queueActor.getOrCreate(["try-next-empty"]);
3045
3180
  const messages = await handle.tryReceiveMany({
3046
3181
  names: ["missing"],
3047
3182
  count: 1
3048
3183
  });
3049
- expect18(messages).toEqual([]);
3184
+ expect20(messages).toEqual([]);
3050
3185
  });
3051
- test18("abort throws ActorAborted", async (c) => {
3186
+ test20("abort throws ActorAborted", async (c) => {
3052
3187
  const { client } = await setupDriverTest(c, driverTestConfig);
3053
3188
  const handle = client.queueActor.getOrCreate(["abort-test"]);
3054
3189
  try {
3055
3190
  await handle.waitForAbort();
3056
- expect18.fail("expected ActorAborted error");
3191
+ expect20.fail("expected ActorAborted error");
3057
3192
  } catch (error) {
3058
- expect18(error.group).toBe("actor");
3059
- expect18(error.code).toBe("aborted");
3193
+ expect20(error.group).toBe("actor");
3194
+ expect20(error.code).toBe("aborted");
3060
3195
  }
3061
3196
  });
3062
- test18("next supports signal abort", async (c) => {
3197
+ test20("next supports signal abort", async (c) => {
3063
3198
  const { client } = await setupDriverTest(c, driverTestConfig);
3064
3199
  const handle = client.queueActor.getOrCreate(["signal-abort-next"]);
3065
3200
  const result = await handle.waitForSignalAbort();
3066
- expect18(result).toEqual({
3201
+ expect20(result).toEqual({
3067
3202
  group: "actor",
3068
3203
  code: "aborted"
3069
3204
  });
3070
3205
  });
3071
- test18("next supports actor abort when signal is provided", async (c) => {
3206
+ test20("next supports actor abort when signal is provided", async (c) => {
3072
3207
  const { client } = await setupDriverTest(c, driverTestConfig);
3073
3208
  const handle = client.queueActor.getOrCreate([
3074
3209
  "actor-abort-with-signal-next"
3075
3210
  ]);
3076
3211
  const result = await handle.waitForActorAbortWithSignal();
3077
- expect18(result).toEqual({
3212
+ expect20(result).toEqual({
3078
3213
  group: "actor",
3079
3214
  code: "aborted"
3080
3215
  });
3081
3216
  });
3082
- test18("iter supports signal abort", async (c) => {
3217
+ test20("iter supports signal abort", async (c) => {
3083
3218
  const { client } = await setupDriverTest(c, driverTestConfig);
3084
3219
  const handle = client.queueActor.getOrCreate(["signal-abort-iter"]);
3085
3220
  const result = await handle.iterWithSignalAbort();
3086
- expect18(result).toEqual({ ok: true });
3221
+ expect20(result).toEqual({ ok: true });
3087
3222
  });
3088
- test18("enforces queue size limit", async (c) => {
3223
+ test20("enforces queue size limit", async (c) => {
3089
3224
  const { client } = await setupDriverTest(c, driverTestConfig);
3090
3225
  const key = `size-limit-${Date.now()}-${Math.random().toString(16).slice(2)}`;
3091
3226
  const handle = client.queueLimitedActor.getOrCreate([key]);
@@ -3093,19 +3228,19 @@ function runActorQueueTests(driverTestConfig) {
3093
3228
  await waitFor(driverTestConfig, 10);
3094
3229
  try {
3095
3230
  await handle.send("message", 2);
3096
- expect18.fail("expected queue full error");
3231
+ expect20.fail("expected queue full error");
3097
3232
  } catch (error) {
3098
- expect18(error).toBeInstanceOf(Error);
3099
- expect18(error.message).toContain(
3233
+ expect20(error).toBeInstanceOf(Error);
3234
+ expect20(error.message).toContain(
3100
3235
  "Queue is full. Limit is"
3101
3236
  );
3102
3237
  if (driverTestConfig.clientType !== "http") {
3103
- expect18(error.group).toBe("queue");
3104
- expect18(error.code).toBe("full");
3238
+ expect20(error.group).toBe("queue");
3239
+ expect20(error.code).toBe("full");
3105
3240
  }
3106
3241
  }
3107
3242
  });
3108
- test18("enforces message size limit", async (c) => {
3243
+ test20("enforces message size limit", async (c) => {
3109
3244
  const { client } = await setupDriverTest(c, driverTestConfig);
3110
3245
  const handle = client.queueLimitedActor.getOrCreate([
3111
3246
  "message-limit"
@@ -3113,13 +3248,13 @@ function runActorQueueTests(driverTestConfig) {
3113
3248
  const largePayload = "a".repeat(200);
3114
3249
  try {
3115
3250
  await handle.send("oversize", largePayload);
3116
- expect18.fail("expected message_too_large error");
3251
+ expect20.fail("expected message_too_large error");
3117
3252
  } catch (error) {
3118
- expect18(error.group).toBe("queue");
3119
- expect18(error.code).toBe("message_too_large");
3253
+ expect20(error.group).toBe("queue");
3254
+ expect20(error.code).toBe("message_too_large");
3120
3255
  }
3121
3256
  });
3122
- test18("wait send returns completion response", async (c) => {
3257
+ test20("wait send returns completion response", async (c) => {
3123
3258
  const { client } = await setupDriverTest(c, driverTestConfig);
3124
3259
  const handle = client.queueActor.getOrCreate(["wait-complete"]);
3125
3260
  const waitTimeout = driverTestConfig.useRealTimers ? 5e3 : 1e3;
@@ -3130,12 +3265,12 @@ function runActorQueueTests(driverTestConfig) {
3130
3265
  { wait: true, timeout: waitTimeout }
3131
3266
  );
3132
3267
  await actionPromise;
3133
- expect18(result).toEqual({
3268
+ expect20(result).toEqual({
3134
3269
  status: "completed",
3135
3270
  response: { echo: { value: 123 } }
3136
3271
  });
3137
3272
  });
3138
- test18("wait send times out", async (c) => {
3273
+ test20("wait send times out", async (c) => {
3139
3274
  const { client } = await setupDriverTest(c, driverTestConfig);
3140
3275
  const handle = client.queueActor.getOrCreate(["wait-timeout"]);
3141
3276
  const resultPromise = handle.send(
@@ -3145,20 +3280,20 @@ function runActorQueueTests(driverTestConfig) {
3145
3280
  );
3146
3281
  await waitFor(driverTestConfig, 60);
3147
3282
  const result = await resultPromise;
3148
- expect18(result.status).toBe("timedOut");
3283
+ expect20(result.status).toBe("timedOut");
3149
3284
  });
3150
- test18("manual receive retries message when not completed", async (c) => {
3285
+ test20("manual receive retries message when not completed", async (c) => {
3151
3286
  const { client } = await setupDriverTest(c, driverTestConfig);
3152
3287
  const handle = client.queueActor.getOrCreate([
3153
3288
  "manual-retry-uncompleted"
3154
3289
  ]);
3155
3290
  await handle.send("tasks", { value: 789 });
3156
3291
  const first = await handle.receiveWithoutComplete("tasks");
3157
- expect18(first).toEqual({ name: "tasks", body: { value: 789 } });
3292
+ expect20(first).toEqual({ name: "tasks", body: { value: 789 } });
3158
3293
  const retried = await handle.receiveOne("tasks", { timeout: 1e3 });
3159
- expect18(retried).toEqual({ name: "tasks", body: { value: 789 } });
3294
+ expect20(retried).toEqual({ name: "tasks", body: { value: 789 } });
3160
3295
  });
3161
- test18("next throws when previous manual message is not completed", async (c) => {
3296
+ test20("next throws when previous manual message is not completed", async (c) => {
3162
3297
  const { client } = await setupDriverTest(c, driverTestConfig);
3163
3298
  const handle = client.queueActor.getOrCreate([
3164
3299
  "manual-next-requires-complete"
@@ -3167,46 +3302,46 @@ function runActorQueueTests(driverTestConfig) {
3167
3302
  const result = await handle.receiveManualThenNextWithoutComplete(
3168
3303
  "tasks"
3169
3304
  );
3170
- expect18(result).toEqual({
3305
+ expect20(result).toEqual({
3171
3306
  group: "queue",
3172
3307
  code: "previous_message_not_completed"
3173
3308
  });
3174
3309
  });
3175
- test18("manual receive includes complete even without completion schema", async (c) => {
3310
+ test20("manual receive includes complete even without completion schema", async (c) => {
3176
3311
  const { client } = await setupDriverTest(c, driverTestConfig);
3177
3312
  const handle = client.queueActor.getOrCreate([
3178
3313
  "complete-not-allowed"
3179
3314
  ]);
3180
3315
  await handle.send("nowait", { value: "test" });
3181
3316
  const result = await handle.receiveWithoutCompleteMethod("nowait");
3182
- expect18(result).toEqual({
3317
+ expect20(result).toEqual({
3183
3318
  hasComplete: true
3184
3319
  });
3185
3320
  });
3186
- test18("manual receive retries queues without completion schema until completed", async (c) => {
3321
+ test20("manual receive retries queues without completion schema until completed", async (c) => {
3187
3322
  const { client } = await setupDriverTest(c, driverTestConfig);
3188
3323
  const handle = client.queueActor.getOrCreate([
3189
3324
  "complete-not-allowed-consume"
3190
3325
  ]);
3191
3326
  await handle.send("nowait", { value: "test" });
3192
3327
  const result = await handle.receiveWithoutCompleteMethod("nowait");
3193
- expect18(result).toEqual({ hasComplete: true });
3328
+ expect20(result).toEqual({ hasComplete: true });
3194
3329
  const next = await handle.receiveOne("nowait", { timeout: 1e3 });
3195
- expect18(next).toEqual({ name: "nowait", body: { value: "test" } });
3330
+ expect20(next).toEqual({ name: "nowait", body: { value: "test" } });
3196
3331
  });
3197
- test18("complete throws when called twice", async (c) => {
3332
+ test20("complete throws when called twice", async (c) => {
3198
3333
  const { client } = await setupDriverTest(c, driverTestConfig);
3199
3334
  const handle = client.queueActor.getOrCreate([
3200
3335
  "complete-twice"
3201
3336
  ]);
3202
3337
  await handle.send("twice", { value: "test" });
3203
3338
  const result = await handle.receiveAndCompleteTwice("twice");
3204
- expect18(result).toEqual({
3339
+ expect20(result).toEqual({
3205
3340
  group: "queue",
3206
3341
  code: "already_completed"
3207
3342
  });
3208
3343
  });
3209
- test18("wait send no longer requires queue completion schema", async (c) => {
3344
+ test20("wait send no longer requires queue completion schema", async (c) => {
3210
3345
  const { client } = await setupDriverTest(c, driverTestConfig);
3211
3346
  const handle = client.queueActor.getOrCreate([
3212
3347
  "missing-completion-schema"
@@ -3216,78 +3351,78 @@ function runActorQueueTests(driverTestConfig) {
3216
3351
  { value: "test" },
3217
3352
  { wait: true, timeout: 50 }
3218
3353
  );
3219
- expect18(result).toEqual({ status: "timedOut" });
3354
+ expect20(result).toEqual({ status: "timedOut" });
3220
3355
  });
3221
- test18("iter can consume queued messages", async (c) => {
3356
+ test20("iter can consume queued messages", async (c) => {
3222
3357
  const { client } = await setupDriverTest(c, driverTestConfig);
3223
3358
  const handle = client.queueActor.getOrCreate(["iter-consume"]);
3224
3359
  await handle.send("one", "first");
3225
3360
  const message = await handle.receiveWithIterator("one");
3226
- expect18(message).toEqual({ name: "one", body: "first" });
3361
+ expect20(message).toEqual({ name: "one", body: "first" });
3227
3362
  });
3228
- test18("queue async iterator can consume queued messages", async (c) => {
3363
+ test20("queue async iterator can consume queued messages", async (c) => {
3229
3364
  const { client } = await setupDriverTest(c, driverTestConfig);
3230
3365
  const handle = client.queueActor.getOrCreate([
3231
3366
  "async-iter-consume"
3232
3367
  ]);
3233
3368
  await handle.send("two", "second");
3234
3369
  const message = await handle.receiveWithAsyncIterator();
3235
- expect18(message).toEqual({ name: "two", body: "second" });
3370
+ expect20(message).toEqual({ name: "two", body: "second" });
3236
3371
  });
3237
3372
  });
3238
3373
  }
3239
3374
 
3240
3375
  // src/driver-test-suite/tests/actor-run.ts
3241
- import { describe as describe20, expect as expect19, test as test19 } from "vitest";
3376
+ import { describe as describe22, expect as expect21, test as test21 } from "vitest";
3242
3377
  function runActorRunTests(driverTestConfig) {
3243
3378
  var _a;
3244
- describe20.skipIf((_a = driverTestConfig.skip) == null ? void 0 : _a.sleep)("Actor Run Tests", () => {
3245
- test19("run handler starts after actor startup", async (c) => {
3379
+ describe22.skipIf((_a = driverTestConfig.skip) == null ? void 0 : _a.sleep)("Actor Run Tests", () => {
3380
+ test21("run handler starts after actor startup", async (c) => {
3246
3381
  const { client } = await setupDriverTest(c, driverTestConfig);
3247
3382
  const actor = client.runWithTicks.getOrCreate(["run-starts"]);
3248
3383
  await waitFor(driverTestConfig, 100);
3249
3384
  const state = await actor.getState();
3250
- expect19(state.runStarted).toBe(true);
3251
- expect19(state.tickCount).toBeGreaterThan(0);
3385
+ expect21(state.runStarted).toBe(true);
3386
+ expect21(state.tickCount).toBeGreaterThan(0);
3252
3387
  });
3253
- test19("run handler ticks continuously", async (c) => {
3388
+ test21("run handler ticks continuously", async (c) => {
3254
3389
  const { client } = await setupDriverTest(c, driverTestConfig);
3255
3390
  const actor = client.runWithTicks.getOrCreate(["run-ticks"]);
3256
3391
  await waitFor(driverTestConfig, 200);
3257
3392
  const state1 = await actor.getState();
3258
- expect19(state1.tickCount).toBeGreaterThan(0);
3393
+ expect21(state1.tickCount).toBeGreaterThan(0);
3259
3394
  const count1 = state1.tickCount;
3260
3395
  await waitFor(driverTestConfig, 200);
3261
3396
  const state2 = await actor.getState();
3262
- expect19(state2.tickCount).toBeGreaterThan(count1);
3397
+ expect21(state2.tickCount).toBeGreaterThan(count1);
3263
3398
  });
3264
- test19("active run handler keeps actor awake past sleep timeout", async (c) => {
3399
+ test21("active run handler keeps actor awake past sleep timeout", async (c) => {
3265
3400
  const { client } = await setupDriverTest(c, driverTestConfig);
3266
3401
  const actor = client.runWithTicks.getOrCreate([
3267
3402
  "run-stays-awake"
3268
3403
  ]);
3269
3404
  await waitFor(driverTestConfig, 100);
3270
3405
  const state1 = await actor.getState();
3271
- expect19(state1.runStarted).toBe(true);
3406
+ expect21(state1.runStarted).toBe(true);
3272
3407
  const tickCount1 = state1.tickCount;
3273
3408
  await waitFor(driverTestConfig, RUN_SLEEP_TIMEOUT + 300);
3274
3409
  const state2 = await actor.getState();
3275
- expect19(state2.runStarted).toBe(true);
3276
- expect19(state2.runExited).toBe(false);
3277
- expect19(state2.tickCount).toBeGreaterThan(tickCount1);
3410
+ expect21(state2.runStarted).toBe(true);
3411
+ expect21(state2.runExited).toBe(false);
3412
+ expect21(state2.tickCount).toBeGreaterThan(tickCount1);
3278
3413
  });
3279
- test19("actor without run handler works normally", async (c) => {
3414
+ test21("actor without run handler works normally", async (c) => {
3280
3415
  const { client } = await setupDriverTest(c, driverTestConfig);
3281
3416
  const actor = client.runWithoutHandler.getOrCreate([
3282
3417
  "no-run-handler"
3283
3418
  ]);
3284
3419
  const state = await actor.getState();
3285
- expect19(state.wakeCount).toBe(1);
3420
+ expect21(state.wakeCount).toBe(1);
3286
3421
  await waitFor(driverTestConfig, RUN_SLEEP_TIMEOUT + 300);
3287
3422
  const state2 = await actor.getState();
3288
- expect19(state2.wakeCount).toBe(2);
3423
+ expect21(state2.wakeCount).toBe(2);
3289
3424
  });
3290
- test19("run handler can consume from queue", async (c) => {
3425
+ test21("run handler can consume from queue", async (c) => {
3291
3426
  const { client } = await setupDriverTest(c, driverTestConfig);
3292
3427
  const actor = client.runWithQueueConsumer.getOrCreate([
3293
3428
  "queue-consumer"
@@ -3298,127 +3433,127 @@ function runActorRunTests(driverTestConfig) {
3298
3433
  await actor.sendMessage({ type: "test", value: 3 });
3299
3434
  await waitFor(driverTestConfig, 1200);
3300
3435
  const state = await actor.getState();
3301
- expect19(state.runStarted).toBe(true);
3302
- expect19(state.messagesReceived.length).toBe(3);
3303
- expect19(state.messagesReceived[0].body).toEqual({
3436
+ expect21(state.runStarted).toBe(true);
3437
+ expect21(state.messagesReceived.length).toBe(3);
3438
+ expect21(state.messagesReceived[0].body).toEqual({
3304
3439
  type: "test",
3305
3440
  value: 1
3306
3441
  });
3307
- expect19(state.messagesReceived[1].body).toEqual({
3442
+ expect21(state.messagesReceived[1].body).toEqual({
3308
3443
  type: "test",
3309
3444
  value: 2
3310
3445
  });
3311
- expect19(state.messagesReceived[2].body).toEqual({
3446
+ expect21(state.messagesReceived[2].body).toEqual({
3312
3447
  type: "test",
3313
3448
  value: 3
3314
3449
  });
3315
3450
  });
3316
- test19("queue-waiting run handler can sleep and resume", async (c) => {
3451
+ test21("queue-waiting run handler can sleep and resume", async (c) => {
3317
3452
  const { client } = await setupDriverTest(c, driverTestConfig);
3318
3453
  const actor = client.runWithQueueConsumer.getOrCreate([
3319
3454
  "queue-consumer-sleep"
3320
3455
  ]);
3321
3456
  await waitFor(driverTestConfig, 100);
3322
3457
  const state1 = await actor.getState();
3323
- expect19(state1.runStarted).toBe(true);
3458
+ expect21(state1.runStarted).toBe(true);
3324
3459
  await waitFor(driverTestConfig, RUN_SLEEP_TIMEOUT + 500);
3325
3460
  const state2 = await actor.getState();
3326
- expect19(state2.wakeCount).toBeGreaterThan(state1.wakeCount);
3461
+ expect21(state2.wakeCount).toBeGreaterThan(state1.wakeCount);
3327
3462
  });
3328
- test19("run handler that exits early triggers destroy", async (c) => {
3463
+ test21("run handler that exits early triggers destroy", async (c) => {
3329
3464
  const { client } = await setupDriverTest(c, driverTestConfig);
3330
3465
  const actor = client.runWithEarlyExit.getOrCreate(["early-exit"]);
3331
3466
  await waitFor(driverTestConfig, 100);
3332
3467
  const state1 = await actor.getState();
3333
- expect19(state1.runStarted).toBe(true);
3468
+ expect21(state1.runStarted).toBe(true);
3334
3469
  await waitFor(driverTestConfig, 300);
3335
3470
  const actor2 = client.runWithEarlyExit.getOrCreate([
3336
3471
  "early-exit-fresh"
3337
3472
  ]);
3338
3473
  const state2 = await actor2.getState();
3339
- expect19(state2.runStarted).toBe(true);
3474
+ expect21(state2.runStarted).toBe(true);
3340
3475
  });
3341
- test19("run handler that throws error triggers destroy", async (c) => {
3476
+ test21("run handler that throws error triggers destroy", async (c) => {
3342
3477
  const { client } = await setupDriverTest(c, driverTestConfig);
3343
3478
  const actor = client.runWithError.getOrCreate(["run-error"]);
3344
3479
  await waitFor(driverTestConfig, 100);
3345
3480
  const state1 = await actor.getState();
3346
- expect19(state1.runStarted).toBe(true);
3481
+ expect21(state1.runStarted).toBe(true);
3347
3482
  await waitFor(driverTestConfig, 300);
3348
3483
  const actor2 = client.runWithError.getOrCreate(["run-error-fresh"]);
3349
3484
  const state2 = await actor2.getState();
3350
- expect19(state2.runStarted).toBe(true);
3485
+ expect21(state2.runStarted).toBe(true);
3351
3486
  });
3352
3487
  });
3353
3488
  }
3354
3489
 
3355
3490
  // src/driver-test-suite/tests/actor-stateless.ts
3356
- import { describe as describe21, expect as expect20, test as test20 } from "vitest";
3491
+ import { describe as describe23, expect as expect22, test as test22 } from "vitest";
3357
3492
  function runActorStatelessTests(driverTestConfig) {
3358
- describe21("Actor Stateless Tests", () => {
3359
- describe21("Stateless Actor Operations", () => {
3360
- test20("can call actions on stateless actor", async (c) => {
3493
+ describe23("Actor Stateless Tests", () => {
3494
+ describe23("Stateless Actor Operations", () => {
3495
+ test22("can call actions on stateless actor", async (c) => {
3361
3496
  const { client } = await setupDriverTest(c, driverTestConfig);
3362
3497
  const instance = client.statelessActor.getOrCreate();
3363
3498
  const result = await instance.ping();
3364
- expect20(result).toBe("pong");
3499
+ expect22(result).toBe("pong");
3365
3500
  });
3366
- test20("can echo messages", async (c) => {
3501
+ test22("can echo messages", async (c) => {
3367
3502
  const { client } = await setupDriverTest(c, driverTestConfig);
3368
3503
  const instance = client.statelessActor.getOrCreate();
3369
3504
  const message = "Hello, World!";
3370
3505
  const result = await instance.echo(message);
3371
- expect20(result).toBe(message);
3506
+ expect22(result).toBe(message);
3372
3507
  });
3373
- test20("can access actorId", async (c) => {
3508
+ test22("can access actorId", async (c) => {
3374
3509
  const { client } = await setupDriverTest(c, driverTestConfig);
3375
3510
  const instance = client.statelessActor.getOrCreate(["test-id"]);
3376
3511
  const actorId = await instance.getActorId();
3377
- expect20(actorId).toBeDefined();
3378
- expect20(typeof actorId).toBe("string");
3512
+ expect22(actorId).toBeDefined();
3513
+ expect22(typeof actorId).toBe("string");
3379
3514
  });
3380
- test20("accessing state throws StateNotEnabled", async (c) => {
3515
+ test22("accessing state throws StateNotEnabled", async (c) => {
3381
3516
  const { client } = await setupDriverTest(c, driverTestConfig);
3382
3517
  const instance = client.statelessActor.getOrCreate();
3383
3518
  const result = await instance.tryGetState();
3384
- expect20(result.success).toBe(false);
3385
- expect20(result.error).toContain("state");
3519
+ expect22(result.success).toBe(false);
3520
+ expect22(result.error).toContain("state");
3386
3521
  });
3387
- test20("accessing db throws DatabaseNotEnabled", async (c) => {
3522
+ test22("accessing db throws DatabaseNotEnabled", async (c) => {
3388
3523
  const { client } = await setupDriverTest(c, driverTestConfig);
3389
3524
  const instance = client.statelessActor.getOrCreate();
3390
3525
  const result = await instance.tryGetDb();
3391
- expect20(result.success).toBe(false);
3392
- expect20(result.error).toContain("database");
3526
+ expect22(result.success).toBe(false);
3527
+ expect22(result.error).toContain("database");
3393
3528
  });
3394
- test20("multiple stateless actors can exist independently", async (c) => {
3529
+ test22("multiple stateless actors can exist independently", async (c) => {
3395
3530
  const { client } = await setupDriverTest(c, driverTestConfig);
3396
3531
  const actor1 = client.statelessActor.getOrCreate(["actor-1"]);
3397
3532
  const actor2 = client.statelessActor.getOrCreate(["actor-2"]);
3398
3533
  const id1 = await actor1.getActorId();
3399
3534
  const id2 = await actor2.getActorId();
3400
- expect20(id1).not.toBe(id2);
3535
+ expect22(id1).not.toBe(id2);
3401
3536
  });
3402
3537
  });
3403
3538
  });
3404
3539
  }
3405
3540
 
3406
3541
  // src/driver-test-suite/tests/actor-vars.ts
3407
- import { describe as describe22, expect as expect21, test as test21 } from "vitest";
3542
+ import { describe as describe24, expect as expect23, test as test23 } from "vitest";
3408
3543
  function runActorVarsTests(driverTestConfig) {
3409
- describe22("Actor Variables", () => {
3410
- describe22("Static vars", () => {
3411
- test21("should provide access to static vars", async (c) => {
3544
+ describe24("Actor Variables", () => {
3545
+ describe24("Static vars", () => {
3546
+ test23("should provide access to static vars", async (c) => {
3412
3547
  const { client } = await setupDriverTest(c, driverTestConfig);
3413
3548
  const instance = client.staticVarActor.getOrCreate();
3414
3549
  const result = await instance.getVars();
3415
- expect21(result).toEqual({ counter: 42, name: "test-actor" });
3550
+ expect23(result).toEqual({ counter: 42, name: "test-actor" });
3416
3551
  const name = await instance.getName();
3417
- expect21(name).toBe("test-actor");
3552
+ expect23(name).toBe("test-actor");
3418
3553
  });
3419
3554
  });
3420
- describe22("Deep cloning of static vars", () => {
3421
- test21("should deep clone static vars between actor instances", async (c) => {
3555
+ describe24("Deep cloning of static vars", () => {
3556
+ test23("should deep clone static vars between actor instances", async (c) => {
3422
3557
  const { client } = await setupDriverTest(c, driverTestConfig);
3423
3558
  const instance1 = client.nestedVarActor.getOrCreate([
3424
3559
  "instance1"
@@ -3427,52 +3562,52 @@ function runActorVarsTests(driverTestConfig) {
3427
3562
  "instance2"
3428
3563
  ]);
3429
3564
  const modifiedVars = await instance1.modifyNested();
3430
- expect21(modifiedVars.nested.value).toBe("modified");
3431
- expect21(modifiedVars.nested.array).toContain(4);
3432
- expect21(modifiedVars.nested.obj.key).toBe("new-value");
3565
+ expect23(modifiedVars.nested.value).toBe("modified");
3566
+ expect23(modifiedVars.nested.array).toContain(4);
3567
+ expect23(modifiedVars.nested.obj.key).toBe("new-value");
3433
3568
  const instance2Vars = await instance2.getVars();
3434
- expect21(instance2Vars.nested.value).toBe("original");
3435
- expect21(instance2Vars.nested.array).toEqual([1, 2, 3]);
3436
- expect21(instance2Vars.nested.obj.key).toBe("value");
3569
+ expect23(instance2Vars.nested.value).toBe("original");
3570
+ expect23(instance2Vars.nested.array).toEqual([1, 2, 3]);
3571
+ expect23(instance2Vars.nested.obj.key).toBe("value");
3437
3572
  });
3438
3573
  });
3439
- describe22("createVars", () => {
3440
- test21("should support dynamic vars creation", async (c) => {
3574
+ describe24("createVars", () => {
3575
+ test23("should support dynamic vars creation", async (c) => {
3441
3576
  const { client } = await setupDriverTest(c, driverTestConfig);
3442
3577
  const instance = client.dynamicVarActor.getOrCreate();
3443
3578
  const vars = await instance.getVars();
3444
- expect21(vars).toHaveProperty("random");
3445
- expect21(vars).toHaveProperty("computed");
3446
- expect21(typeof vars.random).toBe("number");
3447
- expect21(typeof vars.computed).toBe("string");
3448
- expect21(vars.computed).toMatch(/^Actor-\d+$/);
3579
+ expect23(vars).toHaveProperty("random");
3580
+ expect23(vars).toHaveProperty("computed");
3581
+ expect23(typeof vars.random).toBe("number");
3582
+ expect23(typeof vars.computed).toBe("string");
3583
+ expect23(vars.computed).toMatch(/^Actor-\d+$/);
3449
3584
  });
3450
- test21("should create different vars for different instances", async (c) => {
3585
+ test23("should create different vars for different instances", async (c) => {
3451
3586
  const { client } = await setupDriverTest(c, driverTestConfig);
3452
3587
  const instance1 = client.uniqueVarActor.getOrCreate(["test1"]);
3453
3588
  const instance2 = client.uniqueVarActor.getOrCreate(["test2"]);
3454
3589
  const vars1 = await instance1.getVars();
3455
3590
  const vars2 = await instance2.getVars();
3456
- expect21(vars1.id).not.toBe(vars2.id);
3591
+ expect23(vars1.id).not.toBe(vars2.id);
3457
3592
  });
3458
3593
  });
3459
- describe22("Driver Context", () => {
3460
- test21("should provide access to driver context", async (c) => {
3594
+ describe24("Driver Context", () => {
3595
+ test23("should provide access to driver context", async (c) => {
3461
3596
  const { client } = await setupDriverTest(c, driverTestConfig);
3462
3597
  const instance = client.driverCtxActor.getOrCreate();
3463
3598
  const vars = await instance.getVars();
3464
- expect21(vars).toHaveProperty("hasDriverCtx");
3599
+ expect23(vars).toHaveProperty("hasDriverCtx");
3465
3600
  });
3466
3601
  });
3467
3602
  });
3468
3603
  }
3469
3604
 
3470
3605
  // src/driver-test-suite/tests/actor-workflow.ts
3471
- import { describe as describe23, expect as expect22, test as test22 } from "vitest";
3606
+ import { describe as describe25, expect as expect24, test as test24 } from "vitest";
3472
3607
  function runActorWorkflowTests(driverTestConfig) {
3473
- describe23("Actor Workflow Tests", () => {
3608
+ describe25("Actor Workflow Tests", () => {
3474
3609
  var _a;
3475
- test22("replays steps and guards state access", async (c) => {
3610
+ test24("replays steps and guards state access", async (c) => {
3476
3611
  const { client } = await setupDriverTest(c, driverTestConfig);
3477
3612
  const actor = client.workflowCounterActor.getOrCreate([
3478
3613
  "workflow-basic"
@@ -3485,11 +3620,11 @@ function runActorWorkflowTests(driverTestConfig) {
3485
3620
  await waitFor(driverTestConfig, 100);
3486
3621
  state = await actor.getState();
3487
3622
  }
3488
- expect22(state.runCount).toBeGreaterThan(0);
3489
- expect22(state.history.length).toBeGreaterThan(0);
3490
- expect22(state.guardTriggered).toBe(true);
3623
+ expect24(state.runCount).toBeGreaterThan(0);
3624
+ expect24(state.history.length).toBeGreaterThan(0);
3625
+ expect24(state.guardTriggered).toBe(true);
3491
3626
  });
3492
- test22("consumes queue messages via workflow queue.next", async (c) => {
3627
+ test24("consumes queue messages via workflow queue.next", async (c) => {
3493
3628
  const { client } = await setupDriverTest(c, driverTestConfig);
3494
3629
  const actor = client.workflowQueueActor.getOrCreate(["workflow-queue"]);
3495
3630
  await actor.send(WORKFLOW_QUEUE_NAME, {
@@ -3497,20 +3632,20 @@ function runActorWorkflowTests(driverTestConfig) {
3497
3632
  });
3498
3633
  await waitFor(driverTestConfig, 200);
3499
3634
  const messages = await actor.getMessages();
3500
- expect22(messages).toEqual([{ hello: "world" }]);
3635
+ expect24(messages).toEqual([{ hello: "world" }]);
3501
3636
  });
3502
- test22("workflow queue.next supports completing wait sends", async (c) => {
3637
+ test24("workflow queue.next supports completing wait sends", async (c) => {
3503
3638
  const { client } = await setupDriverTest(c, driverTestConfig);
3504
3639
  const actor = client.workflowQueueActor.getOrCreate([
3505
3640
  "workflow-queue-wait"
3506
3641
  ]);
3507
3642
  const result = await actor.sendAndWait({ value: 123 });
3508
- expect22(result).toEqual({
3643
+ expect24(result).toEqual({
3509
3644
  status: "completed",
3510
3645
  response: { echo: { value: 123 } }
3511
3646
  });
3512
3647
  });
3513
- test22("db and client are step-only in workflow context", async (c) => {
3648
+ test24("db and client are step-only in workflow context", async (c) => {
3514
3649
  const { client } = await setupDriverTest(c, driverTestConfig);
3515
3650
  const actor = client.workflowAccessActor.getOrCreate([
3516
3651
  "workflow-access"
@@ -3520,24 +3655,24 @@ function runActorWorkflowTests(driverTestConfig) {
3520
3655
  await waitFor(driverTestConfig, 50);
3521
3656
  state = await actor.getState();
3522
3657
  }
3523
- expect22(state.outsideDbError).toBe(
3658
+ expect24(state.outsideDbError).toBe(
3524
3659
  "db is only available inside workflow steps"
3525
3660
  );
3526
- expect22(state.outsideClientError).toBe(
3661
+ expect24(state.outsideClientError).toBe(
3527
3662
  "client is only available inside workflow steps"
3528
3663
  );
3529
- expect22(state.insideDbCount).toBeGreaterThan(0);
3530
- expect22(state.insideClientAvailable).toBe(true);
3664
+ expect24(state.insideDbCount).toBeGreaterThan(0);
3665
+ expect24(state.insideClientAvailable).toBe(true);
3531
3666
  });
3532
- test22("sleeps and resumes between ticks", async (c) => {
3667
+ test24("sleeps and resumes between ticks", async (c) => {
3533
3668
  const { client } = await setupDriverTest(c, driverTestConfig);
3534
3669
  const actor = client.workflowSleepActor.getOrCreate(["workflow-sleep"]);
3535
3670
  const initial = await actor.getState();
3536
3671
  await waitFor(driverTestConfig, 200);
3537
3672
  const next = await actor.getState();
3538
- expect22(next.ticks).toBeGreaterThan(initial.ticks);
3673
+ expect24(next.ticks).toBeGreaterThan(initial.ticks);
3539
3674
  });
3540
- test22.skipIf((_a = driverTestConfig.skip) == null ? void 0 : _a.sleep)(
3675
+ test24.skipIf((_a = driverTestConfig.skip) == null ? void 0 : _a.sleep)(
3541
3676
  "workflow run teardown does not wait for runStopTimeout",
3542
3677
  async (c) => {
3543
3678
  const { client } = await setupDriverTest(c, driverTestConfig);
@@ -3547,69 +3682,69 @@ function runActorWorkflowTests(driverTestConfig) {
3547
3682
  await actor.getTimeline();
3548
3683
  await waitFor(driverTestConfig, 1200);
3549
3684
  const timeline = await actor.getTimeline();
3550
- expect22(timeline.wakeAts.length).toBeGreaterThanOrEqual(2);
3551
- expect22(timeline.sleepAts.length).toBeGreaterThanOrEqual(1);
3685
+ expect24(timeline.wakeAts.length).toBeGreaterThanOrEqual(2);
3686
+ expect24(timeline.sleepAts.length).toBeGreaterThanOrEqual(1);
3552
3687
  const firstSleepDelayMs = timeline.sleepAts[0] - timeline.wakeAts[0];
3553
- expect22(firstSleepDelayMs).toBeLessThan(1800);
3688
+ expect24(firstSleepDelayMs).toBeLessThan(1800);
3554
3689
  }
3555
3690
  );
3556
3691
  });
3557
3692
  }
3558
3693
 
3559
3694
  // src/driver-test-suite/tests/manager-driver.ts
3560
- import { describe as describe24, expect as expect23, test as test23 } from "vitest";
3695
+ import { describe as describe26, expect as expect25, test as test25 } from "vitest";
3561
3696
  function runManagerDriverTests(driverTestConfig) {
3562
- describe24("Manager Driver Tests", () => {
3563
- describe24("Client Connection Methods", () => {
3564
- test23("connect() - finds or creates a actor", async (c) => {
3697
+ describe26("Manager Driver Tests", () => {
3698
+ describe26("Client Connection Methods", () => {
3699
+ test25("connect() - finds or creates a actor", async (c) => {
3565
3700
  const { client } = await setupDriverTest(c, driverTestConfig);
3566
3701
  const counterA = client.counter.getOrCreate();
3567
3702
  await counterA.increment(5);
3568
3703
  const counterAAgain = client.counter.getOrCreate();
3569
3704
  const count = await counterAAgain.increment(0);
3570
- expect23(count).toBe(5);
3705
+ expect25(count).toBe(5);
3571
3706
  const counterB = client.counter.getOrCreate([
3572
3707
  "counter-b",
3573
3708
  "testing"
3574
3709
  ]);
3575
3710
  await counterB.increment(10);
3576
3711
  const countB = await counterB.increment(0);
3577
- expect23(countB).toBe(10);
3712
+ expect25(countB).toBe(10);
3578
3713
  });
3579
- test23("throws ActorAlreadyExists when creating duplicate actors", async (c) => {
3714
+ test25("throws ActorAlreadyExists when creating duplicate actors", async (c) => {
3580
3715
  const { client } = await setupDriverTest(c, driverTestConfig);
3581
3716
  const uniqueKey = ["duplicate-actor-test", crypto.randomUUID()];
3582
3717
  const counter = client.counter.getOrCreate(uniqueKey);
3583
3718
  await counter.increment(5);
3584
3719
  try {
3585
3720
  await client.counter.create(uniqueKey);
3586
- expect23.fail("did not error on duplicate create");
3721
+ expect25.fail("did not error on duplicate create");
3587
3722
  } catch (err) {
3588
- expect23(err.group).toBe("actor");
3589
- expect23(err.code).toBe("duplicate_key");
3723
+ expect25(err.group).toBe("actor");
3724
+ expect25(err.code).toBe("duplicate_key");
3590
3725
  }
3591
3726
  const count = await counter.increment(0);
3592
- expect23(count).toBe(5);
3727
+ expect25(count).toBe(5);
3593
3728
  });
3594
3729
  });
3595
- describe24("Connection Options", () => {
3596
- test23("get without create prevents actor creation", async (c) => {
3730
+ describe26("Connection Options", () => {
3731
+ test25("get without create prevents actor creation", async (c) => {
3597
3732
  const { client } = await setupDriverTest(c, driverTestConfig);
3598
3733
  const nonexistentId = `nonexistent-${crypto.randomUUID()}`;
3599
3734
  try {
3600
3735
  await client.counter.get([nonexistentId]).resolve();
3601
- expect23.fail("did not error for get");
3736
+ expect25.fail("did not error for get");
3602
3737
  } catch (err) {
3603
- expect23(err.group).toBe("actor");
3604
- expect23(err.code).toBe("not_found");
3738
+ expect25(err.group).toBe("actor");
3739
+ expect25(err.code).toBe("not_found");
3605
3740
  }
3606
3741
  const createdCounter = client.counter.getOrCreate(nonexistentId);
3607
3742
  await createdCounter.increment(3);
3608
3743
  const retrievedCounter = client.counter.get(nonexistentId);
3609
3744
  const count = await retrievedCounter.increment(0);
3610
- expect23(count).toBe(3);
3745
+ expect25(count).toBe(3);
3611
3746
  });
3612
- test23("connection params are passed to actors", async (c) => {
3747
+ test25("connection params are passed to actors", async (c) => {
3613
3748
  const { client } = await setupDriverTest(c, driverTestConfig);
3614
3749
  const counter = client.counter.getOrCreate(void 0, {
3615
3750
  params: {
@@ -3620,20 +3755,20 @@ function runManagerDriverTests(driverTestConfig) {
3620
3755
  });
3621
3756
  await counter.increment(1);
3622
3757
  const count = await counter.increment(0);
3623
- expect23(count).toBe(1);
3758
+ expect25(count).toBe(1);
3624
3759
  });
3625
3760
  });
3626
- describe24("Actor Creation & Retrieval", () => {
3627
- test23("creates and retrieves actors by ID", async (c) => {
3761
+ describe26("Actor Creation & Retrieval", () => {
3762
+ test25("creates and retrieves actors by ID", async (c) => {
3628
3763
  const { client } = await setupDriverTest(c, driverTestConfig);
3629
3764
  const uniqueId = `test-counter-${crypto.randomUUID()}`;
3630
3765
  const counter = client.counter.getOrCreate([uniqueId]);
3631
3766
  await counter.increment(10);
3632
3767
  const retrievedCounter = client.counter.getOrCreate([uniqueId]);
3633
3768
  const count = await retrievedCounter.increment(0);
3634
- expect23(count).toBe(10);
3769
+ expect25(count).toBe(10);
3635
3770
  });
3636
- test23("passes input to actor during creation", async (c) => {
3771
+ test25("passes input to actor during creation", async (c) => {
3637
3772
  const { client } = await setupDriverTest(c, driverTestConfig);
3638
3773
  const testInput = {
3639
3774
  name: "test-actor",
@@ -3644,17 +3779,17 @@ function runManagerDriverTests(driverTestConfig) {
3644
3779
  input: testInput
3645
3780
  });
3646
3781
  const inputs = await actor.getInputs();
3647
- expect23(inputs.initialInput).toEqual(testInput);
3648
- expect23(inputs.onCreateInput).toEqual(testInput);
3782
+ expect25(inputs.initialInput).toEqual(testInput);
3783
+ expect25(inputs.onCreateInput).toEqual(testInput);
3649
3784
  });
3650
- test23("input is undefined when not provided", async (c) => {
3785
+ test25("input is undefined when not provided", async (c) => {
3651
3786
  const { client } = await setupDriverTest(c, driverTestConfig);
3652
3787
  const actor = await client.inputActor.create();
3653
3788
  const inputs = await actor.getInputs();
3654
- expect23(inputs.initialInput).toBeUndefined();
3655
- expect23(inputs.onCreateInput).toBeUndefined();
3789
+ expect25(inputs.initialInput).toBeUndefined();
3790
+ expect25(inputs.onCreateInput).toBeUndefined();
3656
3791
  });
3657
- test23("getOrCreate passes input to actor during creation", async (c) => {
3792
+ test25("getOrCreate passes input to actor during creation", async (c) => {
3658
3793
  const { client } = await setupDriverTest(c, driverTestConfig);
3659
3794
  const uniqueKey = [`input-test-${crypto.randomUUID()}`];
3660
3795
  const testInput = {
@@ -3666,22 +3801,22 @@ function runManagerDriverTests(driverTestConfig) {
3666
3801
  createWithInput: testInput
3667
3802
  });
3668
3803
  const inputs = await actor.getInputs();
3669
- expect23(inputs.initialInput).toEqual(testInput);
3670
- expect23(inputs.onCreateInput).toEqual(testInput);
3804
+ expect25(inputs.initialInput).toEqual(testInput);
3805
+ expect25(inputs.onCreateInput).toEqual(testInput);
3671
3806
  const existingActor = client.inputActor.getOrCreate(uniqueKey);
3672
3807
  const existingInputs = await existingActor.getInputs();
3673
- expect23(existingInputs.initialInput).toEqual(testInput);
3674
- expect23(existingInputs.onCreateInput).toEqual(testInput);
3808
+ expect25(existingInputs.initialInput).toEqual(testInput);
3809
+ expect25(existingInputs.onCreateInput).toEqual(testInput);
3675
3810
  });
3676
3811
  });
3677
- describe24("Key Matching", () => {
3678
- test23("multi-part actor keys are passed through correctly", async (c) => {
3812
+ describe26("Key Matching", () => {
3813
+ test25("multi-part actor keys are passed through correctly", async (c) => {
3679
3814
  const { client } = await setupDriverTest(c, driverTestConfig);
3680
3815
  const multiPartKey = ["tenant/with/slash", "room"];
3681
3816
  const counter = client.counter.getOrCreate(multiPartKey);
3682
- expect23(await counter.getKey()).toEqual(multiPartKey);
3817
+ expect25(await counter.getKey()).toEqual(multiPartKey);
3683
3818
  });
3684
- test23("matches actors only with exactly the same keys", async (c) => {
3819
+ test25("matches actors only with exactly the same keys", async (c) => {
3685
3820
  const { client } = await setupDriverTest(c, driverTestConfig);
3686
3821
  const originalCounter = client.counter.getOrCreate([
3687
3822
  "counter-match",
@@ -3695,20 +3830,20 @@ function runManagerDriverTests(driverTestConfig) {
3695
3830
  "us-east"
3696
3831
  ]);
3697
3832
  const exactMatchCount = await exactMatchCounter.increment(0);
3698
- expect23(exactMatchCount).toBe(10);
3833
+ expect25(exactMatchCount).toBe(10);
3699
3834
  const subsetMatchCounter = client.counter.getOrCreate([
3700
3835
  "counter-match",
3701
3836
  "test"
3702
3837
  ]);
3703
3838
  const subsetMatchCount = await subsetMatchCounter.increment(0);
3704
- expect23(subsetMatchCount).toBe(0);
3839
+ expect25(subsetMatchCount).toBe(0);
3705
3840
  const singleKeyCounter = client.counter.getOrCreate([
3706
3841
  "counter-match"
3707
3842
  ]);
3708
3843
  const singleKeyCount = await singleKeyCounter.increment(0);
3709
- expect23(singleKeyCount).toBe(0);
3844
+ expect25(singleKeyCount).toBe(0);
3710
3845
  });
3711
- test23("string key matches array with single string key", async (c) => {
3846
+ test25("string key matches array with single string key", async (c) => {
3712
3847
  const { client } = await setupDriverTest(c, driverTestConfig);
3713
3848
  const stringKeyCounter = client.counter.getOrCreate("string-key-test");
3714
3849
  await stringKeyCounter.increment(7);
@@ -3716,20 +3851,20 @@ function runManagerDriverTests(driverTestConfig) {
3716
3851
  "string-key-test"
3717
3852
  ]);
3718
3853
  const count = await arrayKeyCounter.increment(0);
3719
- expect23(count).toBe(7);
3854
+ expect25(count).toBe(7);
3720
3855
  });
3721
- test23("undefined key matches empty array key and no key", async (c) => {
3856
+ test25("undefined key matches empty array key and no key", async (c) => {
3722
3857
  const { client } = await setupDriverTest(c, driverTestConfig);
3723
3858
  const undefinedKeyCounter = client.counter.getOrCreate(void 0);
3724
3859
  await undefinedKeyCounter.increment(12);
3725
3860
  const emptyArrayKeyCounter = client.counter.getOrCreate([]);
3726
3861
  const emptyArrayCount = await emptyArrayKeyCounter.increment(0);
3727
- expect23(emptyArrayCount).toBe(12);
3862
+ expect25(emptyArrayCount).toBe(12);
3728
3863
  const noKeyCounter = client.counter.getOrCreate();
3729
3864
  const noKeyCount = await noKeyCounter.increment(0);
3730
- expect23(noKeyCount).toBe(12);
3865
+ expect25(noKeyCount).toBe(12);
3731
3866
  });
3732
- test23("no keys does not match actors with keys", async (c) => {
3867
+ test25("no keys does not match actors with keys", async (c) => {
3733
3868
  const { client } = await setupDriverTest(c, driverTestConfig);
3734
3869
  const keyedCounter = client.counter.getOrCreate([
3735
3870
  "counter-with-keys",
@@ -3738,9 +3873,9 @@ function runManagerDriverTests(driverTestConfig) {
3738
3873
  await keyedCounter.increment(15);
3739
3874
  const noKeysCounter = client.counter.getOrCreate();
3740
3875
  const count = await noKeysCounter.increment(10);
3741
- expect23(count).toBe(10);
3876
+ expect25(count).toBe(10);
3742
3877
  });
3743
- test23("actors with keys match actors with no keys", async (c) => {
3878
+ test25("actors with keys match actors with no keys", async (c) => {
3744
3879
  const { client } = await setupDriverTest(c, driverTestConfig);
3745
3880
  const noKeysCounter = client.counter.getOrCreate();
3746
3881
  await noKeysCounter.increment(25);
@@ -3749,11 +3884,11 @@ function runManagerDriverTests(driverTestConfig) {
3749
3884
  "prod"
3750
3885
  ]);
3751
3886
  const keyedCount = await keyedCounter.increment(0);
3752
- expect23(keyedCount).toBe(0);
3887
+ expect25(keyedCount).toBe(0);
3753
3888
  });
3754
3889
  });
3755
- describe24("Multiple Actor Instances", () => {
3756
- test23("creates multiple actor instances of the same type", async (c) => {
3890
+ describe26("Multiple Actor Instances", () => {
3891
+ test25("creates multiple actor instances of the same type", async (c) => {
3757
3892
  const { client } = await setupDriverTest(c, driverTestConfig);
3758
3893
  const instance1 = client.counter.getOrCreate(["multi-1"]);
3759
3894
  const instance2 = client.counter.getOrCreate(["multi-2"]);
@@ -3764,35 +3899,35 @@ function runManagerDriverTests(driverTestConfig) {
3764
3899
  const retrieved1 = client.counter.getOrCreate(["multi-1"]);
3765
3900
  const retrieved2 = client.counter.getOrCreate(["multi-2"]);
3766
3901
  const retrieved3 = client.counter.getOrCreate(["multi-3"]);
3767
- expect23(await retrieved1.increment(0)).toBe(1);
3768
- expect23(await retrieved2.increment(0)).toBe(2);
3769
- expect23(await retrieved3.increment(0)).toBe(3);
3902
+ expect25(await retrieved1.increment(0)).toBe(1);
3903
+ expect25(await retrieved2.increment(0)).toBe(2);
3904
+ expect25(await retrieved3.increment(0)).toBe(3);
3770
3905
  });
3771
- test23("handles default instance with no explicit ID", async (c) => {
3906
+ test25("handles default instance with no explicit ID", async (c) => {
3772
3907
  const { client } = await setupDriverTest(c, driverTestConfig);
3773
3908
  const defaultCounter = client.counter.getOrCreate();
3774
3909
  await defaultCounter.increment(5);
3775
3910
  const sameDefaultCounter = client.counter.getOrCreate();
3776
3911
  const count = await sameDefaultCounter.increment(0);
3777
- expect23(count).toBe(5);
3912
+ expect25(count).toBe(5);
3778
3913
  });
3779
3914
  });
3780
3915
  });
3781
3916
  }
3782
3917
 
3783
3918
  // src/driver-test-suite/tests/raw-http.ts
3784
- import { describe as describe25, expect as expect24, test as test24 } from "vitest";
3919
+ import { describe as describe27, expect as expect26, test as test26 } from "vitest";
3785
3920
  function runRawHttpTests(driverTestConfig) {
3786
- describe25("raw http", () => {
3787
- test24("should handle raw HTTP GET requests", async (c) => {
3921
+ describe27("raw http", () => {
3922
+ test26("should handle raw HTTP GET requests", async (c) => {
3788
3923
  const { client } = await setupDriverTest(c, driverTestConfig);
3789
3924
  const actor = client.rawHttpActor.getOrCreate(["test"]);
3790
3925
  const helloResponse = await actor.fetch("api/hello");
3791
- expect24(helloResponse.ok).toBe(true);
3926
+ expect26(helloResponse.ok).toBe(true);
3792
3927
  const helloData = await helloResponse.json();
3793
- expect24(helloData).toEqual({ message: "Hello from actor!" });
3928
+ expect26(helloData).toEqual({ message: "Hello from actor!" });
3794
3929
  });
3795
- test24("should handle raw HTTP POST requests with echo", async (c) => {
3930
+ test26("should handle raw HTTP POST requests with echo", async (c) => {
3796
3931
  const { client } = await setupDriverTest(c, driverTestConfig);
3797
3932
  const actor = client.rawHttpActor.getOrCreate(["test"]);
3798
3933
  const testData = { test: "data", number: 123 };
@@ -3803,22 +3938,22 @@ function runRawHttpTests(driverTestConfig) {
3803
3938
  },
3804
3939
  body: JSON.stringify(testData)
3805
3940
  });
3806
- expect24(echoResponse.ok).toBe(true);
3941
+ expect26(echoResponse.ok).toBe(true);
3807
3942
  const echoData = await echoResponse.json();
3808
- expect24(echoData).toEqual(testData);
3943
+ expect26(echoData).toEqual(testData);
3809
3944
  });
3810
- test24("should track state across raw HTTP requests", async (c) => {
3945
+ test26("should track state across raw HTTP requests", async (c) => {
3811
3946
  const { client } = await setupDriverTest(c, driverTestConfig);
3812
3947
  const actor = client.rawHttpActor.getOrCreate(["state-test"]);
3813
3948
  await actor.fetch("api/hello");
3814
3949
  await actor.fetch("api/hello");
3815
3950
  await actor.fetch("api/state");
3816
3951
  const stateResponse = await actor.fetch("api/state");
3817
- expect24(stateResponse.ok).toBe(true);
3952
+ expect26(stateResponse.ok).toBe(true);
3818
3953
  const stateData = await stateResponse.json();
3819
- expect24(stateData.requestCount).toBe(4);
3954
+ expect26(stateData.requestCount).toBe(4);
3820
3955
  });
3821
- test24("should pass headers correctly", async (c) => {
3956
+ test26("should pass headers correctly", async (c) => {
3822
3957
  const { client } = await setupDriverTest(c, driverTestConfig);
3823
3958
  const actor = client.rawHttpActor.getOrCreate(["headers-test"]);
3824
3959
  const customHeaders = {
@@ -3828,44 +3963,44 @@ function runRawHttpTests(driverTestConfig) {
3828
3963
  const response = await actor.fetch("api/headers", {
3829
3964
  headers: customHeaders
3830
3965
  });
3831
- expect24(response.ok).toBe(true);
3966
+ expect26(response.ok).toBe(true);
3832
3967
  const headers = await response.json();
3833
- expect24(headers["x-custom-header"]).toBe("test-value");
3834
- expect24(headers["x-another-header"]).toBe("another-value");
3968
+ expect26(headers["x-custom-header"]).toBe("test-value");
3969
+ expect26(headers["x-another-header"]).toBe("another-value");
3835
3970
  });
3836
- test24("should return 404 for unhandled paths", async (c) => {
3971
+ test26("should return 404 for unhandled paths", async (c) => {
3837
3972
  const { client } = await setupDriverTest(c, driverTestConfig);
3838
3973
  const actor = client.rawHttpActor.getOrCreate(["404-test"]);
3839
3974
  const response = await actor.fetch("api/nonexistent");
3840
- expect24(response.ok).toBe(false);
3841
- expect24(response.status).toBe(404);
3975
+ expect26(response.ok).toBe(false);
3976
+ expect26(response.status).toBe(404);
3842
3977
  });
3843
- test24("should return 404 when no onRequest handler defined", async (c) => {
3978
+ test26("should return 404 when no onRequest handler defined", async (c) => {
3844
3979
  const { client } = await setupDriverTest(c, driverTestConfig);
3845
3980
  const actor = client.rawHttpNoHandlerActor.getOrCreate([
3846
3981
  "no-handler"
3847
3982
  ]);
3848
3983
  const response = await actor.fetch("api/anything");
3849
- expect24(response.ok).toBe(false);
3850
- expect24(response.status).toBe(404);
3984
+ expect26(response.ok).toBe(false);
3985
+ expect26(response.status).toBe(404);
3851
3986
  });
3852
- test24("should return 500 error when onRequest returns void", async (c) => {
3987
+ test26("should return 500 error when onRequest returns void", async (c) => {
3853
3988
  const { client } = await setupDriverTest(c, driverTestConfig);
3854
3989
  const actor = client.rawHttpVoidReturnActor.getOrCreate([
3855
3990
  "void-return"
3856
3991
  ]);
3857
3992
  const response = await actor.fetch("api/anything");
3858
- expect24(response.ok).toBe(false);
3859
- expect24(response.status).toBe(500);
3993
+ expect26(response.ok).toBe(false);
3994
+ expect26(response.status).toBe(500);
3860
3995
  try {
3861
3996
  const errorData = await response.json();
3862
- expect24(errorData.message).toContain(
3997
+ expect26(errorData.message).toContain(
3863
3998
  "onRequest handler must return a Response"
3864
3999
  );
3865
4000
  } catch {
3866
4001
  }
3867
4002
  });
3868
- test24("should handle different HTTP methods", async (c) => {
4003
+ test26("should handle different HTTP methods", async (c) => {
3869
4004
  const { client } = await setupDriverTest(c, driverTestConfig);
3870
4005
  const actor = client.rawHttpActor.getOrCreate(["methods-test"]);
3871
4006
  const methods = ["GET", "POST", "PUT", "DELETE", "PATCH"];
@@ -3875,17 +4010,17 @@ function runRawHttpTests(driverTestConfig) {
3875
4010
  body: ["POST", "PUT", "PATCH"].includes(method) ? JSON.stringify({ method }) : void 0
3876
4011
  });
3877
4012
  if (method === "POST") {
3878
- expect24(response.ok).toBe(true);
4013
+ expect26(response.ok).toBe(true);
3879
4014
  const data = await response.json();
3880
- expect24(data).toEqual({ method });
4015
+ expect26(data).toEqual({ method });
3881
4016
  } else if (method === "GET") {
3882
- expect24(response.status).toBe(404);
4017
+ expect26(response.status).toBe(404);
3883
4018
  } else {
3884
- expect24(response.status).toBe(404);
4019
+ expect26(response.status).toBe(404);
3885
4020
  }
3886
4021
  }
3887
4022
  });
3888
- test24("should handle binary data", async (c) => {
4023
+ test26("should handle binary data", async (c) => {
3889
4024
  const { client } = await setupDriverTest(c, driverTestConfig);
3890
4025
  const actor = client.rawHttpActor.getOrCreate(["binary-test"]);
3891
4026
  const binaryData = new Uint8Array([1, 2, 3, 4, 5]);
@@ -3896,82 +4031,82 @@ function runRawHttpTests(driverTestConfig) {
3896
4031
  },
3897
4032
  body: binaryData
3898
4033
  });
3899
- expect24(response.ok).toBe(true);
4034
+ expect26(response.ok).toBe(true);
3900
4035
  const responseBuffer = await response.arrayBuffer();
3901
4036
  const responseArray = new Uint8Array(responseBuffer);
3902
- expect24(Array.from(responseArray)).toEqual([1, 2, 3, 4, 5]);
4037
+ expect26(Array.from(responseArray)).toEqual([1, 2, 3, 4, 5]);
3903
4038
  });
3904
- test24("should work with Hono router using createVars", async (c) => {
4039
+ test26("should work with Hono router using createVars", async (c) => {
3905
4040
  const { client } = await setupDriverTest(c, driverTestConfig);
3906
4041
  const actor = client.rawHttpHonoActor.getOrCreate(["hono-test"]);
3907
4042
  const rootResponse = await actor.fetch("/");
3908
- expect24(rootResponse.ok).toBe(true);
4043
+ expect26(rootResponse.ok).toBe(true);
3909
4044
  const rootData = await rootResponse.json();
3910
- expect24(rootData).toEqual({ message: "Welcome to Hono actor!" });
4045
+ expect26(rootData).toEqual({ message: "Welcome to Hono actor!" });
3911
4046
  const usersResponse = await actor.fetch("/users");
3912
- expect24(usersResponse.ok).toBe(true);
4047
+ expect26(usersResponse.ok).toBe(true);
3913
4048
  const users = await usersResponse.json();
3914
- expect24(users).toEqual([
4049
+ expect26(users).toEqual([
3915
4050
  { id: 1, name: "Alice" },
3916
4051
  { id: 2, name: "Bob" }
3917
4052
  ]);
3918
4053
  const userResponse = await actor.fetch("/users/1");
3919
- expect24(userResponse.ok).toBe(true);
4054
+ expect26(userResponse.ok).toBe(true);
3920
4055
  const user = await userResponse.json();
3921
- expect24(user).toEqual({ id: 1, name: "Alice" });
4056
+ expect26(user).toEqual({ id: 1, name: "Alice" });
3922
4057
  const newUser = { name: "Charlie" };
3923
4058
  const createResponse = await actor.fetch("/users", {
3924
4059
  method: "POST",
3925
4060
  headers: { "Content-Type": "application/json" },
3926
4061
  body: JSON.stringify(newUser)
3927
4062
  });
3928
- expect24(createResponse.ok).toBe(true);
3929
- expect24(createResponse.status).toBe(201);
4063
+ expect26(createResponse.ok).toBe(true);
4064
+ expect26(createResponse.status).toBe(201);
3930
4065
  const createdUser = await createResponse.json();
3931
- expect24(createdUser).toEqual({ id: 3, name: "Charlie" });
4066
+ expect26(createdUser).toEqual({ id: 3, name: "Charlie" });
3932
4067
  const updateData = { name: "Alice Updated" };
3933
4068
  const updateResponse = await actor.fetch("/users/1", {
3934
4069
  method: "PUT",
3935
4070
  headers: { "Content-Type": "application/json" },
3936
4071
  body: JSON.stringify(updateData)
3937
4072
  });
3938
- expect24(updateResponse.ok).toBe(true);
4073
+ expect26(updateResponse.ok).toBe(true);
3939
4074
  const updatedUser = await updateResponse.json();
3940
- expect24(updatedUser).toEqual({ id: 1, name: "Alice Updated" });
4075
+ expect26(updatedUser).toEqual({ id: 1, name: "Alice Updated" });
3941
4076
  const deleteResponse = await actor.fetch("/users/2", {
3942
4077
  method: "DELETE"
3943
4078
  });
3944
- expect24(deleteResponse.ok).toBe(true);
4079
+ expect26(deleteResponse.ok).toBe(true);
3945
4080
  const deleteResult = await deleteResponse.json();
3946
- expect24(deleteResult).toEqual({ message: "User 2 deleted" });
4081
+ expect26(deleteResult).toEqual({ message: "User 2 deleted" });
3947
4082
  const notFoundResponse = await actor.fetch("/api/unknown");
3948
- expect24(notFoundResponse.ok).toBe(false);
3949
- expect24(notFoundResponse.status).toBe(404);
4083
+ expect26(notFoundResponse.ok).toBe(false);
4084
+ expect26(notFoundResponse.status).toBe(404);
3950
4085
  });
3951
- test24("should handle paths with and without leading slashes", async (c) => {
4086
+ test26("should handle paths with and without leading slashes", async (c) => {
3952
4087
  const { client } = await setupDriverTest(c, driverTestConfig);
3953
4088
  const actor = client.rawHttpActor.getOrCreate(["path-test"]);
3954
4089
  const responseWithoutSlash = await actor.fetch("api/hello");
3955
- expect24(responseWithoutSlash.ok).toBe(true);
4090
+ expect26(responseWithoutSlash.ok).toBe(true);
3956
4091
  const dataWithoutSlash = await responseWithoutSlash.json();
3957
- expect24(dataWithoutSlash).toEqual({ message: "Hello from actor!" });
4092
+ expect26(dataWithoutSlash).toEqual({ message: "Hello from actor!" });
3958
4093
  const responseWithSlash = await actor.fetch("/api/hello");
3959
- expect24(responseWithSlash.ok).toBe(true);
4094
+ expect26(responseWithSlash.ok).toBe(true);
3960
4095
  const dataWithSlash = await responseWithSlash.json();
3961
- expect24(dataWithSlash).toEqual({ message: "Hello from actor!" });
4096
+ expect26(dataWithSlash).toEqual({ message: "Hello from actor!" });
3962
4097
  });
3963
- test24("should not create double slashes in request URLs", async (c) => {
4098
+ test26("should not create double slashes in request URLs", async (c) => {
3964
4099
  const { client } = await setupDriverTest(c, driverTestConfig);
3965
4100
  const actor = client.rawHttpHonoActor.getOrCreate(["url-test"]);
3966
4101
  const response = await actor.fetch("/users");
3967
- expect24(response.ok).toBe(true);
4102
+ expect26(response.ok).toBe(true);
3968
4103
  const data = await response.json();
3969
- expect24(data).toEqual([
4104
+ expect26(data).toEqual([
3970
4105
  { id: 1, name: "Alice" },
3971
4106
  { id: 2, name: "Bob" }
3972
4107
  ]);
3973
4108
  });
3974
- test24("should handle forwarded requests correctly without double slashes", async (c) => {
4109
+ test26("should handle forwarded requests correctly without double slashes", async (c) => {
3975
4110
  const { client } = await setupDriverTest(c, driverTestConfig);
3976
4111
  const actor = client.rawHttpHonoActor.getOrCreate(["forward-test"]);
3977
4112
  const truncatedPath = "/users";
@@ -3983,14 +4118,14 @@ function runRawHttpTests(driverTestConfig) {
3983
4118
  truncatedPath,
3984
4119
  newRequest
3985
4120
  );
3986
- expect24(response.ok).toBe(true);
4121
+ expect26(response.ok).toBe(true);
3987
4122
  const users = await response.json();
3988
- expect24(users).toEqual([
4123
+ expect26(users).toEqual([
3989
4124
  { id: 1, name: "Alice" },
3990
4125
  { id: 2, name: "Bob" }
3991
4126
  ]);
3992
4127
  });
3993
- test24("example fix: should properly forward requests using just Request object", async (c) => {
4128
+ test26("example fix: should properly forward requests using just Request object", async (c) => {
3994
4129
  const { client } = await setupDriverTest(c, driverTestConfig);
3995
4130
  const actor = client.rawHttpHonoActor.getOrCreate(["forward-fix"]);
3996
4131
  const truncatedPath = "/users/1";
@@ -3999,11 +4134,11 @@ function runRawHttpTests(driverTestConfig) {
3999
4134
  method: "GET"
4000
4135
  });
4001
4136
  const response = await actor.fetch(newRequest);
4002
- expect24(response.ok).toBe(true);
4137
+ expect26(response.ok).toBe(true);
4003
4138
  const user = await response.json();
4004
- expect24(user).toEqual({ id: 1, name: "Alice" });
4139
+ expect26(user).toEqual({ id: 1, name: "Alice" });
4005
4140
  });
4006
- test24("should support standard fetch API with URL and Request objects", async (c) => {
4141
+ test26("should support standard fetch API with URL and Request objects", async (c) => {
4007
4142
  const { client } = await setupDriverTest(c, driverTestConfig);
4008
4143
  const actor = client.rawHttpActor.getOrCreate(["fetch-api-test"]);
4009
4144
  const url = new URL("/api/echo", "http://example.com");
@@ -4012,18 +4147,18 @@ function runRawHttpTests(driverTestConfig) {
4012
4147
  headers: { "Content-Type": "application/json" },
4013
4148
  body: JSON.stringify({ from: "URL object" })
4014
4149
  });
4015
- expect24(urlResponse.ok).toBe(true);
4150
+ expect26(urlResponse.ok).toBe(true);
4016
4151
  const urlData = await urlResponse.json();
4017
- expect24(urlData).toEqual({ from: "URL object" });
4152
+ expect26(urlData).toEqual({ from: "URL object" });
4018
4153
  const request = new Request("http://example.com/api/echo", {
4019
4154
  method: "POST",
4020
4155
  headers: { "Content-Type": "application/json" },
4021
4156
  body: JSON.stringify({ from: "Request object" })
4022
4157
  });
4023
4158
  const requestResponse = await actor.fetch(request);
4024
- expect24(requestResponse.ok).toBe(true);
4159
+ expect26(requestResponse.ok).toBe(true);
4025
4160
  const requestData = await requestResponse.json();
4026
- expect24(requestData).toEqual({ from: "Request object" });
4161
+ expect26(requestData).toEqual({ from: "Request object" });
4027
4162
  const request2 = new Request("http://example.com/api/headers", {
4028
4163
  method: "GET",
4029
4164
  headers: { "X-Original": "request-header" }
@@ -4031,19 +4166,19 @@ function runRawHttpTests(driverTestConfig) {
4031
4166
  const overrideResponse = await actor.fetch(request2, {
4032
4167
  headers: { "X-Override": "init-header" }
4033
4168
  });
4034
- expect24(overrideResponse.ok).toBe(true);
4169
+ expect26(overrideResponse.ok).toBe(true);
4035
4170
  const headers = await overrideResponse.json();
4036
- expect24(headers["x-override"]).toBe("init-header");
4037
- expect24(headers["x-original"]).toBe("request-header");
4171
+ expect26(headers["x-override"]).toBe("init-header");
4172
+ expect26(headers["x-original"]).toBe("request-header");
4038
4173
  });
4039
4174
  });
4040
4175
  }
4041
4176
 
4042
4177
  // src/driver-test-suite/tests/raw-http-request-properties.ts
4043
- import { describe as describe26, expect as expect25, test as test25 } from "vitest";
4178
+ import { describe as describe28, expect as expect27, test as test27 } from "vitest";
4044
4179
  function runRawHttpRequestPropertiesTests(driverTestConfig) {
4045
- describe26("raw http request properties", () => {
4046
- test25("should pass all Request properties correctly to onRequest", async (c) => {
4180
+ describe28("raw http request properties", () => {
4181
+ test27("should pass all Request properties correctly to onRequest", async (c) => {
4047
4182
  const { client } = await setupDriverTest(c, driverTestConfig);
4048
4183
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4049
4184
  "test"
@@ -4057,22 +4192,22 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4057
4192
  },
4058
4193
  body: JSON.stringify({ test: "data" })
4059
4194
  });
4060
- expect25(response.ok).toBe(true);
4195
+ expect27(response.ok).toBe(true);
4061
4196
  const data = await response.json();
4062
- expect25(data.url).toContain("/test/path?foo=bar&baz=qux");
4063
- expect25(data.pathname).toBe("/test/path");
4064
- expect25(data.search).toBe("?foo=bar&baz=qux");
4065
- expect25(data.searchParams).toEqual({
4197
+ expect27(data.url).toContain("/test/path?foo=bar&baz=qux");
4198
+ expect27(data.pathname).toBe("/test/path");
4199
+ expect27(data.search).toBe("?foo=bar&baz=qux");
4200
+ expect27(data.searchParams).toEqual({
4066
4201
  foo: "bar",
4067
4202
  baz: "qux"
4068
4203
  });
4069
- expect25(data.method).toBe("POST");
4070
- expect25(data.headers["content-type"]).toBe("application/json");
4071
- expect25(data.headers["x-custom-header"]).toBe("custom-value");
4072
- expect25(data.headers["authorization"]).toBe("Bearer test-token");
4073
- expect25(data.body).toEqual({ test: "data" });
4204
+ expect27(data.method).toBe("POST");
4205
+ expect27(data.headers["content-type"]).toBe("application/json");
4206
+ expect27(data.headers["x-custom-header"]).toBe("custom-value");
4207
+ expect27(data.headers["authorization"]).toBe("Bearer test-token");
4208
+ expect27(data.body).toEqual({ test: "data" });
4074
4209
  });
4075
- test25("should handle GET requests with no body", async (c) => {
4210
+ test27("should handle GET requests with no body", async (c) => {
4076
4211
  const { client } = await setupDriverTest(c, driverTestConfig);
4077
4212
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4078
4213
  "test"
@@ -4080,12 +4215,12 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4080
4215
  const response = await actor.fetch("test/get", {
4081
4216
  method: "GET"
4082
4217
  });
4083
- expect25(response.ok).toBe(true);
4218
+ expect27(response.ok).toBe(true);
4084
4219
  const data = await response.json();
4085
- expect25(data.method).toBe("GET");
4086
- expect25(data.body).toBeNull();
4220
+ expect27(data.method).toBe("GET");
4221
+ expect27(data.body).toBeNull();
4087
4222
  });
4088
- test25("should handle different content types", async (c) => {
4223
+ test27("should handle different content types", async (c) => {
4089
4224
  const { client } = await setupDriverTest(c, driverTestConfig);
4090
4225
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4091
4226
  "test"
@@ -4100,12 +4235,12 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4100
4235
  },
4101
4236
  body: formData.toString()
4102
4237
  });
4103
- expect25(formResponse.ok).toBe(true);
4238
+ expect27(formResponse.ok).toBe(true);
4104
4239
  const formResult = await formResponse.json();
4105
- expect25(formResult.headers["content-type"]).toBe(
4240
+ expect27(formResult.headers["content-type"]).toBe(
4106
4241
  "application/x-www-form-urlencoded"
4107
4242
  );
4108
- expect25(formResult.bodyText).toBe("field1=value1&field2=value2");
4243
+ expect27(formResult.bodyText).toBe("field1=value1&field2=value2");
4109
4244
  const textResponse = await actor.fetch("test/text", {
4110
4245
  method: "POST",
4111
4246
  headers: {
@@ -4113,12 +4248,12 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4113
4248
  },
4114
4249
  body: "Hello, World!"
4115
4250
  });
4116
- expect25(textResponse.ok).toBe(true);
4251
+ expect27(textResponse.ok).toBe(true);
4117
4252
  const textResult = await textResponse.json();
4118
- expect25(textResult.headers["content-type"]).toBe("text/plain");
4119
- expect25(textResult.bodyText).toBe("Hello, World!");
4253
+ expect27(textResult.headers["content-type"]).toBe("text/plain");
4254
+ expect27(textResult.bodyText).toBe("Hello, World!");
4120
4255
  });
4121
- test25("should preserve all header casing and values", async (c) => {
4256
+ test27("should preserve all header casing and values", async (c) => {
4122
4257
  const { client } = await setupDriverTest(c, driverTestConfig);
4123
4258
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4124
4259
  "test"
@@ -4132,38 +4267,38 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4132
4267
  "X-Request-ID": "12345"
4133
4268
  }
4134
4269
  });
4135
- expect25(response.ok).toBe(true);
4270
+ expect27(response.ok).toBe(true);
4136
4271
  const data = await response.json();
4137
- expect25(data.headers["accept"]).toBe("application/json");
4138
- expect25(data.headers["accept-language"]).toBe("en-US,en;q=0.9");
4139
- expect25(data.headers["cache-control"]).toBe("no-cache");
4140
- expect25(data.headers["user-agent"]).toBeTruthy();
4141
- expect25(data.headers["x-request-id"]).toBe("12345");
4272
+ expect27(data.headers["accept"]).toBe("application/json");
4273
+ expect27(data.headers["accept-language"]).toBe("en-US,en;q=0.9");
4274
+ expect27(data.headers["cache-control"]).toBe("no-cache");
4275
+ expect27(data.headers["user-agent"]).toBeTruthy();
4276
+ expect27(data.headers["x-request-id"]).toBe("12345");
4142
4277
  });
4143
- test25("should handle empty and special URL paths", async (c) => {
4278
+ test27("should handle empty and special URL paths", async (c) => {
4144
4279
  const { client } = await setupDriverTest(c, driverTestConfig);
4145
4280
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4146
4281
  "test"
4147
4282
  ]);
4148
4283
  const rootResponse = await actor.fetch("");
4149
- expect25(rootResponse.ok).toBe(true);
4284
+ expect27(rootResponse.ok).toBe(true);
4150
4285
  const rootData = await rootResponse.json();
4151
- expect25(rootData.pathname).toBe("/");
4286
+ expect27(rootData.pathname).toBe("/");
4152
4287
  const specialResponse = await actor.fetch(
4153
4288
  "test/path%20with%20spaces/and%2Fslashes"
4154
4289
  );
4155
- expect25(specialResponse.ok).toBe(true);
4290
+ expect27(specialResponse.ok).toBe(true);
4156
4291
  const specialData = await specialResponse.json();
4157
- expect25(specialData.pathname).toMatch(
4292
+ expect27(specialData.pathname).toMatch(
4158
4293
  /path.*with.*spaces.*and.*slashes/
4159
4294
  );
4160
4295
  const fragmentResponse = await actor.fetch("test/path#fragment");
4161
- expect25(fragmentResponse.ok).toBe(true);
4296
+ expect27(fragmentResponse.ok).toBe(true);
4162
4297
  const fragmentData = await fragmentResponse.json();
4163
- expect25(fragmentData.pathname).toBe("/test/path");
4164
- expect25(fragmentData.hash).toBe("");
4298
+ expect27(fragmentData.pathname).toBe("/test/path");
4299
+ expect27(fragmentData.hash).toBe("");
4165
4300
  });
4166
- test25("should handle request properties for all HTTP methods", async (c) => {
4301
+ test27("should handle request properties for all HTTP methods", async (c) => {
4167
4302
  const { client } = await setupDriverTest(c, driverTestConfig);
4168
4303
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4169
4304
  "test"
@@ -4187,21 +4322,21 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4187
4322
  }
4188
4323
  );
4189
4324
  if (method === "HEAD") {
4190
- expect25(response.status).toBe(200);
4325
+ expect27(response.status).toBe(200);
4191
4326
  const text = await response.text();
4192
- expect25(text).toBe("");
4327
+ expect27(text).toBe("");
4193
4328
  } else if (method === "OPTIONS") {
4194
- expect25(response.status).toBe(204);
4329
+ expect27(response.status).toBe(204);
4195
4330
  const text = await response.text();
4196
- expect25(text).toBe("");
4331
+ expect27(text).toBe("");
4197
4332
  } else {
4198
- expect25(response.ok).toBe(true);
4333
+ expect27(response.ok).toBe(true);
4199
4334
  const data = await response.json();
4200
- expect25(data.method).toBe(method);
4335
+ expect27(data.method).toBe(method);
4201
4336
  }
4202
4337
  }
4203
4338
  });
4204
- test25("should handle complex query parameters", async (c) => {
4339
+ test27("should handle complex query parameters", async (c) => {
4205
4340
  const { client } = await setupDriverTest(c, driverTestConfig);
4206
4341
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4207
4342
  "test"
@@ -4209,13 +4344,13 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4209
4344
  const response = await actor.fetch(
4210
4345
  "test?key=value1&key=value2&array[]=1&array[]=2&nested[prop]=val"
4211
4346
  );
4212
- expect25(response.ok).toBe(true);
4347
+ expect27(response.ok).toBe(true);
4213
4348
  const data = await response.json();
4214
- expect25(data.searchParams.key).toBe("value2");
4215
- expect25(data.searchParams["array[]"]).toBe("2");
4216
- expect25(data.searchParams["nested[prop]"]).toBe("val");
4349
+ expect27(data.searchParams.key).toBe("value2");
4350
+ expect27(data.searchParams["array[]"]).toBe("2");
4351
+ expect27(data.searchParams["nested[prop]"]).toBe("val");
4217
4352
  });
4218
- test25("should handle multipart form data", async (c) => {
4353
+ test27("should handle multipart form data", async (c) => {
4219
4354
  const { client } = await setupDriverTest(c, driverTestConfig);
4220
4355
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4221
4356
  "test"
@@ -4239,27 +4374,27 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4239
4374
  },
4240
4375
  body
4241
4376
  });
4242
- expect25(response.ok).toBe(true);
4377
+ expect27(response.ok).toBe(true);
4243
4378
  const data = await response.json();
4244
- expect25(data.headers["content-type"]).toContain(
4379
+ expect27(data.headers["content-type"]).toContain(
4245
4380
  "multipart/form-data"
4246
4381
  );
4247
- expect25(data.bodyText).toContain("field1");
4248
- expect25(data.bodyText).toContain("value1");
4382
+ expect27(data.bodyText).toContain("field1");
4383
+ expect27(data.bodyText).toContain("value1");
4249
4384
  });
4250
- test25("should handle very long URLs", async (c) => {
4385
+ test27("should handle very long URLs", async (c) => {
4251
4386
  const { client } = await setupDriverTest(c, driverTestConfig);
4252
4387
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4253
4388
  "test"
4254
4389
  ]);
4255
4390
  const longValue = "x".repeat(1e3);
4256
4391
  const response = await actor.fetch(`test/long?param=${longValue}`);
4257
- expect25(response.ok).toBe(true);
4392
+ expect27(response.ok).toBe(true);
4258
4393
  const data = await response.json();
4259
- expect25(data.searchParams.param).toBe(longValue);
4260
- expect25(data.search.length).toBeGreaterThan(1e3);
4394
+ expect27(data.searchParams.param).toBe(longValue);
4395
+ expect27(data.search.length).toBeGreaterThan(1e3);
4261
4396
  });
4262
- test25.skip("should handle large request bodies", async (c) => {
4397
+ test27.skip("should handle large request bodies", async (c) => {
4263
4398
  const { client } = await setupDriverTest(c, driverTestConfig);
4264
4399
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4265
4400
  "test"
@@ -4276,11 +4411,11 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4276
4411
  },
4277
4412
  body: JSON.stringify(largeArray)
4278
4413
  });
4279
- expect25(response.ok).toBe(true);
4414
+ expect27(response.ok).toBe(true);
4280
4415
  const data = await response.json();
4281
- expect25(data.body).toHaveLength(1e4);
4416
+ expect27(data.body).toHaveLength(1e4);
4282
4417
  });
4283
- test25("should handle missing content-type header", async (c) => {
4418
+ test27("should handle missing content-type header", async (c) => {
4284
4419
  const { client } = await setupDriverTest(c, driverTestConfig);
4285
4420
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4286
4421
  "test"
@@ -4289,11 +4424,11 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4289
4424
  method: "POST",
4290
4425
  body: "plain text without content-type"
4291
4426
  });
4292
- expect25(response.ok).toBe(true);
4427
+ expect27(response.ok).toBe(true);
4293
4428
  const data = await response.json();
4294
- expect25(data.bodyText).toBe("plain text without content-type");
4429
+ expect27(data.bodyText).toBe("plain text without content-type");
4295
4430
  });
4296
- test25("should handle empty request body", async (c) => {
4431
+ test27("should handle empty request body", async (c) => {
4297
4432
  const { client } = await setupDriverTest(c, driverTestConfig);
4298
4433
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4299
4434
  "test"
@@ -4305,9 +4440,9 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4305
4440
  },
4306
4441
  body: ""
4307
4442
  });
4308
- expect25(response.ok).toBe(true);
4443
+ expect27(response.ok).toBe(true);
4309
4444
  });
4310
- test25("should handle custom HTTP methods", async (c) => {
4445
+ test27("should handle custom HTTP methods", async (c) => {
4311
4446
  const { client } = await setupDriverTest(c, driverTestConfig);
4312
4447
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4313
4448
  "test"
@@ -4318,12 +4453,12 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4318
4453
  });
4319
4454
  if (response.ok) {
4320
4455
  const data = await response.json();
4321
- expect25(data.method).toBe("CUSTOM");
4456
+ expect27(data.method).toBe("CUSTOM");
4322
4457
  }
4323
4458
  } catch (error) {
4324
4459
  }
4325
4460
  });
4326
- test25("should handle cookies in headers", async (c) => {
4461
+ test27("should handle cookies in headers", async (c) => {
4327
4462
  const { client } = await setupDriverTest(c, driverTestConfig);
4328
4463
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4329
4464
  "test"
@@ -4333,13 +4468,13 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4333
4468
  Cookie: "session=abc123; user=test; preferences=dark_mode"
4334
4469
  }
4335
4470
  });
4336
- expect25(response.ok).toBe(true);
4471
+ expect27(response.ok).toBe(true);
4337
4472
  const data = await response.json();
4338
- expect25(data.headers.cookie).toBe(
4473
+ expect27(data.headers.cookie).toBe(
4339
4474
  "session=abc123; user=test; preferences=dark_mode"
4340
4475
  );
4341
4476
  });
4342
- test25("should handle URL encoding properly", async (c) => {
4477
+ test27("should handle URL encoding properly", async (c) => {
4343
4478
  const { client } = await setupDriverTest(c, driverTestConfig);
4344
4479
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4345
4480
  "test"
@@ -4347,13 +4482,13 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4347
4482
  const response = await actor.fetch(
4348
4483
  "test/encoded?special=%20%21%40%23%24%25%5E%26&unicode=%E2%9C%93&email=test%40example.com"
4349
4484
  );
4350
- expect25(response.ok).toBe(true);
4485
+ expect27(response.ok).toBe(true);
4351
4486
  const data = await response.json();
4352
- expect25(data.searchParams.special).toBe(" !@#$%^&");
4353
- expect25(data.searchParams.unicode).toBe("\u2713");
4354
- expect25(data.searchParams.email).toBe("test@example.com");
4487
+ expect27(data.searchParams.special).toBe(" !@#$%^&");
4488
+ expect27(data.searchParams.unicode).toBe("\u2713");
4489
+ expect27(data.searchParams.email).toBe("test@example.com");
4355
4490
  });
4356
- test25("should handle concurrent requests maintaining separate contexts", async (c) => {
4491
+ test27("should handle concurrent requests maintaining separate contexts", async (c) => {
4357
4492
  const { client } = await setupDriverTest(c, driverTestConfig);
4358
4493
  const actor = client.rawHttpRequestPropertiesActor.getOrCreate([
4359
4494
  "test"
@@ -4377,24 +4512,24 @@ function runRawHttpRequestPropertiesTests(driverTestConfig) {
4377
4512
  const results = await Promise.all(
4378
4513
  responses.map((r) => r.json())
4379
4514
  );
4380
- expect25(results[0].searchParams.id).toBe("1");
4381
- expect25(results[0].method).toBe("POST");
4382
- expect25(results[0].body).toEqual({ request: 1 });
4383
- expect25(results[1].searchParams.id).toBe("2");
4384
- expect25(results[1].method).toBe("PUT");
4385
- expect25(results[1].body).toEqual({ request: 2 });
4386
- expect25(results[2].searchParams.id).toBe("3");
4387
- expect25(results[2].method).toBe("DELETE");
4388
- expect25(results[2].body).toBeNull();
4515
+ expect27(results[0].searchParams.id).toBe("1");
4516
+ expect27(results[0].method).toBe("POST");
4517
+ expect27(results[0].body).toEqual({ request: 1 });
4518
+ expect27(results[1].searchParams.id).toBe("2");
4519
+ expect27(results[1].method).toBe("PUT");
4520
+ expect27(results[1].body).toEqual({ request: 2 });
4521
+ expect27(results[2].searchParams.id).toBe("3");
4522
+ expect27(results[2].method).toBe("DELETE");
4523
+ expect27(results[2].body).toBeNull();
4389
4524
  });
4390
4525
  });
4391
4526
  }
4392
4527
 
4393
4528
  // src/driver-test-suite/tests/raw-websocket.ts
4394
- import { describe as describe27, expect as expect26, test as test26 } from "vitest";
4529
+ import { describe as describe29, expect as expect28, test as test28 } from "vitest";
4395
4530
  function runRawWebSocketTests(driverTestConfig) {
4396
- describe27("raw websocket", () => {
4397
- test26("should establish raw WebSocket connection", async (c) => {
4531
+ describe29("raw websocket", () => {
4532
+ test28("should establish raw WebSocket connection", async (c) => {
4398
4533
  const { client } = await setupDriverTest(c, driverTestConfig);
4399
4534
  const actor = client.rawWebSocketActor.getOrCreate(["basic"]);
4400
4535
  const ws = await actor.webSocket();
@@ -4421,11 +4556,11 @@ function runRawWebSocketTests(driverTestConfig) {
4421
4556
  );
4422
4557
  ws.addEventListener("close", reject);
4423
4558
  });
4424
- expect26(welcomeMessage.type).toBe("welcome");
4425
- expect26(welcomeMessage.connectionCount).toBe(1);
4559
+ expect28(welcomeMessage.type).toBe("welcome");
4560
+ expect28(welcomeMessage.connectionCount).toBe(1);
4426
4561
  ws.close();
4427
4562
  });
4428
- test26("should echo messages", async (c) => {
4563
+ test28("should echo messages", async (c) => {
4429
4564
  const { client } = await setupDriverTest(c, driverTestConfig);
4430
4565
  const actor = client.rawWebSocketActor.getOrCreate(["echo"]);
4431
4566
  const ws = await actor.webSocket();
@@ -4453,10 +4588,10 @@ function runRawWebSocketTests(driverTestConfig) {
4453
4588
  );
4454
4589
  ws.addEventListener("close", reject);
4455
4590
  });
4456
- expect26(echoMessage).toEqual(testMessage);
4591
+ expect28(echoMessage).toEqual(testMessage);
4457
4592
  ws.close();
4458
4593
  });
4459
- test26("should handle ping/pong protocol", async (c) => {
4594
+ test28("should handle ping/pong protocol", async (c) => {
4460
4595
  const { client } = await setupDriverTest(c, driverTestConfig);
4461
4596
  const actor = client.rawWebSocketActor.getOrCreate(["ping"]);
4462
4597
  const ws = await actor.webSocket();
@@ -4482,11 +4617,11 @@ function runRawWebSocketTests(driverTestConfig) {
4482
4617
  });
4483
4618
  ws.addEventListener("close", reject);
4484
4619
  });
4485
- expect26(pongMessage.type).toBe("pong");
4486
- expect26(pongMessage.timestamp).toBeDefined();
4620
+ expect28(pongMessage.type).toBe("pong");
4621
+ expect28(pongMessage.timestamp).toBeDefined();
4487
4622
  ws.close();
4488
4623
  });
4489
- test26("should track stats across connections", async (c) => {
4624
+ test28("should track stats across connections", async (c) => {
4490
4625
  const { client } = await setupDriverTest(c, driverTestConfig);
4491
4626
  const actor1 = client.rawWebSocketActor.getOrCreate(["stats"]);
4492
4627
  const ws1 = await actor1.webSocket();
@@ -4530,15 +4665,15 @@ function runRawWebSocketTests(driverTestConfig) {
4530
4665
  });
4531
4666
  ws1.send(JSON.stringify({ type: "getStats" }));
4532
4667
  const stats = await statsPromise;
4533
- expect26(stats.connectionCount).toBe(2);
4534
- expect26(stats.messageCount).toBe(4);
4668
+ expect28(stats.connectionCount).toBe(2);
4669
+ expect28(stats.messageCount).toBe(4);
4535
4670
  const actionStats = await actor1.getStats();
4536
- expect26(actionStats.connectionCount).toBe(2);
4537
- expect26(actionStats.messageCount).toBe(4);
4671
+ expect28(actionStats.connectionCount).toBe(2);
4672
+ expect28(actionStats.messageCount).toBe(4);
4538
4673
  ws1.close();
4539
4674
  ws2.close();
4540
4675
  });
4541
- test26("should handle binary data", async (c) => {
4676
+ test28("should handle binary data", async (c) => {
4542
4677
  const { client } = await setupDriverTest(c, driverTestConfig);
4543
4678
  const actor = client.rawWebSocketBinaryActor.getOrCreate([
4544
4679
  "binary"
@@ -4571,7 +4706,7 @@ function runRawWebSocketTests(driverTestConfig) {
4571
4706
  const smallData = new Uint8Array([1, 2, 3, 4, 5]);
4572
4707
  ws.send(smallData);
4573
4708
  const smallReversed = await receiveBinaryMessage();
4574
- expect26(Array.from(smallReversed)).toEqual([5, 4, 3, 2, 1]);
4709
+ expect28(Array.from(smallReversed)).toEqual([5, 4, 3, 2, 1]);
4575
4710
  const largeData = new Uint8Array(1024);
4576
4711
  for (let i = 0; i < largeData.length; i++) {
4577
4712
  largeData[i] = i % 256;
@@ -4579,13 +4714,13 @@ function runRawWebSocketTests(driverTestConfig) {
4579
4714
  ws.send(largeData);
4580
4715
  const largeReversed = await receiveBinaryMessage();
4581
4716
  for (let i = 0; i < largeData.length; i++) {
4582
- expect26(largeReversed[i]).toBe(
4717
+ expect28(largeReversed[i]).toBe(
4583
4718
  largeData[largeData.length - 1 - i]
4584
4719
  );
4585
4720
  }
4586
4721
  ws.close();
4587
4722
  });
4588
- test26("should work with custom paths", async (c) => {
4723
+ test28("should work with custom paths", async (c) => {
4589
4724
  const { client } = await setupDriverTest(c, driverTestConfig);
4590
4725
  const actor = client.rawWebSocketActor.getOrCreate(["paths"]);
4591
4726
  const ws = await actor.webSocket("custom/path");
@@ -4605,10 +4740,10 @@ function runRawWebSocketTests(driverTestConfig) {
4605
4740
  { once: true }
4606
4741
  );
4607
4742
  });
4608
- expect26(welcomeMessage.type).toBe("welcome");
4743
+ expect28(welcomeMessage.type).toBe("welcome");
4609
4744
  ws.close();
4610
4745
  });
4611
- test26("should handle connection close properly", async (c) => {
4746
+ test28("should handle connection close properly", async (c) => {
4612
4747
  const { client } = await setupDriverTest(c, driverTestConfig);
4613
4748
  const actor = client.rawWebSocketActor.getOrCreate(["close-test"]);
4614
4749
  const ws = await actor.webSocket();
@@ -4621,7 +4756,7 @@ function runRawWebSocketTests(driverTestConfig) {
4621
4756
  });
4622
4757
  }
4623
4758
  const initialStats = await actor.getStats();
4624
- expect26(initialStats.connectionCount).toBe(1);
4759
+ expect28(initialStats.connectionCount).toBe(1);
4625
4760
  const closePromise = new Promise((resolve) => {
4626
4761
  ws.addEventListener("close", () => resolve(), { once: true });
4627
4762
  });
@@ -4635,9 +4770,9 @@ function runRawWebSocketTests(driverTestConfig) {
4635
4770
  }
4636
4771
  await new Promise((resolve) => setTimeout(resolve, 50));
4637
4772
  }
4638
- expect26(finalStats == null ? void 0 : finalStats.connectionCount).toBe(0);
4773
+ expect28(finalStats == null ? void 0 : finalStats.connectionCount).toBe(0);
4639
4774
  });
4640
- test26("should properly handle onWebSocket open and close events", async (c) => {
4775
+ test28("should properly handle onWebSocket open and close events", async (c) => {
4641
4776
  const { client } = await setupDriverTest(c, driverTestConfig);
4642
4777
  const actor = client.rawWebSocketActor.getOrCreate([
4643
4778
  "open-close-test"
@@ -4657,8 +4792,8 @@ function runRawWebSocketTests(driverTestConfig) {
4657
4792
  );
4658
4793
  ws1.addEventListener("close", reject);
4659
4794
  });
4660
- expect26(welcome1.type).toBe("welcome");
4661
- expect26(welcome1.connectionCount).toBe(1);
4795
+ expect28(welcome1.type).toBe("welcome");
4796
+ expect28(welcome1.connectionCount).toBe(1);
4662
4797
  const ws2 = await actor.webSocket();
4663
4798
  await new Promise((resolve, reject) => {
4664
4799
  ws2.addEventListener("open", () => resolve(), { once: true });
@@ -4674,10 +4809,10 @@ function runRawWebSocketTests(driverTestConfig) {
4674
4809
  );
4675
4810
  ws2.addEventListener("close", reject);
4676
4811
  });
4677
- expect26(welcome2.type).toBe("welcome");
4678
- expect26(welcome2.connectionCount).toBe(2);
4812
+ expect28(welcome2.type).toBe("welcome");
4813
+ expect28(welcome2.connectionCount).toBe(2);
4679
4814
  const midStats = await actor.getStats();
4680
- expect26(midStats.connectionCount).toBe(2);
4815
+ expect28(midStats.connectionCount).toBe(2);
4681
4816
  ws1.close();
4682
4817
  await new Promise((resolve) => {
4683
4818
  ws1.addEventListener("close", () => resolve(), { once: true });
@@ -4690,7 +4825,7 @@ function runRawWebSocketTests(driverTestConfig) {
4690
4825
  }
4691
4826
  await new Promise((resolve) => setTimeout(resolve, 50));
4692
4827
  }
4693
- expect26(afterFirstClose == null ? void 0 : afterFirstClose.connectionCount).toBe(1);
4828
+ expect28(afterFirstClose == null ? void 0 : afterFirstClose.connectionCount).toBe(1);
4694
4829
  ws2.close();
4695
4830
  await new Promise((resolve) => {
4696
4831
  ws2.addEventListener("close", () => resolve(), { once: true });
@@ -4703,9 +4838,9 @@ function runRawWebSocketTests(driverTestConfig) {
4703
4838
  }
4704
4839
  await new Promise((resolve) => setTimeout(resolve, 50));
4705
4840
  }
4706
- expect26(finalStats == null ? void 0 : finalStats.connectionCount).toBe(0);
4841
+ expect28(finalStats == null ? void 0 : finalStats.connectionCount).toBe(0);
4707
4842
  });
4708
- test26("should handle query parameters in websocket paths", async (c) => {
4843
+ test28("should handle query parameters in websocket paths", async (c) => {
4709
4844
  const { client } = await setupDriverTest(c, driverTestConfig);
4710
4845
  const actor = client.rawWebSocketActor.getOrCreate([
4711
4846
  "query-params"
@@ -4728,12 +4863,12 @@ function runRawWebSocketTests(driverTestConfig) {
4728
4863
  });
4729
4864
  ws.send(JSON.stringify({ type: "getRequestInfo" }));
4730
4865
  const requestInfo = await requestInfoPromise;
4731
- expect26(requestInfo.url).toContain("api/v1/stream");
4732
- expect26(requestInfo.url).toContain("token=abc123");
4733
- expect26(requestInfo.url).toContain("user=test");
4866
+ expect28(requestInfo.url).toContain("api/v1/stream");
4867
+ expect28(requestInfo.url).toContain("token=abc123");
4868
+ expect28(requestInfo.url).toContain("user=test");
4734
4869
  ws.close();
4735
4870
  });
4736
- test26("should handle query parameters on base websocket path (no subpath)", async (c) => {
4871
+ test28("should handle query parameters on base websocket path (no subpath)", async (c) => {
4737
4872
  const { client } = await setupDriverTest(c, driverTestConfig);
4738
4873
  const actor = client.rawWebSocketActor.getOrCreate([
4739
4874
  "base-path-query-params"
@@ -4757,18 +4892,18 @@ function runRawWebSocketTests(driverTestConfig) {
4757
4892
  });
4758
4893
  ws.send(JSON.stringify({ type: "getRequestInfo" }));
4759
4894
  const requestInfo = await requestInfoPromise;
4760
- expect26(requestInfo.url).toContain("token=secret");
4761
- expect26(requestInfo.url).toContain("session=123");
4895
+ expect28(requestInfo.url).toContain("token=secret");
4896
+ expect28(requestInfo.url).toContain("session=123");
4762
4897
  ws.close();
4763
4898
  });
4764
4899
  });
4765
4900
  }
4766
4901
 
4767
4902
  // src/driver-test-suite/tests/request-access.ts
4768
- import { describe as describe28, expect as expect27, test as test27 } from "vitest";
4903
+ import { describe as describe30, expect as expect29, test as test29 } from "vitest";
4769
4904
  function runRequestAccessTests(driverTestConfig) {
4770
- describe28("Request Access in Lifecycle Hooks", () => {
4771
- test27("should have access to request object in onBeforeConnect and createConnState", async (c) => {
4905
+ describe30("Request Access in Lifecycle Hooks", () => {
4906
+ test29("should have access to request object in onBeforeConnect and createConnState", async (c) => {
4772
4907
  const { client } = await setupDriverTest(c, driverTestConfig);
4773
4908
  const handle = client.requestAccessActor.getOrCreate(
4774
4909
  ["test-request"],
@@ -4779,23 +4914,23 @@ function runRequestAccessTests(driverTestConfig) {
4779
4914
  const connection = handle.connect();
4780
4915
  const requestInfo = await connection.getRequestInfo();
4781
4916
  if (driverTestConfig.clientType === "http") {
4782
- expect27(requestInfo.onBeforeConnect.hasRequest).toBe(true);
4783
- expect27(requestInfo.onBeforeConnect.requestUrl).toBeDefined();
4784
- expect27(requestInfo.onBeforeConnect.requestMethod).toBeDefined();
4785
- expect27(
4917
+ expect29(requestInfo.onBeforeConnect.hasRequest).toBe(true);
4918
+ expect29(requestInfo.onBeforeConnect.requestUrl).toBeDefined();
4919
+ expect29(requestInfo.onBeforeConnect.requestMethod).toBeDefined();
4920
+ expect29(
4786
4921
  requestInfo.onBeforeConnect.requestHeaders
4787
4922
  ).toBeDefined();
4788
- expect27(requestInfo.createConnState.hasRequest).toBe(true);
4789
- expect27(requestInfo.createConnState.requestUrl).toBeDefined();
4790
- expect27(requestInfo.createConnState.requestMethod).toBeDefined();
4791
- expect27(
4923
+ expect29(requestInfo.createConnState.hasRequest).toBe(true);
4924
+ expect29(requestInfo.createConnState.requestUrl).toBeDefined();
4925
+ expect29(requestInfo.createConnState.requestMethod).toBeDefined();
4926
+ expect29(
4792
4927
  requestInfo.createConnState.requestHeaders
4793
4928
  ).toBeDefined();
4794
4929
  } else {
4795
4930
  }
4796
4931
  await connection.dispose();
4797
4932
  });
4798
- test27("should not have request when trackRequest is false", async (c) => {
4933
+ test29("should not have request when trackRequest is false", async (c) => {
4799
4934
  const { client } = await setupDriverTest(c, driverTestConfig);
4800
4935
  const handle = client.requestAccessActor.getOrCreate(
4801
4936
  ["test-no-request"],
@@ -4805,21 +4940,21 @@ function runRequestAccessTests(driverTestConfig) {
4805
4940
  );
4806
4941
  const connection = handle.connect();
4807
4942
  const requestInfo = await connection.getRequestInfo();
4808
- expect27(requestInfo.onBeforeConnect.hasRequest).toBe(false);
4809
- expect27(requestInfo.onBeforeConnect.requestUrl).toBeNull();
4810
- expect27(requestInfo.onBeforeConnect.requestMethod).toBeNull();
4811
- expect27(
4943
+ expect29(requestInfo.onBeforeConnect.hasRequest).toBe(false);
4944
+ expect29(requestInfo.onBeforeConnect.requestUrl).toBeNull();
4945
+ expect29(requestInfo.onBeforeConnect.requestMethod).toBeNull();
4946
+ expect29(
4812
4947
  Object.keys(requestInfo.onBeforeConnect.requestHeaders)
4813
4948
  ).toHaveLength(0);
4814
- expect27(requestInfo.createConnState.hasRequest).toBe(false);
4815
- expect27(requestInfo.createConnState.requestUrl).toBeNull();
4816
- expect27(requestInfo.createConnState.requestMethod).toBeNull();
4817
- expect27(
4949
+ expect29(requestInfo.createConnState.hasRequest).toBe(false);
4950
+ expect29(requestInfo.createConnState.requestUrl).toBeNull();
4951
+ expect29(requestInfo.createConnState.requestMethod).toBeNull();
4952
+ expect29(
4818
4953
  Object.keys(requestInfo.createConnState.requestHeaders)
4819
4954
  ).toHaveLength(0);
4820
4955
  await connection.dispose();
4821
4956
  });
4822
- test27("should capture request headers and method", async (c) => {
4957
+ test29("should capture request headers and method", async (c) => {
4823
4958
  const { client } = await setupDriverTest(c, driverTestConfig);
4824
4959
  const handle = client.requestAccessActor.getOrCreate(
4825
4960
  ["test-headers"],
@@ -4830,18 +4965,18 @@ function runRequestAccessTests(driverTestConfig) {
4830
4965
  const connection = handle.connect();
4831
4966
  const requestInfo = await connection.getRequestInfo();
4832
4967
  if (driverTestConfig.clientType === "http") {
4833
- expect27(requestInfo.onBeforeConnect.hasRequest).toBe(true);
4834
- expect27(requestInfo.onBeforeConnect.requestMethod).toBeTruthy();
4835
- expect27(requestInfo.onBeforeConnect.requestUrl).toBeTruthy();
4836
- expect27(requestInfo.onBeforeConnect.requestHeaders).toBeTruthy();
4837
- expect27(typeof requestInfo.onBeforeConnect.requestHeaders).toBe(
4968
+ expect29(requestInfo.onBeforeConnect.hasRequest).toBe(true);
4969
+ expect29(requestInfo.onBeforeConnect.requestMethod).toBeTruthy();
4970
+ expect29(requestInfo.onBeforeConnect.requestUrl).toBeTruthy();
4971
+ expect29(requestInfo.onBeforeConnect.requestHeaders).toBeTruthy();
4972
+ expect29(typeof requestInfo.onBeforeConnect.requestHeaders).toBe(
4838
4973
  "object"
4839
4974
  );
4840
- expect27(requestInfo.createConnState.hasRequest).toBe(true);
4841
- expect27(requestInfo.createConnState.requestMethod).toBeTruthy();
4842
- expect27(requestInfo.createConnState.requestUrl).toBeTruthy();
4843
- expect27(requestInfo.createConnState.requestHeaders).toBeTruthy();
4844
- expect27(typeof requestInfo.createConnState.requestHeaders).toBe(
4975
+ expect29(requestInfo.createConnState.hasRequest).toBe(true);
4976
+ expect29(requestInfo.createConnState.requestMethod).toBeTruthy();
4977
+ expect29(requestInfo.createConnState.requestUrl).toBeTruthy();
4978
+ expect29(requestInfo.createConnState.requestHeaders).toBeTruthy();
4979
+ expect29(typeof requestInfo.createConnState.requestHeaders).toBe(
4845
4980
  "object"
4846
4981
  );
4847
4982
  } else {
@@ -4853,14 +4988,14 @@ function runRequestAccessTests(driverTestConfig) {
4853
4988
 
4854
4989
  // src/driver-test-suite/mod.ts
4855
4990
  function runDriverTests(driverTestConfigPartial) {
4856
- describe29("Driver Tests", () => {
4991
+ describe31("Driver Tests", () => {
4857
4992
  var _a;
4858
4993
  const clientTypes = ((_a = driverTestConfigPartial.skip) == null ? void 0 : _a.inline) ? ["http"] : ["http", "inline"];
4859
4994
  for (const clientType of clientTypes) {
4860
- describe29(`client type (${clientType})`, () => {
4995
+ describe31(`client type (${clientType})`, () => {
4861
4996
  const encodings = ["bare", "cbor", "json"];
4862
4997
  for (const encoding of encodings) {
4863
- describe29(`encoding (${encoding})`, () => {
4998
+ describe31(`encoding (${encoding})`, () => {
4864
4999
  const driverTestConfig = {
4865
5000
  ...driverTestConfigPartial,
4866
5001
  clientType,
@@ -4871,6 +5006,7 @@ function runDriverTests(driverTestConfigPartial) {
4871
5006
  runActorConnTests(driverTestConfig);
4872
5007
  runActorConnStateTests(driverTestConfig);
4873
5008
  runActorConnHibernationTests(driverTestConfig);
5009
+ runConnErrorSerializationTests(driverTestConfig);
4874
5010
  runActorDbTests(driverTestConfig);
4875
5011
  runActorDestroyTests(driverTestConfig);
4876
5012
  runRequestAccessTests(driverTestConfig);