actor-ts 0.9.0

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 (1128) hide show
  1. package/CHANGELOG.md +885 -0
  2. package/LICENSE +201 -0
  3. package/README.md +269 -0
  4. package/dist/Actor.d.ts +49 -0
  5. package/dist/Actor.d.ts.map +1 -0
  6. package/dist/Actor.js +45 -0
  7. package/dist/Actor.js.map +1 -0
  8. package/dist/ActorContext.d.ts +171 -0
  9. package/dist/ActorContext.d.ts.map +1 -0
  10. package/dist/ActorContext.js +13 -0
  11. package/dist/ActorContext.js.map +1 -0
  12. package/dist/ActorPath.d.ts +23 -0
  13. package/dist/ActorPath.d.ts.map +1 -0
  14. package/dist/ActorPath.js +56 -0
  15. package/dist/ActorPath.js.map +1 -0
  16. package/dist/ActorRef.d.ts +54 -0
  17. package/dist/ActorRef.d.ts.map +1 -0
  18. package/dist/ActorRef.js +105 -0
  19. package/dist/ActorRef.js.map +1 -0
  20. package/dist/ActorSelection.d.ts +48 -0
  21. package/dist/ActorSelection.d.ts.map +1 -0
  22. package/dist/ActorSelection.js +84 -0
  23. package/dist/ActorSelection.js.map +1 -0
  24. package/dist/ActorSystem.d.ts +152 -0
  25. package/dist/ActorSystem.d.ts.map +1 -0
  26. package/dist/ActorSystem.js +248 -0
  27. package/dist/ActorSystem.js.map +1 -0
  28. package/dist/CoordinatedShutdown.d.ts +112 -0
  29. package/dist/CoordinatedShutdown.d.ts.map +1 -0
  30. package/dist/CoordinatedShutdown.js +252 -0
  31. package/dist/CoordinatedShutdown.js.map +1 -0
  32. package/dist/Dispatcher.d.ts +47 -0
  33. package/dist/Dispatcher.d.ts.map +1 -0
  34. package/dist/Dispatcher.js +90 -0
  35. package/dist/Dispatcher.js.map +1 -0
  36. package/dist/EventStream.d.ts +58 -0
  37. package/dist/EventStream.d.ts.map +1 -0
  38. package/dist/EventStream.js +74 -0
  39. package/dist/EventStream.js.map +1 -0
  40. package/dist/Extension.d.ts +45 -0
  41. package/dist/Extension.d.ts.map +1 -0
  42. package/dist/Extension.js +51 -0
  43. package/dist/Extension.js.map +1 -0
  44. package/dist/LogContext.d.ts +44 -0
  45. package/dist/LogContext.d.ts.map +1 -0
  46. package/dist/LogContext.js +87 -0
  47. package/dist/LogContext.js.map +1 -0
  48. package/dist/Logger.d.ts +57 -0
  49. package/dist/Logger.d.ts.map +1 -0
  50. package/dist/Logger.js +81 -0
  51. package/dist/Logger.js.map +1 -0
  52. package/dist/Props.d.ts +32 -0
  53. package/dist/Props.d.ts.map +1 -0
  54. package/dist/Props.js +27 -0
  55. package/dist/Props.js.map +1 -0
  56. package/dist/Router.d.ts +32 -0
  57. package/dist/Router.d.ts.map +1 -0
  58. package/dist/Router.js +78 -0
  59. package/dist/Router.js.map +1 -0
  60. package/dist/Scheduler.d.ts +25 -0
  61. package/dist/Scheduler.d.ts.map +1 -0
  62. package/dist/Scheduler.js +112 -0
  63. package/dist/Scheduler.js.map +1 -0
  64. package/dist/Supervision.d.ts +66 -0
  65. package/dist/Supervision.d.ts.map +1 -0
  66. package/dist/Supervision.js +75 -0
  67. package/dist/Supervision.js.map +1 -0
  68. package/dist/SystemMessages.d.ts +56 -0
  69. package/dist/SystemMessages.d.ts.map +1 -0
  70. package/dist/SystemMessages.js +71 -0
  71. package/dist/SystemMessages.js.map +1 -0
  72. package/dist/cache/Cache.d.ts +75 -0
  73. package/dist/cache/Cache.d.ts.map +1 -0
  74. package/dist/cache/Cache.js +10 -0
  75. package/dist/cache/Cache.js.map +1 -0
  76. package/dist/cache/CacheExtension.d.ts +44 -0
  77. package/dist/cache/CacheExtension.d.ts.map +1 -0
  78. package/dist/cache/CacheExtension.js +77 -0
  79. package/dist/cache/CacheExtension.js.map +1 -0
  80. package/dist/cache/InMemoryCache.d.ts +16 -0
  81. package/dist/cache/InMemoryCache.d.ts.map +1 -0
  82. package/dist/cache/InMemoryCache.js +86 -0
  83. package/dist/cache/InMemoryCache.js.map +1 -0
  84. package/dist/cache/MemcachedCache.d.ts +71 -0
  85. package/dist/cache/MemcachedCache.d.ts.map +1 -0
  86. package/dist/cache/MemcachedCache.js +243 -0
  87. package/dist/cache/MemcachedCache.js.map +1 -0
  88. package/dist/cache/RedisCache.d.ts +80 -0
  89. package/dist/cache/RedisCache.d.ts.map +1 -0
  90. package/dist/cache/RedisCache.js +194 -0
  91. package/dist/cache/RedisCache.js.map +1 -0
  92. package/dist/cache/index.d.ts +9 -0
  93. package/dist/cache/index.d.ts.map +1 -0
  94. package/dist/cache/index.js +6 -0
  95. package/dist/cache/index.js.map +1 -0
  96. package/dist/cluster/Cluster.d.ts +251 -0
  97. package/dist/cluster/Cluster.d.ts.map +1 -0
  98. package/dist/cluster/Cluster.js +837 -0
  99. package/dist/cluster/Cluster.js.map +1 -0
  100. package/dist/cluster/ClusterBootstrap.d.ts +107 -0
  101. package/dist/cluster/ClusterBootstrap.d.ts.map +1 -0
  102. package/dist/cluster/ClusterBootstrap.js +184 -0
  103. package/dist/cluster/ClusterBootstrap.js.map +1 -0
  104. package/dist/cluster/ClusterClient.d.ts +112 -0
  105. package/dist/cluster/ClusterClient.d.ts.map +1 -0
  106. package/dist/cluster/ClusterClient.js +280 -0
  107. package/dist/cluster/ClusterClient.js.map +1 -0
  108. package/dist/cluster/ClusterClientReceptionist.d.ts +85 -0
  109. package/dist/cluster/ClusterClientReceptionist.d.ts.map +1 -0
  110. package/dist/cluster/ClusterClientReceptionist.js +159 -0
  111. package/dist/cluster/ClusterClientReceptionist.js.map +1 -0
  112. package/dist/cluster/ClusterEvents.d.ts +99 -0
  113. package/dist/cluster/ClusterEvents.d.ts.map +1 -0
  114. package/dist/cluster/ClusterEvents.js +124 -0
  115. package/dist/cluster/ClusterEvents.js.map +1 -0
  116. package/dist/cluster/FailureDetector.d.ts +32 -0
  117. package/dist/cluster/FailureDetector.d.ts.map +1 -0
  118. package/dist/cluster/FailureDetector.js +50 -0
  119. package/dist/cluster/FailureDetector.js.map +1 -0
  120. package/dist/cluster/Member.d.ts +38 -0
  121. package/dist/cluster/Member.d.ts.map +1 -0
  122. package/dist/cluster/Member.js +69 -0
  123. package/dist/cluster/Member.js.map +1 -0
  124. package/dist/cluster/NodeAddress.d.ts +24 -0
  125. package/dist/cluster/NodeAddress.d.ts.map +1 -0
  126. package/dist/cluster/NodeAddress.js +44 -0
  127. package/dist/cluster/NodeAddress.js.map +1 -0
  128. package/dist/cluster/PhiAccrualFailureDetector.d.ts +49 -0
  129. package/dist/cluster/PhiAccrualFailureDetector.d.ts.map +1 -0
  130. package/dist/cluster/PhiAccrualFailureDetector.js +139 -0
  131. package/dist/cluster/PhiAccrualFailureDetector.js.map +1 -0
  132. package/dist/cluster/Protocol.d.ts +151 -0
  133. package/dist/cluster/Protocol.d.ts.map +1 -0
  134. package/dist/cluster/Protocol.js +90 -0
  135. package/dist/cluster/Protocol.js.map +1 -0
  136. package/dist/cluster/RefCodec.d.ts +40 -0
  137. package/dist/cluster/RefCodec.d.ts.map +1 -0
  138. package/dist/cluster/RefCodec.js +134 -0
  139. package/dist/cluster/RefCodec.js.map +1 -0
  140. package/dist/cluster/RemoteActorRef.d.ts +22 -0
  141. package/dist/cluster/RemoteActorRef.d.ts.map +1 -0
  142. package/dist/cluster/RemoteActorRef.js +48 -0
  143. package/dist/cluster/RemoteActorRef.js.map +1 -0
  144. package/dist/cluster/Transport.d.ts +96 -0
  145. package/dist/cluster/Transport.d.ts.map +1 -0
  146. package/dist/cluster/Transport.js +299 -0
  147. package/dist/cluster/Transport.js.map +1 -0
  148. package/dist/cluster/downing/DowningProvider.d.ts +32 -0
  149. package/dist/cluster/downing/DowningProvider.d.ts.map +1 -0
  150. package/dist/cluster/downing/DowningProvider.js +5 -0
  151. package/dist/cluster/downing/DowningProvider.js.map +1 -0
  152. package/dist/cluster/downing/KeepMajority.d.ts +21 -0
  153. package/dist/cluster/downing/KeepMajority.d.ts.map +1 -0
  154. package/dist/cluster/downing/KeepMajority.js +39 -0
  155. package/dist/cluster/downing/KeepMajority.js.map +1 -0
  156. package/dist/cluster/downing/KeepOldest.d.ts +23 -0
  157. package/dist/cluster/downing/KeepOldest.d.ts.map +1 -0
  158. package/dist/cluster/downing/KeepOldest.js +37 -0
  159. package/dist/cluster/downing/KeepOldest.js.map +1 -0
  160. package/dist/cluster/downing/KeepReferee.d.ts +23 -0
  161. package/dist/cluster/downing/KeepReferee.d.ts.map +1 -0
  162. package/dist/cluster/downing/KeepReferee.js +35 -0
  163. package/dist/cluster/downing/KeepReferee.js.map +1 -0
  164. package/dist/cluster/downing/LeaseMajority.d.ts +70 -0
  165. package/dist/cluster/downing/LeaseMajority.d.ts.map +1 -0
  166. package/dist/cluster/downing/LeaseMajority.js +129 -0
  167. package/dist/cluster/downing/LeaseMajority.js.map +1 -0
  168. package/dist/cluster/downing/StaticQuorum.d.ts +21 -0
  169. package/dist/cluster/downing/StaticQuorum.d.ts.map +1 -0
  170. package/dist/cluster/downing/StaticQuorum.js +30 -0
  171. package/dist/cluster/downing/StaticQuorum.js.map +1 -0
  172. package/dist/cluster/downing/index.d.ts +13 -0
  173. package/dist/cluster/downing/index.d.ts.map +1 -0
  174. package/dist/cluster/downing/index.js +7 -0
  175. package/dist/cluster/downing/index.js.map +1 -0
  176. package/dist/cluster/index.d.ts +49 -0
  177. package/dist/cluster/index.d.ts.map +1 -0
  178. package/dist/cluster/index.js +33 -0
  179. package/dist/cluster/index.js.map +1 -0
  180. package/dist/cluster/pubsub/DistributedPubSubExtension.d.ts +30 -0
  181. package/dist/cluster/pubsub/DistributedPubSubExtension.d.ts.map +1 -0
  182. package/dist/cluster/pubsub/DistributedPubSubExtension.js +42 -0
  183. package/dist/cluster/pubsub/DistributedPubSubExtension.js.map +1 -0
  184. package/dist/cluster/pubsub/DistributedPubSubMediator.d.ts +56 -0
  185. package/dist/cluster/pubsub/DistributedPubSubMediator.d.ts.map +1 -0
  186. package/dist/cluster/pubsub/DistributedPubSubMediator.js +240 -0
  187. package/dist/cluster/pubsub/DistributedPubSubMediator.js.map +1 -0
  188. package/dist/cluster/pubsub/Messages.d.ts +75 -0
  189. package/dist/cluster/pubsub/Messages.d.ts.map +1 -0
  190. package/dist/cluster/pubsub/Messages.js +66 -0
  191. package/dist/cluster/pubsub/Messages.js.map +1 -0
  192. package/dist/cluster/pubsub/index.d.ts +5 -0
  193. package/dist/cluster/pubsub/index.d.ts.map +1 -0
  194. package/dist/cluster/pubsub/index.js +4 -0
  195. package/dist/cluster/pubsub/index.js.map +1 -0
  196. package/dist/cluster/router/ClusterRouter.d.ts +87 -0
  197. package/dist/cluster/router/ClusterRouter.d.ts.map +1 -0
  198. package/dist/cluster/router/ClusterRouter.js +116 -0
  199. package/dist/cluster/router/ClusterRouter.js.map +1 -0
  200. package/dist/cluster/router/ConsistentHashing.d.ts +27 -0
  201. package/dist/cluster/router/ConsistentHashing.d.ts.map +1 -0
  202. package/dist/cluster/router/ConsistentHashing.js +69 -0
  203. package/dist/cluster/router/ConsistentHashing.js.map +1 -0
  204. package/dist/cluster/router/index.d.ts +4 -0
  205. package/dist/cluster/router/index.d.ts.map +1 -0
  206. package/dist/cluster/router/index.js +3 -0
  207. package/dist/cluster/router/index.js.map +1 -0
  208. package/dist/cluster/sharding/AllocationStrategy.d.ts +45 -0
  209. package/dist/cluster/sharding/AllocationStrategy.d.ts.map +1 -0
  210. package/dist/cluster/sharding/AllocationStrategy.js +95 -0
  211. package/dist/cluster/sharding/AllocationStrategy.js.map +1 -0
  212. package/dist/cluster/sharding/CassandraRememberEntitiesStore.d.ts +77 -0
  213. package/dist/cluster/sharding/CassandraRememberEntitiesStore.d.ts.map +1 -0
  214. package/dist/cluster/sharding/CassandraRememberEntitiesStore.js +98 -0
  215. package/dist/cluster/sharding/CassandraRememberEntitiesStore.js.map +1 -0
  216. package/dist/cluster/sharding/ClusterSharding.d.ts +116 -0
  217. package/dist/cluster/sharding/ClusterSharding.d.ts.map +1 -0
  218. package/dist/cluster/sharding/ClusterSharding.js +133 -0
  219. package/dist/cluster/sharding/ClusterSharding.js.map +1 -0
  220. package/dist/cluster/sharding/CoordinatorState.d.ts +83 -0
  221. package/dist/cluster/sharding/CoordinatorState.d.ts.map +1 -0
  222. package/dist/cluster/sharding/CoordinatorState.js +46 -0
  223. package/dist/cluster/sharding/CoordinatorState.js.map +1 -0
  224. package/dist/cluster/sharding/Passivate.d.ts +23 -0
  225. package/dist/cluster/sharding/Passivate.d.ts.map +1 -0
  226. package/dist/cluster/sharding/Passivate.js +25 -0
  227. package/dist/cluster/sharding/Passivate.js.map +1 -0
  228. package/dist/cluster/sharding/RememberEntitiesStore.d.ts +60 -0
  229. package/dist/cluster/sharding/RememberEntitiesStore.d.ts.map +1 -0
  230. package/dist/cluster/sharding/RememberEntitiesStore.js +35 -0
  231. package/dist/cluster/sharding/RememberEntitiesStore.js.map +1 -0
  232. package/dist/cluster/sharding/ShardAllocator.d.ts +23 -0
  233. package/dist/cluster/sharding/ShardAllocator.d.ts.map +1 -0
  234. package/dist/cluster/sharding/ShardAllocator.js +54 -0
  235. package/dist/cluster/sharding/ShardAllocator.js.map +1 -0
  236. package/dist/cluster/sharding/ShardCoordinator.d.ts +218 -0
  237. package/dist/cluster/sharding/ShardCoordinator.d.ts.map +1 -0
  238. package/dist/cluster/sharding/ShardCoordinator.js +719 -0
  239. package/dist/cluster/sharding/ShardCoordinator.js.map +1 -0
  240. package/dist/cluster/sharding/ShardRegion.d.ts +156 -0
  241. package/dist/cluster/sharding/ShardRegion.d.ts.map +1 -0
  242. package/dist/cluster/sharding/ShardRegion.js +526 -0
  243. package/dist/cluster/sharding/ShardRegion.js.map +1 -0
  244. package/dist/cluster/sharding/ShardedDaemonProcess.d.ts +64 -0
  245. package/dist/cluster/sharding/ShardedDaemonProcess.d.ts.map +1 -0
  246. package/dist/cluster/sharding/ShardedDaemonProcess.js +107 -0
  247. package/dist/cluster/sharding/ShardedDaemonProcess.js.map +1 -0
  248. package/dist/cluster/sharding/ShardingProtocol.d.ts +92 -0
  249. package/dist/cluster/sharding/ShardingProtocol.d.ts.map +1 -0
  250. package/dist/cluster/sharding/ShardingProtocol.js +7 -0
  251. package/dist/cluster/sharding/ShardingProtocol.js.map +1 -0
  252. package/dist/cluster/singleton/ClusterSingleton.d.ts +59 -0
  253. package/dist/cluster/singleton/ClusterSingleton.d.ts.map +1 -0
  254. package/dist/cluster/singleton/ClusterSingleton.js +63 -0
  255. package/dist/cluster/singleton/ClusterSingleton.js.map +1 -0
  256. package/dist/cluster/singleton/ClusterSingletonManager.d.ts +116 -0
  257. package/dist/cluster/singleton/ClusterSingletonManager.d.ts.map +1 -0
  258. package/dist/cluster/singleton/ClusterSingletonManager.js +300 -0
  259. package/dist/cluster/singleton/ClusterSingletonManager.js.map +1 -0
  260. package/dist/cluster/singleton/ClusterSingletonProxy.d.ts +32 -0
  261. package/dist/cluster/singleton/ClusterSingletonProxy.d.ts.map +1 -0
  262. package/dist/cluster/singleton/ClusterSingletonProxy.js +81 -0
  263. package/dist/cluster/singleton/ClusterSingletonProxy.js.map +1 -0
  264. package/dist/cluster/singleton/index.d.ts +6 -0
  265. package/dist/cluster/singleton/index.d.ts.map +1 -0
  266. package/dist/cluster/singleton/index.js +4 -0
  267. package/dist/cluster/singleton/index.js.map +1 -0
  268. package/dist/cluster/transports/MessageChannelTransport.d.ts +52 -0
  269. package/dist/cluster/transports/MessageChannelTransport.d.ts.map +1 -0
  270. package/dist/cluster/transports/MessageChannelTransport.js +59 -0
  271. package/dist/cluster/transports/MessageChannelTransport.js.map +1 -0
  272. package/dist/config/Config.d.ts +73 -0
  273. package/dist/config/Config.d.ts.map +1 -0
  274. package/dist/config/Config.js +240 -0
  275. package/dist/config/Config.js.map +1 -0
  276. package/dist/config/ConfigKeys.d.ts +94 -0
  277. package/dist/config/ConfigKeys.d.ts.map +1 -0
  278. package/dist/config/ConfigKeys.js +94 -0
  279. package/dist/config/ConfigKeys.js.map +1 -0
  280. package/dist/config/Duration.d.ts +2 -0
  281. package/dist/config/Duration.d.ts.map +1 -0
  282. package/dist/config/Duration.js +70 -0
  283. package/dist/config/Duration.js.map +1 -0
  284. package/dist/config/HoconParser.d.ts +19 -0
  285. package/dist/config/HoconParser.d.ts.map +1 -0
  286. package/dist/config/HoconParser.js +473 -0
  287. package/dist/config/HoconParser.js.map +1 -0
  288. package/dist/config/Size.d.ts +2 -0
  289. package/dist/config/Size.d.ts.map +1 -0
  290. package/dist/config/Size.js +53 -0
  291. package/dist/config/Size.js.map +1 -0
  292. package/dist/config/index.d.ts +9 -0
  293. package/dist/config/index.d.ts.map +1 -0
  294. package/dist/config/index.js +7 -0
  295. package/dist/config/index.js.map +1 -0
  296. package/dist/config/reference.d.ts +11 -0
  297. package/dist/config/reference.d.ts.map +1 -0
  298. package/dist/config/reference.js +86 -0
  299. package/dist/config/reference.js.map +1 -0
  300. package/dist/coordination/Lease.d.ts +40 -0
  301. package/dist/coordination/Lease.d.ts.map +1 -0
  302. package/dist/coordination/Lease.js +2 -0
  303. package/dist/coordination/Lease.js.map +1 -0
  304. package/dist/coordination/index.d.ts +5 -0
  305. package/dist/coordination/index.d.ts.map +1 -0
  306. package/dist/coordination/index.js +3 -0
  307. package/dist/coordination/index.js.map +1 -0
  308. package/dist/coordination/leases/InMemoryLease.d.ts +40 -0
  309. package/dist/coordination/leases/InMemoryLease.d.ts.map +1 -0
  310. package/dist/coordination/leases/InMemoryLease.js +109 -0
  311. package/dist/coordination/leases/InMemoryLease.js.map +1 -0
  312. package/dist/coordination/leases/KubernetesLease.d.ts +78 -0
  313. package/dist/coordination/leases/KubernetesLease.d.ts.map +1 -0
  314. package/dist/coordination/leases/KubernetesLease.js +244 -0
  315. package/dist/coordination/leases/KubernetesLease.js.map +1 -0
  316. package/dist/coordination/leases/k8sApi.d.ts +82 -0
  317. package/dist/coordination/leases/k8sApi.d.ts.map +1 -0
  318. package/dist/coordination/leases/k8sApi.js +191 -0
  319. package/dist/coordination/leases/k8sApi.js.map +1 -0
  320. package/dist/crdt/Crdt.d.ts +52 -0
  321. package/dist/crdt/Crdt.d.ts.map +1 -0
  322. package/dist/crdt/Crdt.js +2 -0
  323. package/dist/crdt/Crdt.js.map +1 -0
  324. package/dist/crdt/DistributedData.d.ts +314 -0
  325. package/dist/crdt/DistributedData.d.ts.map +1 -0
  326. package/dist/crdt/DistributedData.js +658 -0
  327. package/dist/crdt/DistributedData.js.map +1 -0
  328. package/dist/crdt/DurableDistributedDataStore.d.ts +50 -0
  329. package/dist/crdt/DurableDistributedDataStore.d.ts.map +1 -0
  330. package/dist/crdt/DurableDistributedDataStore.js +75 -0
  331. package/dist/crdt/DurableDistributedDataStore.js.map +1 -0
  332. package/dist/crdt/GCounter.d.ts +42 -0
  333. package/dist/crdt/GCounter.d.ts.map +1 -0
  334. package/dist/crdt/GCounter.js +75 -0
  335. package/dist/crdt/GCounter.js.map +1 -0
  336. package/dist/crdt/GCounterMap.d.ts +60 -0
  337. package/dist/crdt/GCounterMap.d.ts.map +1 -0
  338. package/dist/crdt/GCounterMap.js +102 -0
  339. package/dist/crdt/GCounterMap.js.map +1 -0
  340. package/dist/crdt/GSet.d.ts +63 -0
  341. package/dist/crdt/GSet.d.ts.map +1 -0
  342. package/dist/crdt/GSet.js +77 -0
  343. package/dist/crdt/GSet.js.map +1 -0
  344. package/dist/crdt/LWWMap.d.ts +75 -0
  345. package/dist/crdt/LWWMap.d.ts.map +1 -0
  346. package/dist/crdt/LWWMap.js +136 -0
  347. package/dist/crdt/LWWMap.js.map +1 -0
  348. package/dist/crdt/LWWRegister.d.ts +54 -0
  349. package/dist/crdt/LWWRegister.d.ts.map +1 -0
  350. package/dist/crdt/LWWRegister.js +83 -0
  351. package/dist/crdt/LWWRegister.js.map +1 -0
  352. package/dist/crdt/MVRegister.d.ts +36 -0
  353. package/dist/crdt/MVRegister.d.ts.map +1 -0
  354. package/dist/crdt/MVRegister.js +138 -0
  355. package/dist/crdt/MVRegister.js.map +1 -0
  356. package/dist/crdt/ORMap.d.ts +104 -0
  357. package/dist/crdt/ORMap.d.ts.map +1 -0
  358. package/dist/crdt/ORMap.js +178 -0
  359. package/dist/crdt/ORMap.js.map +1 -0
  360. package/dist/crdt/ORSet.d.ts +81 -0
  361. package/dist/crdt/ORSet.d.ts.map +1 -0
  362. package/dist/crdt/ORSet.js +206 -0
  363. package/dist/crdt/ORSet.js.map +1 -0
  364. package/dist/crdt/PNCounter.d.ts +34 -0
  365. package/dist/crdt/PNCounter.d.ts.map +1 -0
  366. package/dist/crdt/PNCounter.js +51 -0
  367. package/dist/crdt/PNCounter.js.map +1 -0
  368. package/dist/crdt/index.d.ts +23 -0
  369. package/dist/crdt/index.d.ts.map +1 -0
  370. package/dist/crdt/index.js +12 -0
  371. package/dist/crdt/index.js.map +1 -0
  372. package/dist/delivery/ConsumerController.d.ts +28 -0
  373. package/dist/delivery/ConsumerController.d.ts.map +1 -0
  374. package/dist/delivery/ConsumerController.js +64 -0
  375. package/dist/delivery/ConsumerController.js.map +1 -0
  376. package/dist/delivery/Messages.d.ts +23 -0
  377. package/dist/delivery/Messages.d.ts.map +1 -0
  378. package/dist/delivery/Messages.js +2 -0
  379. package/dist/delivery/Messages.js.map +1 -0
  380. package/dist/delivery/ProducerController.d.ts +46 -0
  381. package/dist/delivery/ProducerController.d.ts.map +1 -0
  382. package/dist/delivery/ProducerController.js +84 -0
  383. package/dist/delivery/ProducerController.js.map +1 -0
  384. package/dist/delivery/ReliableDelivery.d.ts +36 -0
  385. package/dist/delivery/ReliableDelivery.d.ts.map +1 -0
  386. package/dist/delivery/ReliableDelivery.js +32 -0
  387. package/dist/delivery/ReliableDelivery.js.map +1 -0
  388. package/dist/delivery/index.d.ts +8 -0
  389. package/dist/delivery/index.d.ts.map +1 -0
  390. package/dist/delivery/index.js +4 -0
  391. package/dist/delivery/index.js.map +1 -0
  392. package/dist/discovery/AggregateSeedProvider.d.ts +15 -0
  393. package/dist/discovery/AggregateSeedProvider.d.ts.map +1 -0
  394. package/dist/discovery/AggregateSeedProvider.js +28 -0
  395. package/dist/discovery/AggregateSeedProvider.js.map +1 -0
  396. package/dist/discovery/ConfigSeedProvider.d.ts +20 -0
  397. package/dist/discovery/ConfigSeedProvider.d.ts.map +1 -0
  398. package/dist/discovery/ConfigSeedProvider.js +24 -0
  399. package/dist/discovery/ConfigSeedProvider.js.map +1 -0
  400. package/dist/discovery/DnsSeedProvider.d.ts +49 -0
  401. package/dist/discovery/DnsSeedProvider.d.ts.map +1 -0
  402. package/dist/discovery/DnsSeedProvider.js +57 -0
  403. package/dist/discovery/DnsSeedProvider.js.map +1 -0
  404. package/dist/discovery/KubernetesApiSeedProvider.d.ts +30 -0
  405. package/dist/discovery/KubernetesApiSeedProvider.d.ts.map +1 -0
  406. package/dist/discovery/KubernetesApiSeedProvider.js +66 -0
  407. package/dist/discovery/KubernetesApiSeedProvider.js.map +1 -0
  408. package/dist/discovery/Receptionist.d.ts +55 -0
  409. package/dist/discovery/Receptionist.d.ts.map +1 -0
  410. package/dist/discovery/Receptionist.js +207 -0
  411. package/dist/discovery/Receptionist.js.map +1 -0
  412. package/dist/discovery/ReceptionistMessages.d.ts +65 -0
  413. package/dist/discovery/ReceptionistMessages.d.ts.map +1 -0
  414. package/dist/discovery/ReceptionistMessages.js +76 -0
  415. package/dist/discovery/ReceptionistMessages.js.map +1 -0
  416. package/dist/discovery/SeedProvider.d.ts +17 -0
  417. package/dist/discovery/SeedProvider.d.ts.map +1 -0
  418. package/dist/discovery/SeedProvider.js +2 -0
  419. package/dist/discovery/SeedProvider.js.map +1 -0
  420. package/dist/discovery/ServiceKey.d.ts +15 -0
  421. package/dist/discovery/ServiceKey.d.ts.map +1 -0
  422. package/dist/discovery/ServiceKey.js +17 -0
  423. package/dist/discovery/ServiceKey.js.map +1 -0
  424. package/dist/discovery/autoDiscovery.d.ts +63 -0
  425. package/dist/discovery/autoDiscovery.d.ts.map +1 -0
  426. package/dist/discovery/autoDiscovery.js +91 -0
  427. package/dist/discovery/autoDiscovery.js.map +1 -0
  428. package/dist/discovery/index.d.ts +16 -0
  429. package/dist/discovery/index.d.ts.map +1 -0
  430. package/dist/discovery/index.js +9 -0
  431. package/dist/discovery/index.js.map +1 -0
  432. package/dist/fsm/FSM.d.ts +60 -0
  433. package/dist/fsm/FSM.d.ts.map +1 -0
  434. package/dist/fsm/FSM.js +102 -0
  435. package/dist/fsm/FSM.js.map +1 -0
  436. package/dist/fsm/PersistentFSM.d.ts +230 -0
  437. package/dist/fsm/PersistentFSM.d.ts.map +1 -0
  438. package/dist/fsm/PersistentFSM.js +170 -0
  439. package/dist/fsm/PersistentFSM.js.map +1 -0
  440. package/dist/fsm/index.d.ts +5 -0
  441. package/dist/fsm/index.d.ts.map +1 -0
  442. package/dist/fsm/index.js +3 -0
  443. package/dist/fsm/index.js.map +1 -0
  444. package/dist/http/HttpClient.d.ts +34 -0
  445. package/dist/http/HttpClient.d.ts.map +1 -0
  446. package/dist/http/HttpClient.js +72 -0
  447. package/dist/http/HttpClient.js.map +1 -0
  448. package/dist/http/HttpExtension.d.ts +29 -0
  449. package/dist/http/HttpExtension.d.ts.map +1 -0
  450. package/dist/http/HttpExtension.js +64 -0
  451. package/dist/http/HttpExtension.js.map +1 -0
  452. package/dist/http/Marshalling.d.ts +20 -0
  453. package/dist/http/Marshalling.d.ts.map +1 -0
  454. package/dist/http/Marshalling.js +54 -0
  455. package/dist/http/Marshalling.js.map +1 -0
  456. package/dist/http/Route.d.ts +59 -0
  457. package/dist/http/Route.d.ts.map +1 -0
  458. package/dist/http/Route.js +93 -0
  459. package/dist/http/Route.js.map +1 -0
  460. package/dist/http/backend/ExpressBackend.d.ts +86 -0
  461. package/dist/http/backend/ExpressBackend.d.ts.map +1 -0
  462. package/dist/http/backend/ExpressBackend.js +260 -0
  463. package/dist/http/backend/ExpressBackend.js.map +1 -0
  464. package/dist/http/backend/FastifyBackend.d.ts +31 -0
  465. package/dist/http/backend/FastifyBackend.d.ts.map +1 -0
  466. package/dist/http/backend/FastifyBackend.js +193 -0
  467. package/dist/http/backend/FastifyBackend.js.map +1 -0
  468. package/dist/http/backend/HonoBackend.d.ts +72 -0
  469. package/dist/http/backend/HonoBackend.d.ts.map +1 -0
  470. package/dist/http/backend/HonoBackend.js +212 -0
  471. package/dist/http/backend/HonoBackend.js.map +1 -0
  472. package/dist/http/backend/HttpServerBackend.d.ts +31 -0
  473. package/dist/http/backend/HttpServerBackend.d.ts.map +1 -0
  474. package/dist/http/backend/HttpServerBackend.js +2 -0
  475. package/dist/http/backend/HttpServerBackend.js.map +1 -0
  476. package/dist/http/cache/IdempotencyKey.d.ts +48 -0
  477. package/dist/http/cache/IdempotencyKey.d.ts.map +1 -0
  478. package/dist/http/cache/IdempotencyKey.js +154 -0
  479. package/dist/http/cache/IdempotencyKey.js.map +1 -0
  480. package/dist/http/cache/RateLimit.d.ts +65 -0
  481. package/dist/http/cache/RateLimit.d.ts.map +1 -0
  482. package/dist/http/cache/RateLimit.js +60 -0
  483. package/dist/http/cache/RateLimit.js.map +1 -0
  484. package/dist/http/cache/ResponseCache.d.ts +49 -0
  485. package/dist/http/cache/ResponseCache.d.ts.map +1 -0
  486. package/dist/http/cache/ResponseCache.js +84 -0
  487. package/dist/http/cache/ResponseCache.js.map +1 -0
  488. package/dist/http/cache/index.d.ts +7 -0
  489. package/dist/http/cache/index.d.ts.map +1 -0
  490. package/dist/http/cache/index.js +4 -0
  491. package/dist/http/cache/index.js.map +1 -0
  492. package/dist/http/index.d.ts +18 -0
  493. package/dist/http/index.d.ts.map +1 -0
  494. package/dist/http/index.js +11 -0
  495. package/dist/http/index.js.map +1 -0
  496. package/dist/http/types.d.ts +54 -0
  497. package/dist/http/types.d.ts.map +1 -0
  498. package/dist/http/types.js +40 -0
  499. package/dist/http/types.js.map +1 -0
  500. package/dist/index.d.ts +73 -0
  501. package/dist/index.d.ts.map +1 -0
  502. package/dist/index.js +87 -0
  503. package/dist/index.js.map +1 -0
  504. package/dist/internal/ActorCell.d.ts +116 -0
  505. package/dist/internal/ActorCell.d.ts.map +1 -0
  506. package/dist/internal/ActorCell.js +681 -0
  507. package/dist/internal/ActorCell.js.map +1 -0
  508. package/dist/internal/DeadLetterRef.d.ts +15 -0
  509. package/dist/internal/DeadLetterRef.d.ts.map +1 -0
  510. package/dist/internal/DeadLetterRef.js +24 -0
  511. package/dist/internal/DeadLetterRef.js.map +1 -0
  512. package/dist/internal/Guardian.d.ts +18 -0
  513. package/dist/internal/Guardian.d.ts.map +1 -0
  514. package/dist/internal/Guardian.js +23 -0
  515. package/dist/internal/Guardian.js.map +1 -0
  516. package/dist/internal/LocalActorRef.d.ts +17 -0
  517. package/dist/internal/LocalActorRef.d.ts.map +1 -0
  518. package/dist/internal/LocalActorRef.js +38 -0
  519. package/dist/internal/LocalActorRef.js.map +1 -0
  520. package/dist/internal/Mailbox.d.ts +49 -0
  521. package/dist/internal/Mailbox.d.ts.map +1 -0
  522. package/dist/internal/Mailbox.js +49 -0
  523. package/dist/internal/Mailbox.js.map +1 -0
  524. package/dist/internal/SystemCommand.d.ts +31 -0
  525. package/dist/internal/SystemCommand.d.ts.map +1 -0
  526. package/dist/internal/SystemCommand.js +2 -0
  527. package/dist/internal/SystemCommand.js.map +1 -0
  528. package/dist/io/broker/AmqpActor.d.ts +78 -0
  529. package/dist/io/broker/AmqpActor.d.ts.map +1 -0
  530. package/dist/io/broker/AmqpActor.js +137 -0
  531. package/dist/io/broker/AmqpActor.js.map +1 -0
  532. package/dist/io/broker/BrokerActor.d.ts +125 -0
  533. package/dist/io/broker/BrokerActor.d.ts.map +1 -0
  534. package/dist/io/broker/BrokerActor.js +289 -0
  535. package/dist/io/broker/BrokerActor.js.map +1 -0
  536. package/dist/io/broker/BrokerEvents.d.ts +59 -0
  537. package/dist/io/broker/BrokerEvents.d.ts.map +1 -0
  538. package/dist/io/broker/BrokerEvents.js +79 -0
  539. package/dist/io/broker/BrokerEvents.js.map +1 -0
  540. package/dist/io/broker/BrokerSettings.d.ts +72 -0
  541. package/dist/io/broker/BrokerSettings.d.ts.map +1 -0
  542. package/dist/io/broker/BrokerSettings.js +73 -0
  543. package/dist/io/broker/BrokerSettings.js.map +1 -0
  544. package/dist/io/broker/GrpcClientActor.d.ts +112 -0
  545. package/dist/io/broker/GrpcClientActor.d.ts.map +1 -0
  546. package/dist/io/broker/GrpcClientActor.js +212 -0
  547. package/dist/io/broker/GrpcClientActor.js.map +1 -0
  548. package/dist/io/broker/GrpcServerActor.d.ts +101 -0
  549. package/dist/io/broker/GrpcServerActor.d.ts.map +1 -0
  550. package/dist/io/broker/GrpcServerActor.js +230 -0
  551. package/dist/io/broker/GrpcServerActor.js.map +1 -0
  552. package/dist/io/broker/JetStreamActor.d.ts +352 -0
  553. package/dist/io/broker/JetStreamActor.d.ts.map +1 -0
  554. package/dist/io/broker/JetStreamActor.js +378 -0
  555. package/dist/io/broker/JetStreamActor.js.map +1 -0
  556. package/dist/io/broker/KafkaActor.d.ts +316 -0
  557. package/dist/io/broker/KafkaActor.d.ts.map +1 -0
  558. package/dist/io/broker/KafkaActor.js +355 -0
  559. package/dist/io/broker/KafkaActor.js.map +1 -0
  560. package/dist/io/broker/MqttActor.d.ts +149 -0
  561. package/dist/io/broker/MqttActor.d.ts.map +1 -0
  562. package/dist/io/broker/MqttActor.js +255 -0
  563. package/dist/io/broker/MqttActor.js.map +1 -0
  564. package/dist/io/broker/NatsActor.d.ts +65 -0
  565. package/dist/io/broker/NatsActor.d.ts.map +1 -0
  566. package/dist/io/broker/NatsActor.js +126 -0
  567. package/dist/io/broker/NatsActor.js.map +1 -0
  568. package/dist/io/broker/RedisStreamsActor.d.ts +69 -0
  569. package/dist/io/broker/RedisStreamsActor.d.ts.map +1 -0
  570. package/dist/io/broker/RedisStreamsActor.js +140 -0
  571. package/dist/io/broker/RedisStreamsActor.js.map +1 -0
  572. package/dist/io/broker/ServerWebSocketActor.d.ts +109 -0
  573. package/dist/io/broker/ServerWebSocketActor.d.ts.map +1 -0
  574. package/dist/io/broker/ServerWebSocketActor.js +128 -0
  575. package/dist/io/broker/ServerWebSocketActor.js.map +1 -0
  576. package/dist/io/broker/SseActor.d.ts +45 -0
  577. package/dist/io/broker/SseActor.d.ts.map +1 -0
  578. package/dist/io/broker/SseActor.js +129 -0
  579. package/dist/io/broker/SseActor.js.map +1 -0
  580. package/dist/io/broker/TcpSocketActor.d.ts +73 -0
  581. package/dist/io/broker/TcpSocketActor.d.ts.map +1 -0
  582. package/dist/io/broker/TcpSocketActor.js +168 -0
  583. package/dist/io/broker/TcpSocketActor.js.map +1 -0
  584. package/dist/io/broker/UdpSocketActor.d.ts +54 -0
  585. package/dist/io/broker/UdpSocketActor.d.ts.map +1 -0
  586. package/dist/io/broker/UdpSocketActor.js +100 -0
  587. package/dist/io/broker/UdpSocketActor.js.map +1 -0
  588. package/dist/io/broker/WebSocketActor.d.ts +77 -0
  589. package/dist/io/broker/WebSocketActor.d.ts.map +1 -0
  590. package/dist/io/broker/WebSocketActor.js +217 -0
  591. package/dist/io/broker/WebSocketActor.js.map +1 -0
  592. package/dist/io/broker/WebSocketServerAdapters.d.ts +140 -0
  593. package/dist/io/broker/WebSocketServerAdapters.d.ts.map +1 -0
  594. package/dist/io/broker/WebSocketServerAdapters.js +155 -0
  595. package/dist/io/broker/WebSocketServerAdapters.js.map +1 -0
  596. package/dist/io/broker/index.d.ts +32 -0
  597. package/dist/io/broker/index.d.ts.map +1 -0
  598. package/dist/io/broker/index.js +22 -0
  599. package/dist/io/broker/index.js.map +1 -0
  600. package/dist/io/index.d.ts +2 -0
  601. package/dist/io/index.d.ts.map +1 -0
  602. package/dist/io/index.js +2 -0
  603. package/dist/io/index.js.map +1 -0
  604. package/dist/mailbox/BoundedMailbox.d.ts +28 -0
  605. package/dist/mailbox/BoundedMailbox.d.ts.map +1 -0
  606. package/dist/mailbox/BoundedMailbox.js +41 -0
  607. package/dist/mailbox/BoundedMailbox.js.map +1 -0
  608. package/dist/mailbox/PriorityMailbox.d.ts +32 -0
  609. package/dist/mailbox/PriorityMailbox.d.ts.map +1 -0
  610. package/dist/mailbox/PriorityMailbox.js +58 -0
  611. package/dist/mailbox/PriorityMailbox.js.map +1 -0
  612. package/dist/mailbox/index.d.ts +5 -0
  613. package/dist/mailbox/index.d.ts.map +1 -0
  614. package/dist/mailbox/index.js +3 -0
  615. package/dist/mailbox/index.js.map +1 -0
  616. package/dist/management/HealthCheck.d.ts +21 -0
  617. package/dist/management/HealthCheck.d.ts.map +1 -0
  618. package/dist/management/HealthCheck.js +46 -0
  619. package/dist/management/HealthCheck.js.map +1 -0
  620. package/dist/management/HttpManagement.d.ts +43 -0
  621. package/dist/management/HttpManagement.d.ts.map +1 -0
  622. package/dist/management/HttpManagement.js +158 -0
  623. package/dist/management/HttpManagement.js.map +1 -0
  624. package/dist/management/index.d.ts +5 -0
  625. package/dist/management/index.d.ts.map +1 -0
  626. package/dist/management/index.js +3 -0
  627. package/dist/management/index.js.map +1 -0
  628. package/dist/metrics/Metrics.d.ts +142 -0
  629. package/dist/metrics/Metrics.d.ts.map +1 -0
  630. package/dist/metrics/Metrics.js +231 -0
  631. package/dist/metrics/Metrics.js.map +1 -0
  632. package/dist/metrics/MetricsExtension.d.ts +51 -0
  633. package/dist/metrics/MetricsExtension.d.ts.map +1 -0
  634. package/dist/metrics/MetricsExtension.js +63 -0
  635. package/dist/metrics/MetricsExtension.js.map +1 -0
  636. package/dist/metrics/PromClientAdapter.d.ts +102 -0
  637. package/dist/metrics/PromClientAdapter.d.ts.map +1 -0
  638. package/dist/metrics/PromClientAdapter.js +244 -0
  639. package/dist/metrics/PromClientAdapter.js.map +1 -0
  640. package/dist/metrics/PrometheusExporter.d.ts +31 -0
  641. package/dist/metrics/PrometheusExporter.d.ts.map +1 -0
  642. package/dist/metrics/PrometheusExporter.js +128 -0
  643. package/dist/metrics/PrometheusExporter.js.map +1 -0
  644. package/dist/metrics/index.d.ts +7 -0
  645. package/dist/metrics/index.d.ts.map +1 -0
  646. package/dist/metrics/index.js +5 -0
  647. package/dist/metrics/index.js.map +1 -0
  648. package/dist/pattern/BackoffPolicy.d.ts +67 -0
  649. package/dist/pattern/BackoffPolicy.d.ts.map +1 -0
  650. package/dist/pattern/BackoffPolicy.js +87 -0
  651. package/dist/pattern/BackoffPolicy.js.map +1 -0
  652. package/dist/pattern/BackoffSupervisor.d.ts +234 -0
  653. package/dist/pattern/BackoffSupervisor.d.ts.map +1 -0
  654. package/dist/pattern/BackoffSupervisor.js +292 -0
  655. package/dist/pattern/BackoffSupervisor.js.map +1 -0
  656. package/dist/pattern/CircuitBreaker.d.ts +49 -0
  657. package/dist/pattern/CircuitBreaker.d.ts.map +1 -0
  658. package/dist/pattern/CircuitBreaker.js +110 -0
  659. package/dist/pattern/CircuitBreaker.js.map +1 -0
  660. package/dist/pattern/Status.d.ts +13 -0
  661. package/dist/pattern/Status.d.ts.map +1 -0
  662. package/dist/pattern/Status.js +13 -0
  663. package/dist/pattern/Status.js.map +1 -0
  664. package/dist/pattern/after.d.ts +13 -0
  665. package/dist/pattern/after.d.ts.map +1 -0
  666. package/dist/pattern/after.js +26 -0
  667. package/dist/pattern/after.js.map +1 -0
  668. package/dist/pattern/index.d.ts +14 -0
  669. package/dist/pattern/index.d.ts.map +1 -0
  670. package/dist/pattern/index.js +8 -0
  671. package/dist/pattern/index.js.map +1 -0
  672. package/dist/pattern/pipeTo.d.ts +20 -0
  673. package/dist/pattern/pipeTo.d.ts.map +1 -0
  674. package/dist/pattern/pipeTo.js +22 -0
  675. package/dist/pattern/pipeTo.js.map +1 -0
  676. package/dist/pattern/retry.d.ts +24 -0
  677. package/dist/pattern/retry.d.ts.map +1 -0
  678. package/dist/pattern/retry.js +35 -0
  679. package/dist/pattern/retry.js.map +1 -0
  680. package/dist/persistence/DurableStateActor.d.ts +62 -0
  681. package/dist/persistence/DurableStateActor.d.ts.map +1 -0
  682. package/dist/persistence/DurableStateActor.js +120 -0
  683. package/dist/persistence/DurableStateActor.js.map +1 -0
  684. package/dist/persistence/DurableStateStore.d.ts +43 -0
  685. package/dist/persistence/DurableStateStore.d.ts.map +1 -0
  686. package/dist/persistence/DurableStateStore.js +13 -0
  687. package/dist/persistence/DurableStateStore.js.map +1 -0
  688. package/dist/persistence/EventDispatcher.d.ts +88 -0
  689. package/dist/persistence/EventDispatcher.d.ts.map +1 -0
  690. package/dist/persistence/EventDispatcher.js +81 -0
  691. package/dist/persistence/EventDispatcher.js.map +1 -0
  692. package/dist/persistence/Journal.d.ts +40 -0
  693. package/dist/persistence/Journal.d.ts.map +1 -0
  694. package/dist/persistence/Journal.js +2 -0
  695. package/dist/persistence/Journal.js.map +1 -0
  696. package/dist/persistence/JournalEventBus.d.ts +47 -0
  697. package/dist/persistence/JournalEventBus.d.ts.map +1 -0
  698. package/dist/persistence/JournalEventBus.js +26 -0
  699. package/dist/persistence/JournalEventBus.js.map +1 -0
  700. package/dist/persistence/JournalTypes.d.ts +39 -0
  701. package/dist/persistence/JournalTypes.d.ts.map +1 -0
  702. package/dist/persistence/JournalTypes.js +28 -0
  703. package/dist/persistence/JournalTypes.js.map +1 -0
  704. package/dist/persistence/PersistenceExtension.d.ts +32 -0
  705. package/dist/persistence/PersistenceExtension.d.ts.map +1 -0
  706. package/dist/persistence/PersistenceExtension.js +69 -0
  707. package/dist/persistence/PersistenceExtension.js.map +1 -0
  708. package/dist/persistence/PersistenceOptions.d.ts +95 -0
  709. package/dist/persistence/PersistenceOptions.d.ts.map +1 -0
  710. package/dist/persistence/PersistenceOptions.js +20 -0
  711. package/dist/persistence/PersistenceOptions.js.map +1 -0
  712. package/dist/persistence/PersistentActor.d.ts +120 -0
  713. package/dist/persistence/PersistentActor.d.ts.map +1 -0
  714. package/dist/persistence/PersistentActor.js +246 -0
  715. package/dist/persistence/PersistentActor.js.map +1 -0
  716. package/dist/persistence/ReplicatedEventSourcedActor.d.ts +238 -0
  717. package/dist/persistence/ReplicatedEventSourcedActor.d.ts.map +1 -0
  718. package/dist/persistence/ReplicatedEventSourcedActor.js +430 -0
  719. package/dist/persistence/ReplicatedEventSourcedActor.js.map +1 -0
  720. package/dist/persistence/SnapshotStore.d.ts +31 -0
  721. package/dist/persistence/SnapshotStore.d.ts.map +1 -0
  722. package/dist/persistence/SnapshotStore.js +2 -0
  723. package/dist/persistence/SnapshotStore.js.map +1 -0
  724. package/dist/persistence/durable-state-stores/InMemoryDurableStateStore.d.ts +14 -0
  725. package/dist/persistence/durable-state-stores/InMemoryDurableStateStore.d.ts.map +1 -0
  726. package/dist/persistence/durable-state-stores/InMemoryDurableStateStore.js +31 -0
  727. package/dist/persistence/durable-state-stores/InMemoryDurableStateStore.js.map +1 -0
  728. package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.d.ts +27 -0
  729. package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.d.ts.map +1 -0
  730. package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.js +157 -0
  731. package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.js.map +1 -0
  732. package/dist/persistence/index.d.ts +65 -0
  733. package/dist/persistence/index.d.ts.map +1 -0
  734. package/dist/persistence/index.js +44 -0
  735. package/dist/persistence/index.js.map +1 -0
  736. package/dist/persistence/journals/CassandraClient.d.ts +81 -0
  737. package/dist/persistence/journals/CassandraClient.d.ts.map +1 -0
  738. package/dist/persistence/journals/CassandraClient.js +65 -0
  739. package/dist/persistence/journals/CassandraClient.js.map +1 -0
  740. package/dist/persistence/journals/CassandraJournal.d.ts +96 -0
  741. package/dist/persistence/journals/CassandraJournal.d.ts.map +1 -0
  742. package/dist/persistence/journals/CassandraJournal.js +247 -0
  743. package/dist/persistence/journals/CassandraJournal.js.map +1 -0
  744. package/dist/persistence/journals/CassandraPlugin.d.ts +30 -0
  745. package/dist/persistence/journals/CassandraPlugin.d.ts.map +1 -0
  746. package/dist/persistence/journals/CassandraPlugin.js +18 -0
  747. package/dist/persistence/journals/CassandraPlugin.js.map +1 -0
  748. package/dist/persistence/journals/InMemoryJournal.d.ts +35 -0
  749. package/dist/persistence/journals/InMemoryJournal.d.ts.map +1 -0
  750. package/dist/persistence/journals/InMemoryJournal.js +97 -0
  751. package/dist/persistence/journals/InMemoryJournal.js.map +1 -0
  752. package/dist/persistence/journals/SqliteJournal.d.ts +68 -0
  753. package/dist/persistence/journals/SqliteJournal.d.ts.map +1 -0
  754. package/dist/persistence/journals/SqliteJournal.js +225 -0
  755. package/dist/persistence/journals/SqliteJournal.js.map +1 -0
  756. package/dist/persistence/migration/Adapter.d.ts +72 -0
  757. package/dist/persistence/migration/Adapter.d.ts.map +1 -0
  758. package/dist/persistence/migration/Adapter.js +24 -0
  759. package/dist/persistence/migration/Adapter.js.map +1 -0
  760. package/dist/persistence/migration/Codec.d.ts +103 -0
  761. package/dist/persistence/migration/Codec.d.ts.map +1 -0
  762. package/dist/persistence/migration/Codec.js +92 -0
  763. package/dist/persistence/migration/Codec.js.map +1 -0
  764. package/dist/persistence/migration/Envelope.d.ts +37 -0
  765. package/dist/persistence/migration/Envelope.d.ts.map +1 -0
  766. package/dist/persistence/migration/Envelope.js +79 -0
  767. package/dist/persistence/migration/Envelope.js.map +1 -0
  768. package/dist/persistence/migration/MigrationChain.d.ts +100 -0
  769. package/dist/persistence/migration/MigrationChain.d.ts.map +1 -0
  770. package/dist/persistence/migration/MigrationChain.js +159 -0
  771. package/dist/persistence/migration/MigrationChain.js.map +1 -0
  772. package/dist/persistence/migration/SchemaRegistry.d.ts +114 -0
  773. package/dist/persistence/migration/SchemaRegistry.d.ts.map +1 -0
  774. package/dist/persistence/migration/SchemaRegistry.js +112 -0
  775. package/dist/persistence/migration/SchemaRegistry.js.map +1 -0
  776. package/dist/persistence/migration/defaultsAdapter.d.ts +56 -0
  777. package/dist/persistence/migration/defaultsAdapter.d.ts.map +1 -0
  778. package/dist/persistence/migration/defaultsAdapter.js +119 -0
  779. package/dist/persistence/migration/defaultsAdapter.js.map +1 -0
  780. package/dist/persistence/migration/index.d.ts +18 -0
  781. package/dist/persistence/migration/index.d.ts.map +1 -0
  782. package/dist/persistence/migration/index.js +12 -0
  783. package/dist/persistence/migration/index.js.map +1 -0
  784. package/dist/persistence/migration/journalMigration.d.ts +155 -0
  785. package/dist/persistence/migration/journalMigration.d.ts.map +1 -0
  786. package/dist/persistence/migration/journalMigration.js +149 -0
  787. package/dist/persistence/migration/journalMigration.js.map +1 -0
  788. package/dist/persistence/migration/migratingAdapter.d.ts +43 -0
  789. package/dist/persistence/migration/migratingAdapter.d.ts.map +1 -0
  790. package/dist/persistence/migration/migratingAdapter.js +65 -0
  791. package/dist/persistence/migration/migratingAdapter.js.map +1 -0
  792. package/dist/persistence/migration/validatedAdapter.d.ts +48 -0
  793. package/dist/persistence/migration/validatedAdapter.d.ts.map +1 -0
  794. package/dist/persistence/migration/validatedAdapter.js +86 -0
  795. package/dist/persistence/migration/validatedAdapter.js.map +1 -0
  796. package/dist/persistence/migration/wrapLegacy.d.ts +83 -0
  797. package/dist/persistence/migration/wrapLegacy.d.ts.map +1 -0
  798. package/dist/persistence/migration/wrapLegacy.js +126 -0
  799. package/dist/persistence/migration/wrapLegacy.js.map +1 -0
  800. package/dist/persistence/object-storage/BodyCodec.d.ts +88 -0
  801. package/dist/persistence/object-storage/BodyCodec.d.ts.map +1 -0
  802. package/dist/persistence/object-storage/BodyCodec.js +171 -0
  803. package/dist/persistence/object-storage/BodyCodec.js.map +1 -0
  804. package/dist/persistence/object-storage/Compression.d.ts +31 -0
  805. package/dist/persistence/object-storage/Compression.d.ts.map +1 -0
  806. package/dist/persistence/object-storage/Compression.js +99 -0
  807. package/dist/persistence/object-storage/Compression.js.map +1 -0
  808. package/dist/persistence/object-storage/Encryption.d.ts +73 -0
  809. package/dist/persistence/object-storage/Encryption.d.ts.map +1 -0
  810. package/dist/persistence/object-storage/Encryption.js +167 -0
  811. package/dist/persistence/object-storage/Encryption.js.map +1 -0
  812. package/dist/persistence/object-storage/FilesystemObjectStorageBackend.d.ts +79 -0
  813. package/dist/persistence/object-storage/FilesystemObjectStorageBackend.d.ts.map +1 -0
  814. package/dist/persistence/object-storage/FilesystemObjectStorageBackend.js +325 -0
  815. package/dist/persistence/object-storage/FilesystemObjectStorageBackend.js.map +1 -0
  816. package/dist/persistence/object-storage/ObjectStorageBackend.d.ts +86 -0
  817. package/dist/persistence/object-storage/ObjectStorageBackend.d.ts.map +1 -0
  818. package/dist/persistence/object-storage/ObjectStorageBackend.js +24 -0
  819. package/dist/persistence/object-storage/ObjectStorageBackend.js.map +1 -0
  820. package/dist/persistence/object-storage/ObjectStoragePlugin.d.ts +93 -0
  821. package/dist/persistence/object-storage/ObjectStoragePlugin.d.ts.map +1 -0
  822. package/dist/persistence/object-storage/ObjectStoragePlugin.js +113 -0
  823. package/dist/persistence/object-storage/ObjectStoragePlugin.js.map +1 -0
  824. package/dist/persistence/object-storage/PluginConfig.d.ts +67 -0
  825. package/dist/persistence/object-storage/PluginConfig.d.ts.map +1 -0
  826. package/dist/persistence/object-storage/PluginConfig.js +93 -0
  827. package/dist/persistence/object-storage/PluginConfig.js.map +1 -0
  828. package/dist/persistence/object-storage/S3ObjectStorageBackend.d.ts +104 -0
  829. package/dist/persistence/object-storage/S3ObjectStorageBackend.d.ts.map +1 -0
  830. package/dist/persistence/object-storage/S3ObjectStorageBackend.js +202 -0
  831. package/dist/persistence/object-storage/S3ObjectStorageBackend.js.map +1 -0
  832. package/dist/persistence/object-storage/reEncryptionSweep.d.ts +110 -0
  833. package/dist/persistence/object-storage/reEncryptionSweep.d.ts.map +1 -0
  834. package/dist/persistence/object-storage/reEncryptionSweep.js +157 -0
  835. package/dist/persistence/object-storage/reEncryptionSweep.js.map +1 -0
  836. package/dist/persistence/projection/OffsetStore.d.ts +69 -0
  837. package/dist/persistence/projection/OffsetStore.d.ts.map +1 -0
  838. package/dist/persistence/projection/OffsetStore.js +103 -0
  839. package/dist/persistence/projection/OffsetStore.js.map +1 -0
  840. package/dist/persistence/projection/ProjectionActor.d.ts +62 -0
  841. package/dist/persistence/projection/ProjectionActor.d.ts.map +1 -0
  842. package/dist/persistence/projection/ProjectionActor.js +120 -0
  843. package/dist/persistence/projection/ProjectionActor.js.map +1 -0
  844. package/dist/persistence/query/CassandraQuery.d.ts +42 -0
  845. package/dist/persistence/query/CassandraQuery.d.ts.map +1 -0
  846. package/dist/persistence/query/CassandraQuery.js +118 -0
  847. package/dist/persistence/query/CassandraQuery.js.map +1 -0
  848. package/dist/persistence/query/InMemoryQuery.d.ts +31 -0
  849. package/dist/persistence/query/InMemoryQuery.d.ts.map +1 -0
  850. package/dist/persistence/query/InMemoryQuery.js +285 -0
  851. package/dist/persistence/query/InMemoryQuery.js.map +1 -0
  852. package/dist/persistence/query/PersistenceQuery.d.ts +162 -0
  853. package/dist/persistence/query/PersistenceQuery.d.ts.map +1 -0
  854. package/dist/persistence/query/PersistenceQuery.js +78 -0
  855. package/dist/persistence/query/PersistenceQuery.js.map +1 -0
  856. package/dist/persistence/query/SqliteQuery.d.ts +58 -0
  857. package/dist/persistence/query/SqliteQuery.d.ts.map +1 -0
  858. package/dist/persistence/query/SqliteQuery.js +173 -0
  859. package/dist/persistence/query/SqliteQuery.js.map +1 -0
  860. package/dist/persistence/replicated/ConflictResolver.d.ts +70 -0
  861. package/dist/persistence/replicated/ConflictResolver.d.ts.map +1 -0
  862. package/dist/persistence/replicated/ConflictResolver.js +47 -0
  863. package/dist/persistence/replicated/ConflictResolver.js.map +1 -0
  864. package/dist/persistence/replicated/ReplicatedSnapshot.d.ts +43 -0
  865. package/dist/persistence/replicated/ReplicatedSnapshot.d.ts.map +1 -0
  866. package/dist/persistence/replicated/ReplicatedSnapshot.js +2 -0
  867. package/dist/persistence/replicated/ReplicatedSnapshot.js.map +1 -0
  868. package/dist/persistence/replicated/VectorClock.d.ts +57 -0
  869. package/dist/persistence/replicated/VectorClock.d.ts.map +1 -0
  870. package/dist/persistence/replicated/VectorClock.js +79 -0
  871. package/dist/persistence/replicated/VectorClock.js.map +1 -0
  872. package/dist/persistence/snapshot-stores/CachedSnapshotStore.d.ts +27 -0
  873. package/dist/persistence/snapshot-stores/CachedSnapshotStore.d.ts.map +1 -0
  874. package/dist/persistence/snapshot-stores/CachedSnapshotStore.js +82 -0
  875. package/dist/persistence/snapshot-stores/CachedSnapshotStore.js.map +1 -0
  876. package/dist/persistence/snapshot-stores/CassandraSnapshotStore.d.ts +42 -0
  877. package/dist/persistence/snapshot-stores/CassandraSnapshotStore.d.ts.map +1 -0
  878. package/dist/persistence/snapshot-stores/CassandraSnapshotStore.js +121 -0
  879. package/dist/persistence/snapshot-stores/CassandraSnapshotStore.js.map +1 -0
  880. package/dist/persistence/snapshot-stores/InMemorySnapshotStore.d.ts +19 -0
  881. package/dist/persistence/snapshot-stores/InMemorySnapshotStore.d.ts.map +1 -0
  882. package/dist/persistence/snapshot-stores/InMemorySnapshotStore.js +44 -0
  883. package/dist/persistence/snapshot-stores/InMemorySnapshotStore.js.map +1 -0
  884. package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.d.ts +46 -0
  885. package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.d.ts.map +1 -0
  886. package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.js +172 -0
  887. package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.js.map +1 -0
  888. package/dist/persistence/snapshot-stores/SqliteSnapshotStore.d.ts +42 -0
  889. package/dist/persistence/snapshot-stores/SqliteSnapshotStore.d.ts.map +1 -0
  890. package/dist/persistence/snapshot-stores/SqliteSnapshotStore.js +108 -0
  891. package/dist/persistence/snapshot-stores/SqliteSnapshotStore.js.map +1 -0
  892. package/dist/persistence/storage/KeyValidator.d.ts +80 -0
  893. package/dist/persistence/storage/KeyValidator.d.ts.map +1 -0
  894. package/dist/persistence/storage/KeyValidator.js +88 -0
  895. package/dist/persistence/storage/KeyValidator.js.map +1 -0
  896. package/dist/runtime/detect.d.ts +35 -0
  897. package/dist/runtime/detect.d.ts.map +1 -0
  898. package/dist/runtime/detect.js +60 -0
  899. package/dist/runtime/detect.js.map +1 -0
  900. package/dist/runtime/http/BunHonoRunner.d.ts +16 -0
  901. package/dist/runtime/http/BunHonoRunner.d.ts.map +1 -0
  902. package/dist/runtime/http/BunHonoRunner.js +26 -0
  903. package/dist/runtime/http/BunHonoRunner.js.map +1 -0
  904. package/dist/runtime/http/DenoHonoRunner.d.ts +16 -0
  905. package/dist/runtime/http/DenoHonoRunner.d.ts.map +1 -0
  906. package/dist/runtime/http/DenoHonoRunner.js +33 -0
  907. package/dist/runtime/http/DenoHonoRunner.js.map +1 -0
  908. package/dist/runtime/http/HonoServerRunner.d.ts +28 -0
  909. package/dist/runtime/http/HonoServerRunner.d.ts.map +1 -0
  910. package/dist/runtime/http/HonoServerRunner.js +16 -0
  911. package/dist/runtime/http/HonoServerRunner.js.map +1 -0
  912. package/dist/runtime/http/NodeHonoRunner.d.ts +19 -0
  913. package/dist/runtime/http/NodeHonoRunner.d.ts.map +1 -0
  914. package/dist/runtime/http/NodeHonoRunner.js +70 -0
  915. package/dist/runtime/http/NodeHonoRunner.js.map +1 -0
  916. package/dist/runtime/http/index.d.ts +13 -0
  917. package/dist/runtime/http/index.d.ts.map +1 -0
  918. package/dist/runtime/http/index.js +40 -0
  919. package/dist/runtime/http/index.js.map +1 -0
  920. package/dist/runtime/sqlite/BetterSqliteDriver.d.ts +18 -0
  921. package/dist/runtime/sqlite/BetterSqliteDriver.d.ts.map +1 -0
  922. package/dist/runtime/sqlite/BetterSqliteDriver.js +64 -0
  923. package/dist/runtime/sqlite/BetterSqliteDriver.js.map +1 -0
  924. package/dist/runtime/sqlite/BunSqliteDriver.d.ts +17 -0
  925. package/dist/runtime/sqlite/BunSqliteDriver.d.ts.map +1 -0
  926. package/dist/runtime/sqlite/BunSqliteDriver.js +34 -0
  927. package/dist/runtime/sqlite/BunSqliteDriver.js.map +1 -0
  928. package/dist/runtime/sqlite/SqliteDriver.d.ts +35 -0
  929. package/dist/runtime/sqlite/SqliteDriver.d.ts.map +1 -0
  930. package/dist/runtime/sqlite/SqliteDriver.js +13 -0
  931. package/dist/runtime/sqlite/SqliteDriver.js.map +1 -0
  932. package/dist/runtime/sqlite/index.d.ts +14 -0
  933. package/dist/runtime/sqlite/index.d.ts.map +1 -0
  934. package/dist/runtime/sqlite/index.js +41 -0
  935. package/dist/runtime/sqlite/index.js.map +1 -0
  936. package/dist/runtime/tcp/BunTcpBackend.d.ts +24 -0
  937. package/dist/runtime/tcp/BunTcpBackend.d.ts.map +1 -0
  938. package/dist/runtime/tcp/BunTcpBackend.js +66 -0
  939. package/dist/runtime/tcp/BunTcpBackend.js.map +1 -0
  940. package/dist/runtime/tcp/DenoTcpBackend.d.ts +30 -0
  941. package/dist/runtime/tcp/DenoTcpBackend.d.ts.map +1 -0
  942. package/dist/runtime/tcp/DenoTcpBackend.js +145 -0
  943. package/dist/runtime/tcp/DenoTcpBackend.js.map +1 -0
  944. package/dist/runtime/tcp/NodeTcpBackend.d.ts +25 -0
  945. package/dist/runtime/tcp/NodeTcpBackend.d.ts.map +1 -0
  946. package/dist/runtime/tcp/NodeTcpBackend.js +102 -0
  947. package/dist/runtime/tcp/NodeTcpBackend.js.map +1 -0
  948. package/dist/runtime/tcp/TcpBackend.d.ts +65 -0
  949. package/dist/runtime/tcp/TcpBackend.d.ts.map +1 -0
  950. package/dist/runtime/tcp/TcpBackend.js +17 -0
  951. package/dist/runtime/tcp/TcpBackend.js.map +1 -0
  952. package/dist/runtime/tcp/index.d.ts +13 -0
  953. package/dist/runtime/tcp/index.d.ts.map +1 -0
  954. package/dist/runtime/tcp/index.js +40 -0
  955. package/dist/runtime/tcp/index.js.map +1 -0
  956. package/dist/runtime/worker/NodeWorkerBackend.d.ts +19 -0
  957. package/dist/runtime/worker/NodeWorkerBackend.d.ts.map +1 -0
  958. package/dist/runtime/worker/NodeWorkerBackend.js +84 -0
  959. package/dist/runtime/worker/NodeWorkerBackend.js.map +1 -0
  960. package/dist/runtime/worker/WebWorkerBackend.d.ts +12 -0
  961. package/dist/runtime/worker/WebWorkerBackend.d.ts.map +1 -0
  962. package/dist/runtime/worker/WebWorkerBackend.js +55 -0
  963. package/dist/runtime/worker/WebWorkerBackend.js.map +1 -0
  964. package/dist/runtime/worker/WorkerBackend.d.ts +45 -0
  965. package/dist/runtime/worker/WorkerBackend.d.ts.map +1 -0
  966. package/dist/runtime/worker/WorkerBackend.js +18 -0
  967. package/dist/runtime/worker/WorkerBackend.js.map +1 -0
  968. package/dist/runtime/worker/index.d.ts +14 -0
  969. package/dist/runtime/worker/index.d.ts.map +1 -0
  970. package/dist/runtime/worker/index.js +34 -0
  971. package/dist/runtime/worker/index.js.map +1 -0
  972. package/dist/serialization/CborCodec.d.ts +51 -0
  973. package/dist/serialization/CborCodec.d.ts.map +1 -0
  974. package/dist/serialization/CborCodec.js +321 -0
  975. package/dist/serialization/CborCodec.js.map +1 -0
  976. package/dist/serialization/CborSerializer.d.ts +23 -0
  977. package/dist/serialization/CborSerializer.d.ts.map +1 -0
  978. package/dist/serialization/CborSerializer.js +27 -0
  979. package/dist/serialization/CborSerializer.js.map +1 -0
  980. package/dist/serialization/JsonSerializer.d.ts +18 -0
  981. package/dist/serialization/JsonSerializer.d.ts.map +1 -0
  982. package/dist/serialization/JsonSerializer.js +114 -0
  983. package/dist/serialization/JsonSerializer.js.map +1 -0
  984. package/dist/serialization/SerializationExtension.d.ts +46 -0
  985. package/dist/serialization/SerializationExtension.d.ts.map +1 -0
  986. package/dist/serialization/SerializationExtension.js +105 -0
  987. package/dist/serialization/SerializationExtension.js.map +1 -0
  988. package/dist/serialization/Serializer.d.ts +44 -0
  989. package/dist/serialization/Serializer.d.ts.map +1 -0
  990. package/dist/serialization/Serializer.js +7 -0
  991. package/dist/serialization/Serializer.js.map +1 -0
  992. package/dist/serialization/index.d.ts +7 -0
  993. package/dist/serialization/index.d.ts.map +1 -0
  994. package/dist/serialization/index.js +6 -0
  995. package/dist/serialization/index.js.map +1 -0
  996. package/dist/testkit/ManualScheduler.d.ts +35 -0
  997. package/dist/testkit/ManualScheduler.d.ts.map +1 -0
  998. package/dist/testkit/ManualScheduler.js +126 -0
  999. package/dist/testkit/ManualScheduler.js.map +1 -0
  1000. package/dist/testkit/MultiNodeSpec.d.ts +132 -0
  1001. package/dist/testkit/MultiNodeSpec.d.ts.map +1 -0
  1002. package/dist/testkit/MultiNodeSpec.js +237 -0
  1003. package/dist/testkit/MultiNodeSpec.js.map +1 -0
  1004. package/dist/testkit/ParallelMultiNodeSpec.d.ts +117 -0
  1005. package/dist/testkit/ParallelMultiNodeSpec.d.ts.map +1 -0
  1006. package/dist/testkit/ParallelMultiNodeSpec.js +310 -0
  1007. package/dist/testkit/ParallelMultiNodeSpec.js.map +1 -0
  1008. package/dist/testkit/TestKit.d.ts +40 -0
  1009. package/dist/testkit/TestKit.d.ts.map +1 -0
  1010. package/dist/testkit/TestKit.js +60 -0
  1011. package/dist/testkit/TestKit.js.map +1 -0
  1012. package/dist/testkit/TestProbe.d.ts +56 -0
  1013. package/dist/testkit/TestProbe.d.ts.map +1 -0
  1014. package/dist/testkit/TestProbe.js +184 -0
  1015. package/dist/testkit/TestProbe.js.map +1 -0
  1016. package/dist/testkit/index.d.ts +11 -0
  1017. package/dist/testkit/index.d.ts.map +1 -0
  1018. package/dist/testkit/index.js +6 -0
  1019. package/dist/testkit/index.js.map +1 -0
  1020. package/dist/testkit/internal/MultiNodeBroker.d.ts +39 -0
  1021. package/dist/testkit/internal/MultiNodeBroker.d.ts.map +1 -0
  1022. package/dist/testkit/internal/MultiNodeBroker.js +96 -0
  1023. package/dist/testkit/internal/MultiNodeBroker.js.map +1 -0
  1024. package/dist/testkit/internal/MultiNodeTransport.d.ts +58 -0
  1025. package/dist/testkit/internal/MultiNodeTransport.d.ts.map +1 -0
  1026. package/dist/testkit/internal/MultiNodeTransport.js +96 -0
  1027. package/dist/testkit/internal/MultiNodeTransport.js.map +1 -0
  1028. package/dist/testkit/internal/parallel-multi-node-bootstrap.d.ts +54 -0
  1029. package/dist/testkit/internal/parallel-multi-node-bootstrap.d.ts.map +1 -0
  1030. package/dist/testkit/internal/parallel-multi-node-bootstrap.js +157 -0
  1031. package/dist/testkit/internal/parallel-multi-node-bootstrap.js.map +1 -0
  1032. package/dist/tracing/NoopTracer.d.ts +11 -0
  1033. package/dist/tracing/NoopTracer.d.ts.map +1 -0
  1034. package/dist/tracing/NoopTracer.js +29 -0
  1035. package/dist/tracing/NoopTracer.js.map +1 -0
  1036. package/dist/tracing/OtelAdapter.d.ts +106 -0
  1037. package/dist/tracing/OtelAdapter.d.ts.map +1 -0
  1038. package/dist/tracing/OtelAdapter.js +164 -0
  1039. package/dist/tracing/OtelAdapter.js.map +1 -0
  1040. package/dist/tracing/RecordingTracer.d.ts +54 -0
  1041. package/dist/tracing/RecordingTracer.d.ts.map +1 -0
  1042. package/dist/tracing/RecordingTracer.js +129 -0
  1043. package/dist/tracing/RecordingTracer.js.map +1 -0
  1044. package/dist/tracing/Tracer.d.ts +100 -0
  1045. package/dist/tracing/Tracer.d.ts.map +1 -0
  1046. package/dist/tracing/Tracer.js +76 -0
  1047. package/dist/tracing/Tracer.js.map +1 -0
  1048. package/dist/tracing/TracingExtension.d.ts +32 -0
  1049. package/dist/tracing/TracingExtension.d.ts.map +1 -0
  1050. package/dist/tracing/TracingExtension.js +38 -0
  1051. package/dist/tracing/TracingExtension.js.map +1 -0
  1052. package/dist/tracing/index.d.ts +9 -0
  1053. package/dist/tracing/index.d.ts.map +1 -0
  1054. package/dist/tracing/index.js +6 -0
  1055. package/dist/tracing/index.js.map +1 -0
  1056. package/dist/typed/Behavior.d.ts +78 -0
  1057. package/dist/typed/Behavior.d.ts.map +1 -0
  1058. package/dist/typed/Behavior.js +2 -0
  1059. package/dist/typed/Behavior.js.map +1 -0
  1060. package/dist/typed/Behaviors.d.ts +60 -0
  1061. package/dist/typed/Behaviors.d.ts.map +1 -0
  1062. package/dist/typed/Behaviors.js +77 -0
  1063. package/dist/typed/Behaviors.js.map +1 -0
  1064. package/dist/typed/TypedActor.d.ts +28 -0
  1065. package/dist/typed/TypedActor.d.ts.map +1 -0
  1066. package/dist/typed/TypedActor.js +194 -0
  1067. package/dist/typed/TypedActor.js.map +1 -0
  1068. package/dist/typed/TypedActorContext.d.ts +29 -0
  1069. package/dist/typed/TypedActorContext.d.ts.map +1 -0
  1070. package/dist/typed/TypedActorContext.js +2 -0
  1071. package/dist/typed/TypedActorContext.js.map +1 -0
  1072. package/dist/typed/index.d.ts +7 -0
  1073. package/dist/typed/index.d.ts.map +1 -0
  1074. package/dist/typed/index.js +4 -0
  1075. package/dist/typed/index.js.map +1 -0
  1076. package/dist/typed/spawn.d.ts +14 -0
  1077. package/dist/typed/spawn.d.ts.map +1 -0
  1078. package/dist/typed/spawn.js +16 -0
  1079. package/dist/typed/spawn.js.map +1 -0
  1080. package/dist/util/Constants.d.ts +66 -0
  1081. package/dist/util/Constants.d.ts.map +1 -0
  1082. package/dist/util/Constants.js +66 -0
  1083. package/dist/util/Constants.js.map +1 -0
  1084. package/dist/util/Either.d.ts +100 -0
  1085. package/dist/util/Either.d.ts.map +1 -0
  1086. package/dist/util/Either.js +128 -0
  1087. package/dist/util/Either.js.map +1 -0
  1088. package/dist/util/Lazy.d.ts +82 -0
  1089. package/dist/util/Lazy.d.ts.map +1 -0
  1090. package/dist/util/Lazy.js +119 -0
  1091. package/dist/util/Lazy.js.map +1 -0
  1092. package/dist/util/LazyImport.d.ts +68 -0
  1093. package/dist/util/LazyImport.d.ts.map +1 -0
  1094. package/dist/util/LazyImport.js +64 -0
  1095. package/dist/util/LazyImport.js.map +1 -0
  1096. package/dist/util/Option.d.ts +105 -0
  1097. package/dist/util/Option.d.ts.map +1 -0
  1098. package/dist/util/Option.js +123 -0
  1099. package/dist/util/Option.js.map +1 -0
  1100. package/dist/util/TokenBucket.d.ts +59 -0
  1101. package/dist/util/TokenBucket.d.ts.map +1 -0
  1102. package/dist/util/TokenBucket.js +76 -0
  1103. package/dist/util/TokenBucket.js.map +1 -0
  1104. package/dist/util/Try.d.ts +103 -0
  1105. package/dist/util/Try.d.ts.map +1 -0
  1106. package/dist/util/Try.js +176 -0
  1107. package/dist/util/Try.js.map +1 -0
  1108. package/dist/util/WrapError.d.ts +42 -0
  1109. package/dist/util/WrapError.d.ts.map +1 -0
  1110. package/dist/util/WrapError.js +46 -0
  1111. package/dist/util/WrapError.js.map +1 -0
  1112. package/dist/worker/WorkerBroker.d.ts +29 -0
  1113. package/dist/worker/WorkerBroker.d.ts.map +1 -0
  1114. package/dist/worker/WorkerBroker.js +74 -0
  1115. package/dist/worker/WorkerBroker.js.map +1 -0
  1116. package/dist/worker/WorkerCluster.d.ts +68 -0
  1117. package/dist/worker/WorkerCluster.d.ts.map +1 -0
  1118. package/dist/worker/WorkerCluster.js +161 -0
  1119. package/dist/worker/WorkerCluster.js.map +1 -0
  1120. package/dist/worker/WorkerNode.d.ts +20 -0
  1121. package/dist/worker/WorkerNode.d.ts.map +1 -0
  1122. package/dist/worker/WorkerNode.js +84 -0
  1123. package/dist/worker/WorkerNode.js.map +1 -0
  1124. package/dist/worker/index.d.ts +6 -0
  1125. package/dist/worker/index.d.ts.map +1 -0
  1126. package/dist/worker/index.js +4 -0
  1127. package/dist/worker/index.js.map +1 -0
  1128. package/package.json +148 -0
@@ -0,0 +1,719 @@
1
+ import { match, P } from 'ts-pattern';
2
+ import { Actor } from '../../Actor.js';
3
+ import { LeaderChanged, MemberRemoved } from '../ClusterEvents.js';
4
+ import { NodeAddress } from '../NodeAddress.js';
5
+ import { RemoteActorRef } from '../RemoteActorRef.js';
6
+ function isCoordinatorEvent(msg) {
7
+ if (!msg || typeof msg !== 'object')
8
+ return false;
9
+ const t = msg.t;
10
+ return t === 'reconcile' || t === 'lease-acquire-result'
11
+ || t === 'lease-lost' || t === 'acquire-retry';
12
+ }
13
+ function regionKey(node, path) {
14
+ return `${node}|${path}`;
15
+ }
16
+ /**
17
+ * Cluster-wide authoritative source of shard-to-region assignments. Runs on
18
+ * every node but only responds to requests when the local node is the
19
+ * cluster leader. Non-leader coordinators ignore incoming messages so that
20
+ * duplicate coordinators during a leader transition are harmless.
21
+ *
22
+ * State is reconstructed from Register messages: each region reports the
23
+ * shards it currently hosts, and the coordinator merges that with any new
24
+ * allocation requests. This is deliberately lightweight — a production
25
+ * upgrade would snapshot state to a journal so the coordinator can recover
26
+ * across restarts without re-allocating every shard from scratch.
27
+ */
28
+ export class ShardCoordinator extends Actor {
29
+ settings;
30
+ regions = new Map();
31
+ shardHome = new Map(); // shardId → regionPath
32
+ pending = new Map(); // waiting queries
33
+ rebalanceInProgress = new Map();
34
+ entitiesPerShard = new Map();
35
+ rebalanceTimer = null;
36
+ unsubscribeCluster = null;
37
+ unsubscribeLeaseLost = null;
38
+ acquireRetryTimer = null;
39
+ /**
40
+ * Lease lifecycle (only used when `settings.lease` is set).
41
+ * Drives the `isActive()` predicate — coordinator only processes
42
+ * shard messages while `isLeader() && leaseState === 'held'`.
43
+ */
44
+ leaseState = 'none';
45
+ /**
46
+ * Sharding messages received while we're the leader but waiting
47
+ * for the lease. Drained on the `acquiring → held` transition so
48
+ * regions that asked early get an answer instead of having to
49
+ * wait for the next cluster event to retrigger their ask.
50
+ *
51
+ * Non-leader messages are NOT buffered — they're dropped because
52
+ * the regions on this node will retry against whichever node is
53
+ * the actual leader on their next attempt.
54
+ *
55
+ * Capped to avoid unbounded growth if the lease never resolves.
56
+ */
57
+ acquireBuffer = [];
58
+ static ACQUIRE_BUFFER_CAP = 1_000;
59
+ /**
60
+ * Promise chain over remembered-entity persistence. Each new
61
+ * `EntityStarted` / `EntityStopped` chains its append onto the tail
62
+ * of this promise so writes serialise — `Journal.append`'s
63
+ * optimistic `expectedSeq` would otherwise race when two events
64
+ * fire in fast succession. `.catch` on each link prevents a
65
+ * failed write from breaking the chain for subsequent writes.
66
+ */
67
+ rememberWriteChain = Promise.resolve();
68
+ /**
69
+ * Coalesced save state for `coordinatorStateStore`. State
70
+ * mutations are bursty during rebalance; rather than fire one
71
+ * disk write per mutation we mark the state dirty and the
72
+ * in-flight save's `.finally` kicks off a follow-up if more
73
+ * changes accumulated meanwhile. Same pattern as
74
+ * `DistributedData.scheduleDurableSave` from #40.
75
+ */
76
+ coordinatorStateInFlight = false;
77
+ coordinatorStateDirty = false;
78
+ constructor(settings) {
79
+ super();
80
+ this.settings = settings;
81
+ }
82
+ /** Path used by ClusterSharding to locate the coordinator on any node. */
83
+ static pathFor(typeName) {
84
+ return `actor-ts://SYSTEM/user/sharding-coordinator-${typeName}`;
85
+ }
86
+ async preStart() {
87
+ // 1. Replay the persisted remembered-entities log so the
88
+ // in-memory map is populated BEFORE we accept any messages.
89
+ // Without this, a fresh-cluster start would treat every
90
+ // rememberEntities=true sharded type as empty and only
91
+ // re-register entities lazily as messages arrive.
92
+ if (this.settings.rememberEntities && this.settings.rememberEntitiesStore) {
93
+ try {
94
+ const events = await this.settings.rememberEntitiesStore
95
+ .load(this.settings.typeName);
96
+ for (const ev of events)
97
+ this.applyRememberEvent(ev);
98
+ }
99
+ catch (err) {
100
+ this.system.log.warn(`[sharding] failed to load remembered entities for '${this.settings.typeName}'`, err);
101
+ }
102
+ }
103
+ this.unsubscribeCluster = this.settings.cluster.subscribe(evt => match(evt)
104
+ .with(P.instanceOf(MemberRemoved), (e) => this.onMemberRemoved(e.member.address))
105
+ .with(P.instanceOf(LeaderChanged), () => this.onLeaderChanged())
106
+ .otherwise(() => { }));
107
+ if (this.settings.lease) {
108
+ this.unsubscribeLeaseLost = this.settings.lease.onLost((reason) => {
109
+ this.self.tell({ t: 'lease-lost', reason });
110
+ });
111
+ // Kick the initial reconcile through the mailbox so the lease
112
+ // path serialises with subsequent cluster events.
113
+ this.self.tell({ t: 'reconcile' });
114
+ }
115
+ this.rebalanceTimer = this.system.scheduler.scheduleAtFixedRateFn(this.settings.rebalanceIntervalMs ?? 2_000, this.settings.rebalanceIntervalMs ?? 2_000, () => { if (this.isActive())
116
+ this.rebalanceTick(); });
117
+ }
118
+ /** Apply a single `RememberEvent` to the in-memory `entitiesPerShard`
119
+ * map. Used by both the preStart replay AND
120
+ * `handleEntityStarted` / `handleEntityStopped` so the in-memory
121
+ * derivation rule lives in exactly one place. */
122
+ applyRememberEvent(ev) {
123
+ if (ev.kind === 'started') {
124
+ const set = this.entitiesPerShard.get(ev.shardId) ?? new Set();
125
+ set.add(ev.entityId);
126
+ this.entitiesPerShard.set(ev.shardId, set);
127
+ }
128
+ else {
129
+ const set = this.entitiesPerShard.get(ev.shardId);
130
+ if (!set)
131
+ return;
132
+ set.delete(ev.entityId);
133
+ if (set.size === 0)
134
+ this.entitiesPerShard.delete(ev.shardId);
135
+ }
136
+ }
137
+ async postStop() {
138
+ this.unsubscribeCluster?.();
139
+ this.unsubscribeLeaseLost?.();
140
+ this.rebalanceTimer?.cancel();
141
+ this.acquireRetryTimer?.cancel();
142
+ for (const r of this.rebalanceInProgress.values())
143
+ r.timer.cancel();
144
+ if (this.settings.lease && this.leaseState === 'held') {
145
+ try {
146
+ await this.settings.lease.release();
147
+ }
148
+ catch { /* best-effort */ }
149
+ this.leaseState = 'none';
150
+ }
151
+ }
152
+ onReceive(msg) {
153
+ // Internal coordinator events drive the lease state machine — they
154
+ // run regardless of `isActive()` because they're how we transition
155
+ // INTO `isActive()` in the first place.
156
+ if (isCoordinatorEvent(msg)) {
157
+ this.handleCoordinatorEvent(msg);
158
+ return;
159
+ }
160
+ if (!this.isLeader())
161
+ return;
162
+ if (this.settings.lease && this.leaseState !== 'held') {
163
+ // Leader, but lease not yet held — buffer instead of drop so
164
+ // regions don't need to retry on the next cluster event.
165
+ if (this.acquireBuffer.length < ShardCoordinator.ACQUIRE_BUFFER_CAP) {
166
+ this.acquireBuffer.push(msg);
167
+ }
168
+ return;
169
+ }
170
+ this.dispatchShardingMessage(msg);
171
+ }
172
+ dispatchShardingMessage(msg) {
173
+ match(msg)
174
+ .with({ $t: 'sharding.Register' }, (m) => this.handleRegister(m))
175
+ .with({ $t: 'sharding.GetShardHome' }, (m) => this.handleGetShardHome(m))
176
+ .with({ $t: 'sharding.HandOffComplete' }, (m) => this.handleHandOffComplete(m))
177
+ .with({ $t: 'sharding.BeginHandOffAck' }, () => { })
178
+ .with({ $t: 'sharding.RegionTerminated' }, (m) => this.onRegionTerminated(m))
179
+ .with({ $t: 'sharding.EntityStarted' }, (m) => this.handleEntityStarted(m))
180
+ .with({ $t: 'sharding.EntityStopped' }, (m) => this.handleEntityStopped(m))
181
+ .otherwise(() => { });
182
+ }
183
+ isLeader() { return this.settings.cluster.isLeader(); }
184
+ /**
185
+ * True iff this coordinator is the authoritative one — i.e. should
186
+ * be processing shard messages. Without a lease this is just
187
+ * `isLeader()`; with a lease it additionally requires that the
188
+ * lease be currently held by this replica.
189
+ */
190
+ isActive() {
191
+ if (!this.settings.lease)
192
+ return this.isLeader();
193
+ return this.isLeader() && this.leaseState === 'held';
194
+ }
195
+ /* --------------------------- Lease state machine ------------------------ */
196
+ handleCoordinatorEvent(evt) {
197
+ match(evt)
198
+ .with({ t: 'reconcile' }, () => this.reconcileLease())
199
+ .with({ t: 'lease-acquire-result' }, (m) => this.handleAcquireResult(m))
200
+ .with({ t: 'lease-lost' }, (m) => this.handleLeaseLost(m))
201
+ .with({ t: 'acquire-retry' }, () => this.reconcileLease())
202
+ .exhaustive();
203
+ }
204
+ reconcileLease() {
205
+ if (!this.settings.lease)
206
+ return;
207
+ const wantActive = this.isLeader();
208
+ if (wantActive) {
209
+ if (this.leaseState === 'held')
210
+ return; // already active
211
+ if (this.leaseState === 'acquiring')
212
+ return; // already trying
213
+ this.acquireRetryTimer?.cancel();
214
+ this.acquireRetryTimer = null;
215
+ this.leaseState = 'acquiring';
216
+ void this.runAcquire();
217
+ }
218
+ else {
219
+ if (this.leaseState === 'held') {
220
+ // Stepped down — release so a follower can pick up faster
221
+ // than waiting for the TTL to expire.
222
+ void this.settings.lease.release().catch((e) => this.system.log.warn(`[sharding] lease release failed`, e));
223
+ this.leaseState = 'none';
224
+ // Falling out of `held` already triggers our standard
225
+ // "not-leader" cleanup via onLeaderChanged below — no extra
226
+ // state reset needed here.
227
+ }
228
+ else if (this.leaseState === 'acquiring') {
229
+ // Let the in-flight acquire finish; handleAcquireResult will
230
+ // notice we no longer want it and release immediately.
231
+ }
232
+ else {
233
+ this.acquireRetryTimer?.cancel();
234
+ this.acquireRetryTimer = null;
235
+ }
236
+ }
237
+ }
238
+ async runAcquire() {
239
+ try {
240
+ const got = await this.settings.lease.acquire();
241
+ this.self.tell({ t: 'lease-acquire-result', got });
242
+ }
243
+ catch (error) {
244
+ this.self.tell({
245
+ t: 'lease-acquire-result', got: false, error: error,
246
+ });
247
+ }
248
+ }
249
+ handleAcquireResult(msg) {
250
+ if (this.leaseState !== 'acquiring') {
251
+ // Spurious result — release if we somehow got it.
252
+ if (msg.got)
253
+ void this.settings.lease.release().catch(() => { });
254
+ return;
255
+ }
256
+ if (!msg.got) {
257
+ if (msg.error)
258
+ this.system.log.warn(`[sharding] lease acquire failed`, msg.error);
259
+ this.leaseState = 'none';
260
+ this.scheduleAcquireRetry();
261
+ return;
262
+ }
263
+ if (!this.isLeader()) {
264
+ // Lost leadership during the acquire — release and let the
265
+ // new leader (if any) take over.
266
+ void this.settings.lease.release().catch(() => { });
267
+ this.leaseState = 'none';
268
+ return;
269
+ }
270
+ this.leaseState = 'held';
271
+ this.system.log.info(`[sharding] coordinator '${this.settings.typeName}' became active (lease acquired)`);
272
+ // Drain any messages that arrived while we were acquiring.
273
+ // Regions don't retry on a timer — they only re-ask on cluster
274
+ // events — so without this drain a region that asked during
275
+ // `acquiring` would sit forever on a buffered user message.
276
+ if (this.acquireBuffer.length > 0) {
277
+ const buffered = this.acquireBuffer;
278
+ this.acquireBuffer = [];
279
+ for (const m of buffered)
280
+ this.dispatchShardingMessage(m);
281
+ }
282
+ }
283
+ handleLeaseLost(msg) {
284
+ if (this.leaseState !== 'held')
285
+ return;
286
+ this.system.log.warn(`[sharding] coordinator '${this.settings.typeName}' lost lease — ${msg.reason}; stepping down`);
287
+ this.leaseState = 'none';
288
+ // Cancel any in-flight rebalance handoff timers — those would
289
+ // fire force-reallocations that we shouldn't be doing while
290
+ // passive. Pending queries get dropped (regions retry once we
291
+ // become active again, or once cluster events flush their
292
+ // register loop).
293
+ for (const r of this.rebalanceInProgress.values())
294
+ r.timer.cancel();
295
+ this.rebalanceInProgress.clear();
296
+ this.pending.clear();
297
+ this.acquireBuffer = [];
298
+ // Deliberately do NOT clear `regions` or `shardHome` here. We
299
+ // stay leader and likely re-acquire — keeping the cached view
300
+ // means subsequent re-acquires resume serving without waiting
301
+ // for every region to re-register. If another node took the
302
+ // lease during our window and reallocated, our stale homes
303
+ // self-correct via the standard "remote send fails →
304
+ // MemberRemoved → invalidateHomesOnNode" flow on the regions.
305
+ // Re-enter the acquire loop in case we're still the leader.
306
+ this.self.tell({ t: 'reconcile' });
307
+ }
308
+ scheduleAcquireRetry() {
309
+ const interval = this.settings.acquireRetryIntervalMs ?? 5_000;
310
+ this.acquireRetryTimer?.cancel();
311
+ this.acquireRetryTimer = this.system.scheduler.scheduleOnceFn(interval, () => {
312
+ this.self.tell({ t: 'acquire-retry' });
313
+ });
314
+ }
315
+ candidates() {
316
+ const role = this.settings.role;
317
+ const activeRegions = Array.from(this.regions.values()).filter(r => !r.proxy);
318
+ const addrs = activeRegions.map(r => r.node);
319
+ if (!role)
320
+ return addrs;
321
+ return addrs.filter(a => {
322
+ const m = this.settings.cluster.getMembers().find(x => x.address.equals(a));
323
+ return m?.hasRole(role) ?? false;
324
+ });
325
+ }
326
+ currentShardCounts() {
327
+ // Keyed by node address string so AllocationStrategy can match against
328
+ // the NodeAddress it returned in `allocate`.
329
+ const out = new Map();
330
+ for (const info of this.regions.values()) {
331
+ if (info.proxy)
332
+ continue;
333
+ const addr = info.node.toString();
334
+ const existing = out.get(addr) ?? new Set();
335
+ for (const s of info.shards)
336
+ existing.add(s);
337
+ out.set(addr, existing);
338
+ }
339
+ return out;
340
+ }
341
+ /* ------------------------------- Handlers -------------------------------- */
342
+ handleRegister(msg) {
343
+ const node = NodeAddress.fromJSON(msg.node);
344
+ const key = regionKey(node, msg.region);
345
+ this.regions.set(key, {
346
+ node,
347
+ path: msg.region,
348
+ proxy: msg.proxy,
349
+ shards: new Set(msg.hostedShards),
350
+ });
351
+ for (const shardId of msg.hostedShards) {
352
+ this.shardHome.set(shardId, key);
353
+ }
354
+ const ack = {
355
+ $t: 'sharding.RegisterAck',
356
+ coordinator: this.self.path.toString(),
357
+ };
358
+ this.replyTo(msg.region, msg.node, ack);
359
+ for (const shardId of msg.hostedShards)
360
+ this.flushPending(shardId);
361
+ if (this.settings.rememberEntities) {
362
+ for (const shardId of msg.hostedShards)
363
+ this.shipRememberedEntities(shardId);
364
+ }
365
+ this.scheduleCoordinatorStateSave();
366
+ }
367
+ handleGetShardHome(msg) {
368
+ const home = this.shardHome.get(msg.shardId);
369
+ if (home && this.regions.has(home)) {
370
+ const info = this.regions.get(home);
371
+ this.replyTo(msg.requester, msg.requesterNode, {
372
+ $t: 'sharding.ShardHome',
373
+ shardId: msg.shardId,
374
+ region: info.path,
375
+ node: info.node.toJSON(),
376
+ });
377
+ return;
378
+ }
379
+ const list = this.pending.get(msg.shardId) ?? [];
380
+ list.push(msg);
381
+ this.pending.set(msg.shardId, list);
382
+ if (!this.rebalanceInProgress.has(msg.shardId))
383
+ this.tryAllocate(msg.shardId);
384
+ }
385
+ tryAllocate(shardId) {
386
+ const cs = this.candidates();
387
+ if (cs.length === 0)
388
+ return;
389
+ const owner = this.settings.allocationStrategy.allocate(shardId, cs, this.currentShardCounts());
390
+ const key = this.findRegionKey(owner);
391
+ if (!key)
392
+ return;
393
+ this.shardHome.set(shardId, key);
394
+ const info = this.regions.get(key);
395
+ info.shards.add(shardId);
396
+ // Proactively notify the new owner — they may not have asked, but need
397
+ // to know they are now responsible for the shard (and, when remembering
398
+ // entities, need that knowledge before RememberedEntities arrives).
399
+ this.sendToRegion(key, {
400
+ $t: 'sharding.ShardHome',
401
+ shardId,
402
+ region: info.path,
403
+ node: info.node.toJSON(),
404
+ });
405
+ this.flushPending(shardId);
406
+ if (this.settings.rememberEntities)
407
+ this.shipRememberedEntities(shardId);
408
+ this.scheduleCoordinatorStateSave();
409
+ }
410
+ handleHandOffComplete(msg) {
411
+ const shardId = msg.shardId;
412
+ const inProgress = this.rebalanceInProgress.get(shardId);
413
+ if (!inProgress)
414
+ return;
415
+ inProgress.timer.cancel();
416
+ this.rebalanceInProgress.delete(shardId);
417
+ // Remove ownership from old region.
418
+ const oldPath = inProgress.from;
419
+ const old = this.regions.get(oldPath);
420
+ if (old)
421
+ old.shards.delete(shardId);
422
+ this.shardHome.delete(shardId);
423
+ // Reallocate (the pending queries will get the new home).
424
+ // tryAllocate already calls scheduleCoordinatorStateSave, so a
425
+ // second save here would be redundant.
426
+ this.tryAllocate(shardId);
427
+ }
428
+ handleEntityStarted(msg) {
429
+ if (!this.settings.rememberEntities)
430
+ return;
431
+ this.applyRememberEvent({ kind: 'started', shardId: msg.shardId, entityId: msg.entityId });
432
+ this.persistRememberEvent({ kind: 'started', shardId: msg.shardId, entityId: msg.entityId });
433
+ }
434
+ handleEntityStopped(msg) {
435
+ if (!this.settings.rememberEntities) {
436
+ // Existing behaviour: tidy the in-memory map even when we're
437
+ // not remembering entities, so an unwise external trigger
438
+ // doesn't leave stale data in the map.
439
+ const set = this.entitiesPerShard.get(msg.shardId);
440
+ if (set) {
441
+ set.delete(msg.entityId);
442
+ if (set.size === 0)
443
+ this.entitiesPerShard.delete(msg.shardId);
444
+ }
445
+ return;
446
+ }
447
+ this.applyRememberEvent({ kind: 'stopped', shardId: msg.shardId, entityId: msg.entityId });
448
+ this.persistRememberEvent({ kind: 'stopped', shardId: msg.shardId, entityId: msg.entityId });
449
+ }
450
+ /**
451
+ * Append a remembered-entity event to the persistent store. Chains
452
+ * onto `rememberWriteChain` so two events fired in fast succession
453
+ * don't race the journal's optimistic-`expectedSeq` check — each
454
+ * append awaits the previous one. Errors are caught + logged so a
455
+ * transient store failure doesn't break the chain for subsequent
456
+ * writes.
457
+ */
458
+ persistRememberEvent(event) {
459
+ const store = this.settings.rememberEntitiesStore;
460
+ if (!store)
461
+ return;
462
+ this.rememberWriteChain = this.rememberWriteChain
463
+ .catch(() => { })
464
+ .then(() => store.append(this.settings.typeName, event))
465
+ .catch((err) => {
466
+ this.system.log.warn(`[sharding] failed to persist remembered-entity event ${event.kind}/${event.shardId}/${event.entityId}`, err);
467
+ });
468
+ }
469
+ onRegionTerminated(msg) {
470
+ const addr = NodeAddress.fromJSON(msg.node);
471
+ const key = regionKey(addr, msg.region);
472
+ const info = this.regions.get(key);
473
+ if (!info)
474
+ return;
475
+ this.regions.delete(key);
476
+ for (const shardId of info.shards) {
477
+ this.shardHome.delete(shardId);
478
+ const inProg = this.rebalanceInProgress.get(shardId);
479
+ if (inProg) {
480
+ inProg.timer.cancel();
481
+ this.rebalanceInProgress.delete(shardId);
482
+ }
483
+ this.tryAllocate(shardId);
484
+ }
485
+ // tryAllocate already schedules saves for each re-allocation;
486
+ // an extra one here would be redundant. But if `info.shards`
487
+ // was empty (region had no shards) we still removed it from the
488
+ // regions map and need to record that.
489
+ if (info.shards.size === 0)
490
+ this.scheduleCoordinatorStateSave();
491
+ }
492
+ onMemberRemoved(addr) {
493
+ for (const [_key, info] of Array.from(this.regions.entries())) {
494
+ if (info.node.equals(addr)) {
495
+ this.onRegionTerminated({
496
+ $t: 'sharding.RegionTerminated',
497
+ region: info.path,
498
+ node: addr.toJSON(),
499
+ });
500
+ }
501
+ }
502
+ }
503
+ onLeaderChanged() {
504
+ if (!this.isLeader()) {
505
+ // No longer leader — drop the in-memory view; the new leader
506
+ // owns the canonical state now.
507
+ this.regions.clear();
508
+ this.shardHome.clear();
509
+ this.pending.clear();
510
+ this.acquireBuffer = [];
511
+ for (const r of this.rebalanceInProgress.values())
512
+ r.timer.cancel();
513
+ this.rebalanceInProgress.clear();
514
+ }
515
+ else {
516
+ // Just became leader (or re-elected). If a state store is
517
+ // configured, try to seed `regions` + `shardHome` from the
518
+ // last known snapshot — saves the from-scratch reallocation
519
+ // storm of every shard re-registering through a fresh
520
+ // tryAllocate call. Failure is tolerated: we fall back to
521
+ // the v1 rebuild-from-Register path when the load fails or
522
+ // returns nothing.
523
+ if (this.settings.coordinatorStateStore) {
524
+ void this.loadCoordinatorState();
525
+ }
526
+ }
527
+ // Lease-aware coordinators re-evaluate the acquire/release cycle
528
+ // any time the leader role flips — see `reconcileLease()`. We
529
+ // route through the mailbox so the state machine serialises with
530
+ // any in-flight acquire result.
531
+ if (this.settings.lease) {
532
+ this.self.tell({ t: 'reconcile' });
533
+ }
534
+ }
535
+ /* ------------------- Coordinator-state persistence ------------------ */
536
+ /**
537
+ * Read the most recent snapshot from `coordinatorStateStore` and
538
+ * seed `regions` + `shardHome` from it. Drops any region whose
539
+ * node has left the cluster between the snapshot and now —
540
+ * otherwise we'd happily route shards to dead pods. Existing
541
+ * pending queries get a fresh allocation pass via the regular
542
+ * onMessage flow.
543
+ */
544
+ async loadCoordinatorState() {
545
+ const store = this.settings.coordinatorStateStore;
546
+ if (!store)
547
+ return;
548
+ let data;
549
+ try {
550
+ data = await store.load(this.settings.typeName);
551
+ }
552
+ catch (err) {
553
+ this.system.log.warn(`[sharding] coordinator-state load failed for '${this.settings.typeName}'`, err);
554
+ return;
555
+ }
556
+ if (!data)
557
+ return;
558
+ // If we already have local state (e.g. preStart already absorbed
559
+ // some Register messages), merge — keep what we know AND what
560
+ // the snapshot says. The snapshot's `regions` may be stale (a
561
+ // node may have died), so we filter by current cluster membership.
562
+ const livingNodes = new Set(this.settings.cluster.upMembers().map((m) => m.address.toString()));
563
+ for (const r of data.regions) {
564
+ if (!livingNodes.has(r.node.systemName + '@' + r.node.host + ':' + r.node.port)) {
565
+ // Node dropped out of the cluster between snapshot and now
566
+ // — skip the entry; the dead region won't be re-resurrected.
567
+ continue;
568
+ }
569
+ const node = NodeAddress.fromJSON(r.node);
570
+ if (this.regions.has(r.key))
571
+ continue; // already known via Register
572
+ this.regions.set(r.key, {
573
+ node, path: r.path, proxy: r.proxy, shards: new Set(r.shards),
574
+ });
575
+ }
576
+ for (const [shardId, regionKey] of data.shardHome) {
577
+ // Only adopt the home if the region survived the filter above.
578
+ if (this.regions.has(regionKey) && !this.shardHome.has(shardId)) {
579
+ this.shardHome.set(shardId, regionKey);
580
+ }
581
+ }
582
+ }
583
+ /**
584
+ * Mark coordinator state dirty + schedule a save. Called after
585
+ * every meaningful mutation — handleRegister, tryAllocate,
586
+ * handleHandOffComplete, onRegionTerminated. Coalesces
587
+ * overlapping bursts into 1-2 store writes via the
588
+ * `inFlight + dirty` flag pair.
589
+ */
590
+ scheduleCoordinatorStateSave() {
591
+ const store = this.settings.coordinatorStateStore;
592
+ if (!store)
593
+ return;
594
+ if (!this.isLeader())
595
+ return;
596
+ if (this.coordinatorStateInFlight) {
597
+ this.coordinatorStateDirty = true;
598
+ return;
599
+ }
600
+ this.coordinatorStateInFlight = true;
601
+ const snapshot = this.snapshotCoordinatorState();
602
+ void store.save(this.settings.typeName, snapshot)
603
+ .catch((err) => {
604
+ this.system.log.warn(`[sharding] coordinator-state save failed for '${this.settings.typeName}'`, err);
605
+ })
606
+ .finally(() => {
607
+ this.coordinatorStateInFlight = false;
608
+ if (this.coordinatorStateDirty) {
609
+ this.coordinatorStateDirty = false;
610
+ this.scheduleCoordinatorStateSave();
611
+ }
612
+ });
613
+ }
614
+ snapshotCoordinatorState() {
615
+ const regions = [];
616
+ for (const [key, info] of this.regions) {
617
+ regions.push({
618
+ key,
619
+ node: info.node.toJSON(),
620
+ path: info.path,
621
+ proxy: info.proxy,
622
+ shards: Array.from(info.shards),
623
+ });
624
+ }
625
+ const shardHome = [];
626
+ for (const [shardId, regionKey] of this.shardHome) {
627
+ shardHome.push([shardId, regionKey]);
628
+ }
629
+ return {
630
+ leader: this.settings.cluster.selfAddress.toString(),
631
+ takenAt: Date.now(),
632
+ regions,
633
+ shardHome,
634
+ };
635
+ }
636
+ /* ------------------------------- Rebalance ------------------------------- */
637
+ rebalanceTick() {
638
+ const shardsToMove = this.settings.allocationStrategy.rebalance(this.currentShardCounts(), this.candidates(), new Set(this.rebalanceInProgress.keys()));
639
+ for (const shardId of shardsToMove)
640
+ this.beginHandOff(shardId);
641
+ }
642
+ beginHandOff(shardId) {
643
+ const ownerKey = this.shardHome.get(shardId);
644
+ if (!ownerKey)
645
+ return;
646
+ const owner = this.regions.get(ownerKey);
647
+ if (!owner)
648
+ return;
649
+ const timeout = this.settings.handOffTimeoutMs ?? 10_000;
650
+ const timer = this.system.scheduler.scheduleOnceFn(timeout, () => {
651
+ if (this.rebalanceInProgress.delete(shardId)) {
652
+ this.system.log.warn(`[sharding] handoff timeout for shard ${shardId}; forcing reallocate`);
653
+ this.shardHome.delete(shardId);
654
+ this.tryAllocate(shardId);
655
+ }
656
+ });
657
+ this.rebalanceInProgress.set(shardId, { from: ownerKey, timer });
658
+ this.sendToRegion(ownerKey, { $t: 'sharding.HandOff', shardId });
659
+ }
660
+ /* --------------------------------- Helpers ------------------------------- */
661
+ findRegionKey(node) {
662
+ for (const [key, info] of this.regions) {
663
+ if (!info.proxy && info.node.equals(node))
664
+ return key;
665
+ }
666
+ return null;
667
+ }
668
+ flushPending(shardId) {
669
+ const pending = this.pending.get(shardId);
670
+ if (!pending || pending.length === 0)
671
+ return;
672
+ const home = this.shardHome.get(shardId);
673
+ if (!home)
674
+ return;
675
+ const info = this.regions.get(home);
676
+ if (!info)
677
+ return;
678
+ for (const q of pending) {
679
+ this.replyTo(q.requester, q.requesterNode, {
680
+ $t: 'sharding.ShardHome',
681
+ shardId,
682
+ region: info.path,
683
+ node: info.node.toJSON(),
684
+ });
685
+ }
686
+ this.pending.delete(shardId);
687
+ }
688
+ shipRememberedEntities(shardId) {
689
+ const set = this.entitiesPerShard.get(shardId);
690
+ if (!set || set.size === 0)
691
+ return;
692
+ const home = this.shardHome.get(shardId);
693
+ if (!home)
694
+ return;
695
+ this.sendToRegion(home, {
696
+ $t: 'sharding.RememberedEntities',
697
+ shardId,
698
+ entityIds: Array.from(set),
699
+ });
700
+ }
701
+ sendToRegion(key, msg) {
702
+ const info = this.regions.get(key);
703
+ if (!info)
704
+ return;
705
+ this.replyTo(info.path, info.node.toJSON(), msg);
706
+ }
707
+ replyTo(path, nodeData, msg) {
708
+ const node = NodeAddress.fromJSON(nodeData);
709
+ if (node.equals(this.settings.cluster.selfAddress)) {
710
+ const ref = this.settings.localResolver(path);
711
+ if (ref)
712
+ ref.tell(msg);
713
+ return;
714
+ }
715
+ const remote = new RemoteActorRef(node, path, this.settings.cluster);
716
+ remote.tell(msg);
717
+ }
718
+ }
719
+ //# sourceMappingURL=ShardCoordinator.js.map