@forgeax/engine-ecs 0.0.0-dev.8d955ade1c79

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 (383) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +278 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/__fixtures__/field-shape-fixture.d.ts +16 -0
  5. package/dist/__fixtures__/field-shape-fixture.d.ts.map +1 -0
  6. package/dist/__tests__/__fixtures__/inspect-scripts.snapshot.d.ts +3 -0
  7. package/dist/__tests__/__fixtures__/inspect-scripts.snapshot.d.ts.map +1 -0
  8. package/dist/__tests__/archetype.unit.test.d.ts +2 -0
  9. package/dist/__tests__/archetype.unit.test.d.ts.map +1 -0
  10. package/dist/__tests__/array-handle-element.test-d.d.ts +2 -0
  11. package/dist/__tests__/array-handle-element.test-d.d.ts.map +1 -0
  12. package/dist/__tests__/buffer-array-vocab.test-d.d.ts +2 -0
  13. package/dist/__tests__/buffer-array-vocab.test-d.d.ts.map +1 -0
  14. package/dist/__tests__/buffer-field-input-widen.unit.test.d.ts +2 -0
  15. package/dist/__tests__/buffer-field-input-widen.unit.test.d.ts.map +1 -0
  16. package/dist/__tests__/buffer-pool.test-d.d.ts +2 -0
  17. package/dist/__tests__/buffer-pool.test-d.d.ts.map +1 -0
  18. package/dist/__tests__/change-detection.unit.test.d.ts +2 -0
  19. package/dist/__tests__/change-detection.unit.test.d.ts.map +1 -0
  20. package/dist/__tests__/command-buffer.test.d.ts +2 -0
  21. package/dist/__tests__/command-buffer.test.d.ts.map +1 -0
  22. package/dist/__tests__/commands-deferred.unit.test.d.ts +2 -0
  23. package/dist/__tests__/commands-deferred.unit.test.d.ts.map +1 -0
  24. package/dist/__tests__/component-catalog.test.d.ts +2 -0
  25. package/dist/__tests__/component-catalog.test.d.ts.map +1 -0
  26. package/dist/__tests__/component-definition-identity.unit.test.d.ts +2 -0
  27. package/dist/__tests__/component-definition-identity.unit.test.d.ts.map +1 -0
  28. package/dist/__tests__/component-nan-preflight.unit.test.d.ts +2 -0
  29. package/dist/__tests__/component-nan-preflight.unit.test.d.ts.map +1 -0
  30. package/dist/__tests__/component-schema.test-d.d.ts +2 -0
  31. package/dist/__tests__/component-schema.test-d.d.ts.map +1 -0
  32. package/dist/__tests__/component-schema.test.d.ts +2 -0
  33. package/dist/__tests__/component-schema.test.d.ts.map +1 -0
  34. package/dist/__tests__/define-component-options.test-d.d.ts +2 -0
  35. package/dist/__tests__/define-component-options.test-d.d.ts.map +1 -0
  36. package/dist/__tests__/deprecated-vocab-rejection.unit.test.d.ts +2 -0
  37. package/dist/__tests__/deprecated-vocab-rejection.unit.test.d.ts.map +1 -0
  38. package/dist/__tests__/despawn-all.unit.test.d.ts +2 -0
  39. package/dist/__tests__/despawn-all.unit.test.d.ts.map +1 -0
  40. package/dist/__tests__/ecs-core-reduction.characterization.test.d.ts +2 -0
  41. package/dist/__tests__/ecs-core-reduction.characterization.test.d.ts.map +1 -0
  42. package/dist/__tests__/ecs-core-reduction.perf.test.d.ts +2 -0
  43. package/dist/__tests__/ecs-core-reduction.perf.test.d.ts.map +1 -0
  44. package/dist/__tests__/ecs-error-code-31.test-d.d.ts +2 -0
  45. package/dist/__tests__/ecs-error-code-31.test-d.d.ts.map +1 -0
  46. package/dist/__tests__/entity-disabling.unit.test.d.ts +2 -0
  47. package/dist/__tests__/entity-disabling.unit.test.d.ts.map +1 -0
  48. package/dist/__tests__/entity-handle-codec-parity.unit.test.d.ts +2 -0
  49. package/dist/__tests__/entity-handle-codec-parity.unit.test.d.ts.map +1 -0
  50. package/dist/__tests__/errors.unit.test.d.ts +2 -0
  51. package/dist/__tests__/errors.unit.test.d.ts.map +1 -0
  52. package/dist/__tests__/execution-conflict-boundary.unit.test.d.ts +2 -0
  53. package/dist/__tests__/execution-conflict-boundary.unit.test.d.ts.map +1 -0
  54. package/dist/__tests__/execution-shared-storage.unit.test.d.ts +2 -0
  55. package/dist/__tests__/execution-shared-storage.unit.test.d.ts.map +1 -0
  56. package/dist/__tests__/externalization-portable-value.unit.test.d.ts +2 -0
  57. package/dist/__tests__/externalization-portable-value.unit.test.d.ts.map +1 -0
  58. package/dist/__tests__/externalization-projection.unit.test.d.ts +2 -0
  59. package/dist/__tests__/externalization-projection.unit.test.d.ts.map +1 -0
  60. package/dist/__tests__/externalization-render-read-lease.test-d.d.ts +2 -0
  61. package/dist/__tests__/externalization-render-read-lease.test-d.d.ts.map +1 -0
  62. package/dist/__tests__/externalization-render-read-lease.unit.test.d.ts +2 -0
  63. package/dist/__tests__/externalization-render-read-lease.unit.test.d.ts.map +1 -0
  64. package/dist/__tests__/externalization-root-surface.unit.test.d.ts +2 -0
  65. package/dist/__tests__/externalization-root-surface.unit.test.d.ts.map +1 -0
  66. package/dist/__tests__/field-enum-labels-reflection.test.d.ts +2 -0
  67. package/dist/__tests__/field-enum-labels-reflection.test.d.ts.map +1 -0
  68. package/dist/__tests__/field-shape-fixture.test.d.ts +2 -0
  69. package/dist/__tests__/field-shape-fixture.test.d.ts.map +1 -0
  70. package/dist/__tests__/field-transient-reflection.test.d.ts +2 -0
  71. package/dist/__tests__/field-transient-reflection.test.d.ts.map +1 -0
  72. package/dist/__tests__/field-value-type.test-d.d.ts +2 -0
  73. package/dist/__tests__/field-value-type.test-d.d.ts.map +1 -0
  74. package/dist/__tests__/fixed-update.unit.test.d.ts +2 -0
  75. package/dist/__tests__/fixed-update.unit.test.d.ts.map +1 -0
  76. package/dist/__tests__/handle.test-d.d.ts +2 -0
  77. package/dist/__tests__/handle.test-d.d.ts.map +1 -0
  78. package/dist/__tests__/hierarchy.unit.test.d.ts +2 -0
  79. package/dist/__tests__/hierarchy.unit.test.d.ts.map +1 -0
  80. package/dist/__tests__/managed-array-vocab.test-d.d.ts +2 -0
  81. package/dist/__tests__/managed-array-vocab.test-d.d.ts.map +1 -0
  82. package/dist/__tests__/minimal-example.test-d.d.ts +2 -0
  83. package/dist/__tests__/minimal-example.test-d.d.ts.map +1 -0
  84. package/dist/__tests__/name-read-types.test-d.d.ts +2 -0
  85. package/dist/__tests__/name-read-types.test-d.d.ts.map +1 -0
  86. package/dist/__tests__/plugin-service.test.d.ts +2 -0
  87. package/dist/__tests__/plugin-service.test.d.ts.map +1 -0
  88. package/dist/__tests__/query-combinations.unit.test.d.ts +2 -0
  89. package/dist/__tests__/query-combinations.unit.test.d.ts.map +1 -0
  90. package/dist/__tests__/query-light-extract-flat-column-ratio.perf.test.d.ts +2 -0
  91. package/dist/__tests__/query-light-extract-flat-column-ratio.perf.test.d.ts.map +1 -0
  92. package/dist/__tests__/query-storage-trends.perf.test.d.ts +2 -0
  93. package/dist/__tests__/query-storage-trends.perf.test.d.ts.map +1 -0
  94. package/dist/__tests__/query-trs-flat-column-ratio.perf.test.d.ts +2 -0
  95. package/dist/__tests__/query-trs-flat-column-ratio.perf.test.d.ts.map +1 -0
  96. package/dist/__tests__/query.unit.test.d.ts +2 -0
  97. package/dist/__tests__/query.unit.test.d.ts.map +1 -0
  98. package/dist/__tests__/relationship-index.perf.test.d.ts +2 -0
  99. package/dist/__tests__/relationship-index.perf.test.d.ts.map +1 -0
  100. package/dist/__tests__/relationship-index.test.d.ts +2 -0
  101. package/dist/__tests__/relationship-index.test.d.ts.map +1 -0
  102. package/dist/__tests__/scalar-field-type-owner.test-d.d.ts +2 -0
  103. package/dist/__tests__/scalar-field-type-owner.test-d.d.ts.map +1 -0
  104. package/dist/__tests__/schedule-determinism.unit.test.d.ts +2 -0
  105. package/dist/__tests__/schedule-determinism.unit.test.d.ts.map +1 -0
  106. package/dist/__tests__/schedule-inspection.unit.test.d.ts +2 -0
  107. package/dist/__tests__/schedule-inspection.unit.test.d.ts.map +1 -0
  108. package/dist/__tests__/schedule-scope-error.unit.test.d.ts +2 -0
  109. package/dist/__tests__/schedule-scope-error.unit.test.d.ts.map +1 -0
  110. package/dist/__tests__/schedule-token.unit.test.d.ts +2 -0
  111. package/dist/__tests__/schedule-token.unit.test.d.ts.map +1 -0
  112. package/dist/__tests__/schema-vocab.test-d.d.ts +2 -0
  113. package/dist/__tests__/schema-vocab.test-d.d.ts.map +1 -0
  114. package/dist/__tests__/serialization.unit.test.d.ts +2 -0
  115. package/dist/__tests__/serialization.unit.test.d.ts.map +1 -0
  116. package/dist/__tests__/shared-kernel-eligibility.test-d.d.ts +2 -0
  117. package/dist/__tests__/shared-kernel-eligibility.test-d.d.ts.map +1 -0
  118. package/dist/__tests__/shared-kernel-eligibility.unit.test.d.ts +2 -0
  119. package/dist/__tests__/shared-kernel-eligibility.unit.test.d.ts.map +1 -0
  120. package/dist/__tests__/shared-ref-store.unit.test.d.ts +2 -0
  121. package/dist/__tests__/shared-ref-store.unit.test.d.ts.map +1 -0
  122. package/dist/__tests__/sparse-tag.unit.test.d.ts +2 -0
  123. package/dist/__tests__/sparse-tag.unit.test.d.ts.map +1 -0
  124. package/dist/__tests__/spawn-field-error.test-d.d.ts +2 -0
  125. package/dist/__tests__/spawn-field-error.test-d.d.ts.map +1 -0
  126. package/dist/__tests__/stale-error.test-d.d.ts +2 -0
  127. package/dist/__tests__/stale-error.test-d.d.ts.map +1 -0
  128. package/dist/__tests__/string-view-symmetry.test-d.d.ts +2 -0
  129. package/dist/__tests__/string-view-symmetry.test-d.d.ts.map +1 -0
  130. package/dist/__tests__/string-vocab.test-d.d.ts +2 -0
  131. package/dist/__tests__/string-vocab.test-d.d.ts.map +1 -0
  132. package/dist/__tests__/structure-epoch-boundaries.unit.test.d.ts +2 -0
  133. package/dist/__tests__/structure-epoch-boundaries.unit.test.d.ts.map +1 -0
  134. package/dist/__tests__/structure-epoch.unit.test.d.ts +2 -0
  135. package/dist/__tests__/structure-epoch.unit.test.d.ts.map +1 -0
  136. package/dist/__tests__/table-archetype-mapping.unit.test.d.ts +2 -0
  137. package/dist/__tests__/table-archetype-mapping.unit.test.d.ts.map +1 -0
  138. package/dist/__tests__/time.unit.test.d.ts +2 -0
  139. package/dist/__tests__/time.unit.test.d.ts.map +1 -0
  140. package/dist/__tests__/types.test-d.d.ts +2 -0
  141. package/dist/__tests__/types.test-d.d.ts.map +1 -0
  142. package/dist/__tests__/unique-ref-store.unit.test.d.ts +2 -0
  143. package/dist/__tests__/unique-ref-store.unit.test.d.ts.map +1 -0
  144. package/dist/__tests__/utils/handle-numeric.d.ts +14 -0
  145. package/dist/__tests__/utils/handle-numeric.d.ts.map +1 -0
  146. package/dist/__tests__/validation-root-surface.unit.test.d.ts +2 -0
  147. package/dist/__tests__/validation-root-surface.unit.test.d.ts.map +1 -0
  148. package/dist/__tests__/visibility-atomic-write.unit.test.d.ts +2 -0
  149. package/dist/__tests__/visibility-atomic-write.unit.test.d.ts.map +1 -0
  150. package/dist/__tests__/world-change-journal.unit.test.d.ts +2 -0
  151. package/dist/__tests__/world-change-journal.unit.test.d.ts.map +1 -0
  152. package/dist/__tests__/world-characterization.unit.test.d.ts +2 -0
  153. package/dist/__tests__/world-characterization.unit.test.d.ts.map +1 -0
  154. package/dist/__tests__/world-consumer-inference.test-d.d.ts +2 -0
  155. package/dist/__tests__/world-consumer-inference.test-d.d.ts.map +1 -0
  156. package/dist/__tests__/world-health.contract.test.d.ts +2 -0
  157. package/dist/__tests__/world-health.contract.test.d.ts.map +1 -0
  158. package/dist/__tests__/world-inspection.test.d.ts +2 -0
  159. package/dist/__tests__/world-inspection.test.d.ts.map +1 -0
  160. package/dist/__tests__/world-internal-identity.unit.test.d.ts +2 -0
  161. package/dist/__tests__/world-internal-identity.unit.test.d.ts.map +1 -0
  162. package/dist/__tests__/world-managed-roundtrip.unit.test.d.ts +2 -0
  163. package/dist/__tests__/world-managed-roundtrip.unit.test.d.ts.map +1 -0
  164. package/dist/__tests__/world-scheduling.m4.test.d.ts +2 -0
  165. package/dist/__tests__/world-scheduling.m4.test.d.ts.map +1 -0
  166. package/dist/__tests__/world-unique-roundtrip.unit.test.d.ts +2 -0
  167. package/dist/__tests__/world-unique-roundtrip.unit.test.d.ts.map +1 -0
  168. package/dist/__tests__/world.test-d.d.ts +2 -0
  169. package/dist/__tests__/world.test-d.d.ts.map +1 -0
  170. package/dist/buffer-pool.d.ts +109 -0
  171. package/dist/buffer-pool.d.ts.map +1 -0
  172. package/dist/commands.d.ts +93 -0
  173. package/dist/commands.d.ts.map +1 -0
  174. package/dist/component-default-fallback.d.ts +88 -0
  175. package/dist/component-default-fallback.d.ts.map +1 -0
  176. package/dist/component-schema.d.ts +34 -0
  177. package/dist/component-schema.d.ts.map +1 -0
  178. package/dist/component-value-validate.d.ts +29 -0
  179. package/dist/component-value-validate.d.ts.map +1 -0
  180. package/dist/component.d.ts +581 -0
  181. package/dist/component.d.ts.map +1 -0
  182. package/dist/entity-handle.d.ts +68 -0
  183. package/dist/entity-handle.d.ts.map +1 -0
  184. package/dist/entity.d.ts +86 -0
  185. package/dist/entity.d.ts.map +1 -0
  186. package/dist/errors/query-and-component-errors.d.ts +132 -0
  187. package/dist/errors/query-and-component-errors.d.ts.map +1 -0
  188. package/dist/errors/relationship-errors.d.ts +112 -0
  189. package/dist/errors/relationship-errors.d.ts.map +1 -0
  190. package/dist/errors/sprite-and-shared-errors.d.ts +107 -0
  191. package/dist/errors/sprite-and-shared-errors.d.ts.map +1 -0
  192. package/dist/errors/validation-errors.d.ts +229 -0
  193. package/dist/errors/validation-errors.d.ts.map +1 -0
  194. package/dist/errors.d.ts +763 -0
  195. package/dist/errors.d.ts.map +1 -0
  196. package/dist/execution/shared-kernel.d.ts +106 -0
  197. package/dist/execution/shared-kernel.d.ts.map +1 -0
  198. package/dist/externalization/index.d.ts +31 -0
  199. package/dist/externalization/index.d.ts.map +1 -0
  200. package/dist/externalization/index.mjs +298 -0
  201. package/dist/externalization/index.mjs.map +1 -0
  202. package/dist/index.d.ts +261 -0
  203. package/dist/index.d.ts.map +1 -0
  204. package/dist/index.mjs +7422 -0
  205. package/dist/index.mjs.map +1 -0
  206. package/dist/internal.mjs +479 -0
  207. package/dist/internal.mjs.map +1 -0
  208. package/dist/plugin-service.d.ts +11 -0
  209. package/dist/plugin-service.d.ts.map +1 -0
  210. package/dist/projection/index.d.ts +103 -0
  211. package/dist/projection/index.d.ts.map +1 -0
  212. package/dist/projection/index.mjs +615 -0
  213. package/dist/projection/index.mjs.map +1 -0
  214. package/dist/query/query.d.ts +58 -0
  215. package/dist/query/query.d.ts.map +1 -0
  216. package/dist/relationship-index.d.ts +81 -0
  217. package/dist/relationship-index.d.ts.map +1 -0
  218. package/dist/resource.d.ts +70 -0
  219. package/dist/resource.d.ts.map +1 -0
  220. package/dist/schedule-token.d.ts +16 -0
  221. package/dist/schedule-token.d.ts.map +1 -0
  222. package/dist/schedule.d.ts +271 -0
  223. package/dist/schedule.d.ts.map +1 -0
  224. package/dist/shared-ref-store.d.ts +144 -0
  225. package/dist/shared-ref-store.d.ts.map +1 -0
  226. package/dist/shared.d.ts +3 -0
  227. package/dist/shared.d.ts.map +1 -0
  228. package/dist/shared.mjs +364 -0
  229. package/dist/shared.mjs.map +1 -0
  230. package/dist/storage/archetype-graph.d.ts +54 -0
  231. package/dist/storage/archetype-graph.d.ts.map +1 -0
  232. package/dist/storage/archetype.d.ts +23 -0
  233. package/dist/storage/archetype.d.ts.map +1 -0
  234. package/dist/storage/change-detection.d.ts +40 -0
  235. package/dist/storage/change-detection.d.ts.map +1 -0
  236. package/dist/storage/column.d.ts +111 -0
  237. package/dist/storage/column.d.ts.map +1 -0
  238. package/dist/storage/table.d.ts +29 -0
  239. package/dist/storage/table.d.ts.map +1 -0
  240. package/dist/time.d.ts +57 -0
  241. package/dist/time.d.ts.map +1 -0
  242. package/dist/unique-ref-store.d.ts +105 -0
  243. package/dist/unique-ref-store.d.ts.map +1 -0
  244. package/dist/world-change-journal.d.ts +34 -0
  245. package/dist/world-change-journal.d.ts.map +1 -0
  246. package/dist/world-component-access.d.ts +265 -0
  247. package/dist/world-component-access.d.ts.map +1 -0
  248. package/dist/world-component-storage.d.ts +282 -0
  249. package/dist/world-component-storage.d.ts.map +1 -0
  250. package/dist/world-core.d.ts +39 -0
  251. package/dist/world-core.d.ts.map +1 -0
  252. package/dist/world-entity-lifecycle.d.ts +30 -0
  253. package/dist/world-entity-lifecycle.d.ts.map +1 -0
  254. package/dist/world-internal.d.ts +14 -0
  255. package/dist/world-internal.d.ts.map +1 -0
  256. package/dist/world-scheduling.d.ts +30 -0
  257. package/dist/world-scheduling.d.ts.map +1 -0
  258. package/dist/world.d.ts +620 -0
  259. package/dist/world.d.ts.map +1 -0
  260. package/package.json +77 -0
  261. package/src/__fixtures__/field-shape-fixture.ts +30 -0
  262. package/src/__tests__/__fixtures__/inspect-scripts.snapshot.ts +2 -0
  263. package/src/__tests__/archetype.unit.test.ts +1837 -0
  264. package/src/__tests__/array-handle-element.test-d.ts +34 -0
  265. package/src/__tests__/buffer-array-vocab.test-d.ts +53 -0
  266. package/src/__tests__/buffer-field-input-widen.unit.test.ts +99 -0
  267. package/src/__tests__/buffer-pool.test-d.ts +32 -0
  268. package/src/__tests__/change-detection.unit.test.ts +86 -0
  269. package/src/__tests__/command-buffer.test.ts +179 -0
  270. package/src/__tests__/commands-deferred.unit.test.ts +68 -0
  271. package/src/__tests__/component-catalog.test.ts +59 -0
  272. package/src/__tests__/component-definition-identity.unit.test.ts +24 -0
  273. package/src/__tests__/component-nan-preflight.unit.test.ts +186 -0
  274. package/src/__tests__/component-schema.test-d.ts +119 -0
  275. package/src/__tests__/component-schema.test.ts +55 -0
  276. package/src/__tests__/define-component-options.test-d.ts +35 -0
  277. package/src/__tests__/deprecated-vocab-rejection.unit.test.ts +59 -0
  278. package/src/__tests__/despawn-all.unit.test.ts +17 -0
  279. package/src/__tests__/ecs-core-reduction.characterization.test.ts +130 -0
  280. package/src/__tests__/ecs-core-reduction.perf.test.ts +260 -0
  281. package/src/__tests__/ecs-error-code-31.test-d.ts +42 -0
  282. package/src/__tests__/entity-disabling.unit.test.ts +37 -0
  283. package/src/__tests__/entity-handle-codec-parity.unit.test.ts +126 -0
  284. package/src/__tests__/errors.unit.test.ts +1456 -0
  285. package/src/__tests__/execution-conflict-boundary.unit.test.ts +123 -0
  286. package/src/__tests__/execution-shared-storage.unit.test.ts +40 -0
  287. package/src/__tests__/externalization-portable-value.unit.test.ts +275 -0
  288. package/src/__tests__/externalization-projection.unit.test.ts +325 -0
  289. package/src/__tests__/externalization-render-read-lease.test-d.ts +30 -0
  290. package/src/__tests__/externalization-render-read-lease.unit.test.ts +79 -0
  291. package/src/__tests__/externalization-root-surface.unit.test.ts +33 -0
  292. package/src/__tests__/field-enum-labels-reflection.test.ts +66 -0
  293. package/src/__tests__/field-shape-fixture.test.ts +61 -0
  294. package/src/__tests__/field-transient-reflection.test.ts +59 -0
  295. package/src/__tests__/field-value-type.test-d.ts +57 -0
  296. package/src/__tests__/fixed-update.unit.test.ts +78 -0
  297. package/src/__tests__/handle.test-d.ts +86 -0
  298. package/src/__tests__/hierarchy.unit.test.ts +2534 -0
  299. package/src/__tests__/managed-array-vocab.test-d.ts +137 -0
  300. package/src/__tests__/minimal-example.test-d.ts +42 -0
  301. package/src/__tests__/name-read-types.test-d.ts +72 -0
  302. package/src/__tests__/plugin-service.test.ts +13 -0
  303. package/src/__tests__/query-combinations.unit.test.ts +42 -0
  304. package/src/__tests__/query-light-extract-flat-column-ratio.perf.test.ts +252 -0
  305. package/src/__tests__/query-storage-trends.perf.test.ts +104 -0
  306. package/src/__tests__/query-trs-flat-column-ratio.perf.test.ts +194 -0
  307. package/src/__tests__/query.unit.test.ts +196 -0
  308. package/src/__tests__/relationship-index.perf.test.ts +126 -0
  309. package/src/__tests__/relationship-index.test.ts +70 -0
  310. package/src/__tests__/scalar-field-type-owner.test-d.ts +71 -0
  311. package/src/__tests__/schedule-determinism.unit.test.ts +36 -0
  312. package/src/__tests__/schedule-inspection.unit.test.ts +81 -0
  313. package/src/__tests__/schedule-scope-error.unit.test.ts +63 -0
  314. package/src/__tests__/schedule-token.unit.test.ts +54 -0
  315. package/src/__tests__/schema-vocab.test-d.ts +103 -0
  316. package/src/__tests__/serialization.unit.test.ts +2740 -0
  317. package/src/__tests__/shared-kernel-eligibility.test-d.ts +18 -0
  318. package/src/__tests__/shared-kernel-eligibility.unit.test.ts +78 -0
  319. package/src/__tests__/shared-ref-store.unit.test.ts +646 -0
  320. package/src/__tests__/sparse-tag.unit.test.ts +201 -0
  321. package/src/__tests__/spawn-field-error.test-d.ts +41 -0
  322. package/src/__tests__/stale-error.test-d.ts +208 -0
  323. package/src/__tests__/string-view-symmetry.test-d.ts +26 -0
  324. package/src/__tests__/string-vocab.test-d.ts +49 -0
  325. package/src/__tests__/structure-epoch-boundaries.unit.test.ts +39 -0
  326. package/src/__tests__/structure-epoch.unit.test.ts +48 -0
  327. package/src/__tests__/table-archetype-mapping.unit.test.ts +78 -0
  328. package/src/__tests__/time.unit.test.ts +79 -0
  329. package/src/__tests__/types.test-d.ts +38 -0
  330. package/src/__tests__/unique-ref-store.unit.test.ts +348 -0
  331. package/src/__tests__/utils/handle-numeric.ts +30 -0
  332. package/src/__tests__/validation-root-surface.unit.test.ts +15 -0
  333. package/src/__tests__/visibility-atomic-write.unit.test.ts +82 -0
  334. package/src/__tests__/world-change-journal.unit.test.ts +97 -0
  335. package/src/__tests__/world-characterization.unit.test.ts +408 -0
  336. package/src/__tests__/world-consumer-inference.test-d.ts +16 -0
  337. package/src/__tests__/world-health.contract.test.ts +87 -0
  338. package/src/__tests__/world-inspection.test.ts +37 -0
  339. package/src/__tests__/world-internal-identity.unit.test.ts +17 -0
  340. package/src/__tests__/world-managed-roundtrip.unit.test.ts +98 -0
  341. package/src/__tests__/world-scheduling.m4.test.ts +52 -0
  342. package/src/__tests__/world-unique-roundtrip.unit.test.ts +357 -0
  343. package/src/__tests__/world.test-d.ts +156 -0
  344. package/src/buffer-pool.ts +357 -0
  345. package/src/commands.ts +644 -0
  346. package/src/component-default-fallback.ts +236 -0
  347. package/src/component-schema.ts +92 -0
  348. package/src/component-value-validate.ts +135 -0
  349. package/src/component.ts +1268 -0
  350. package/src/entity-handle.ts +104 -0
  351. package/src/entity.ts +140 -0
  352. package/src/errors/query-and-component-errors.ts +200 -0
  353. package/src/errors/relationship-errors.ts +198 -0
  354. package/src/errors/sprite-and-shared-errors.ts +231 -0
  355. package/src/errors/validation-errors.ts +506 -0
  356. package/src/errors.ts +1464 -0
  357. package/src/execution/shared-kernel.ts +392 -0
  358. package/src/externalization/index.ts +170 -0
  359. package/src/index.ts +414 -0
  360. package/src/plugin-service.ts +35 -0
  361. package/src/projection/index.ts +318 -0
  362. package/src/query/query.ts +606 -0
  363. package/src/relationship-index.ts +175 -0
  364. package/src/resource.ts +106 -0
  365. package/src/schedule-token.ts +40 -0
  366. package/src/schedule.ts +846 -0
  367. package/src/shared-ref-store.ts +418 -0
  368. package/src/shared.ts +23 -0
  369. package/src/storage/archetype-graph.ts +166 -0
  370. package/src/storage/archetype.ts +78 -0
  371. package/src/storage/change-detection.ts +231 -0
  372. package/src/storage/column.ts +247 -0
  373. package/src/storage/table.ts +153 -0
  374. package/src/time.ts +122 -0
  375. package/src/unique-ref-store.ts +278 -0
  376. package/src/world-change-journal.ts +84 -0
  377. package/src/world-component-access.ts +1421 -0
  378. package/src/world-component-storage.ts +1178 -0
  379. package/src/world-core.ts +74 -0
  380. package/src/world-entity-lifecycle.ts +539 -0
  381. package/src/world-internal.ts +75 -0
  382. package/src/world-scheduling.ts +499 -0
  383. package/src/world.ts +1399 -0
@@ -0,0 +1,58 @@
1
+ import { type Result } from '@forgeax/engine-types';
2
+ import { type Component, type ComponentSchema, type ShapeOf, type TypedArrayFor } from '../component';
3
+ import type { EntityHandle } from '../entity-handle';
4
+ import { QueryDataRequiresFieldsError, QueryDescriptorConflictError, QuerySpanUnavailableError } from '../errors';
5
+ import { type WorldInternal, worldInternal } from '../world-internal';
6
+ export interface QueryDescriptor<R extends readonly Component[] = readonly Component[], W extends readonly Component[] = readonly Component[], O extends readonly Component[] = readonly Component[]> {
7
+ readonly read?: R;
8
+ readonly write?: W;
9
+ readonly optional?: O;
10
+ readonly with?: readonly Component[];
11
+ readonly without?: readonly Component[];
12
+ readonly changed?: readonly Component[];
13
+ readonly added?: readonly Component[];
14
+ }
15
+ export type ReadonlyRowShape<C> = C extends Component<string, infer S> ? Readonly<ShapeOf<S>> : never;
16
+ export type MutableRowShape<C> = C extends Component<string, infer S> ? {
17
+ -readonly [K in keyof ShapeOf<S>]: ShapeOf<S>[K];
18
+ } : never;
19
+ type ColumnShapeForSchema<S extends ComponentSchema> = {
20
+ [K in keyof S]: TypedArrayFor<S[K]>;
21
+ };
22
+ export type ReadonlyColumnShape<C> = C extends Component<string, infer S> ? Readonly<ColumnShapeForSchema<S>> : never;
23
+ export type MutableColumnShape<C> = C extends Component<string, infer S> ? {
24
+ -readonly [K in keyof ColumnShapeForSchema<S>]: ColumnShapeForSchema<S>[K];
25
+ } : never;
26
+ export interface QueryRow<R extends readonly Component[] = readonly Component[], W extends readonly Component[] = readonly Component[], O extends readonly Component[] = readonly Component[]> {
27
+ readonly entity: EntityHandle;
28
+ /** Test component presence without materialising its row object. */
29
+ has(component: R[number] | W[number] | O[number]): boolean;
30
+ get<C extends R[number]>(component: C): ReadonlyRowShape<C>;
31
+ get<C extends O[number]>(component: C): ReadonlyRowShape<C> | undefined;
32
+ mut<C extends W[number]>(component: C): MutableRowShape<C>;
33
+ }
34
+ export interface QuerySpan<R extends readonly Component[] = readonly Component[], W extends readonly Component[] = readonly Component[]> {
35
+ /** Packed entity identities for this contiguous table range. */
36
+ readonly entities: Readonly<Uint32Array>;
37
+ readonly length: number;
38
+ get<C extends R[number]>(component: C): ReadonlyColumnShape<C>;
39
+ mut<C extends W[number]>(component: C): MutableColumnShape<C>;
40
+ }
41
+ export interface Query<R extends readonly Component[] = readonly Component[], W extends readonly Component[] = readonly Component[], O extends readonly Component[] = readonly Component[]> extends Iterable<QueryRow<R, W, O>> {
42
+ /**
43
+ * Read one known entity without iterating the query's matching tables.
44
+ * Structural descriptor constraints are applied; temporal `changed` and
45
+ * `added` filters are intentionally not evaluated because this is an
46
+ * identity-addressed read, not a journal drain.
47
+ */
48
+ at(entity: EntityHandle): QueryRow<R, W, O> | undefined;
49
+ spans(): Result<Iterable<QuerySpan<R, W>>, QuerySpanUnavailableError>;
50
+ combinations(k?: number): Iterable<readonly QueryRow<R, W, O>[]>;
51
+ }
52
+ export type QueryCreationError = QueryDescriptorConflictError | QueryDataRequiresFieldsError;
53
+ interface WorldQueryAccess {
54
+ readonly [worldInternal]: WorldInternal;
55
+ }
56
+ export declare function createQuery<const R extends readonly Component[] = readonly [], const W extends readonly Component[] = readonly [], const O extends readonly Component[] = readonly []>(world: WorldQueryAccess, descriptor: QueryDescriptor<R, W, O>): Result<Query<R, W, O>, QueryCreationError>;
57
+ export {};
58
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/query/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,eAAe,EAIpB,KAAK,OAAO,EACZ,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAG5B,yBAAyB,EAE1B,MAAM,WAAW,CAAC;AAMnB,OAAO,EAAE,KAAK,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEtE,MAAM,WAAW,eAAe,CAC9B,CAAC,SAAS,SAAS,SAAS,EAAE,GAAG,SAAS,SAAS,EAAE,EACrD,CAAC,SAAS,SAAS,SAAS,EAAE,GAAG,SAAS,SAAS,EAAE,EACrD,CAAC,SAAS,SAAS,SAAS,EAAE,GAAG,SAAS,SAAS,EAAE;IAErD,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACnB,QAAQ,CAAC,QAAQ,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E,kBAAkB,CAAC,CAI5C"}
@@ -0,0 +1,81 @@
1
+ import { type Component, type ComponentSchema } from './component';
2
+ import type { EntityHandle } from './entity-handle';
3
+ declare const relationshipTargetBrand: unique symbol;
4
+ /** A relationship target is a read projection, never a structural-write token. */
5
+ export type RelationshipTargetComponent<C extends Component = Component> = C & {
6
+ readonly [relationshipTargetBrand]: true;
7
+ };
8
+ /** The two immutable roles produced by one relationship declaration. */
9
+ export interface RelationshipDefinition {
10
+ readonly source: Component<string, ComponentSchema>;
11
+ readonly target: RelationshipTargetComponent<Component<string, ComponentSchema>>;
12
+ }
13
+ export interface RelationshipOptions {
14
+ readonly sourceName: string;
15
+ readonly sourceField: string;
16
+ readonly targetName: string;
17
+ readonly targetField: string;
18
+ readonly exclusive?: boolean;
19
+ readonly linkedSpawn?: boolean;
20
+ /** Allow a source to point at its own holder (e.g. self-animated entities). */
21
+ readonly allowSelf?: boolean;
22
+ }
23
+ export type RelationshipRole = {
24
+ readonly kind: 'source';
25
+ readonly target: Component<string, ComponentSchema>;
26
+ readonly sourceField: string;
27
+ readonly targetField: string;
28
+ readonly exclusive: boolean;
29
+ readonly linkedSpawn: boolean;
30
+ readonly allowSelf: boolean;
31
+ } | {
32
+ readonly kind: 'target';
33
+ readonly source: Component<string, ComponentSchema>;
34
+ readonly sourceField: string;
35
+ readonly targetField: string;
36
+ };
37
+ /**
38
+ * Declare both sides of a relationship in one closed operation. The source is
39
+ * the only writable relationship component; its target is a materialized,
40
+ * engine-maintained reverse list.
41
+ */
42
+ export declare function defineRelationship<const S extends string, const SF extends string, const T extends string, const TF extends string>(options: RelationshipOptions & {
43
+ readonly sourceName: S;
44
+ readonly sourceField: SF;
45
+ readonly targetName: T;
46
+ readonly targetField: TF;
47
+ }): {
48
+ readonly source: Component<S, {
49
+ [K in SF]: 'entity';
50
+ }>;
51
+ readonly target: RelationshipTargetComponent<Component<T, {
52
+ [K in TF]: 'array<entity>';
53
+ }>>;
54
+ };
55
+ export declare function relationshipRole(component: Component): RelationshipRole | undefined;
56
+ /** Return the materialized target token owned by a source relationship. */
57
+ export declare function relationshipMirror(component: Component): Component | undefined;
58
+ /** Return the source token owned by a materialized relationship target. */
59
+ export declare function relationshipSource(component: Component): Component | undefined;
60
+ export declare function isRelationshipTarget(component: Component): boolean;
61
+ /**
62
+ * Backpointer index for the materialized reverse lists stored by World.
63
+ * The target component array is the one authoritative read list; this index
64
+ * stores only source-to-target locations for O(1) swap-remove bookkeeping.
65
+ */
66
+ export declare class RelationshipIndex {
67
+ private readonly slots;
68
+ private epochValue;
69
+ get epoch(): number;
70
+ attach(source: EntityHandle, target: EntityHandle, slot: number): number;
71
+ detach(source: EntityHandle): boolean;
72
+ reparent(source: EntityHandle, target: EntityHandle, slot: number): number;
73
+ slotOf(source: EntityHandle): number | undefined;
74
+ targetOf(source: EntityHandle): EntityHandle | undefined;
75
+ /** Bind the source that swap-remove moved into `slot`. */
76
+ updateSlot(source: EntityHandle, target: EntityHandle, slot: number): void;
77
+ /** Cold recovery path only: rebuild from R source records. */
78
+ recover(records: Iterable<readonly [EntityHandle, EntityHandle]>): void;
79
+ }
80
+ export {};
81
+ //# sourceMappingURL=relationship-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationship-index.d.ts","sourceRoot":"","sources":["../src/relationship-index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,eAAe,EAGrB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,CAAC,MAAM,uBAAuB,EAAE,OAAO,MAAM,CAAC;AAErD,kFAAkF;AAClF,MAAM,MAAM,2BAA2B,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI,CAAC,GAAG;IAC7E,QAAQ,CAAC,CAAC,uBAAuB,CAAC,EAAE,IAAI,CAAC;CAC1C,CAAC;AAEF,wEAAwE;AACxE,MAAM,WAAW,sBAAsB;IACrC,QAAQ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M,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAI1E,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS;IAIhD,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,GAAG,SAAS;IAIxD,0DAA0D;IAC1D,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAQ1E,8DAA8D;IAC9D,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,GAAG,IAAI;CAUxE"}
@@ -0,0 +1,70 @@
1
+ /** Internal resource storage. */
2
+ export interface ResourceEntry {
3
+ value: unknown;
4
+ added: number;
5
+ changed: number;
6
+ }
7
+ export interface ResourceStore {
8
+ readonly entries: Map<string, ResourceEntry>;
9
+ }
10
+ /** Create a fresh resource store. */
11
+ export declare function createResourceStore(): ResourceStore;
12
+ /**
13
+ * Insert or overwrite a resource (idempotent, E-13).
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * import { createResourceStore, insertResource, type ResourceStore } from './resource';
18
+ *
19
+ * const store: ResourceStore = createResourceStore();
20
+ * insertResource(store, 'health', 100);
21
+ * // overwriting is idempotent (no error / no duplicate slot):
22
+ * insertResource(store, 'health', 95);
23
+ * ```
24
+ */
25
+ export declare function insertResource<T>(store: ResourceStore, key: string, value: T, epoch?: number): void;
26
+ /**
27
+ * Get a resource by key.
28
+ * @throws ResourceNotFoundError if key does not exist (E-14).
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * import { getResource, insertResource, type ResourceStore } from './resource';
33
+ *
34
+ * declare const store: ResourceStore;
35
+ * insertResource(store, 'health', 100);
36
+ * const hp = getResource<number>(store, 'health');
37
+ * // hp === 100; throws ResourceNotFoundError on missing key (charter proposition 4)
38
+ * ```
39
+ */
40
+ export declare function getResource<T>(store: ResourceStore, key: string): T;
41
+ /**
42
+ * Check if a resource exists.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * import { hasResource, insertResource, type ResourceStore } from './resource';
47
+ *
48
+ * declare const store: ResourceStore;
49
+ * insertResource(store, 'health', 100);
50
+ * if (hasResource(store, 'health')) {
51
+ * // guarded access avoids ResourceNotFoundError from getResource
52
+ * }
53
+ * ```
54
+ */
55
+ export declare function hasResource(store: ResourceStore, key: string): boolean;
56
+ /**
57
+ * Remove a resource by key.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * import { hasResource, insertResource, removeResource, type ResourceStore } from './resource';
62
+ *
63
+ * declare const store: ResourceStore;
64
+ * insertResource(store, 'health', 100);
65
+ * removeResource(store, 'health');
66
+ * // hasResource(store, 'health') === false; idempotent on missing keys
67
+ * ```
68
+ */
69
+ export declare function removeResource(store: ResourceStore, key: string): boolean;
70
+ //# sourceMappingURL=resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAWA,iCAAiC;AACjC,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CAC9C;AAED,qCAAqC;AACrC,wBAAgB,mBAAmB,IAAI,aAAa,CAEnD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,SAAI,GAAG,IAAI,CAQ9F;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,CAMnE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAEtE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAEzE"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Nominal label for one of the World-owned schedules.
3
+ *
4
+ * Worlds expose the built-in tokens below. A token is both a registration
5
+ * scope and, for FixedUpdate, the intrinsic Update ordering anchor.
6
+ */
7
+ export interface ScheduleToken {
8
+ readonly name: string;
9
+ }
10
+ export type ScheduleName = 'Update' | 'FixedUpdate';
11
+ /** Variable-rate World schedule. */
12
+ export declare const Update: ScheduleToken;
13
+ /** Fixed-rate World schedule and the intrinsic Update ordering anchor. */
14
+ export declare const FixedUpdate: ScheduleToken;
15
+ export declare function isScheduleToken(value: unknown): value is ScheduleToken;
16
+ //# sourceMappingURL=schedule-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-token.d.ts","sourceRoot":"","sources":["../src/schedule-token.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,aAAa,CAAC;AAuBpD,oCAAoC;AACpC,eAAO,MAAM,MAAM,eAAgC,CAAC;AACpD,0EAA0E;AAC1E,eAAO,MAAM,WAAW,eAAqC,CAAC;AAC9D,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE"}
@@ -0,0 +1,271 @@
1
+ import { type Result } from '@forgeax/engine-types';
2
+ import { type CommandBuffer } from './commands';
3
+ import type { Component } from './component';
4
+ import { ScheduleMutationError, type SystemSetNotRegisteredError } from './errors';
5
+ import type { Query, QueryDescriptor } from './query/query';
6
+ import type { ScheduleToken } from './schedule-token';
7
+ import type { World } from './world';
8
+ type SystemQueryResults<Qs extends ReadonlyArray<QueryDescriptor> = ReadonlyArray<QueryDescriptor>> = {
9
+ [K in keyof Qs]: Qs[K] extends QueryDescriptor<infer R extends ReadonlyArray<Component>, infer W extends ReadonlyArray<Component>, infer O extends ReadonlyArray<Component>> ? Query<NoInfer<R>, NoInfer<W>, NoInfer<O>> : Query;
10
+ };
11
+ /**
12
+ * System descriptor passed to `world.addSystem` — `fn` receives one persistent
13
+ * executable Query per descriptor, mapped over `Qs` without casts.
14
+ *
15
+ * `Qs` is the tuple of query descriptors; defaults to
16
+ * `readonly QueryDescriptor[]` so non-generic call sites stay zero-modification
17
+ * (KD-5). The `fn` first parameter is mapped over `Qs` so each
18
+ * `queryResults[i]` recovers its own row access roles (S-5, KD-2).
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * // Single-query system — row access recovers each component schema.
23
+ * import { defineComponent, World } from '@forgeax/engine-ecs';
24
+ *
25
+ * const Position = defineComponent('Position', { x: 'f32', y: 'f32' });
26
+ * const Velocity = defineComponent('Velocity', { dx: 'f32', dy: 'f32' });
27
+ *
28
+ * const world = new World();
29
+ * world.addSystem(Update, {
30
+ * name: 'movement',
31
+ * queries: [{ write: [Position], read: [Velocity] }],
32
+ * fn: (_world, queryResults, _commands) => {
33
+ * for (const row of queryResults[0]) {
34
+ * row.mut(Position).x += row.get(Velocity).dx;
35
+ * }
36
+ * },
37
+ * });
38
+ * ```
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * // Multi-query system — each queryResults[i] keeps its own row shape.
43
+ * const Health = defineComponent('Health', { hp: 'f32' });
44
+ * world.addSystem(Update, {
45
+ * name: 'multi',
46
+ * queries: [{ read: [Position] }, { read: [Health] }],
47
+ * fn: (_world, queryResults) => {
48
+ * for (const row of queryResults[0]) void row.get(Position).x;
49
+ * for (const row of queryResults[1]) void row.get(Health).hp;
50
+ * },
51
+ * });
52
+ * ```
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * // Commands-only system — `queries: []` is a legal form; fn receives `[]`.
57
+ * world.addSystem(Update, {
58
+ * name: 'spawner',
59
+ * queries: [],
60
+ * fn: (_world, _queryResults, commands) => {
61
+ * commands.spawn({ component: Position, data: { x: 0, y: 0 } });
62
+ * },
63
+ * });
64
+ * ```
65
+ */
66
+ export interface SystemDescriptor<Qs extends ReadonlyArray<QueryDescriptor> = ReadonlyArray<QueryDescriptor>> {
67
+ /** Unique system name (used for before/after references). */
68
+ readonly name: string;
69
+ /** Query descriptors this system reads. */
70
+ readonly queries: Qs;
71
+ /**
72
+ * System function — receives the World, resolved query results, and commands.
73
+ *
74
+ * @param world The owning World — read resources (`world.getResource(KEY)`),
75
+ * resolve components by name, etc. without closure capture.
76
+ * @param queryResults Mapped over `Qs`: each entry is a persistent Query.
77
+ * @param commands Deferred-mutation buffer (flushed after the system).
78
+ */
79
+ readonly fn: (world: World, queryResults: SystemQueryResults<Qs>, commands: CommandBuffer) => void | unknown;
80
+ /** Run this system after named systems or the FixedUpdate anchor. */
81
+ readonly after?: ReadonlyArray<string | ScheduleToken>;
82
+ /** Run this system before named systems or the FixedUpdate anchor. */
83
+ readonly before?: ReadonlyArray<string | ScheduleToken>;
84
+ /**
85
+ * Run condition. Evaluated each frame after ParamValidation passes (tag
86
+ * 'ok') and before query iteration. Returning `false` skips the system silently —
87
+ * no query runs, no fn call, no state added (plan-strategy D-8). Omitting it
88
+ * (undefined) always runs the system.
89
+ */
90
+ readonly runIf?: (world: World) => boolean;
91
+ }
92
+ /**
93
+ * A registered system token returned by {@link defineSystem}. Structurally the
94
+ * frozen {@link SystemDescriptor} itself (plan-strategy D-6 — "define ==
95
+ * register"). `world.addSystem(handle)` consumes it directly; the generic `Qs`
96
+ * flows through so the `fn` per-query row access shapes survive (S-5).
97
+ */
98
+ export type SystemHandle<Qs extends ReadonlyArray<QueryDescriptor> = ReadonlyArray<QueryDescriptor>> = SystemDescriptor<Qs>;
99
+ /** Internal system record with registration index. */
100
+ interface SystemRecord {
101
+ descriptor: SystemDescriptor;
102
+ /** Registration order index (for tie-breaking). */
103
+ registrationIndex: number;
104
+ /** Cached executable Queries, one per descriptor. */
105
+ queries: Query[] | null;
106
+ }
107
+ /**
108
+ * Per-set record in the Schedule. Created lazily on first addSystems /
109
+ * addSystems call for a given set name.
110
+ */
111
+ export interface SetRecord {
112
+ /** Member system names (insertion-ordered, Set preserves add order). */
113
+ readonly members: Set<string>;
114
+ /** Snapshot of runIf from the defining token. */
115
+ readonly runIf: ((world: import('./world').World) => boolean) | undefined;
116
+ /** Snapshot of chained from the defining token. */
117
+ readonly chained: boolean;
118
+ }
119
+ /** The Schedule manages system registration, DAG sorting, and execution. */
120
+ export interface Schedule {
121
+ /** Owning token for scope-aware diagnostics. */
122
+ readonly token: ScheduleToken;
123
+ /** All registered systems by name. */
124
+ systems: Map<string, SystemRecord>;
125
+ /** Set records keyed by set name. Created lazily. */
126
+ sets: Map<string, SetRecord>;
127
+ /** Next registration index. */
128
+ nextIndex: number;
129
+ /** Whether the sorted order is stale. */
130
+ dirty: boolean;
131
+ /** Sorted system names after buildSchedule(). */
132
+ sortedOrder: string[];
133
+ /** Direct predecessor names derived while the DAG is built. */
134
+ predecessors: Map<string, Set<string>>;
135
+ }
136
+ /** Create a fresh Schedule. */
137
+ export declare function createSchedule(token: ScheduleToken): Schedule;
138
+ /**
139
+ * Register a system. Marks schedule as dirty.
140
+ * Queries are lazily initialized on first runSchedule.
141
+ *
142
+ * `const Qs` locks the `queries` tuple at the call site so `fn`'s first
143
+ * parameter recovers per-query row shapes without `as const` annotations
144
+ * (S-5, KD-2). `SystemRecord` itself is intentionally non-generic — the
145
+ * heterogeneous `Qs` cannot be expressed inside the systems Map (KD-3).
146
+ */
147
+ export declare function addSystem<const Qs extends ReadonlyArray<QueryDescriptor>>(schedule: Schedule, descriptor: SystemDescriptor<Qs>): void;
148
+ /**
149
+ * Define a system at module level. Returns a frozen {@link SystemHandle} token
150
+ * (the descriptor itself); executable registration is World-local.
151
+ *
152
+ * `world.addSystem(handle)` consumes the token directly — no by-name overload
153
+ * (OOS-8). Duplicate names are resolved by the owning World schedule.
154
+ *
155
+ * `const Qs` locks the `queries` tuple so `fn`'s query-results parameter
156
+ * recovers per-query row access shapes without `as const` (S-5).
157
+ *
158
+ * @example
159
+ * ```ts
160
+ * const Move = defineSystem({
161
+ * name: 'movement',
162
+ * queries: [{ with: [Position, Velocity] }],
163
+ * fn: (_world, queryResults) => { ... },
164
+ * });
165
+ * world.addSystem(Move);
166
+ * ```
167
+ */
168
+ export declare function defineSystem<const Qs extends ReadonlyArray<QueryDescriptor>>(descriptor: SystemDescriptor<Qs>): SystemHandle<Qs>;
169
+ /**
170
+ */
171
+ /** Brand symbol for {@link SystemSet}. Declared (not runtime-initialised) so
172
+ * the token interface carries nominal identity without a runtime allocation.
173
+ * Mirrors the `FORGEAX_STATE_BRAND` pattern in `@forgeax/engine-state`. */
174
+ declare const FORGEAX_SYSTEM_SET_BRAND: unique symbol;
175
+ /**
176
+ * Opaque branded type for system-set tokens.
177
+ *
178
+ * Use {@link defineSystemSet} to create a token; never construct manually.
179
+ * The {@link __forgeaxSystemSet} brand prevents plain-object assignment and
180
+ * enables TypeScript narrowing at the two mutation entry points.
181
+ */
182
+ export interface SystemSet {
183
+ /** Brand — prevents structural compatibility with plain objects. */
184
+ readonly __forgeaxSystemSet: typeof FORGEAX_SYSTEM_SET_BRAND;
185
+ /** The user-supplied set name. */
186
+ readonly name: string;
187
+ /** Optional per-frame run condition. Consumed by M3 condition gate. */
188
+ readonly runIf?: (world: import('./world').World) => boolean;
189
+ /** Whether this set forms a sequential chain (M2). */
190
+ readonly chained?: boolean;
191
+ }
192
+ /**
193
+ * Define a system set at module level. Returns a frozen branded token and
194
+ * keeps membership in the World-local Schedule.
195
+ *
196
+ * Duplicate names are independent tokens; the owning World decides membership.
197
+ *
198
+ * @example
199
+ * ```ts
200
+ * const GameplaySet = defineSystemSet({ name: 'gameplay', runIf: (w) => !w.getResource<boolean>('paused') });
201
+ * const OrderedSet = defineSystemSet({ name: 'ordered', chained: true });
202
+ * ```
203
+ */
204
+ export declare function defineSystemSet(opts: {
205
+ readonly name: string;
206
+ readonly runIf?: (world: import('./world').World) => boolean;
207
+ readonly chained?: boolean;
208
+ }): SystemSet;
209
+ /**
210
+ /**
211
+ * Validate every token in `tokens` for local structural validity.
212
+ * Returns `ok(undefined)` for a structurally valid token and reports an empty
213
+ * token name as a structured registration error.
214
+ *
215
+ * Does not write any Schedule state — callers consume the `Result` and proceed
216
+ * only on `ok`.
217
+ */
218
+ export declare function validateSystemSetTokens(tokens: readonly SystemSet[]): Result<void, SystemSetNotRegisteredError>;
219
+ /**
220
+ * Remove a registered system by name (M2 — plan-strategy D-3).
221
+ *
222
+ * Drops the entry from `schedule.systems` and marks the schedule dirty so the
223
+ * next `runSchedule` rebuilds the sorted order via Kahn topo. Cycle detection
224
+ * already happens inside `buildSchedule`, so a removal that breaks an unrelated
225
+ * `before/after` reference simply skips the unknown name (existing behaviour).
226
+ *
227
+ * Failure: name not registered → `Result.err(ScheduleMutationError)` with
228
+ * `.code = 'system-before-unknown'` and `.detail.candidates` carrying the
229
+ * registered names for AI-friendly typo recovery.
230
+ */
231
+ export declare function removeSystem(schedule: Schedule, name: string): Result<void, ScheduleMutationError>;
232
+ /**
233
+ * Replace a registered system in-place (M2 — plan-strategy D-3 atomic semantics).
234
+ *
235
+ * Overwrites the `descriptor` field of the existing `SystemRecord` while
236
+ * keeping `registrationIndex` and the `Map` slot identical, so all `before /
237
+ * after` edges that reference this name remain bound to the same slot. Marks
238
+ * the schedule dirty: the next `runSchedule` re-sorts.
239
+ *
240
+ * Failure: name not registered → `Result.err(ScheduleMutationError)` with
241
+ * `.code = 'system-before-unknown'`.
242
+ */
243
+ export declare function replaceSystem<const Qs extends ReadonlyArray<QueryDescriptor>>(schedule: Schedule, name: string, descriptor: SystemDescriptor<Qs>): Result<void, ScheduleMutationError>;
244
+ /**
245
+ * Batch-register systems to a set. Validates the set token before writing.
246
+ *
247
+ * - First call for a system name: registers via the existing `addSystem` path.
248
+ * - Subsequent calls: only adds the system name to the set's members (dedup).
249
+ * - `runIf` / `chained` are snapshotted from the token into the SetRecord on
250
+ * first encounter.
251
+ *
252
+ * Returns `Result.err` with `SystemSetNotRegisteredError` if the set token
253
+ * fails identity validation.
254
+ */
255
+ export declare function addSystems<const Qs extends ReadonlyArray<QueryDescriptor>>(schedule: Schedule, set: SystemSet, systems: ReadonlyArray<SystemDescriptor<Qs>>): Result<void, SystemSetNotRegisteredError>;
256
+ /**
257
+ * Build the sorted execution order via Kahn's topological sort.
258
+ * Throws CyclicDependencyError if a cycle is detected.
259
+ *
260
+ * @returns sorted system names
261
+ */
262
+ export declare function buildSchedule(schedule: Schedule): string[];
263
+ /**
264
+ * Execute one schedule with a terminalization guard. Query construction,
265
+ * run-if evaluation, DAG compilation, and command draining may all throw an
266
+ * unexpected error; every still-open buffer is nevertheless aborted before the
267
+ * error reaches World.update.
268
+ */
269
+ export declare function runSchedule(schedule: Schedule, world: World, selectedNames?: readonly string[], commandsBySystem?: Map<string, import("./commands").CommandBufferImpl>, finalDrain?: boolean): void;
270
+ export {};
271
+ //# sourceMappingURL=schedule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../src/schedule.ts"],"names":[],"mappings":"AAKA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,KAAK,aAAa,EAAsC,MAAM,YAAY,CAAC;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAEL,qBAAqB,EAErB,KAAK,2BAA2B,EAEjC,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAK5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,KAAK,E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