@oasys/oecs 0.5.3 → 0.6.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 (510) hide show
  1. package/CHANGELOG.md +1399 -276
  2. package/README.md +327 -169
  3. package/dist/core/ecs/access_check.d.cts +31 -31
  4. package/dist/core/ecs/access_check.d.ts +31 -31
  5. package/dist/core/ecs/access_check.d.ts.map +1 -1
  6. package/dist/core/ecs/archetype.d.cts +273 -205
  7. package/dist/core/ecs/archetype.d.ts +273 -205
  8. package/dist/core/ecs/archetype.d.ts.map +1 -1
  9. package/dist/core/ecs/archetype_closure.d.cts +23 -0
  10. package/dist/core/ecs/archetype_closure.d.ts +23 -0
  11. package/dist/core/ecs/archetype_closure.d.ts.map +1 -0
  12. package/dist/core/ecs/archetype_graph.d.cts +34 -34
  13. package/dist/core/ecs/archetype_graph.d.ts +34 -34
  14. package/dist/core/ecs/archetype_graph.d.ts.map +1 -1
  15. package/dist/core/ecs/archetype_types.d.cts +55 -0
  16. package/dist/core/ecs/archetype_types.d.ts +55 -0
  17. package/dist/core/ecs/archetype_types.d.ts.map +1 -0
  18. package/dist/core/ecs/change_feed.d.cts +53 -0
  19. package/dist/core/ecs/change_feed.d.ts +53 -0
  20. package/dist/core/ecs/change_feed.d.ts.map +1 -0
  21. package/dist/core/ecs/changed_query.d.cts +36 -0
  22. package/dist/core/ecs/changed_query.d.ts +36 -0
  23. package/dist/core/ecs/changed_query.d.ts.map +1 -0
  24. package/dist/core/ecs/chunk_columns.d.cts +49 -0
  25. package/dist/core/ecs/chunk_columns.d.ts +49 -0
  26. package/dist/core/ecs/chunk_columns.d.ts.map +1 -0
  27. package/dist/core/ecs/command_log.d.cts +30 -30
  28. package/dist/core/ecs/command_log.d.ts +30 -30
  29. package/dist/core/ecs/command_log.d.ts.map +1 -1
  30. package/dist/core/ecs/component.d.cts +45 -44
  31. package/dist/core/ecs/component.d.ts +45 -44
  32. package/dist/core/ecs/component.d.ts.map +1 -1
  33. package/dist/core/ecs/component_registry.d.cts +53 -0
  34. package/dist/core/ecs/component_registry.d.ts +53 -0
  35. package/dist/core/ecs/component_registry.d.ts.map +1 -0
  36. package/dist/core/ecs/compute_backend.d.cts +18 -7
  37. package/dist/core/ecs/compute_backend.d.ts +18 -7
  38. package/dist/core/ecs/compute_backend.d.ts.map +1 -1
  39. package/dist/core/ecs/deferred_commands.d.cts +15 -14
  40. package/dist/core/ecs/deferred_commands.d.ts +15 -14
  41. package/dist/core/ecs/deferred_commands.d.ts.map +1 -1
  42. package/dist/core/ecs/dispatch_trace.d.cts +32 -31
  43. package/dist/core/ecs/dispatch_trace.d.ts +32 -31
  44. package/dist/core/ecs/dispatch_trace.d.ts.map +1 -1
  45. package/dist/core/ecs/ecs.d.cts +337 -276
  46. package/dist/core/ecs/ecs.d.ts +337 -276
  47. package/dist/core/ecs/ecs.d.ts.map +1 -1
  48. package/dist/core/ecs/ecs_memory.d.cts +134 -136
  49. package/dist/core/ecs/ecs_memory.d.ts +134 -136
  50. package/dist/core/ecs/ecs_memory.d.ts.map +1 -1
  51. package/dist/core/ecs/ecs_options.d.cts +89 -0
  52. package/dist/core/ecs/ecs_options.d.ts +89 -0
  53. package/dist/core/ecs/ecs_options.d.ts.map +1 -0
  54. package/dist/core/ecs/entity.d.cts +4 -4
  55. package/dist/core/ecs/entity.d.ts +4 -4
  56. package/dist/core/ecs/entity_allocator.d.cts +24 -22
  57. package/dist/core/ecs/entity_allocator.d.ts +24 -22
  58. package/dist/core/ecs/entity_allocator.d.ts.map +1 -1
  59. package/dist/core/ecs/event.d.cts +37 -23
  60. package/dist/core/ecs/event.d.ts +37 -23
  61. package/dist/core/ecs/event.d.ts.map +1 -1
  62. package/dist/core/ecs/facades.d.cts +12 -126
  63. package/dist/core/ecs/facades.d.ts +12 -126
  64. package/dist/core/ecs/facades.d.ts.map +1 -1
  65. package/dist/core/ecs/frame_stepper.d.cts +12 -12
  66. package/dist/core/ecs/frame_stepper.d.ts +12 -12
  67. package/dist/core/ecs/frame_stepper.d.ts.map +1 -1
  68. package/dist/core/ecs/frame_trace.d.cts +34 -34
  69. package/dist/core/ecs/frame_trace.d.ts +34 -34
  70. package/dist/core/ecs/frame_trace.d.ts.map +1 -1
  71. package/dist/core/ecs/host_commands.d.cts +107 -89
  72. package/dist/core/ecs/host_commands.d.ts +107 -89
  73. package/dist/core/ecs/host_commands.d.ts.map +1 -1
  74. package/dist/core/ecs/index.d.cts +22 -12
  75. package/dist/core/ecs/index.d.ts +22 -12
  76. package/dist/core/ecs/index.d.ts.map +1 -1
  77. package/dist/core/ecs/observer.d.cts +41 -122
  78. package/dist/core/ecs/observer.d.ts +41 -122
  79. package/dist/core/ecs/observer.d.ts.map +1 -1
  80. package/dist/core/ecs/phase.d.cts +79 -0
  81. package/dist/core/ecs/phase.d.ts +79 -0
  82. package/dist/core/ecs/phase.d.ts.map +1 -0
  83. package/dist/core/ecs/plugin.d.cts +125 -0
  84. package/dist/core/ecs/plugin.d.ts +125 -0
  85. package/dist/core/ecs/plugin.d.ts.map +1 -0
  86. package/dist/core/ecs/plugin_slots.d.cts +26 -0
  87. package/dist/core/ecs/plugin_slots.d.ts +26 -0
  88. package/dist/core/ecs/plugin_slots.d.ts.map +1 -0
  89. package/dist/core/ecs/query.d.cts +219 -568
  90. package/dist/core/ecs/query.d.ts +219 -568
  91. package/dist/core/ecs/query.d.ts.map +1 -1
  92. package/dist/core/ecs/query_cache.d.cts +130 -0
  93. package/dist/core/ecs/query_cache.d.ts +130 -0
  94. package/dist/core/ecs/query_cache.d.ts.map +1 -0
  95. package/dist/core/ecs/query_registry.d.cts +47 -0
  96. package/dist/core/ecs/query_registry.d.ts +47 -0
  97. package/dist/core/ecs/query_registry.d.ts.map +1 -0
  98. package/dist/core/ecs/query_terms.d.cts +126 -0
  99. package/dist/core/ecs/query_terms.d.ts +126 -0
  100. package/dist/core/ecs/query_terms.d.ts.map +1 -0
  101. package/dist/core/ecs/ref.d.cts +129 -16
  102. package/dist/core/ecs/ref.d.ts +129 -16
  103. package/dist/core/ecs/ref.d.ts.map +1 -1
  104. package/dist/core/ecs/relation.d.cts +105 -186
  105. package/dist/core/ecs/relation.d.ts +105 -186
  106. package/dist/core/ecs/relation.d.ts.map +1 -1
  107. package/dist/core/ecs/resource.d.cts +14 -14
  108. package/dist/core/ecs/resource.d.ts +14 -14
  109. package/dist/core/ecs/resource_registry.d.cts +6 -6
  110. package/dist/core/ecs/resource_registry.d.ts +6 -6
  111. package/dist/core/ecs/resource_registry.d.ts.map +1 -1
  112. package/dist/core/ecs/row_kinds.d.cts +24 -0
  113. package/dist/core/ecs/row_kinds.d.ts +24 -0
  114. package/dist/core/ecs/row_kinds.d.ts.map +1 -0
  115. package/dist/core/ecs/run_condition.d.cts +23 -23
  116. package/dist/core/ecs/run_condition.d.ts +23 -23
  117. package/dist/core/ecs/run_condition.d.ts.map +1 -1
  118. package/dist/core/ecs/schedule.d.cts +98 -114
  119. package/dist/core/ecs/schedule.d.ts +98 -114
  120. package/dist/core/ecs/schedule.d.ts.map +1 -1
  121. package/dist/core/ecs/schedule_plan.d.cts +33 -0
  122. package/dist/core/ecs/schedule_plan.d.ts +33 -0
  123. package/dist/core/ecs/schedule_plan.d.ts.map +1 -0
  124. package/dist/core/ecs/snapshot.d.cts +77 -0
  125. package/dist/core/ecs/snapshot.d.ts +77 -0
  126. package/dist/core/ecs/snapshot.d.ts.map +1 -0
  127. package/dist/core/ecs/snapshot_mount.d.cts +42 -0
  128. package/dist/core/ecs/snapshot_mount.d.ts +42 -0
  129. package/dist/core/ecs/snapshot_mount.d.ts.map +1 -0
  130. package/dist/core/ecs/sparse_store.d.cts +110 -53
  131. package/dist/core/ecs/sparse_store.d.ts +110 -53
  132. package/dist/core/ecs/sparse_store.d.ts.map +1 -1
  133. package/dist/core/ecs/store.d.cts +644 -511
  134. package/dist/core/ecs/store.d.ts +644 -511
  135. package/dist/core/ecs/store.d.ts.map +1 -1
  136. package/dist/core/ecs/store_layout_listener.d.cts +8 -8
  137. package/dist/core/ecs/store_layout_listener.d.ts +8 -8
  138. package/dist/core/ecs/store_types.d.cts +122 -0
  139. package/dist/core/ecs/store_types.d.ts +122 -0
  140. package/dist/core/ecs/store_types.d.ts.map +1 -0
  141. package/dist/core/ecs/system.d.cts +151 -66
  142. package/dist/core/ecs/system.d.ts +151 -66
  143. package/dist/core/ecs/system.d.ts.map +1 -1
  144. package/dist/core/ecs/system_context.d.cts +296 -0
  145. package/dist/core/ecs/system_context.d.ts +296 -0
  146. package/dist/core/ecs/system_context.d.ts.map +1 -0
  147. package/dist/core/ecs/system_set.d.cts +48 -0
  148. package/dist/core/ecs/system_set.d.ts +48 -0
  149. package/dist/core/ecs/system_set.d.ts.map +1 -0
  150. package/dist/core/ecs/utils/arrays.d.cts +15 -1
  151. package/dist/core/ecs/utils/arrays.d.ts +15 -1
  152. package/dist/core/ecs/utils/arrays.d.ts.map +1 -1
  153. package/dist/core/ecs/utils/error.d.cts +87 -4
  154. package/dist/core/ecs/utils/error.d.ts +87 -4
  155. package/dist/core/ecs/utils/error.d.ts.map +1 -1
  156. package/dist/core/ecs/utils/plugin_error.d.cts +10 -0
  157. package/dist/core/ecs/utils/plugin_error.d.ts +10 -0
  158. package/dist/core/ecs/utils/plugin_error.d.ts.map +1 -0
  159. package/dist/core/restore_errors.d.cts +30 -0
  160. package/dist/core/restore_errors.d.ts +30 -0
  161. package/dist/core/restore_errors.d.ts.map +1 -0
  162. package/dist/core/store/action_ring.d.cts +48 -49
  163. package/dist/core/store/action_ring.d.ts +48 -49
  164. package/dist/core/store/action_ring.d.ts.map +1 -1
  165. package/dist/core/store/allocator.d.cts +166 -114
  166. package/dist/core/store/allocator.d.ts +166 -114
  167. package/dist/core/store/allocator.d.ts.map +1 -1
  168. package/dist/core/store/buffer_backed_column.d.cts +21 -22
  169. package/dist/core/store/buffer_backed_column.d.ts +21 -22
  170. package/dist/core/store/buffer_backed_column.d.ts.map +1 -1
  171. package/dist/core/store/column_store.d.cts +138 -100
  172. package/dist/core/store/column_store.d.ts +138 -100
  173. package/dist/core/store/column_store.d.ts.map +1 -1
  174. package/dist/core/store/command_dispatch.d.cts +14 -15
  175. package/dist/core/store/command_dispatch.d.ts +14 -15
  176. package/dist/core/store/command_dispatch.d.ts.map +1 -1
  177. package/dist/core/store/command_ring.d.cts +41 -45
  178. package/dist/core/store/command_ring.d.ts +41 -45
  179. package/dist/core/store/command_ring.d.ts.map +1 -1
  180. package/dist/core/store/descriptor.d.cts +35 -18
  181. package/dist/core/store/descriptor.d.ts +35 -18
  182. package/dist/core/store/descriptor.d.ts.map +1 -1
  183. package/dist/core/store/entity_index.d.cts +34 -35
  184. package/dist/core/store/entity_index.d.ts +34 -35
  185. package/dist/core/store/entity_index.d.ts.map +1 -1
  186. package/dist/core/store/event_ring.d.cts +40 -42
  187. package/dist/core/store/event_ring.d.ts +40 -42
  188. package/dist/core/store/event_ring.d.ts.map +1 -1
  189. package/dist/core/store/extend.d.cts +15 -9
  190. package/dist/core/store/extend.d.ts +15 -9
  191. package/dist/core/store/extend.d.ts.map +1 -1
  192. package/dist/core/store/grow.d.cts +3 -3
  193. package/dist/core/store/grow.d.ts +3 -3
  194. package/dist/core/store/grow.d.ts.map +1 -1
  195. package/dist/core/store/header.d.cts +37 -33
  196. package/dist/core/store/header.d.ts +37 -33
  197. package/dist/core/store/header.d.ts.map +1 -1
  198. package/dist/core/store/index.d.cts +10 -10
  199. package/dist/core/store/index.d.ts +10 -10
  200. package/dist/core/store/index.d.ts.map +1 -1
  201. package/dist/core/store/layout_ops.d.cts +72 -63
  202. package/dist/core/store/layout_ops.d.ts +72 -63
  203. package/dist/core/store/layout_ops.d.ts.map +1 -1
  204. package/dist/core/store/region_table.d.cts +28 -21
  205. package/dist/core/store/region_table.d.ts +28 -21
  206. package/dist/core/store/region_table.d.ts.map +1 -1
  207. package/dist/core/store/snapshot.d.cts +31 -16
  208. package/dist/core/store/snapshot.d.ts +31 -16
  209. package/dist/core/store/snapshot.d.ts.map +1 -1
  210. package/dist/core/store/state_hash.d.cts +14 -14
  211. package/dist/core/store/state_hash.d.ts +14 -14
  212. package/dist/core/store/state_hash.d.ts.map +1 -1
  213. package/dist/core/store/store_regions.d.cts +10 -10
  214. package/dist/core/store/store_regions.d.ts +10 -10
  215. package/dist/core/store/store_regions.d.ts.map +1 -1
  216. package/dist/core/store/vendored_abi/abi.d.cts +27 -2
  217. package/dist/core/store/vendored_abi/abi.d.ts +27 -2
  218. package/dist/core/store/vendored_abi/abi.d.ts.map +1 -1
  219. package/dist/host_commands-B2KMx8O2.cjs +1 -0
  220. package/dist/host_commands-ClVPvhSa.cjs +2 -0
  221. package/dist/host_commands-CwxVQS1z.js +1524 -0
  222. package/dist/host_commands-nJvTy88E.js +1667 -0
  223. package/dist/index.cjs +1 -1
  224. package/dist/index.d.cts +16 -11
  225. package/dist/index.d.ts +16 -11
  226. package/dist/index.d.ts.map +1 -1
  227. package/dist/index.development.cjs +1 -1
  228. package/dist/index.development.js +6709 -5729
  229. package/dist/index.js +5664 -4743
  230. package/dist/internal.cjs +2 -2
  231. package/dist/internal.d.cts +5 -2
  232. package/dist/internal.d.ts +5 -2
  233. package/dist/internal.d.ts.map +1 -1
  234. package/dist/internal.development.cjs +1 -1
  235. package/dist/internal.development.js +70 -20
  236. package/dist/internal.js +138 -83
  237. package/dist/plugins/abi-D3V-QUSf.cjs +1 -0
  238. package/dist/plugins/abi-NP8pNxpd.js +42 -0
  239. package/dist/plugins/arrays-Dr_1hCjL.js +28 -0
  240. package/dist/plugins/arrays-Dt-Joc4i.cjs +1 -0
  241. package/dist/plugins/assertions-gtDVfbnQ.js +6 -0
  242. package/dist/plugins/assertions-z5GQd_bB.cjs +1 -0
  243. package/dist/{extensions → plugins}/editor/editor.d.cts +56 -56
  244. package/dist/{extensions → plugins}/editor/editor.d.ts +56 -56
  245. package/dist/plugins/editor/editor.d.ts.map +1 -0
  246. package/dist/{extensions → plugins}/editor/field_handle.d.cts +13 -13
  247. package/dist/{extensions → plugins}/editor/field_handle.d.ts +13 -13
  248. package/dist/plugins/editor/field_handle.d.ts.map +1 -0
  249. package/dist/plugins/editor/index.d.cts +22 -0
  250. package/dist/plugins/editor/index.d.ts +22 -0
  251. package/dist/plugins/editor/index.d.ts.map +1 -0
  252. package/dist/plugins/editor.cjs +1 -0
  253. package/dist/plugins/editor.d.cts +1 -0
  254. package/dist/plugins/editor.d.ts +1 -0
  255. package/dist/plugins/editor.development.cjs +1 -0
  256. package/dist/{extensions/editor/index.development.js → plugins/editor.development.js} +83 -66
  257. package/dist/{extensions/editor/index.js → plugins/editor.js} +83 -66
  258. package/dist/plugins/events/event_channel.d.cts +13 -0
  259. package/dist/plugins/events/event_channel.d.ts +13 -0
  260. package/dist/plugins/events/event_channel.d.ts.map +1 -0
  261. package/dist/plugins/events/event_registry.d.cts +22 -0
  262. package/dist/plugins/events/event_registry.d.ts +22 -0
  263. package/dist/plugins/events/event_registry.d.ts.map +1 -0
  264. package/dist/plugins/events/facade.d.cts +26 -0
  265. package/dist/plugins/events/facade.d.ts +26 -0
  266. package/dist/plugins/events/facade.d.ts.map +1 -0
  267. package/dist/plugins/events/index.d.cts +10 -0
  268. package/dist/plugins/events/index.d.ts +10 -0
  269. package/dist/plugins/events/index.d.ts.map +1 -0
  270. package/dist/plugins/events.cjs +1 -0
  271. package/dist/plugins/events.d.cts +1 -0
  272. package/dist/plugins/events.d.ts +1 -0
  273. package/dist/plugins/events.development.cjs +1 -0
  274. package/dist/plugins/events.development.js +174 -0
  275. package/dist/plugins/events.js +159 -0
  276. package/dist/plugins/observers/index.d.cts +23 -0
  277. package/dist/plugins/observers/index.d.ts +23 -0
  278. package/dist/plugins/observers/index.d.ts.map +1 -0
  279. package/dist/plugins/observers/observer_registry.d.cts +101 -0
  280. package/dist/plugins/observers/observer_registry.d.ts +101 -0
  281. package/dist/plugins/observers/observer_registry.d.ts.map +1 -0
  282. package/dist/plugins/observers.cjs +1 -0
  283. package/dist/plugins/observers.d.cts +1 -0
  284. package/dist/plugins/observers.d.ts +1 -0
  285. package/dist/plugins/observers.development.cjs +1 -0
  286. package/dist/plugins/observers.development.js +431 -0
  287. package/dist/plugins/observers.js +403 -0
  288. package/dist/plugins/relation_store-BsoegrZh.js +313 -0
  289. package/dist/plugins/relation_store-DQKSnxsm.cjs +1 -0
  290. package/dist/plugins/relation_store-RBhpcE28.cjs +1 -0
  291. package/dist/plugins/relation_store-RqW5Snx6.js +328 -0
  292. package/dist/plugins/relations/builtin_relations.d.cts +48 -0
  293. package/dist/plugins/relations/builtin_relations.d.ts +48 -0
  294. package/dist/plugins/relations/builtin_relations.d.ts.map +1 -0
  295. package/dist/plugins/relations/facade.d.cts +73 -0
  296. package/dist/plugins/relations/facade.d.ts +73 -0
  297. package/dist/plugins/relations/facade.d.ts.map +1 -0
  298. package/dist/plugins/relations/index.d.cts +11 -0
  299. package/dist/plugins/relations/index.d.ts +11 -0
  300. package/dist/plugins/relations/index.d.ts.map +1 -0
  301. package/dist/{core/ecs → plugins/relations}/relation_service.d.cts +93 -105
  302. package/dist/{core/ecs → plugins/relations}/relation_service.d.ts +93 -105
  303. package/dist/plugins/relations/relation_service.d.ts.map +1 -0
  304. package/dist/plugins/relations/relation_store.d.cts +177 -0
  305. package/dist/plugins/relations/relation_store.d.ts +177 -0
  306. package/dist/plugins/relations/relation_store.d.ts.map +1 -0
  307. package/dist/plugins/relations.cjs +1 -0
  308. package/dist/plugins/relations.d.cts +1 -0
  309. package/dist/plugins/relations.d.ts +1 -0
  310. package/dist/plugins/relations.development.cjs +1 -0
  311. package/dist/plugins/relations.development.js +603 -0
  312. package/dist/plugins/relations.js +553 -0
  313. package/dist/plugins/snapshots/index.d.cts +33 -0
  314. package/dist/plugins/snapshots/index.d.ts +33 -0
  315. package/dist/plugins/snapshots/index.d.ts.map +1 -0
  316. package/dist/plugins/snapshots/resume.d.cts +57 -0
  317. package/dist/plugins/snapshots/resume.d.ts +57 -0
  318. package/dist/plugins/snapshots/resume.d.ts.map +1 -0
  319. package/dist/plugins/snapshots/snapshot_service.d.cts +59 -0
  320. package/dist/plugins/snapshots/snapshot_service.d.ts +59 -0
  321. package/dist/plugins/snapshots/snapshot_service.d.ts.map +1 -0
  322. package/dist/plugins/snapshots.cjs +1 -0
  323. package/dist/plugins/snapshots.d.cts +1 -0
  324. package/dist/plugins/snapshots.d.ts +1 -0
  325. package/dist/plugins/snapshots.development.cjs +1 -0
  326. package/dist/plugins/snapshots.development.js +737 -0
  327. package/dist/plugins/snapshots.js +737 -0
  328. package/dist/plugins/solid/index.d.cts +8 -0
  329. package/dist/plugins/solid/index.d.ts +8 -0
  330. package/dist/plugins/solid/index.d.ts.map +1 -0
  331. package/dist/plugins/solid/solid.d.cts +97 -0
  332. package/dist/plugins/solid/solid.d.ts +97 -0
  333. package/dist/plugins/solid/solid.d.ts.map +1 -0
  334. package/dist/plugins/solid.cjs +1 -0
  335. package/dist/plugins/solid.d.cts +1 -0
  336. package/dist/plugins/solid.d.ts +1 -0
  337. package/dist/plugins/solid.development.cjs +1 -0
  338. package/dist/plugins/solid.development.js +319 -0
  339. package/dist/plugins/solid.js +319 -0
  340. package/dist/plugins/workers/index.d.cts +75 -0
  341. package/dist/plugins/workers/index.d.ts +75 -0
  342. package/dist/plugins/workers/index.d.ts.map +1 -0
  343. package/dist/plugins/workers/node_threads.d.cts +25 -0
  344. package/dist/plugins/workers/node_threads.d.ts +25 -0
  345. package/dist/plugins/workers/node_threads.d.ts.map +1 -0
  346. package/dist/plugins/workers/plan.d.cts +61 -0
  347. package/dist/plugins/workers/plan.d.ts +61 -0
  348. package/dist/plugins/workers/plan.d.ts.map +1 -0
  349. package/dist/plugins/workers/pool.d.cts +144 -0
  350. package/dist/plugins/workers/pool.d.ts +144 -0
  351. package/dist/plugins/workers/pool.d.ts.map +1 -0
  352. package/dist/plugins/workers/protocol.d.cts +112 -0
  353. package/dist/plugins/workers/protocol.d.ts +112 -0
  354. package/dist/plugins/workers/protocol.d.ts.map +1 -0
  355. package/dist/plugins/workers/worker_bind.d.cts +64 -0
  356. package/dist/plugins/workers/worker_bind.d.ts +64 -0
  357. package/dist/plugins/workers/worker_bind.d.ts.map +1 -0
  358. package/dist/plugins/workers/worker_loop.d.cts +14 -0
  359. package/dist/plugins/workers/worker_loop.d.ts +14 -0
  360. package/dist/plugins/workers/worker_loop.d.ts.map +1 -0
  361. package/dist/plugins/workers.cjs +1 -0
  362. package/dist/plugins/workers.d.cts +1 -0
  363. package/dist/plugins/workers.d.ts +1 -0
  364. package/dist/plugins/workers.development.cjs +1 -0
  365. package/dist/plugins/workers.development.js +596 -0
  366. package/dist/plugins/workers.js +474 -0
  367. package/dist/primitives.cjs +1 -1
  368. package/dist/primitives.d.cts +4 -4
  369. package/dist/primitives.d.ts +4 -4
  370. package/dist/primitives.development.cjs +1 -1
  371. package/dist/primitives.development.js +66 -22
  372. package/dist/primitives.js +66 -22
  373. package/dist/shared-BKl12xF1.js +132 -0
  374. package/dist/shared-Dk-pACZT.cjs +1 -0
  375. package/dist/shared.cjs +1 -1
  376. package/dist/shared.d.cts +7 -7
  377. package/dist/shared.d.ts +7 -7
  378. package/dist/shared.d.ts.map +1 -1
  379. package/dist/shared.development.cjs +1 -1
  380. package/dist/shared.development.js +4 -3
  381. package/dist/shared.js +4 -3
  382. package/dist/topological_sort-Cc_yXqPT.js +346 -0
  383. package/dist/topological_sort-vp1imU6D.cjs +1 -0
  384. package/dist/type_primitives/assertions.d.cts +12 -16
  385. package/dist/type_primitives/assertions.d.ts +12 -16
  386. package/dist/type_primitives/assertions.d.ts.map +1 -1
  387. package/dist/type_primitives/binary_heap/binary_heap.d.cts +2 -6
  388. package/dist/type_primitives/binary_heap/binary_heap.d.ts +2 -6
  389. package/dist/type_primitives/binary_heap/binary_heap.d.ts.map +1 -1
  390. package/dist/type_primitives/bitset/bitset.d.cts +7 -11
  391. package/dist/type_primitives/bitset/bitset.d.ts +7 -11
  392. package/dist/type_primitives/bitset/bitset.d.ts.map +1 -1
  393. package/dist/type_primitives/brand.d.cts +2 -7
  394. package/dist/type_primitives/brand.d.ts +2 -7
  395. package/dist/type_primitives/brand.d.ts.map +1 -1
  396. package/dist/type_primitives/error.d.cts +1 -2
  397. package/dist/type_primitives/error.d.ts +1 -2
  398. package/dist/type_primitives/error.d.ts.map +1 -1
  399. package/dist/type_primitives/index.d.cts +1 -1
  400. package/dist/type_primitives/index.d.ts +1 -1
  401. package/dist/type_primitives/sparse_map/sparse_map.d.cts +3 -7
  402. package/dist/type_primitives/sparse_map/sparse_map.d.ts +3 -7
  403. package/dist/type_primitives/sparse_map/sparse_map.d.ts.map +1 -1
  404. package/dist/type_primitives/sparse_set/sparse_set.d.cts +2 -6
  405. package/dist/type_primitives/sparse_set/sparse_set.d.ts +2 -6
  406. package/dist/type_primitives/sparse_set/sparse_set.d.ts.map +1 -1
  407. package/dist/type_primitives/topological_sort/topological_sort.d.cts +1 -5
  408. package/dist/type_primitives/topological_sort/topological_sort.d.ts +1 -5
  409. package/dist/type_primitives/topological_sort/topological_sort.d.ts.map +1 -1
  410. package/dist/type_primitives/typed_arrays/typed_arrays.d.cts +18 -17
  411. package/dist/type_primitives/typed_arrays/typed_arrays.d.ts +18 -17
  412. package/dist/type_primitives/typed_arrays/typed_arrays.d.ts.map +1 -1
  413. package/dist/utils/error.d.ts.map +1 -1
  414. package/dist/version.d.cts +4 -4
  415. package/dist/version.d.ts +4 -4
  416. package/dist/worker.cjs +1 -0
  417. package/dist/worker.d.cts +17 -0
  418. package/dist/worker.d.ts +17 -0
  419. package/dist/worker.d.ts.map +1 -0
  420. package/dist/worker.development.cjs +1 -0
  421. package/dist/worker.development.js +253 -0
  422. package/dist/worker.js +253 -0
  423. package/package.json +363 -191
  424. package/dist/core/ecs/builtin_relations.d.cts +0 -43
  425. package/dist/core/ecs/builtin_relations.d.ts +0 -43
  426. package/dist/core/ecs/builtin_relations.d.ts.map +0 -1
  427. package/dist/core/ecs/event_registry.d.cts +0 -22
  428. package/dist/core/ecs/event_registry.d.ts +0 -22
  429. package/dist/core/ecs/event_registry.d.ts.map +0 -1
  430. package/dist/core/ecs/relation_service.d.ts.map +0 -1
  431. package/dist/core/ecs/resume.d.cts +0 -85
  432. package/dist/core/ecs/resume.d.ts +0 -85
  433. package/dist/core/ecs/resume.d.ts.map +0 -1
  434. package/dist/core/ecs/snapshot_service.d.cts +0 -94
  435. package/dist/core/ecs/snapshot_service.d.ts +0 -94
  436. package/dist/core/ecs/snapshot_service.d.ts.map +0 -1
  437. package/dist/extensions/editor/editor.d.ts.map +0 -1
  438. package/dist/extensions/editor/field_handle.d.ts.map +0 -1
  439. package/dist/extensions/editor/index.cjs +0 -1
  440. package/dist/extensions/editor/index.d.cts +0 -21
  441. package/dist/extensions/editor/index.d.ts +0 -21
  442. package/dist/extensions/editor/index.d.ts.map +0 -1
  443. package/dist/extensions/editor/index.development.cjs +0 -1
  444. package/dist/extensions/reactive/ecs_sync.d.cts +0 -214
  445. package/dist/extensions/reactive/ecs_sync.d.ts +0 -214
  446. package/dist/extensions/reactive/ecs_sync.d.ts.map +0 -1
  447. package/dist/extensions/reactive/index.cjs +0 -1
  448. package/dist/extensions/reactive/index.d.cts +0 -23
  449. package/dist/extensions/reactive/index.d.ts +0 -23
  450. package/dist/extensions/reactive/index.d.ts.map +0 -1
  451. package/dist/extensions/reactive/index.development.cjs +0 -1
  452. package/dist/extensions/reactive/index.development.js +0 -215
  453. package/dist/extensions/reactive/index.js +0 -215
  454. package/dist/extensions/solid/index.cjs +0 -1
  455. package/dist/extensions/solid/index.d.cts +0 -6
  456. package/dist/extensions/solid/index.d.ts +0 -6
  457. package/dist/extensions/solid/index.d.ts.map +0 -1
  458. package/dist/extensions/solid/index.development.cjs +0 -1
  459. package/dist/extensions/solid/index.development.js +0 -40
  460. package/dist/extensions/solid/index.js +0 -36
  461. package/dist/extensions/solid/kernel_solid.d.cts +0 -45
  462. package/dist/extensions/solid/kernel_solid.d.ts +0 -45
  463. package/dist/extensions/solid/kernel_solid.d.ts.map +0 -1
  464. package/dist/host_commands-3jyFfWNg.js +0 -2326
  465. package/dist/host_commands-DNf0f6ko.cjs +0 -1
  466. package/dist/internal-C9jjL90H.js +0 -2485
  467. package/dist/internal-RZN14uMw.cjs +0 -2
  468. package/dist/interop-CT-REx0W.cjs +0 -1
  469. package/dist/interop-CcY6ASQc.js +0 -18
  470. package/dist/interop-DqxleBo7.js +0 -18
  471. package/dist/interop-T1HZ-Dpa.cjs +0 -1
  472. package/dist/kernel-Cz2Kxlwl.js +0 -240
  473. package/dist/kernel-DgyrLFjW.js +0 -227
  474. package/dist/kernel-sw7ScKWu.cjs +0 -1
  475. package/dist/kernel-yWV3XnAb.cjs +0 -1
  476. package/dist/reactive/array.d.cts +0 -24
  477. package/dist/reactive/array.d.ts +0 -24
  478. package/dist/reactive/array.d.ts.map +0 -1
  479. package/dist/reactive/index.cjs +0 -1
  480. package/dist/reactive/index.d.cts +0 -11
  481. package/dist/reactive/index.d.ts +0 -11
  482. package/dist/reactive/index.d.ts.map +0 -1
  483. package/dist/reactive/index.development.cjs +0 -1
  484. package/dist/reactive/index.development.js +0 -18
  485. package/dist/reactive/index.js +0 -18
  486. package/dist/reactive/interop.d.cts +0 -19
  487. package/dist/reactive/interop.d.ts +0 -19
  488. package/dist/reactive/interop.d.ts.map +0 -1
  489. package/dist/reactive/kernel.d.cts +0 -73
  490. package/dist/reactive/kernel.d.ts +0 -73
  491. package/dist/reactive/kernel.d.ts.map +0 -1
  492. package/dist/reactive/map.d.cts +0 -16
  493. package/dist/reactive/map.d.ts +0 -16
  494. package/dist/reactive/map.d.ts.map +0 -1
  495. package/dist/reactive/shallow.d.cts +0 -11
  496. package/dist/reactive/shallow.d.ts +0 -11
  497. package/dist/reactive/shallow.d.ts.map +0 -1
  498. package/dist/reactive/struct.d.cts +0 -10
  499. package/dist/reactive/struct.d.ts +0 -10
  500. package/dist/reactive/struct.d.ts.map +0 -1
  501. package/dist/shallow-9S1pY_Iw.js +0 -159
  502. package/dist/shallow-C5YmTbtb.cjs +0 -1
  503. package/dist/shallow-DQ8aG51_.cjs +0 -1
  504. package/dist/shallow-DfnAm9vG.js +0 -150
  505. package/dist/shared-BMXh9hxm.cjs +0 -1
  506. package/dist/shared-DQKK0i-E.js +0 -109
  507. package/dist/topological_sort-BDvEyb9W.cjs +0 -1
  508. package/dist/topological_sort-DK6EjpWa.js +0 -135
  509. package/dist/typed_arrays-BcXcnzB4.js +0 -258
  510. package/dist/typed_arrays-D3NmwtCG.cjs +0 -1
@@ -1,59 +1,61 @@
1
1
  import { EntityID } from './entity.cjs';
2
2
  export declare class EntityAllocator {
3
- /** SAB-backed per-slot generation counters replanted on restore. */
3
+ /** SAB-backed per-slot generation counters, replanted on restore. */
4
4
  private _generations;
5
- /** Single-slot view over the entity-index region's `length` header field
6
- * replanted on restore. Written on every high-water bump (#368). */
5
+ /** Single-slot view over the entity-index region's `length` header field,
6
+ * replanted on restore. Written on every high-water bump. */
7
7
  private _lengthView;
8
8
  private _highWater;
9
9
  private readonly _freeIndices;
10
10
  private _aliveCount;
11
11
  private readonly _capacity;
12
- /** Slot index of the entity allocated by the most recent `alloc` call
12
+ /** Slot index of the entity allocated by the most recent `alloc` call,
13
13
  * alloc-free out-param, read immediately after the call (the `_spawnIndex`
14
14
  * pattern the pre-extraction Store used). */
15
15
  lastIndex: number;
16
16
  constructor(capacity: number, generations: Int32Array, lengthView: Uint32Array);
17
17
  /** Re-point the SAB views after the backing buffer was reallocated
18
- * (grow/extend/restore). Does NOT touch host-side counters. */
18
+ * (grow, extend and restore). Does not touch host-side counters. */
19
19
  replantViews(generations: Int32Array, lengthView: Uint32Array): void;
20
20
  /** The live generations view. Hot flush loops hoist this to a local once
21
- * per flush; do not cache it across a potential SAB replant. */
21
+ * per flush. Do not cache it across a potential SAB replant. */
22
22
  get generations(): Int32Array;
23
23
  get highWater(): number;
24
24
  get aliveCount(): number;
25
25
  get freeCount(): number;
26
- /** Allocate a slot and return its packed id; the slot index is left in
26
+ /** Allocate a slot and return its packed id. The slot index is left in
27
27
  * `lastIndex`. This *commits* the slot (bumps counts, stamps the generation
28
- * so `isAliveIndex` is already true) a caller placing the entity into an
29
- * archetype row must have reserved column capacity first (#775). */
28
+ * so `isAliveIndex` is already true), a caller placing the entity into an
29
+ * archetype row must have reserved column capacity first. */
30
30
  alloc(): EntityID;
31
31
  /** Pre-check that `count` fresh slots fit, so a bulk-spawn commits
32
- * all-or-nothing (#775): `alloc`'s own per-call guard would otherwise
32
+ * all-or-nothing: `alloc`'s own per-call guard would otherwise
33
33
  * throw partway through the loop, leaving committed slots phantom-alive.
34
- * Free-list reuse covers the first `freeCount` slots; only the remainder
34
+ * Free-list reuse covers the first `freeCount` slots. Only the remainder
35
35
  * draws down the high-water headroom. */
36
- ensureCapacity(count: number): void;
37
- /** Recycle (or retire) a slot whose entity carried `generation`. Bumps the
38
- * generation so stale IDs read dead; once the counter would reach the
39
- * reserved tombstone the slot is RETIRED, not recycled (#376): stamp
36
+ assertCapacity(count: number): void;
37
+ /** Release a slot whose entity carried `generation`, for reuse or for
38
+ * retirement. Bumps the generation so stale IDs read dead. Once the counter
39
+ * would reach the reserved tombstone the slot retires instead of returning
40
+ * to the free list: stamp
40
41
  * RETIRED_GENERATION (never issued to a live handle) and skip the
41
42
  * free-list push, closing the ABA window. Burning one of 2^20 indices
42
- * after 2047 reuses is cheap; the branch is predicted not-taken on
43
+ * after 2047 reuses is cheap. The branch is predicted not-taken on
43
44
  * essentially every destroy. */
44
- recycle(index: number, generation: number): void;
45
+ release(index: number, generation: number): void;
45
46
  /** Allocation-side liveness: the slot is in the issued range and its
46
47
  * current generation matches the handle's. (`Store.isAlive` layers the
47
- * malformed-handle guards (#778) on top of this.) */
48
+ * malformed-handle guards on top of this.) */
48
49
  isAliveIndex(index: number, generation: number): boolean;
49
- /** Mirror the current high-water into the SAB `length` header called
50
+ /** Mirror the current high-water into the SAB `length` header, called
50
51
  * after a buffer replant so the fresh region carries the host value. */
51
52
  publishLength(): void;
52
53
  snapshotFreeIndices(): number[];
53
- /** Restore path, step 1: adopt the high-water recovered from the restored
54
- * region's length header BEFORE the replant republishes it (#789). */
54
+ /** Restore path. Adopt the high-water recovered from the restored
55
+ * region's length header, before the replant republishes it. */
55
56
  setHighWater(value: number): void;
56
- /** Restore path, step 2: adopt the captured free-list + alive count. */
57
+ /** Restore path. Adopt the captured free list and alive count, after
58
+ * `setHighWater` has taken the high-water. */
57
59
  restoreHostState(freeIndices: readonly number[], aliveCount: number): void;
58
60
  }
59
61
  //# sourceMappingURL=entity_allocator.d.ts.map
@@ -1,59 +1,61 @@
1
1
  import { EntityID } from './entity.js';
2
2
  export declare class EntityAllocator {
3
- /** SAB-backed per-slot generation counters replanted on restore. */
3
+ /** SAB-backed per-slot generation counters, replanted on restore. */
4
4
  private _generations;
5
- /** Single-slot view over the entity-index region's `length` header field
6
- * replanted on restore. Written on every high-water bump (#368). */
5
+ /** Single-slot view over the entity-index region's `length` header field,
6
+ * replanted on restore. Written on every high-water bump. */
7
7
  private _lengthView;
8
8
  private _highWater;
9
9
  private readonly _freeIndices;
10
10
  private _aliveCount;
11
11
  private readonly _capacity;
12
- /** Slot index of the entity allocated by the most recent `alloc` call
12
+ /** Slot index of the entity allocated by the most recent `alloc` call,
13
13
  * alloc-free out-param, read immediately after the call (the `_spawnIndex`
14
14
  * pattern the pre-extraction Store used). */
15
15
  lastIndex: number;
16
16
  constructor(capacity: number, generations: Int32Array, lengthView: Uint32Array);
17
17
  /** Re-point the SAB views after the backing buffer was reallocated
18
- * (grow/extend/restore). Does NOT touch host-side counters. */
18
+ * (grow, extend and restore). Does not touch host-side counters. */
19
19
  replantViews(generations: Int32Array, lengthView: Uint32Array): void;
20
20
  /** The live generations view. Hot flush loops hoist this to a local once
21
- * per flush; do not cache it across a potential SAB replant. */
21
+ * per flush. Do not cache it across a potential SAB replant. */
22
22
  get generations(): Int32Array;
23
23
  get highWater(): number;
24
24
  get aliveCount(): number;
25
25
  get freeCount(): number;
26
- /** Allocate a slot and return its packed id; the slot index is left in
26
+ /** Allocate a slot and return its packed id. The slot index is left in
27
27
  * `lastIndex`. This *commits* the slot (bumps counts, stamps the generation
28
- * so `isAliveIndex` is already true) a caller placing the entity into an
29
- * archetype row must have reserved column capacity first (#775). */
28
+ * so `isAliveIndex` is already true), a caller placing the entity into an
29
+ * archetype row must have reserved column capacity first. */
30
30
  alloc(): EntityID;
31
31
  /** Pre-check that `count` fresh slots fit, so a bulk-spawn commits
32
- * all-or-nothing (#775): `alloc`'s own per-call guard would otherwise
32
+ * all-or-nothing: `alloc`'s own per-call guard would otherwise
33
33
  * throw partway through the loop, leaving committed slots phantom-alive.
34
- * Free-list reuse covers the first `freeCount` slots; only the remainder
34
+ * Free-list reuse covers the first `freeCount` slots. Only the remainder
35
35
  * draws down the high-water headroom. */
36
- ensureCapacity(count: number): void;
37
- /** Recycle (or retire) a slot whose entity carried `generation`. Bumps the
38
- * generation so stale IDs read dead; once the counter would reach the
39
- * reserved tombstone the slot is RETIRED, not recycled (#376): stamp
36
+ assertCapacity(count: number): void;
37
+ /** Release a slot whose entity carried `generation`, for reuse or for
38
+ * retirement. Bumps the generation so stale IDs read dead. Once the counter
39
+ * would reach the reserved tombstone the slot retires instead of returning
40
+ * to the free list: stamp
40
41
  * RETIRED_GENERATION (never issued to a live handle) and skip the
41
42
  * free-list push, closing the ABA window. Burning one of 2^20 indices
42
- * after 2047 reuses is cheap; the branch is predicted not-taken on
43
+ * after 2047 reuses is cheap. The branch is predicted not-taken on
43
44
  * essentially every destroy. */
44
- recycle(index: number, generation: number): void;
45
+ release(index: number, generation: number): void;
45
46
  /** Allocation-side liveness: the slot is in the issued range and its
46
47
  * current generation matches the handle's. (`Store.isAlive` layers the
47
- * malformed-handle guards (#778) on top of this.) */
48
+ * malformed-handle guards on top of this.) */
48
49
  isAliveIndex(index: number, generation: number): boolean;
49
- /** Mirror the current high-water into the SAB `length` header called
50
+ /** Mirror the current high-water into the SAB `length` header, called
50
51
  * after a buffer replant so the fresh region carries the host value. */
51
52
  publishLength(): void;
52
53
  snapshotFreeIndices(): number[];
53
- /** Restore path, step 1: adopt the high-water recovered from the restored
54
- * region's length header BEFORE the replant republishes it (#789). */
54
+ /** Restore path. Adopt the high-water recovered from the restored
55
+ * region's length header, before the replant republishes it. */
55
56
  setHighWater(value: number): void;
56
- /** Restore path, step 2: adopt the captured free-list + alive count. */
57
+ /** Restore path. Adopt the captured free list and alive count, after
58
+ * `setHighWater` has taken the high-water. */
57
59
  restoreHostState(freeIndices: readonly number[], aliveCount: number): void;
58
60
  }
59
61
  //# sourceMappingURL=entity_allocator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entity_allocator.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/entity_allocator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAsC,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAG7E,qBAAa,eAAe;IAC3B,sEAAsE;IACtE,OAAO,CAAC,YAAY,CAAa;IACjC;wEACoE;IACpE,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgB;IAC7C,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC;;iDAE6C;IACtC,SAAS,SAAK;gBAET,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW;IAM9E;mEAC+D;IACxD,YAAY,CAAC,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,GAAG,IAAI;IAK3E;oEACgE;IAChE,IAAW,WAAW,IAAI,UAAU,CAEnC;IAED,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED;;;wEAGoE;IAC7D,KAAK,IAAI,QAAQ;IA8BxB;;;;6CAIyC;IA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AM,CAE9B;IAED,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED;;;iEAG6D;IACtD,KAAK,IAAI,QAAQ;IA8BxB;;;;6CAIyC;IAClC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAY1C;;;;;;;oCAOgC;IACzB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAWvD;;kDAE8C;IACvC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAI/D;4EACwE;IACjE,aAAa,IAAI,IAAI;IAOrB,mBAAmB,IAAI,MAAM,EAAE;IAItC;oEACgE;IACzD,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIxC;kDAC8C;IACvC,gBAAgB,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;CAKjF"}
@@ -2,24 +2,24 @@ import { Brand } from '../../type_primitives/index.cjs';
2
2
  export type EventID = Brand<number, "event_id">;
3
3
  export declare const asEventId: (value: number) => EventID;
4
4
  /** Event schema: field name → value type. Every value is a number at
5
- * runtime; the declared type may be a branded number (e.g. `EntityID`)
5
+ * runtime. The declared type may be a branded number (e.g. `EntityID`)
6
6
  * so the brand survives the emit → read round trip at the type layer.
7
- * This is the erased/default schema type; the public surfaces constrain
7
+ * This is the erased and default schema type. The public surfaces constrain
8
8
  * on `EventShape<S>` (below) instead, so schemas may be declared as type
9
- * literals OR interfaces an interface lacks the implicit index
9
+ * literals or interfaces, an interface lacks the implicit index
10
10
  * signature literals get (and so isn't assignable to this `Record`
11
11
  * alias), but satisfies the homomorphic `EventShape` check. */
12
12
  export type EventSchema = Readonly<Record<string, number>>;
13
13
  /**
14
- * Homomorphic constraint for event-schema type params (POLISH_AUDIT M9):
15
- * `S extends EventShape<S>` checks every property of `S` is a number WITHOUT
14
+ * Homomorphic constraint for event-schema type params:
15
+ * `S extends EventShape<S>` checks every property of `S` is a number without
16
16
  * requiring an index signature, so `interface`-declared schemas (which lack
17
17
  * the implicit index signature type literals get) are accepted too.
18
18
  */
19
19
  export type EventShape<S> = {
20
20
  readonly [K in keyof S]: number;
21
21
  };
22
- /** Schema of a signal a zero-field event. */
22
+ /** Schema of a signal, a zero-field event. */
23
23
  export type EmptyEventSchema = Readonly<Record<never, number>>;
24
24
  declare const __eventSchema: unique symbol;
25
25
  export type EventDef<S extends EventShape<S> = EventSchema> = EventID & {
@@ -29,28 +29,42 @@ export type EventDef<S extends EventShape<S> = EventSchema> = EventID & {
29
29
  * Reader view over an event channel's SoA columns. Columns are read-only
30
30
  * arrays typed per the event schema: consumers index them and read
31
31
  * `.length`. A field declared as a branded number (e.g. `EntityID`) reads
32
- * back branded no cast at the consumer.
32
+ * back branded, no cast at the consumer.
33
33
  *
34
34
  * The "cannot mutate the live channel through the reader" property is
35
- * **advisory** the columns are the same live `number[]` objects the channel
36
- * mutates (see `EventChannel` below), so the `readonly` typing blocks writes
37
- * at the type layer only; a §10c-policed cast can still write through.
35
+ * **advisory**, the columns are the same live `number[]` objects the channel
36
+ * mutates, so the `readonly` typing blocks writes at the type layer only. A
37
+ * deliberate cast can still write through.
38
38
  */
39
39
  export type EventReader<S extends EventShape<S>> = {
40
40
  readonly length: number;
41
41
  } & {
42
42
  readonly [K in keyof S]: ReadonlyArray<S[K]>;
43
43
  };
44
- export declare class EventChannel {
45
- readonly fieldNames: string[];
46
- readonly columns: number[][];
47
- readonly reader: EventReader<any>;
48
- private readonly _readerLen;
49
- constructor(fieldNames: string[]);
50
- emit(values: Record<string, number>): void;
51
- /** Emit a signal (zero-field event). */
52
- emitSignal(): void;
44
+ /** The event registry, as everything outside the plugin sees it.
45
+ *
46
+ * `Store.events` is public, so this is the whole crossing surface. The
47
+ * plugin's class implements it, and the compiler holds the two in step.
48
+ *
49
+ * `SystemContext` resolves a key and emits or reads through this. `ECS.update`
50
+ * clears the channels at the tick tail, and a `DEV` build samples the buffered
51
+ * count either side of the observer drain. */
52
+ export interface EventHooks {
53
+ /** Register a channel and take its def. The key form is what a caller
54
+ * uses, and this is the anonymous one the key form builds on. */
55
+ register<S extends EventShape<S>>(fields: readonly (keyof S & string)[]): EventDef<S>;
56
+ /** Register a channel under a module-scope key. Throws on a repeat. */
57
+ registerByKey<S extends EventShape<S>>(key: symbol, fields: readonly (keyof S & string)[]): EventDef<S>;
58
+ /** The def a key was registered under. Throws when it was not. */
59
+ defByKey(key: symbol): EventDef<any>;
60
+ hasKey(key: symbol): boolean;
61
+ emit(def: EventDef<any>, values: Record<string, number>): void;
62
+ emitSignal(def: EventDef<EmptyEventSchema>): void;
63
+ reader<S extends EventShape<S>>(def: EventDef<S>): EventReader<S>;
64
+ /** Drop every channel emitted to this tick. Runs once per `update()`. */
53
65
  clear(): void;
66
+ /** `DEV` only. Events buffered across the dirty channels right now. */
67
+ devBufferedCount(): number;
54
68
  }
55
69
  declare const __eventKeySchema: unique symbol;
56
70
  export type EventKey<S extends EventShape<S> = EventSchema> = symbol & {
@@ -62,17 +76,17 @@ export type SignalKey = EventKey<EmptyEventSchema> & {
62
76
  };
63
77
  /**
64
78
  * Compile-time exact-cover check for `registerEvent`'s `fields` list. The
65
- * element type (`keyof S & string`) already rejects foreign fields; this
66
- * catches the inverse mistake an UNDER-registered channel. Registering
79
+ * element type (`keyof S & string`) already rejects foreign fields. This
80
+ * catches the inverse mistake, an under-registered channel. Registering
67
81
  * `eventKey<{a; b}>` with `["a"]` used to compile, but `emit` requires the
68
82
  * full payload while the channel only has an `a` column, so `b` was silently
69
83
  * dropped and `reader.b` (typed as an array) was `undefined` at runtime.
70
84
  * Resolves to `unknown` (intersection no-op) when `F` covers every key, and
71
85
  * to an impossible tuple naming the missing fields otherwise. A schema with a
72
- * string index signature (erased/untyped keys) skips the check there is no
86
+ * string index signature (erased or untyped keys) skips the check. There is no
73
87
  * finite key set to cover.
74
88
  */
75
- export type EventFieldsCover<S extends EventShape<S>, F extends readonly (keyof S & string)[]> = string extends keyof S ? unknown : Exclude<keyof S & string, F[number]> extends never ? unknown : readonly [`ERROR missing event field: ${Exclude<keyof S & string, F[number]>}`];
89
+ export type EventFieldsCover<S extends EventShape<S>, F extends readonly (keyof S & string)[]> = string extends keyof S ? unknown : Exclude<keyof S & string, F[number]> extends never ? unknown : readonly [`ERROR, missing event field: ${Exclude<keyof S & string, F[number]>}`];
76
90
  export declare function eventKey<S extends EventShape<S>>(name: string): EventKey<S>;
77
91
  export declare function signalKey(name: string): SignalKey;
78
92
  export {};
@@ -2,24 +2,24 @@ import { Brand } from '../../type_primitives/index.js';
2
2
  export type EventID = Brand<number, "event_id">;
3
3
  export declare const asEventId: (value: number) => EventID;
4
4
  /** Event schema: field name → value type. Every value is a number at
5
- * runtime; the declared type may be a branded number (e.g. `EntityID`)
5
+ * runtime. The declared type may be a branded number (e.g. `EntityID`)
6
6
  * so the brand survives the emit → read round trip at the type layer.
7
- * This is the erased/default schema type; the public surfaces constrain
7
+ * This is the erased and default schema type. The public surfaces constrain
8
8
  * on `EventShape<S>` (below) instead, so schemas may be declared as type
9
- * literals OR interfaces an interface lacks the implicit index
9
+ * literals or interfaces, an interface lacks the implicit index
10
10
  * signature literals get (and so isn't assignable to this `Record`
11
11
  * alias), but satisfies the homomorphic `EventShape` check. */
12
12
  export type EventSchema = Readonly<Record<string, number>>;
13
13
  /**
14
- * Homomorphic constraint for event-schema type params (POLISH_AUDIT M9):
15
- * `S extends EventShape<S>` checks every property of `S` is a number WITHOUT
14
+ * Homomorphic constraint for event-schema type params:
15
+ * `S extends EventShape<S>` checks every property of `S` is a number without
16
16
  * requiring an index signature, so `interface`-declared schemas (which lack
17
17
  * the implicit index signature type literals get) are accepted too.
18
18
  */
19
19
  export type EventShape<S> = {
20
20
  readonly [K in keyof S]: number;
21
21
  };
22
- /** Schema of a signal a zero-field event. */
22
+ /** Schema of a signal, a zero-field event. */
23
23
  export type EmptyEventSchema = Readonly<Record<never, number>>;
24
24
  declare const __eventSchema: unique symbol;
25
25
  export type EventDef<S extends EventShape<S> = EventSchema> = EventID & {
@@ -29,28 +29,42 @@ export type EventDef<S extends EventShape<S> = EventSchema> = EventID & {
29
29
  * Reader view over an event channel's SoA columns. Columns are read-only
30
30
  * arrays typed per the event schema: consumers index them and read
31
31
  * `.length`. A field declared as a branded number (e.g. `EntityID`) reads
32
- * back branded no cast at the consumer.
32
+ * back branded, no cast at the consumer.
33
33
  *
34
34
  * The "cannot mutate the live channel through the reader" property is
35
- * **advisory** the columns are the same live `number[]` objects the channel
36
- * mutates (see `EventChannel` below), so the `readonly` typing blocks writes
37
- * at the type layer only; a §10c-policed cast can still write through.
35
+ * **advisory**, the columns are the same live `number[]` objects the channel
36
+ * mutates, so the `readonly` typing blocks writes at the type layer only. A
37
+ * deliberate cast can still write through.
38
38
  */
39
39
  export type EventReader<S extends EventShape<S>> = {
40
40
  readonly length: number;
41
41
  } & {
42
42
  readonly [K in keyof S]: ReadonlyArray<S[K]>;
43
43
  };
44
- export declare class EventChannel {
45
- readonly fieldNames: string[];
46
- readonly columns: number[][];
47
- readonly reader: EventReader<any>;
48
- private readonly _readerLen;
49
- constructor(fieldNames: string[]);
50
- emit(values: Record<string, number>): void;
51
- /** Emit a signal (zero-field event). */
52
- emitSignal(): void;
44
+ /** The event registry, as everything outside the plugin sees it.
45
+ *
46
+ * `Store.events` is public, so this is the whole crossing surface. The
47
+ * plugin's class implements it, and the compiler holds the two in step.
48
+ *
49
+ * `SystemContext` resolves a key and emits or reads through this. `ECS.update`
50
+ * clears the channels at the tick tail, and a `DEV` build samples the buffered
51
+ * count either side of the observer drain. */
52
+ export interface EventHooks {
53
+ /** Register a channel and take its def. The key form is what a caller
54
+ * uses, and this is the anonymous one the key form builds on. */
55
+ register<S extends EventShape<S>>(fields: readonly (keyof S & string)[]): EventDef<S>;
56
+ /** Register a channel under a module-scope key. Throws on a repeat. */
57
+ registerByKey<S extends EventShape<S>>(key: symbol, fields: readonly (keyof S & string)[]): EventDef<S>;
58
+ /** The def a key was registered under. Throws when it was not. */
59
+ defByKey(key: symbol): EventDef<any>;
60
+ hasKey(key: symbol): boolean;
61
+ emit(def: EventDef<any>, values: Record<string, number>): void;
62
+ emitSignal(def: EventDef<EmptyEventSchema>): void;
63
+ reader<S extends EventShape<S>>(def: EventDef<S>): EventReader<S>;
64
+ /** Drop every channel emitted to this tick. Runs once per `update()`. */
53
65
  clear(): void;
66
+ /** `DEV` only. Events buffered across the dirty channels right now. */
67
+ devBufferedCount(): number;
54
68
  }
55
69
  declare const __eventKeySchema: unique symbol;
56
70
  export type EventKey<S extends EventShape<S> = EventSchema> = symbol & {
@@ -62,17 +76,17 @@ export type SignalKey = EventKey<EmptyEventSchema> & {
62
76
  };
63
77
  /**
64
78
  * Compile-time exact-cover check for `registerEvent`'s `fields` list. The
65
- * element type (`keyof S & string`) already rejects foreign fields; this
66
- * catches the inverse mistake an UNDER-registered channel. Registering
79
+ * element type (`keyof S & string`) already rejects foreign fields. This
80
+ * catches the inverse mistake, an under-registered channel. Registering
67
81
  * `eventKey<{a; b}>` with `["a"]` used to compile, but `emit` requires the
68
82
  * full payload while the channel only has an `a` column, so `b` was silently
69
83
  * dropped and `reader.b` (typed as an array) was `undefined` at runtime.
70
84
  * Resolves to `unknown` (intersection no-op) when `F` covers every key, and
71
85
  * to an impossible tuple naming the missing fields otherwise. A schema with a
72
- * string index signature (erased/untyped keys) skips the check there is no
86
+ * string index signature (erased or untyped keys) skips the check. There is no
73
87
  * finite key set to cover.
74
88
  */
75
- export type EventFieldsCover<S extends EventShape<S>, F extends readonly (keyof S & string)[]> = string extends keyof S ? unknown : Exclude<keyof S & string, F[number]> extends never ? unknown : readonly [`ERROR missing event field: ${Exclude<keyof S & string, F[number]>}`];
89
+ export type EventFieldsCover<S extends EventShape<S>, F extends readonly (keyof S & string)[]> = string extends keyof S ? unknown : Exclude<keyof S & string, F[number]> extends never ? unknown : readonly [`ERROR, missing event field: ${Exclude<keyof S & string, F[number]>}`];
76
90
  export declare function eventKey<S extends EventShape<S>>(name: string): EventKey<S>;
77
91
  export declare function signalKey(name: string): SignalKey;
78
92
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/event.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BK;AAEL,OAAO,EACN,KAAK,EAIL,MAAM,uBAAuB,CAAC;AAI/B,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAChD,eAAO,MAAM,SAAS,UAAW,MAAM,YAKrC,CAAC;AAEH;;;;;;;+DAO+D;AAC/D,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM;CAAE,CAAC;AAEhE,+CAA+C;AAC/C,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAQ/D,OAAO,CAAC,MAAM,aAAa,EAAE,OAAO,MAAM,CAAC;AAE3C,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,OAAO,GAAG;IACvE,QAAQ,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,IAAI;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB,GAAG;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAA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AM,QAAQ,CAAC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,MAAM,GAAG;IACtE,QAAQ,CAAC,CAAC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;CAC7C,CAAC;AAQF,OAAO,CAAC,MAAM,WAAW,EAAE,OAAO,MAAM,CAAC;AAEzC,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,gBAAgB,CAAC,GAAG;IACpD,QAAQ,CAAC,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC;CAC7B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,gBAAgB,CAC3B,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EACvB,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,EAAE,IACpC,MAAM,SAAS,MAAM,CAAC,GACvB,OAAO,GACP,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,KAAK,GACjD,OAAO,GACP,SAAS,CAAC,+BAA+B,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;AAErF,wBAAgB,QAAQ,CAAC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAE3E;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAEjD"}
@@ -1,110 +1,14 @@
1
1
  import { Store } from './store.cjs';
2
- import { EntityID } from './entity.cjs';
3
- import { OnDeleteTarget, RelationDef, RelationOptions } from './relation.cjs';
4
2
  import { ResourceKey } from './resource.cjs';
5
- import { EventFieldsCover, EventKey, EventReader, EventShape, SignalKey } from './event.cjs';
6
- /** Relations sparse `(relation, target)` pairs and hierarchy traversal
7
- * (#471 / #474, ADR-0011). Add/remove/re-target cause no archetype
8
- * transition; ops are immediate and safe mid-tick. Traversal and wildcard
9
- * reads are cold-path. */
10
- export declare class ECSRelations {
11
- private readonly store;
12
- /** @internal constructed by `ECS`. */
13
- constructor(store: Store);
14
- /** Register a relation kind. Exclusive (default) stores one target per
15
- * source; `{ multi: true }` stores a target set per source.
16
- * `{ onDeleteTarget: "delete" | "clear" | "orphan" }` selects target-death
17
- * cleanup (default `orphan`, #473).
18
- *
19
- * The overloads stamp the CARDINALITY into the handle type (typestate
20
- * a173382 / POLISH_AUDIT #7), exactly like the flat `registerRelation`:
21
- * the exclusive-only surfaces (`targetOf`, `ancestorsOf`/`rootOf`/
22
- * `cascadeOf`, `Query.hierarchy`) accept only `RelationDef<"exclusive">`,
23
- * so passing a `{ multi: true }` relation is a compile error. A
24
- * dynamically-built options value falls to the erased overload and keeps
25
- * the runtime check as its only guard. */
26
- register(opts?: {
27
- readonly exclusive?: true;
28
- readonly multi?: false;
29
- readonly onDeleteTarget?: OnDeleteTarget;
30
- }): RelationDef<"exclusive">;
31
- register(opts: {
32
- readonly multi: true;
33
- readonly exclusive?: false;
34
- readonly onDeleteTarget?: OnDeleteTarget;
35
- }): RelationDef<"multi">;
36
- register(opts?: RelationOptions): RelationDef;
37
- /** Count of registered relations. */
38
- get count(): number;
39
- /** Add a `(R, tgt)` pair to `src`. Exclusive replaces the existing target;
40
- * multi adds to the set. No archetype transition. */
41
- add(src: EntityID, def: RelationDef, tgt: EntityID): this;
42
- /** Remove a `(R, tgt)` pair from `src`. For multi, omitting `tgt` removes
43
- * all of `src`'s targets. No archetype transition. */
44
- remove(src: EntityID, def: RelationDef, tgt?: EntityID): this;
45
- /** Whether `src` holds any pair under `R`. */
46
- has(src: EntityID, def: RelationDef): boolean;
47
- /** The single target of `src` under an exclusive relation, or `undefined`. */
48
- targetOf(src: EntityID, def: RelationDef<"exclusive">): EntityID | undefined;
49
- /** All targets of `src` under `R`, ascending by id. */
50
- targetsOf(src: EntityID, def: RelationDef): EntityID[];
51
- /** Sources pointing at `tgt` under `R` (the reverse index), ascending by id.
52
- * `(entity, def)` order, matching `targetOf` / `targetsOf`. */
53
- sourcesOf(tgt: EntityID, def: RelationDef): EntityID[];
54
- /** All `(source, target)` pairs of relation `R` — the `(R, *)` wildcard
55
- * (#472). Sources in canonical entity-index order. Cold path. */
56
- pairsOf(def: RelationDef): readonly (readonly [EntityID, EntityID])[];
57
- /** Every `(relation, source)` pointing at `tgt`, across all relation kinds —
58
- * the `(*, T)` wildcard (#472). Ordered by relation id then source id. */
59
- sourcesOfAny(tgt: EntityID): readonly (readonly [RelationDef, EntityID])[];
60
- /** Walk relation `R` up from `src` to its chain root, returning
61
- * `[src, parent, …, root]` (nearest-ancestor-first). Exclusive only. */
62
- ancestorsOf(src: EntityID, def: RelationDef<"exclusive">): EntityID[];
63
- /** The root of `src`'s `R`-chain (`src` itself when it has no target).
64
- * Exclusive only. */
65
- rootOf(src: EntityID, def: RelationDef<"exclusive">): EntityID;
66
- /** Walk relation `R` down from `root` over the reverse index, returning the
67
- * subtree (including `root`) breadth-first — parents before children (the
68
- * `cascade` order). Exclusive only. */
69
- cascadeOf(root: EntityID, def: RelationDef<"exclusive">): EntityID[];
70
- /** Reclaim relation reverse-index memory: drop every reverse entry whose
71
- * target has been destroyed, returning the total dropped (#491). Purely
72
- * cold-path, no observable state change — call at scene/snapshot
73
- * boundaries. */
74
- compact(): number;
75
- }
76
- /** Event channels and signals. Emit during one `update()`, visible to every
77
- * later system in that call, cleared before the next. System-side reads and
78
- * emits go through `ctx` — this facade is the HOST-side surface. */
79
- export declare class ECSEvents {
80
- private readonly store;
81
- /** @internal constructed by `ECS`. */
82
- constructor(store: Store);
83
- /** Register an event channel at world setup, before anything emits on it.
84
- * `fields` must name EVERY schema key — an under-registered channel would
85
- * silently drop the missing fields at emit (see `EventFieldsCover`).
86
- *
87
- * @example
88
- * const Damaged = eventKey<{ target: EntityID; amount: number }>("Damaged");
89
- * ecs.events.register(Damaged, ["target", "amount"]);
90
- * ecs.events.emit(Damaged, { target: e, amount: 10 }); // or ctx.emit inside a system
91
- */
92
- register<S extends EventShape<S>, const F extends readonly (keyof S & string)[]>(key: EventKey<S>, fields: F & EventFieldsCover<S, F>): void;
93
- /** Register a signal (empty-payload event channel). */
94
- registerSignal(key: SignalKey): void;
95
- emit(key: SignalKey): void;
96
- emit<S extends EventShape<S>>(key: EventKey<S>, values: NoInfer<S>): void;
97
- read<S extends EventShape<S>>(key: EventKey<S>): EventReader<S>;
98
- }
99
- /** World resources — singleton values keyed by `ResourceKey<T>`. Runtime
100
- * mutations (`set` / `remove`) are access-checked as resource writes inside
101
- * a system span; `register` is a one-time world-setup op. */
3
+ /** World resources, singleton values keyed by `ResourceKey<T>`. Runtime
4
+ * mutations (`set` and `remove`) are access-checked as resource writes inside
5
+ * a system span. `register` is a one-time world-setup op. */
102
6
  export declare class ECSResources {
103
- private readonly store;
7
+ private readonly _store;
104
8
  /** @internal constructed by `ECS`. */
105
9
  constructor(store: Store);
106
- /** Register a resource at world setup. Reading/writing an unregistered
107
- * key throws (fail-closed) registration is the explicit "this world has
10
+ /** Register a resource at world setup. Reading and writing an unregistered
11
+ * key throws (fail-closed), registration is the explicit "this world has
108
12
  * this singleton" declaration, not a lazy default.
109
13
  *
110
14
  * @example
@@ -115,44 +19,26 @@ export declare class ECSResources {
115
19
  register<T>(key: ResourceKey<T>, value: NoInfer<T>): void;
116
20
  get<T>(key: ResourceKey<T>): T;
117
21
  set<T>(key: ResourceKey<T>, value: NoInfer<T>): void;
118
- /** Drop a resource from the world (#798). Access-checked as a *write*;
22
+ /** Drop a resource from the world. Access-checked as a *write*, and it
119
23
  * fails closed on a missing key. Afterwards the key is free to `register`
120
- * again the present → absent → present lifecycle. */
24
+ * again, the present → absent → present lifecycle. */
121
25
  remove<T>(key: ResourceKey<T>): void;
122
26
  has<T>(key: ResourceKey<T>): boolean;
123
27
  }
124
- /** The determinism surface (#626 / ADR-0020): world snapshot/resume and the
28
+ /** The determinism surface: world snapshot and resume and the
125
29
  * canonical state digest. Every member except `deterministic` throws
126
30
  * `DETERMINISM_DISABLED` unless the world was constructed with
127
- * `{ deterministic: true }`. All cold-path take captures at tick
31
+ * `{ deterministic: true }`. All cold-path, take captures at tick
128
32
  * boundaries (between `update()`s). */
129
33
  export declare class ECSSnapshots {
130
- private readonly store;
34
+ protected readonly _store: Store;
131
35
  /** @internal constructed by `ECS`. */
132
36
  constructor(store: Store);
133
37
  /** Whether the determinism surface is enabled. */
134
38
  get deterministic(): boolean;
135
- /** FNV-1a 32 digest over every archetype's live rows in id order the
39
+ /** FNV-1a 32 digest over every archetype's live rows in id order, the
136
40
  * canonical "live ECS state digest". Per-call cost scales with live
137
41
  * entity count, not SAB capacity. */
138
42
  stateHash(): number;
139
- /** Capture the full live world (dense + sparse/relations + host-side
140
- * bookkeeping) to one self-contained byte buffer that `restore` can mount
141
- * back onto a live, ticking world (#789). v1 does NOT capture resources,
142
- * events, or change-detection baselines (ADR-0031). */
143
- capture(): Uint8Array;
144
- /** Mount a `capture()` buffer onto this live world and keep ticking.
145
- * Fails closed on a malformed frame or registration mismatch BEFORE
146
- * mutating any live state. Requires a matching archetype set + column
147
- * layout (prewarm so the set is stable). */
148
- restore(bytes: Uint8Array): void;
149
- /** Serialize the sparse stores + relations to a self-contained buffer —
150
- * the sparse half of a world snapshot, canonical entity-index order
151
- * (#470). Pairs with `restoreSparse`. */
152
- captureSparse(): Uint8Array;
153
- /** Repopulate the sparse stores + relation indices from `captureSparse`
154
- * bytes. Sparse components must already be registered in the same order;
155
- * throws `SparseRestoreError` on a shape or identity mismatch. */
156
- restoreSparse(bytes: Uint8Array): void;
157
43
  }
158
44
  //# sourceMappingURL=facades.d.ts.map