@oasys/oecs 0.5.4 → 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 +1223 -266
  2. package/README.md +217 -112
  3. package/dist/core/ecs/access_check.d.cts +29 -29
  4. package/dist/core/ecs/access_check.d.ts +29 -29
  5. package/dist/core/ecs/access_check.d.ts.map +1 -1
  6. package/dist/core/ecs/archetype.d.cts +217 -209
  7. package/dist/core/ecs/archetype.d.ts +217 -209
  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 +33 -33
  13. package/dist/core/ecs/archetype_graph.d.ts +33 -33
  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 +26 -26
  28. package/dist/core/ecs/command_log.d.ts +26 -26
  29. package/dist/core/ecs/command_log.d.ts.map +1 -1
  30. package/dist/core/ecs/component.d.cts +43 -42
  31. package/dist/core/ecs/component.d.ts +43 -42
  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 +289 -270
  46. package/dist/core/ecs/ecs.d.ts +289 -270
  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 +20 -18
  57. package/dist/core/ecs/entity_allocator.d.ts +20 -18
  58. package/dist/core/ecs/entity_allocator.d.ts.map +1 -1
  59. package/dist/core/ecs/event.d.cts +36 -22
  60. package/dist/core/ecs/event.d.ts +36 -22
  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 +32 -32
  69. package/dist/core/ecs/frame_trace.d.ts +32 -32
  70. package/dist/core/ecs/frame_trace.d.ts.map +1 -1
  71. package/dist/core/ecs/host_commands.d.cts +103 -85
  72. package/dist/core/ecs/host_commands.d.ts +103 -85
  73. package/dist/core/ecs/host_commands.d.ts.map +1 -1
  74. package/dist/core/ecs/index.d.cts +21 -11
  75. package/dist/core/ecs/index.d.ts +21 -11
  76. package/dist/core/ecs/index.d.ts.map +1 -1
  77. package/dist/core/ecs/observer.d.cts +39 -120
  78. package/dist/core/ecs/observer.d.ts +39 -120
  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 +208 -578
  90. package/dist/core/ecs/query.d.ts +208 -578
  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 +100 -39
  102. package/dist/core/ecs/ref.d.ts +100 -39
  103. package/dist/core/ecs/ref.d.ts.map +1 -1
  104. package/dist/core/ecs/relation.d.cts +101 -182
  105. package/dist/core/ecs/relation.d.ts +101 -182
  106. package/dist/core/ecs/relation.d.ts.map +1 -1
  107. package/dist/core/ecs/resource.d.cts +13 -13
  108. package/dist/core/ecs/resource.d.ts +13 -13
  109. package/dist/core/ecs/resource_registry.d.cts +5 -5
  110. package/dist/core/ecs/resource_registry.d.ts +5 -5
  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 +91 -120
  119. package/dist/core/ecs/schedule.d.ts +91 -120
  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 +108 -51
  131. package/dist/core/ecs/sparse_store.d.ts +108 -51
  132. package/dist/core/ecs/sparse_store.d.ts.map +1 -1
  133. package/dist/core/ecs/store.d.cts +527 -473
  134. package/dist/core/ecs/store.d.ts +527 -473
  135. package/dist/core/ecs/store.d.ts.map +1 -1
  136. package/dist/core/ecs/store_layout_listener.d.cts +6 -6
  137. package/dist/core/ecs/store_layout_listener.d.ts +6 -6
  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 +146 -61
  142. package/dist/core/ecs/system.d.ts +146 -61
  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 +82 -6
  154. package/dist/core/ecs/utils/error.d.ts +82 -6
  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 +44 -44
  163. package/dist/core/store/action_ring.d.ts +44 -44
  164. package/dist/core/store/action_ring.d.ts.map +1 -1
  165. package/dist/core/store/allocator.d.cts +149 -95
  166. package/dist/core/store/allocator.d.ts +149 -95
  167. package/dist/core/store/allocator.d.ts.map +1 -1
  168. package/dist/core/store/buffer_backed_column.d.cts +17 -17
  169. package/dist/core/store/buffer_backed_column.d.ts +17 -17
  170. package/dist/core/store/buffer_backed_column.d.ts.map +1 -1
  171. package/dist/core/store/column_store.d.cts +124 -86
  172. package/dist/core/store/column_store.d.ts +124 -86
  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 +36 -39
  178. package/dist/core/store/command_ring.d.ts +36 -39
  179. package/dist/core/store/command_ring.d.ts.map +1 -1
  180. package/dist/core/store/descriptor.d.cts +34 -17
  181. package/dist/core/store/descriptor.d.ts +34 -17
  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 +36 -38
  187. package/dist/core/store/event_ring.d.ts +36 -38
  188. package/dist/core/store/event_ring.d.ts.map +1 -1
  189. package/dist/core/store/extend.d.cts +13 -7
  190. package/dist/core/store/extend.d.ts +13 -7
  191. package/dist/core/store/extend.d.ts.map +1 -1
  192. package/dist/core/store/grow.d.cts +2 -2
  193. package/dist/core/store/grow.d.ts +2 -2
  194. package/dist/core/store/grow.d.ts.map +1 -1
  195. package/dist/core/store/header.d.cts +31 -27
  196. package/dist/core/store/header.d.ts +31 -27
  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 +71 -62
  202. package/dist/core/store/layout_ops.d.ts +71 -62
  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 +12 -12
  211. package/dist/core/store/state_hash.d.ts +12 -12
  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 +15 -10
  225. package/dist/index.d.ts +15 -10
  226. package/dist/index.d.ts.map +1 -1
  227. package/dist/index.development.cjs +1 -1
  228. package/dist/index.development.js +5804 -5203
  229. package/dist/index.js +5323 -4764
  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 +54 -54
  244. package/dist/{extensions → plugins}/editor/editor.d.ts +54 -54
  245. package/dist/plugins/editor/editor.d.ts.map +1 -0
  246. package/dist/{extensions → plugins}/editor/field_handle.d.cts +12 -12
  247. package/dist/{extensions → plugins}/editor/field_handle.d.ts +12 -12
  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} +81 -64
  257. package/dist/{extensions/editor/index.js → plugins/editor.js} +81 -64
  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 +85 -97
  302. package/dist/{core/ecs → plugins/relations}/relation_service.d.ts +85 -97
  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 +16 -15
  411. package/dist/type_primitives/typed_arrays/typed_arrays.d.ts +16 -15
  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 +3 -3
  415. package/dist/version.d.ts +3 -3
  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-BlR3oZ3x.js +0 -2406
  465. package/dist/host_commands-C2cpU3yC.cjs +0 -1
  466. package/dist/internal-BoxWl4dG.js +0 -2565
  467. package/dist/internal-CGBEwfeB.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-Bs39EPh1.js +0 -150
  502. package/dist/shallow-C5YmTbtb.cjs +0 -1
  503. package/dist/shallow-CiFC70Dz.js +0 -159
  504. package/dist/shallow-DQ8aG51_.cjs +0 -1
  505. package/dist/shared-B4v0L1cw.js +0 -109
  506. package/dist/shared-DU78k0pU.cjs +0 -1
  507. package/dist/topological_sort-BDvEyb9W.cjs +0 -1
  508. package/dist/topological_sort-DK6EjpWa.js +0 -135
  509. package/dist/typed_arrays-D3NmwtCG.cjs +0 -1
  510. package/dist/typed_arrays-DIVwVy5_.js +0 -258
@@ -1,22 +0,0 @@
1
- import { EmptyEventSchema, EventDef, EventReader, EventShape } from './event.cjs';
2
- export declare class EventRegistry {
3
- private readonly channels;
4
- private readonly dirtyChannels;
5
- private count;
6
- private readonly keyMap;
7
- registerEvent<S extends EventShape<S>>(fields: readonly (keyof S & string)[]): EventDef<S>;
8
- emitEvent(def: EventDef<any>, values: Record<string, number>): void;
9
- emitSignal(def: EventDef<EmptyEventSchema>): void;
10
- getEventReader<S extends EventShape<S>>(def: EventDef<S>): EventReader<S>;
11
- clearEvents(): void;
12
- /** `DEV`-only: total events currently buffered across the dirty channels.
13
- * `ECS.update` samples this either side of `dispatchSet` to assert an onSet
14
- * observer emitted nothing — its emissions would be wiped by the tick-tail
15
- * `clearEvents` and break the empty-channel-at-boundary invariant snapshot /
16
- * restore relies on. Walks only the dirty list, never the hot emit path. */
17
- devBufferedEventCount(): number;
18
- registerEventByKey<S extends EventShape<S>>(key: symbol, fields: readonly (keyof S & string)[]): EventDef<S>;
19
- getEventDefByKey(key: symbol): EventDef<any>;
20
- hasEventKey(key: symbol): boolean;
21
- }
22
- //# sourceMappingURL=event_registry.d.ts.map
@@ -1,22 +0,0 @@
1
- import { EmptyEventSchema, EventDef, EventReader, EventShape } from './event.js';
2
- export declare class EventRegistry {
3
- private readonly channels;
4
- private readonly dirtyChannels;
5
- private count;
6
- private readonly keyMap;
7
- registerEvent<S extends EventShape<S>>(fields: readonly (keyof S & string)[]): EventDef<S>;
8
- emitEvent(def: EventDef<any>, values: Record<string, number>): void;
9
- emitSignal(def: EventDef<EmptyEventSchema>): void;
10
- getEventReader<S extends EventShape<S>>(def: EventDef<S>): EventReader<S>;
11
- clearEvents(): void;
12
- /** `DEV`-only: total events currently buffered across the dirty channels.
13
- * `ECS.update` samples this either side of `dispatchSet` to assert an onSet
14
- * observer emitted nothing — its emissions would be wiped by the tick-tail
15
- * `clearEvents` and break the empty-channel-at-boundary invariant snapshot /
16
- * restore relies on. Walks only the dirty list, never the hot emit path. */
17
- devBufferedEventCount(): number;
18
- registerEventByKey<S extends EventShape<S>>(key: symbol, fields: readonly (keyof S & string)[]): EventDef<S>;
19
- getEventDefByKey(key: symbol): EventDef<any>;
20
- hasEventKey(key: symbol): boolean;
21
- }
22
- //# sourceMappingURL=event_registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event_registry.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/event_registry.ts"],"names":[],"mappings":"AAAA;;;;;;;KAOK;AAGL,OAAO,EAGN,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,MAAM,SAAS,CAAC;AAGjB,qBAAa,aAAa;IAEzB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAK/C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,KAAK,CAAK;IAIlB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAEzD,aAAa,CAAC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAC3C,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,EAAE,GACnC,QAAQ,CAAC,CAAC,CAAC;IAOP,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAYnE,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAQ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,KAAK,IAAI,GAC9B,IAAI;IA+CP;;;;;;;;;;;;;;;6DAeyD;IAClD,gBAAgB,IAAI,MAAM;IAmBjC;;;;;;;;;;;;;;;;gCAgB4B;IACrB,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,GAAG,QAAQ,EAAE;IA2C/D;;;;uDAImD;IAC5C,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,GAAG,QAAQ;IAKxD;;;;;;0BAMsB;IACf,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,GAAG,QAAQ,EAAE;IAoC9D;;;;;;;;sEAQkE;IAC3D,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAK5C;;;;;;;;;;;;;;;;;iFAiB6E;IACtE,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI;IAgBnE;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA2B2C;IACpC,qBAAqB,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,aAAa,EAAE,SAAS,iBAAiB,EAAE,EAC3C,aAAa,EAAE,SAAS,iBAAiB,EAAE,EAC3C,eAAe,EAAE,SAAS,SAAS,EAAE,EACrC,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,OAAO,EACxB,EAAE,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,GAC9B,IAAI;IAmEP;;;;;;;;uEAQmE;IACnE,OAAO,CAAC,iBAAiB;CAuDzB"}
@@ -1,85 +0,0 @@
1
- import { ArchetypeViews } from '../store/index.cjs';
2
- /** Magic for the combined world-snapshot frame (`"WRS0"` little-endian). Distinct
3
- * from the SAB `STORE_MAGIC` so a bare dense snapshot fed to `restoreInto` is
4
- * rejected with a clear error instead of being mis-parsed as a combined frame. */
5
- export declare const WORLD_SNAPSHOT_MAGIC = 810766935;
6
- /** Combined-frame format version. Bumped if the section framing or host-state
7
- * layout changes. Independent of `SIM_ABI_VERSION` (which gates the dense bytes). */
8
- export declare const ECS_SNAPSHOT_VERSION = 1;
9
- /** Thrown by `Store.restoreInto` (and the helpers here) when a combined snapshot
10
- * is malformed, carries the wrong magic/version, or targets a world whose
11
- * archetype/component registration doesn't match the snapshot. Mirrors
12
- * `StoreRestoreError` / `SparseRestoreError` so callers see one error class per
13
- * restore failure mode. */
14
- export declare class ECSRestoreError extends Error {
15
- constructor(message: string);
16
- }
17
- /** Per-archetype host-side row bookkeeping the SAB doesn't carry authoritatively. */
18
- export interface ArchetypeRowState {
19
- readonly archetypeId: number;
20
- /** Total live rows (enabled + disabled). */
21
- readonly length: number;
22
- /** Enabled-row partition boundary: rows `[0, enabledCount)` enabled. */
23
- readonly enabledCount: number;
24
- }
25
- /** The host-side state a snapshot captures alongside the dense + sparse bytes. */
26
- export interface HostState {
27
- /** World tick at snapshot time (`Store._tick`). */
28
- readonly tick: number;
29
- /** Entity-index high-water (count of slots ever issued). Also mirrored in the
30
- * SAB region's `length` header; carried here for a cross-check on restore. */
31
- readonly entityHighWater: number;
32
- /** Live entity count. */
33
- readonly entityAliveCount: number;
34
- /** Recycle free-list in live order (LIFO: the last element is the next slot
35
- * `createEntity` hands out). */
36
- readonly freeIndices: readonly number[];
37
- /** Per-archetype row state, one entry per SAB-backed archetype. */
38
- readonly archetypeRows: readonly ArchetypeRowState[];
39
- }
40
- /** Serialize host-state to a self-contained little-endian byte buffer. Layout:
41
- *
42
- * [u32 tick][u32 highWater][u32 alive_count]
43
- * [u32 freeCount][u32 free_index × freeCount]
44
- * [u32 archCount][(u32 id, u32 length, u32 enabled_count) × archCount]
45
- */
46
- export declare function serializeHostState(hs: HostState): Uint8Array;
47
- /** Parse host-state bytes produced by `serializeHostState`. Throws
48
- * `ECSRestoreError` on truncation or a trailing-byte (non-canonical) buffer. */
49
- export declare function parseHostState(bytes: Uint8Array): HostState;
50
- /** Assemble the combined world-snapshot frame from its three sections. Layout:
51
- *
52
- * [u32 magic][u32 version][u32 denseLen][u32 sparseLen][u32 hostLen]
53
- * [dense][sparse][host]
54
- */
55
- export declare function frameWorldSnapshot(dense: Uint8Array, sparse: Uint8Array, host: Uint8Array): Uint8Array;
56
- /** The three sections of a combined frame, as zero-copy subviews over `bytes`. */
57
- export interface WorldSnapshotSections {
58
- readonly dense: Uint8Array;
59
- readonly sparse: Uint8Array;
60
- readonly host: Uint8Array;
61
- }
62
- /** Split a combined frame back into its sections. Validates magic, version, and
63
- * an exact (no trailing bytes) frame; throws `ECSRestoreError` otherwise. */
64
- export declare function unframeWorldSnapshot(bytes: Uint8Array): WorldSnapshotSections;
65
- /**
66
- * Fail-closed registration guard, read **directly from the snapshot's dense
67
- * bytes** so it can run BEFORE the dense backing is touched. `restoreInto`
68
- * builds the restored store through the live world's in-place allocator,
69
- * which reuses the live backing buffer — so validating a
70
- * *materialised* `ColumnStore` would already have overwritten live column data
71
- * (the buffer is overwritten inside `restoreColumnStore`, before any post-build
72
- * check could run). Parsing the descriptors off the raw `dense` `Uint8Array`
73
- * keeps the check non-mutating, so a mismatch leaves the live world untouched.
74
- *
75
- * Asserts: the dense section's SAB magic + ABI, that its archetype set +
76
- * per-archetype `componentMask` + per-column `(componentId, fieldId, typeTag)`
77
- * match the live store's exactly (so every live `Archetype.refreshViews` finds
78
- * its region and no snapshot archetype is orphaned), and that the entity-index
79
- * capacity matches (the region is sized once at construction). The archetype
80
- * graph is rebuilt from registration code, not the snapshot (mirroring
81
- * `restoreSparse`'s "registered in the same order" contract). Throws
82
- * `ECSRestoreError` on any mismatch / malformed section.
83
- */
84
- export declare function assertDenseLayoutMatchesLive(dense: Uint8Array, live: ReadonlyMap<number, ArchetypeViews>, liveEntityIndexCapacity: number): void;
85
- //# sourceMappingURL=resume.d.ts.map
@@ -1,85 +0,0 @@
1
- import { ArchetypeViews } from '../store/index.js';
2
- /** Magic for the combined world-snapshot frame (`"WRS0"` little-endian). Distinct
3
- * from the SAB `STORE_MAGIC` so a bare dense snapshot fed to `restoreInto` is
4
- * rejected with a clear error instead of being mis-parsed as a combined frame. */
5
- export declare const WORLD_SNAPSHOT_MAGIC = 810766935;
6
- /** Combined-frame format version. Bumped if the section framing or host-state
7
- * layout changes. Independent of `SIM_ABI_VERSION` (which gates the dense bytes). */
8
- export declare const ECS_SNAPSHOT_VERSION = 1;
9
- /** Thrown by `Store.restoreInto` (and the helpers here) when a combined snapshot
10
- * is malformed, carries the wrong magic/version, or targets a world whose
11
- * archetype/component registration doesn't match the snapshot. Mirrors
12
- * `StoreRestoreError` / `SparseRestoreError` so callers see one error class per
13
- * restore failure mode. */
14
- export declare class ECSRestoreError extends Error {
15
- constructor(message: string);
16
- }
17
- /** Per-archetype host-side row bookkeeping the SAB doesn't carry authoritatively. */
18
- export interface ArchetypeRowState {
19
- readonly archetypeId: number;
20
- /** Total live rows (enabled + disabled). */
21
- readonly length: number;
22
- /** Enabled-row partition boundary: rows `[0, enabledCount)` enabled. */
23
- readonly enabledCount: number;
24
- }
25
- /** The host-side state a snapshot captures alongside the dense + sparse bytes. */
26
- export interface HostState {
27
- /** World tick at snapshot time (`Store._tick`). */
28
- readonly tick: number;
29
- /** Entity-index high-water (count of slots ever issued). Also mirrored in the
30
- * SAB region's `length` header; carried here for a cross-check on restore. */
31
- readonly entityHighWater: number;
32
- /** Live entity count. */
33
- readonly entityAliveCount: number;
34
- /** Recycle free-list in live order (LIFO: the last element is the next slot
35
- * `createEntity` hands out). */
36
- readonly freeIndices: readonly number[];
37
- /** Per-archetype row state, one entry per SAB-backed archetype. */
38
- readonly archetypeRows: readonly ArchetypeRowState[];
39
- }
40
- /** Serialize host-state to a self-contained little-endian byte buffer. Layout:
41
- *
42
- * [u32 tick][u32 highWater][u32 alive_count]
43
- * [u32 freeCount][u32 free_index × freeCount]
44
- * [u32 archCount][(u32 id, u32 length, u32 enabled_count) × archCount]
45
- */
46
- export declare function serializeHostState(hs: HostState): Uint8Array;
47
- /** Parse host-state bytes produced by `serializeHostState`. Throws
48
- * `ECSRestoreError` on truncation or a trailing-byte (non-canonical) buffer. */
49
- export declare function parseHostState(bytes: Uint8Array): HostState;
50
- /** Assemble the combined world-snapshot frame from its three sections. Layout:
51
- *
52
- * [u32 magic][u32 version][u32 denseLen][u32 sparseLen][u32 hostLen]
53
- * [dense][sparse][host]
54
- */
55
- export declare function frameWorldSnapshot(dense: Uint8Array, sparse: Uint8Array, host: Uint8Array): Uint8Array;
56
- /** The three sections of a combined frame, as zero-copy subviews over `bytes`. */
57
- export interface WorldSnapshotSections {
58
- readonly dense: Uint8Array;
59
- readonly sparse: Uint8Array;
60
- readonly host: Uint8Array;
61
- }
62
- /** Split a combined frame back into its sections. Validates magic, version, and
63
- * an exact (no trailing bytes) frame; throws `ECSRestoreError` otherwise. */
64
- export declare function unframeWorldSnapshot(bytes: Uint8Array): WorldSnapshotSections;
65
- /**
66
- * Fail-closed registration guard, read **directly from the snapshot's dense
67
- * bytes** so it can run BEFORE the dense backing is touched. `restoreInto`
68
- * builds the restored store through the live world's in-place allocator,
69
- * which reuses the live backing buffer — so validating a
70
- * *materialised* `ColumnStore` would already have overwritten live column data
71
- * (the buffer is overwritten inside `restoreColumnStore`, before any post-build
72
- * check could run). Parsing the descriptors off the raw `dense` `Uint8Array`
73
- * keeps the check non-mutating, so a mismatch leaves the live world untouched.
74
- *
75
- * Asserts: the dense section's SAB magic + ABI, that its archetype set +
76
- * per-archetype `componentMask` + per-column `(componentId, fieldId, typeTag)`
77
- * match the live store's exactly (so every live `Archetype.refreshViews` finds
78
- * its region and no snapshot archetype is orphaned), and that the entity-index
79
- * capacity matches (the region is sized once at construction). The archetype
80
- * graph is rebuilt from registration code, not the snapshot (mirroring
81
- * `restoreSparse`'s "registered in the same order" contract). Throws
82
- * `ECSRestoreError` on any mismatch / malformed section.
83
- */
84
- export declare function assertDenseLayoutMatchesLive(dense: Uint8Array, live: ReadonlyMap<number, ArchetypeViews>, liveEntityIndexCapacity: number): void;
85
- //# sourceMappingURL=resume.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resume.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/resume.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAUN,KAAK,cAAc,EACnB,MAAM,UAAU,CAAC;AAElB;;kFAEkF;AAClF,eAAO,MAAM,oBAAoB,YAAa,CAAC;AAE/C;qFACqF;AACrF,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC;;;;2BAI2B;AAC3B,qBAAa,eAAgB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM;CAI3B;AAED,qFAAqF;AACrF,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC9B;AAED,kFAAkF;AAClF,MAAM,WAAW,SAAS;IACzB,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;kFAC8E;IAC9E,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,yBAAyB;IACzB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC;oCACgC;IAChC,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,mEAAmE;IACnE,QAAQ,CAAC,aAAa,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACrD;AAID;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,SAAS,GAAG,UAAU,CAwB5D;AAED;gFACgF;AAChF,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAqC3D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,UAAU,GACd,UAAU,CAaZ;AAED,kFAAkF;AAClF,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC1B;AAED;6EAC6E;AAC7E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,qBAAqB,CAuC7E;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,4BAA4B,CAC3C,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,EACzC,uBAAuB,EAAE,MAAM,GAC7B,IAAI,CAoGN"}
@@ -1,94 +0,0 @@
1
- import { Archetype } from './archetype.cjs';
2
- import { EntityAllocator } from './entity_allocator.cjs';
3
- import { SparseComponentStore } from './sparse_store.cjs';
4
- import { RelationStore } from './relation.cjs';
5
- import { ColumnStore, InPlaceBufferAllocator } from '../store/index.cjs';
6
- import { HostState } from './resume.cjs';
7
- /** What the snapshot/resume orchestration needs from `Store` — closure-
8
- * injected (the `RelationServiceHost` style). Accessors re-read live fields
9
- * per call (the column store and the entity-index views are replaced on
10
- * restore); the three mutation members keep Store-owned state transitions on
11
- * the Store side. All cold-path. */
12
- export interface SnapshotHost {
13
- readonly sparseStores: () => readonly SparseComponentStore[];
14
- readonly relationStores: () => readonly RelationStore[];
15
- /** Live SAB generations view (replanted on restore) — for rebuilding
16
- * relation ids from entity indices. */
17
- readonly generations: () => Int32Array;
18
- readonly archetypes: () => readonly Archetype[];
19
- readonly columnStore: () => ColumnStore;
20
- readonly bufferAllocator: () => InPlaceBufferAllocator;
21
- readonly entityIndexCapacity: () => number;
22
- readonly tick: () => number;
23
- readonly setTick: (tick: number) => void;
24
- /** Stamp live row counts into the dense descriptors so a bare dense
25
- * reader of the snapshot sees self-consistent counts. */
26
- readonly publishRowCounts: () => void;
27
- /** Adopt a restored dense store: swap the live backing, refresh archetype
28
- * views, recover the allocator high-water from the restored region, and
29
- * republish (the grow tail). Owned by Store — see `_mountRestoredDense`. */
30
- readonly mountRestoredDense: (restored: ColumnStore) => void;
31
- /** Rebuild each archetype's host-side `length`/`enabledCount`/entity-id
32
- * back-references from the restored entity-index region + captured host
33
- * state. Owned by Store — see `_reconstructHostRows`. */
34
- readonly reconstructHostRows: (host: HostState) => void;
35
- /** Every archetype's membership just changed — bump the query epoch and
36
- * force the next descriptor publish. */
37
- readonly invalidateQueryCaches: () => void;
38
- }
39
- export declare class SnapshotService {
40
- private readonly host;
41
- /** The allocator IS its own snapshot seam: free-list copy on
42
- * capture; `setHighWater` + `restoreHostState` on mount. */
43
- private readonly allocator;
44
- constructor(host: SnapshotHost, allocator: EntityAllocator);
45
- /** Serialize the sparse stores **and** relation side data to a self-contained
46
- * byte buffer — the sparse half of a world snapshot (the dense half is the
47
- * SAB snapshot). Two framed sections: the sparse stores (`snapshotSparseStores`
48
- * — exclusive relation targets + multi membership ride here) followed
49
- * by the relation side data (`snapshotRelations` — multi forward target
50
- * sets, which live outside the sparse store). Both are written in canonical
51
- * entity-index order, so two worlds with identical contents inserted in
52
- * different orders snapshot byte-for-byte the same. The reverse index
53
- * is derived and never serialized — `restoreSparse` rebuilds it. */
54
- snapshotSparse(): Uint8Array;
55
- /** Repopulate the sparse stores from `snapshotSparse` bytes, replacing all
56
- * current sparse data (full-equality round-trip of membership + data), then
57
- * rebuild every relation's derived side indices: multi forward sets from the
58
- * relation section, and the reverse index for both cardinalities (exclusive
59
- * from the just-restored sparse target field, multi from the rebuilt forward
60
- * sets). The sparse components and relations must already be registered in
61
- * the same order — restore carries data, not the registration (which is
62
- * code). Throws `SparseRestoreError` if the snapshot's shape, field identity,
63
- * entity-index bounds, or frame length don't validate. */
64
- restoreSparse(bytes: Uint8Array): void;
65
- /** Rebuild every relation's derived side indices after the sparse stores have
66
- * been restored. `restoreRelations` resets all relations, rebuilds the multi
67
- * forward sets + their reverse edges from `relBytes`, and validates shape.
68
- * The exclusive reverse index can't be carried in the bytes (it's derivable),
69
- * so it's rebuilt here from the backing sparse store: every member row holds
70
- * `(source index → target EntityID)`, which is exactly one reverse edge. */
71
- private rebuildRelationIndices;
72
- /** Capture the full live world to one self-contained byte buffer that
73
- * `restoreInto` can mount back onto a live, ticking world. Three
74
- * sections (see `resume.ts`): the dense SAB column bytes, the sparse +
75
- * relation bytes, and the host-side bookkeeping the SAB omits. */
76
- snapshot(): Uint8Array;
77
- /** Gather the host-side state a snapshot carries alongside the dense + sparse
78
- * bytes — see `snapshot()`. The free-list is copied (it's a live mutable). */
79
- private collectHostState;
80
- /** Mount a `snapshot()` buffer onto the live world and leave it ready to keep
81
- * ticking. Fails closed on a malformed frame or a registration mismatch
82
- * BEFORE any live state is touched. */
83
- restoreInto(bytes: Uint8Array): void;
84
- /** Read-only validation of a `snapshotSparse` SECTION (the framed
85
- * `[sparseLen][relLen][sparse][rel]` buffer) against the live registry, used
86
- * by `restoreInto` to fail closed on a sparse-registration mismatch BEFORE the
87
- * dense mount commits. Mirrors `restoreSparse`'s frame check, then validates the
88
- * sparse-stores sub-section without mutating. A relation-registration difference
89
- * surfaces here too: every `registerRelation` adds a backing sparse store, so a
90
- * differing relation set changes the sparse store count / schema. Throws
91
- * `SparseRestoreError` on a mismatch. */
92
- private assertSparseSectionMatches;
93
- }
94
- //# sourceMappingURL=snapshot_service.d.ts.map
@@ -1,94 +0,0 @@
1
- import { Archetype } from './archetype.js';
2
- import { EntityAllocator } from './entity_allocator.js';
3
- import { SparseComponentStore } from './sparse_store.js';
4
- import { RelationStore } from './relation.js';
5
- import { ColumnStore, InPlaceBufferAllocator } from '../store/index.js';
6
- import { HostState } from './resume.js';
7
- /** What the snapshot/resume orchestration needs from `Store` — closure-
8
- * injected (the `RelationServiceHost` style). Accessors re-read live fields
9
- * per call (the column store and the entity-index views are replaced on
10
- * restore); the three mutation members keep Store-owned state transitions on
11
- * the Store side. All cold-path. */
12
- export interface SnapshotHost {
13
- readonly sparseStores: () => readonly SparseComponentStore[];
14
- readonly relationStores: () => readonly RelationStore[];
15
- /** Live SAB generations view (replanted on restore) — for rebuilding
16
- * relation ids from entity indices. */
17
- readonly generations: () => Int32Array;
18
- readonly archetypes: () => readonly Archetype[];
19
- readonly columnStore: () => ColumnStore;
20
- readonly bufferAllocator: () => InPlaceBufferAllocator;
21
- readonly entityIndexCapacity: () => number;
22
- readonly tick: () => number;
23
- readonly setTick: (tick: number) => void;
24
- /** Stamp live row counts into the dense descriptors so a bare dense
25
- * reader of the snapshot sees self-consistent counts. */
26
- readonly publishRowCounts: () => void;
27
- /** Adopt a restored dense store: swap the live backing, refresh archetype
28
- * views, recover the allocator high-water from the restored region, and
29
- * republish (the grow tail). Owned by Store — see `_mountRestoredDense`. */
30
- readonly mountRestoredDense: (restored: ColumnStore) => void;
31
- /** Rebuild each archetype's host-side `length`/`enabledCount`/entity-id
32
- * back-references from the restored entity-index region + captured host
33
- * state. Owned by Store — see `_reconstructHostRows`. */
34
- readonly reconstructHostRows: (host: HostState) => void;
35
- /** Every archetype's membership just changed — bump the query epoch and
36
- * force the next descriptor publish. */
37
- readonly invalidateQueryCaches: () => void;
38
- }
39
- export declare class SnapshotService {
40
- private readonly host;
41
- /** The allocator IS its own snapshot seam: free-list copy on
42
- * capture; `setHighWater` + `restoreHostState` on mount. */
43
- private readonly allocator;
44
- constructor(host: SnapshotHost, allocator: EntityAllocator);
45
- /** Serialize the sparse stores **and** relation side data to a self-contained
46
- * byte buffer — the sparse half of a world snapshot (the dense half is the
47
- * SAB snapshot). Two framed sections: the sparse stores (`snapshotSparseStores`
48
- * — exclusive relation targets + multi membership ride here) followed
49
- * by the relation side data (`snapshotRelations` — multi forward target
50
- * sets, which live outside the sparse store). Both are written in canonical
51
- * entity-index order, so two worlds with identical contents inserted in
52
- * different orders snapshot byte-for-byte the same. The reverse index
53
- * is derived and never serialized — `restoreSparse` rebuilds it. */
54
- snapshotSparse(): Uint8Array;
55
- /** Repopulate the sparse stores from `snapshotSparse` bytes, replacing all
56
- * current sparse data (full-equality round-trip of membership + data), then
57
- * rebuild every relation's derived side indices: multi forward sets from the
58
- * relation section, and the reverse index for both cardinalities (exclusive
59
- * from the just-restored sparse target field, multi from the rebuilt forward
60
- * sets). The sparse components and relations must already be registered in
61
- * the same order — restore carries data, not the registration (which is
62
- * code). Throws `SparseRestoreError` if the snapshot's shape, field identity,
63
- * entity-index bounds, or frame length don't validate. */
64
- restoreSparse(bytes: Uint8Array): void;
65
- /** Rebuild every relation's derived side indices after the sparse stores have
66
- * been restored. `restoreRelations` resets all relations, rebuilds the multi
67
- * forward sets + their reverse edges from `relBytes`, and validates shape.
68
- * The exclusive reverse index can't be carried in the bytes (it's derivable),
69
- * so it's rebuilt here from the backing sparse store: every member row holds
70
- * `(source index → target EntityID)`, which is exactly one reverse edge. */
71
- private rebuildRelationIndices;
72
- /** Capture the full live world to one self-contained byte buffer that
73
- * `restoreInto` can mount back onto a live, ticking world. Three
74
- * sections (see `resume.ts`): the dense SAB column bytes, the sparse +
75
- * relation bytes, and the host-side bookkeeping the SAB omits. */
76
- snapshot(): Uint8Array;
77
- /** Gather the host-side state a snapshot carries alongside the dense + sparse
78
- * bytes — see `snapshot()`. The free-list is copied (it's a live mutable). */
79
- private collectHostState;
80
- /** Mount a `snapshot()` buffer onto the live world and leave it ready to keep
81
- * ticking. Fails closed on a malformed frame or a registration mismatch
82
- * BEFORE any live state is touched. */
83
- restoreInto(bytes: Uint8Array): void;
84
- /** Read-only validation of a `snapshotSparse` SECTION (the framed
85
- * `[sparseLen][relLen][sparse][rel]` buffer) against the live registry, used
86
- * by `restoreInto` to fail closed on a sparse-registration mismatch BEFORE the
87
- * dense mount commits. Mirrors `restoreSparse`'s frame check, then validates the
88
- * sparse-stores sub-section without mutating. A relation-registration difference
89
- * surfaces here too: every `registerRelation` adds a backing sparse store, so a
90
- * differing relation set changes the sparse store count / schema. Throws
91
- * `SparseRestoreError` on a mismatch. */
92
- private assertSparseSectionMatches;
93
- }
94
- //# sourceMappingURL=snapshot_service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snapshot_service.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/snapshot_service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EACN,oBAAoB,EAKpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAuC,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,EAGN,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,MAAM,UAAU,CAAC;AAClB,OAAO,EAON,KAAK,SAAS,EACd,MAAM,UAAU,CAAC;AAElB;;;;oCAIoC;AACpC,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,SAAS,oBAAoB,EAAE,CAAC;IAC7D,QAAQ,CAAC,cAAc,EAAE,MAAM,SAAS,aAAa,EAAE,CAAC;IACxD;2CACuC;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,UAAU,CAAC;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,SAAS,SAAS,EAAE,CAAC;IAChD,QAAQ,CAAC,WAAW,EAAE,MAAM,WAAW,CAAC;IACxC,QAAQ,CAAC,eAAe,EAAE,MAAM,sBAAsB,CAAC;IACvD,QAAQ,CAAC,mBAAmB,EAAE,MAAM,MAAM,CAAC;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC;6DACyD;IACzD,QAAQ,C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AE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAkBzF,iFAAiF;IACjF,OAAO,CAAC,MAAM;IAad,wEAAwE;IACxE,OAAO,CAAC,WAAW;CAOnB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"field_handle.d.ts","sourceRoot":"","sources":["../../../src/extensions/editor/field_handle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,8EAA8E;IAC9E,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,eAAe,EACpD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC,EACpB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,EACvB,IAAI,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,GAC7B,WAAW,CAYb"}
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(r,t,e){return`${r}:${t.id}:${e}`}const a=new WeakMap;class h{constructor(t,e){this.readField=t,this.shadow=e,a.set(this,{forward:[],inverse:[]})}staged=new Map;get _txn(){return a.get(this)}spawn(t,e){const s={kind:"despawn",eid:0};return this._txn.inverse.push(s),this._txn.forward.push({kind:"spawn",components:t,onSpawned:n=>{s.eid=n,e?.(n)}}),this}despawn(t,e){const s={kind:"despawn",eid:t};return this._txn.forward.push(s),this._txn.inverse.push({kind:"spawn",components:e,onSpawned:n=>{s.eid=n}}),this}setField(t,e,s,n){const i=o(t,e,s),d=this.staged.get(i)??this.shadow.get(i)??this.readField(t,e,s)??0;return this.staged.set(i,n),this._txn.forward.push({kind:"set_field",eid:t,def:e,field:s,value:n}),this._txn.inverse.push({kind:"set_field",eid:t,def:e,field:s,value:d}),this}add(t,e,s){return this._txn.forward.push({kind:"add_component",eid:t,def:e,values:s}),this._txn.inverse.push({kind:"remove_component",eid:t,def:e}),this}remove(t,e,s){return this._txn.forward.push({kind:"remove_component",eid:t,def:e}),this._txn.inverse.push({kind:"add_component",eid:t,def:e,values:s}),this}disable(t){return this._txn.forward.push({kind:"disable",eid:t}),this._txn.inverse.push({kind:"enable",eid:t}),this}enable(t){return this._txn.forward.push({kind:"enable",eid:t}),this._txn.inverse.push({kind:"disable",eid:t}),this}}class u{constructor(t,e){this.queue=t,this.readField=e}undoStack=[];redoStack=[];listeners=[];shadow=new Map;transaction(t){const e=new h(this.readField,this.shadow);return t(e),this.commit(a.get(e))}spawn(t,e){return this.transaction(s=>s.spawn(t,e))}despawn(t,e){return this.transaction(s=>s.despawn(t,e))}setField(t,e,s,n){return this.transaction(i=>i.setField(t,e,s,n))}add(t,e,s){return this.transaction(n=>n.add(t,e,s))}remove(t,e,s){return this.transaction(n=>n.remove(t,e,s))}disable(t){return this.transaction(e=>e.disable(t))}enable(t){return this.transaction(e=>e.enable(t))}undo(){const t=this.undoStack.pop();if(t===void 0)return!1;const e=t.inverse.slice().reverse();for(const s of e)this.queue.push(s);return this.applyShadow(e),this.redoStack.push(t),this.notify(),!0}redo(){const t=this.redoStack.pop();if(t===void 0)return!1;for(const e of t.forward)this.queue.push(e);return this.applyShadow(t.forward),this.undoStack.push(t),this.notify(),!0}clear(){this.undoStack.length=0,this.redoStack.length=0,this.shadow.clear(),this.notify()}depths(){return{undo:this.undoStack.length,redo:this.redoStack.length}}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}onChange(t){return this.listeners.push(t),()=>{const e=this.listeners.indexOf(t);e!==-1&&this.listeners.splice(e,1)}}notify(){for(const t of this.listeners.slice())t()}committedField(t,e,s){return this.readField(t,e,s)}pendingField(t,e,s){const n=o(t,e,s),i=this.shadow.get(n);if(i===void 0)return;const d=this.readField(t,e,s);if(d===i||d===void 0){this.shadow.delete(n);return}return i}commit(t){if(t.forward.length===0)return t;for(const e of t.forward)this.queue.push(e);return this.applyShadow(t.forward),this.undoStack.push(t),this.redoStack.length=0,this.notify(),t}applyShadow(t){for(const e of t)e.kind==="set_field"&&this.shadow.set(o(e.eid,e.def,e.field),e.value)}}function c(r,t,e,s,n){return{get value(){return n!==void 0?n():r.committedField(t,e,s)},set(i){r.setField(t,e,s,i)},get pending(){return r.pendingField(t,e,s)}}}exports.Editor=u;exports.TransactionBuilder=h;exports.fieldHandle=c;
@@ -1,21 +0,0 @@
1
- /**
2
- * The host write seam's EDITOR layer — layer 2 of the seam.
3
- *
4
- * Reified undo/redo + the inspector field-handle, built on the shipped typed
5
- * `HostCommandQueue`. Application policy, so it lives here in
6
- * `engine-extensions`, not engine core — and it pulls NO third-party / framework
7
- * dependency (the field-handle reads through a caller-supplied thunk).
8
- *
9
- * - `Editor` — reified `EditorTransaction`s on undo/redo stacks, with
10
- * transaction grouping; `undo()`/`redo()` enqueue the inverse/forward on the
11
- * SAME bus, applied at the next schedule head (undo is just another command).
12
- * - `fieldHandle` — pairs a reactive-channel read with a `setField` command, so
13
- * an inspector field feels two-way while staying safe and undoable.
14
- *
15
- * Reachable as `@oasys/oecs/editor`. Pair it with
16
- * `@oasys/oecs/reactive-sync`'s `syncFieldsToMap` /
17
- * `syncSingletonToStruct` for the read channel the field-handle reads through.
18
- */
19
- export { Editor, TransactionBuilder, type EditorTransaction, type FieldReader } from './editor.cjs';
20
- export { fieldHandle, type FieldHandle } from './field_handle.cjs';
21
- //# sourceMappingURL=index.d.ts.map
@@ -1,21 +0,0 @@
1
- /**
2
- * The host write seam's EDITOR layer — layer 2 of the seam.
3
- *
4
- * Reified undo/redo + the inspector field-handle, built on the shipped typed
5
- * `HostCommandQueue`. Application policy, so it lives here in
6
- * `engine-extensions`, not engine core — and it pulls NO third-party / framework
7
- * dependency (the field-handle reads through a caller-supplied thunk).
8
- *
9
- * - `Editor` — reified `EditorTransaction`s on undo/redo stacks, with
10
- * transaction grouping; `undo()`/`redo()` enqueue the inverse/forward on the
11
- * SAME bus, applied at the next schedule head (undo is just another command).
12
- * - `fieldHandle` — pairs a reactive-channel read with a `setField` command, so
13
- * an inspector field feels two-way while staying safe and undoable.
14
- *
15
- * Reachable as `@oasys/oecs/editor`. Pair it with
16
- * `@oasys/oecs/reactive-sync`'s `syncFieldsToMap` /
17
- * `syncSingletonToStruct` for the read channel the field-handle reads through.
18
- */
19
- export { Editor, TransactionBuilder, type EditorTransaction, type FieldReader } from './editor.js';
20
- export { fieldHandle, type FieldHandle } from './field_handle.js';
21
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(r,t,e){return`${r}:${t.id}:${e}`}const a=new WeakMap;class h{constructor(t,e){this.readField=t,this.shadow=e,a.set(this,{forward:[],inverse:[]})}staged=new Map;get _txn(){return a.get(this)}spawn(t,e){const s={kind:"despawn",eid:0};return this._txn.inverse.push(s),this._txn.forward.push({kind:"spawn",components:t,onSpawned:n=>{s.eid=n,e?.(n)}}),this}despawn(t,e){const s={kind:"despawn",eid:t};return this._txn.forward.push(s),this._txn.inverse.push({kind:"spawn",components:e,onSpawned:n=>{s.eid=n}}),this}setField(t,e,s,n){const i=o(t,e,s),d=this.staged.get(i)??this.shadow.get(i)??this.readField(t,e,s)??0;return this.staged.set(i,n),this._txn.forward.push({kind:"set_field",eid:t,def:e,field:s,value:n}),this._txn.inverse.push({kind:"set_field",eid:t,def:e,field:s,value:d}),this}add(t,e,s){return this._txn.forward.push({kind:"add_component",eid:t,def:e,values:s}),this._txn.inverse.push({kind:"remove_component",eid:t,def:e}),this}remove(t,e,s){return this._txn.forward.push({kind:"remove_component",eid:t,def:e}),this._txn.inverse.push({kind:"add_component",eid:t,def:e,values:s}),this}disable(t){return this._txn.forward.push({kind:"disable",eid:t}),this._txn.inverse.push({kind:"enable",eid:t}),this}enable(t){return this._txn.forward.push({kind:"enable",eid:t}),this._txn.inverse.push({kind:"disable",eid:t}),this}}class u{constructor(t,e){this.queue=t,this.readField=e}undoStack=[];redoStack=[];listeners=[];shadow=new Map;transaction(t){const e=new h(this.readField,this.shadow);return t(e),this.commit(a.get(e))}spawn(t,e){return this.transaction(s=>s.spawn(t,e))}despawn(t,e){return this.transaction(s=>s.despawn(t,e))}setField(t,e,s,n){return this.transaction(i=>i.setField(t,e,s,n))}add(t,e,s){return this.transaction(n=>n.add(t,e,s))}remove(t,e,s){return this.transaction(n=>n.remove(t,e,s))}disable(t){return this.transaction(e=>e.disable(t))}enable(t){return this.transaction(e=>e.enable(t))}undo(){const t=this.undoStack.pop();if(t===void 0)return!1;const e=t.inverse.slice().reverse();for(const s of e)this.queue.push(s);return this.applyShadow(e),this.redoStack.push(t),this.notify(),!0}redo(){const t=this.redoStack.pop();if(t===void 0)return!1;for(const e of t.forward)this.queue.push(e);return this.applyShadow(t.forward),this.undoStack.push(t),this.notify(),!0}clear(){this.undoStack.length=0,this.redoStack.length=0,this.shadow.clear(),this.notify()}depths(){return{undo:this.undoStack.length,redo:this.redoStack.length}}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}onChange(t){return this.listeners.push(t),()=>{const e=this.listeners.indexOf(t);e!==-1&&this.listeners.splice(e,1)}}notify(){for(const t of this.listeners.slice())t()}committedField(t,e,s){return this.readField(t,e,s)}pendingField(t,e,s){const n=o(t,e,s),i=this.shadow.get(n);if(i===void 0)return;const d=this.readField(t,e,s);if(d===i||d===void 0){this.shadow.delete(n);return}return i}commit(t){if(t.forward.length===0)return t;for(const e of t.forward)this.queue.push(e);return this.applyShadow(t.forward),this.undoStack.push(t),this.redoStack.length=0,this.notify(),t}applyShadow(t){for(const e of t)e.kind==="set_field"&&this.shadow.set(o(e.eid,e.def,e.field),e.value)}}function c(r,t,e,s,n){return{get value(){return n!==void 0?n():r.committedField(t,e,s)},set(i){r.setField(t,e,s,i)},get pending(){return r.pendingField(t,e,s)}}}exports.Editor=u;exports.TransactionBuilder=h;exports.fieldHandle=c;