@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,581 @@
1
+ import { type Handle, type Result } from '@forgeax/engine-types';
2
+ import type { EntityHandle } from './entity-handle';
3
+ import type { ManagedColumnReader } from './storage/column';
4
+ export { componentDefinition } from './component-schema';
5
+ /** Bytes per element for each scalar field type. */
6
+ declare const FIELD_SIZE_BYTES: {
7
+ readonly f32: 4;
8
+ readonly f64: 8;
9
+ readonly i32: 4;
10
+ readonly u32: 4;
11
+ readonly i16: 2;
12
+ readonly u16: 2;
13
+ readonly i8: 1;
14
+ readonly u8: 1;
15
+ readonly bool: 1;
16
+ readonly enum: 4;
17
+ readonly ref: 4;
18
+ };
19
+ /** Numeric scalar field types backed by TypedArray storage (legacy tier). */
20
+ export type ScalarFieldType = keyof typeof FIELD_SIZE_BYTES;
21
+ /**
22
+ * Legal element-type whitelist for the `array<T,N>` / `array<T>` vocab
23
+ * keywords (AC-03). T must be a scalar field type, `entity`, or a
24
+ * `shared\<X\>` template with a non-empty tag; reference / buffer / nested
25
+ * array element types are forbidden (OOS-08 / OOS-03).
26
+ *
27
+ * feat-20260614 M5 / w23: the historical `handle\<X\>` element family was
28
+ * deleted in favor of `shared\<X\>` (rc-tracked, lifecycle owned by
29
+ * SharedRefStore). The `MANAGED_ARRAY_ELEMENT_TYPES` Set remains
30
+ * static-scalar + entity only (D-8); dynamic `shared\<X\>` templates are
31
+ * validated by `isValidArrayElementType` at parse time.
32
+ *
33
+ * Legal: every member of `ScalarFieldType` plus `entity` plus
34
+ * `shared\<X\>` (non-empty tag). The `ref` legacy scalar keyword (a u32
35
+ * column placeholder) is in the whitelist; the parametric `unique<T>` /
36
+ * `shared<T>` scalars are rejected as array element types by AC-03.
37
+ */
38
+ export type ManagedArrayElementType = ScalarFieldType | 'entity' | `shared<${string}>`;
39
+ /**
40
+ * Schema-vocab keywords beyond the legacy scalar tier (AC-01).
41
+ *
42
+ * Each pattern is a template-literal type so a literal schema like
43
+ * `{ mat: 'unique<MaterialAsset>' }` types the value as
44
+ * `Handle<'MaterialAsset','unique'>` end-to-end. Runtime acceptance is
45
+ * gated by the internal `isSchemaVocabKeyword` check — the SSOT for parser fail-fast.
46
+ *
47
+ * The legacy `'buffer:<N>'` literal is retired one-cut by
48
+ * feat-20260515-buffer-array-vocab-collapse w4: replaced by the
49
+ * angle-bracket generic shapes `'buffer'` (variable byte slot) and
50
+ * `'buffer<N>'` (fixed byte slot). With `'array<T>'` / `'array<T, N>'` they
51
+ * form a 4-keyword closed surface across two orthogonal axes (element-type
52
+ * x capacity contract).
53
+ */
54
+ export type SchemaVocabKeyword = 'string' | 'buffer' | `buffer<${number}>` | `unique<${string}>` | `shared<${string}>` | 'entity' | `array<${ManagedArrayElementType}, ${number}>` | `array<${ManagedArrayElementType}>`;
55
+ /**
56
+ * Closed union of every keyword `defineComponent` accepts for a schema field.
57
+ * Combines the legacy scalar tier with the schema-vocab tier.
58
+ *
59
+ * `ComponentSchema` is keyed against this union; `defineComponent` rejects
60
+ * any field value not satisfying it (compile-time) or matching it
61
+ * (runtime).
62
+ */
63
+ export type SchemaFieldType = ScalarFieldType | SchemaVocabKeyword;
64
+ /**
65
+ * Producer-owned semantic shape tags for authoring/schema consumers.
66
+ *
67
+ * The ECS storage vocabulary remains the source of truth for bytes and
68
+ * runtime values. These tags capture the semantic shape that storage alone
69
+ * cannot express (for example an optional entity reference or a nested
70
+ * unique payload). The tag is deliberately closed so downstream consumers
71
+ * can exhaustively handle the representative field-shape vocabulary without
72
+ * creating a second component registry.
73
+ */
74
+ export type FieldShapeKind = 'scalar' | 'boolean' | 'enum' | 'vector' | 'quaternion' | 'optional' | 'nested' | 'array' | 'asset-ref';
75
+ /**
76
+ * Normalize any field-type keyword to its TYPE_METADATA key.
77
+ *
78
+ * The 11 legacy scalars round-trip their own key. The 6 vocab families normalize
79
+ * their parametric shapes to the family key:
80
+ * - `unique<T>` / `shared<T>` — strip `<T>` → `'ref'` / `'shared'`
81
+ * - `buffer<N>` — strip `<N>` → `'buffer'`
82
+ * - `array<T>` / `array<T,N>` — strip `<...>` → `'array'`
83
+ * - `entity` / `string` / `buffer` are identity.
84
+ *
85
+ * Returns `null` for an unrecognised keyword so callers can skip column
86
+ * allocation (same semantics as the retired `storageFieldType`).
87
+ */
88
+ export declare function fieldTypeToMetaKey(fieldType: string): string | null;
89
+ /**
90
+ * `true` when the schema field type is a managed-store slot - i.e. should be
91
+ * routed through `UniqueRefStore` (or `SharedRefStore` for `'shared<T>'`)
92
+ * for alloc / resolve / release. Derived from TYPE_METADATA[].isManaged
93
+ * column (feat-20260611-ecs-storage-naming-ssot D-3).
94
+ *
95
+ * Naming note (D-6 whitelist): `managed = ECS-tracked`. The prefix here is
96
+ * about column-side lifecycle ownership (the ECS releases the slot on
97
+ * despawn / overwrite), not the retired `'managed' | 'unmanaged'` Handle
98
+ * brand. Both `'unique<T>'` and `'shared<T>'` schema fields satisfy
99
+ * `isManagedField` because both are ECS-tracked; the dispatcher in
100
+ * `releaseManagedFieldOnRow` picks the right store per field type.
101
+ */
102
+ export declare function isManagedField(fieldType: string): boolean;
103
+ /**
104
+ * `true` when the schema field type is a managed-buffer slot - i.e. should be
105
+ * released by the M2 BufferPool release loop. Derived from
106
+ * TYPE_METADATA[].isBuffer column (feat-20260611-ecs-storage-naming-ssot D-3/D-4).
107
+ *
108
+ * D-4 semantic widening accepted: `buffer<abc>` resolves to metaKey 'buffer'
109
+ * (isBuffer=true) while the old regex-based impl rejected the non-integer N.
110
+ * This is a dead path — `defineComponent` rejects `buffer<abc>` via
111
+ * `isSchemaVocabKeyword` before the predicate fires.
112
+ *
113
+ * Naming note (D-6 whitelist): `managed = ECS-tracked`. Same semantic as
114
+ * `isManagedField` — the variable `'buffer'` keyword is one whose
115
+ * BufferPool slot the ECS releases at despawn / overwrite time.
116
+ */
117
+ export declare function isManagedBufferField(fieldType: string): boolean;
118
+ /**
119
+ * `true` when the schema field type is the single-entity reference keyword
120
+ * `'entity'`. Derived from TYPE_METADATA[].isEntityRef column
121
+ * (feat-20260611-ecs-storage-naming-ssot D-3).
122
+ */
123
+ export declare function isEntityField(fieldType: string): boolean;
124
+ /**
125
+ * `true` when the schema field type is an `array<T,N>` / `array<T>` vocab
126
+ * keyword. Derived from TYPE_METADATA[].isArray column
127
+ * (feat-20260611-ecs-storage-naming-ssot D-3).
128
+ *
129
+ * Naming note (D-6 whitelist): `managed = ECS-tracked`. Variable
130
+ * `array<T>` storage routes through BufferPool (slot lifecycle owned by
131
+ * the ECS); fixed `array<T,N>` is inline stride-N and has no separate
132
+ * slot to release, but both share this predicate as they share the
133
+ * `'array'` meta key.
134
+ */
135
+ export declare function isManagedArrayField(fieldType: string): boolean;
136
+ /**
137
+ * Set of legal element types for the `array<T,N>` / `array<T>` keywords
138
+ * (AC-03). Runtime mirror of `ManagedArrayElementType`.
139
+ *
140
+ * Naming note (D-6 whitelist): `MANAGED_ARRAY_ELEMENT_TYPES` keeps the
141
+ * `MANAGED` prefix because `managed = ECS-tracked` here — the Set is the
142
+ * static-whitelist arm of `isValidArrayElementType`, which gates which
143
+ * element types the ECS array dispatch knows how to retain / release.
144
+ * The `'shared<X>'` template family rides the `startsWith('shared<')`
145
+ * special case (D-8) rather than living in this Set.
146
+ */
147
+ export declare const MANAGED_ARRAY_ELEMENT_TYPES: ReadonlySet<ManagedArrayElementType>;
148
+ /**
149
+ * Parse an `array<T,N>` / `array<T>` schema string into its element type and
150
+ * optional fixed length. Returns `null` if the string is not a managed-array
151
+ * keyword or its element type is not in the whitelist (AC-03 runtime
152
+ * fail-safe).
153
+ *
154
+ * Examples:
155
+ * parseManagedArraySchema('array<entity>') => { elementType: 'entity', length: undefined }
156
+ * parseManagedArraySchema('array<f32, 16>') => { elementType: 'f32', length: 16 }
157
+ * parseManagedArraySchema('array<shared<MaterialAsset>>') => { elementType: 'shared<MaterialAsset>', length: undefined }
158
+ * parseManagedArraySchema('array<shared<>>') => null (empty tag rejection)
159
+ * parseManagedArraySchema('array<unique<X>>') => null (illegal element)
160
+ * parseManagedArraySchema('array<array<f32,4>>') => null (nested rejected)
161
+ *
162
+ * Naming note (D-6 whitelist): `parseManagedArraySchema` keeps the
163
+ * `Managed` infix because `managed = ECS-tracked` — every legal output
164
+ * shape this parser returns is one whose lifecycle the ECS knows how to
165
+ * retain / release on overwrite, despawn, or archetype migration.
166
+ */
167
+ export declare function parseManagedArraySchema(fieldType: string): {
168
+ readonly elementType: ManagedArrayElementType;
169
+ readonly length: number | undefined;
170
+ } | null;
171
+ /**
172
+ * Parse the byte count out of a `buffer<N>` schema keyword. Returns NaN if
173
+ * the input does not match the keyword pattern - callers that already gated
174
+ * via `isManagedBufferField` get a guaranteed-positive integer for the
175
+ * fixed-byte form. The bare `'buffer'` keyword (variable byte capacity)
176
+ * returns NaN and callers must check `fieldType === 'buffer'` separately.
177
+ */
178
+ export declare function bufferFieldByteLength(fieldType: string): number;
179
+ /**
180
+ * Runtime check for a schema-vocab keyword (the tier-2 surface).
181
+ *
182
+ * Pure-function regex match — kept off the hot path; only invoked by
183
+ * `defineComponent` once per field at registration time. The match patterns
184
+ * are the runtime mirror of `SchemaVocabKeyword` template literals.
185
+ *
186
+ * - `'string'` is exact-match (bare literal, no `<>`).
187
+ * - `'buffer'` is exact-match (variable-byte capacity).
188
+ * - `buffer<N>` requires `N` to be a positive base-10 integer (`/^[1-9]\d*$/`).
189
+ * Forms like `buffer<abc>` / `buffer<0>` / `buffer<>` are rejected.
190
+ * - `unique<T>` / `shared<T>` require a non-empty target tag (`/^\w+$/`).
191
+ * - `entity` is exact-match.
192
+ * - `array<T,N>` / `array<T>` accept only the whitelist element types
193
+ * (`MANAGED_ARRAY_ELEMENT_TYPES`); illegal inner types fall through and
194
+ * the caller surfaces `managed-array-element-type-not-allowed`.
195
+ */
196
+ export declare function isSchemaVocabKeyword(s: string): s is SchemaVocabKeyword;
197
+ /**
198
+ * JS value-shape per managed-array element type. `entity` maps to `Entity`
199
+ * (branded number), every scalar maps to `number` (bool is stored as a 0/1
200
+ * byte and read back as 0 or 1).
201
+ */
202
+ export type ManagedArrayElementValue<T extends ManagedArrayElementType> = T extends 'entity' ? EntityHandle : number;
203
+ /**
204
+ * Maps each field-type keyword to the JS value type read/written by it.
205
+ *
206
+ * Tier-1 (legacy scalars) widens to `boolean | number`; tier-2 (schema-vocab)
207
+ * resolves to the corresponding handle / entity / buffer / array / string
208
+ * shape via the `infer T` template-literal extraction pattern. Conditional
209
+ * types resolve top-down --- the `'string'` arm sits BEFORE the array<...> /
210
+ * `buffer<N>` arms so the precise literal wins template-literal resolution
211
+ * (R-P5: prevents `'string'` from being shadowed by a wider template-literal
212
+ * pattern). The fixed-capacity `array<T,N>` arm matches before the
213
+ * variable-capacity `array<T>` arm by the same rule.
214
+ *
215
+ * The 4 buffer/array keywords (`'buffer'` / `'buffer<N>'` / `'array<T>'` /
216
+ * `'array<T, N>'`) all resolve directly to a concrete TypedArray (or
217
+ * Uint8Array for the byte-only buffer family). The materialised value is a
218
+ * read-only snapshot: for fixed `buffer<N>` / `array<T,N>` it aliases the
219
+ * inline column buffer (feat-20260602); for variable `buffer` / `array<T>`
220
+ * it aliases the BufferPool slot bytes (plan-strategy §2.2 D-R3 contract).
221
+ * Mutation flows through `world.set` / `world.push` / `world.pop`
222
+ * not direct assignment to the returned TypedArray.
223
+ *
224
+ * The `'string'` arm resolves to a native JS `string` (D-R1 / AC-13): the
225
+ * dispatch routes the column u32 through `UniqueRefStore.resolve(handle)`
226
+ * which returns the immutable string payload by reference.
227
+ */
228
+ export type FieldValueType<T extends SchemaFieldType> = T extends 'bool' ? boolean : T extends 'entity' ? EntityHandle | null : T extends 'string' ? string : T extends 'buffer' ? Uint8Array : T extends `buffer<${number}>` ? Uint8Array : T extends `array<shared<${infer Target}>, ${number}>` ? readonly Handle<Target, 'shared'>[] : T extends `array<shared<${infer Target}>>` ? readonly Handle<Target, 'shared'>[] : T extends `array<${infer Elem extends ManagedArrayElementType}, ${number}>` ? TypedArrayFor<Elem extends 'entity' ? 'u32' : Elem> : T extends `array<${infer Elem extends ManagedArrayElementType}>` ? TypedArrayFor<Elem extends 'entity' ? 'u32' : Elem> : T extends `unique<${infer Target}>` ? Handle<Target, 'unique'> : T extends `shared<${infer Target}>` ? Handle<Target, 'shared'> : T extends ScalarFieldType ? number : never;
229
+ /**
230
+ * Input-side counterpart of {@link FieldValueType} for write paths
231
+ * (`world.spawn` / `world.addComponent` / `world.set`).
232
+ *
233
+ * Asymmetric on `array<scalar, N>` / `array<scalar>` ONLY: the read side
234
+ * surfaces zero-copy `Float32Array` / `Uint32Array` / etc views; the write
235
+ * side ALSO accepts `readonly number[]` because writeArrayField copies bytes
236
+ * verbatim from either shape (TypedArray subarray() OR per-element pack via
237
+ * DataView). Plain literals like `times: [0.5]` reach the same code path
238
+ * with no Float32Array wrapper boilerplate at the call site, and short
239
+ * prefixes pad the row tail with zero (writeArrayField D-3 contract).
240
+ *
241
+ * Asymmetric on `buffer` / `buffer<N>`: the read side returns `Uint8Array`,
242
+ * but the write side accepts any `AllowSharedBufferSource` (Float32Array /
243
+ * ArrayBuffer / Uint8Array / any TypedArray). The ECS buffer-write ingestion
244
+ * point (`World.writeRow` / `World.set`) normalizes any view to `Uint8Array`
245
+ * over its raw bytes before storing (feat-20260621 V2 / AC-A4). This lets AI
246
+ * users write typed param payloads directly, e.g.
247
+ * `world.set(e, PostProcessParams, { data: Float32Array.of(exposure,0,0,0) })`,
248
+ * without manual byte-reinterpret boilerplate at the call site.
249
+ *
250
+ * Every other arm matches FieldValueType verbatim (no widening): handles
251
+ * are already arrays-of-handle, scalars stay number, etc.
252
+ */
253
+ export type FieldInputType<T extends SchemaFieldType> = T extends 'bool' ? boolean : T extends 'entity' ? EntityHandle | null : T extends 'string' ? string : T extends 'buffer' ? AllowSharedBufferSource : T extends `buffer<${number}>` ? AllowSharedBufferSource : T extends `array<shared<${infer Target}>, ${number}>` ? readonly Handle<Target, 'shared'>[] : T extends `array<shared<${infer Target}>>` ? readonly Handle<Target, 'shared'>[] : T extends `array<${infer Elem extends ManagedArrayElementType}, ${number}>` ? TypedArrayFor<Elem extends 'entity' ? 'u32' : Elem> | readonly number[] : T extends `array<${infer Elem extends ManagedArrayElementType}>` ? TypedArrayFor<Elem extends 'entity' ? 'u32' : Elem> | readonly number[] : T extends `unique<${infer Target}>` ? Handle<Target, 'unique'> : T extends `shared<${infer Target}>` ? Handle<Target, 'shared'> : T extends ScalarFieldType ? number : never;
254
+ /**
255
+ * Maps a SchemaFieldType to its zero-copy query-column view type.
256
+ *
257
+ * Three storage shapes share the keyword space:
258
+ *
259
+ * 1. Scalar / fixed-inline columns -- the column buffer is the data, written
260
+ * in place. The bundle entry is a concrete writable TypedArray of the
261
+ * correct ctor (`f32` -> `Float32Array`, `'buffer<N>'` -> `Uint8Array`,
262
+ * `'array<T,N>'` -> the T-typed array). Direct index assignment is
263
+ * fine -- the column owns the bytes.
264
+ *
265
+ * 2. `shared\<X\>` (rc-tracked AssetRegistry reference) -- the column carries
266
+ * a u32 handle id; SharedRefStore owns the rc lifecycle. The bundle
267
+ * entry is a `ManagedColumnReader<T>` (D-4 / D-7) -- read-only, walk
268
+ * via `.get(i)`. Consumers route through `assets.get(handle)` to
269
+ * materialise the asset payload.
270
+ *
271
+ * 3. The 4 managed-vocab keywords -- `'string'` / `` `ref<T>` `` / variable
272
+ * `'buffer'` / variable `` `array<T>` `` -- the column carries a u32 slot
273
+ * id; the payload lives in `UniqueRefStore` / `BufferPool`. The bundle
274
+ * entry is a `ManagedColumnReader<T>` (D-4 / D-7) -- read-only by
275
+ * construction, no index signature. Mutation MUST flow through the
276
+ * public dispatch (`world.set` / `world.push` / `world.allocUniqueRef`).
277
+ *
278
+ * The `extends SchemaFieldType` upper bound matches `ComponentSchema[K]`
279
+ * so query bundle types do not have to pre-filter.
280
+ */
281
+ export type TypedArrayFor<T extends SchemaFieldType> = T extends 'f32' ? Float32Array : T extends 'f64' ? Float64Array : T extends 'i32' ? Int32Array : T extends 'u32' | 'enum' | 'ref' | 'entity' ? Uint32Array : T extends 'i16' ? Int16Array : T extends 'u16' ? Uint16Array : T extends 'i8' ? Int8Array : T extends 'u8' | 'bool' ? Uint8Array : T extends 'string' ? ManagedColumnReader<'string'> : T extends `unique<${string}>` ? ManagedColumnReader<T> : T extends `shared<${string}>` ? ManagedColumnReader<T> : T extends 'buffer' ? ManagedColumnReader<'buffer'> : T extends `buffer<${number}>` ? Uint8Array : T extends `array<${infer Elem extends ManagedArrayElementType}, ${number}>` ? TypedArrayFor<Elem extends 'entity' | `shared<${string}>` ? 'u32' : Elem> : T extends `array<${string}>` ? ManagedColumnReader<T> : never;
282
+ /**
283
+ * Relationship metadata (feat-20260531 M2 / plan-strategy D-5). Declares this
284
+ * component as the holder side of a Bevy-style bidirectional relationship: the
285
+ * holder carries a single `entity` field (the target), and the engine mirrors
286
+ * the reverse reference into `mirror`.`field` (an `array<entity>` on the target
287
+ * entity) at add / remove / despawn time.
288
+ *
289
+ * - `mirror` — the mirror component's string NAME (not a type reference, so
290
+ * `engine-ecs` never imports the mirror component type; AC-29). The mirror
291
+ * component is a derived runtime view rebuilt by the relationship owner, so
292
+ * it MUST declare `transient: true` — otherwise scene collect serializes it
293
+ * and `instantiateScene` double-writes (serialized copy + owner rebuild).
294
+ * - `field` — the `array<entity>` field on the mirror component that holds the
295
+ * reverse list. Validated to be exactly `'array<entity>'` at `defineComponent` time.
296
+ * - `exclusive` — when `true`, re-adding the holder component with a new target
297
+ * auto-reparents (clears the old mirror entry, then appends the new one)
298
+ * instead of returning `ComponentAlreadyPresentError` (AC-12).
299
+ * - `linkedSpawn` — when `true`, despawning the target recursively despawns the
300
+ * holders in its mirror list. Default `false` (D-1): despawn only prunes the
301
+ * mirror entry, the holder entity survives.
302
+ */
303
+ /** A schema is a record of field-name → field-type keyword. */
304
+ export type ComponentSchema = Record<string, SchemaFieldType>;
305
+ /** Derive the JS value-shape from a schema (read side; zero-copy views). */
306
+ export type ShapeOf<S extends ComponentSchema> = {
307
+ [K in keyof S]: FieldValueType<S[K]>;
308
+ };
309
+ /**
310
+ * Derive the input-side value-shape from a schema (write side; widens
311
+ * `array<scalar>` to also accept `readonly number[]` plus the strict
312
+ * TypedArray view). Used by `world.spawn` / `world.addComponent` /
313
+ * `world.set` `data` so AI users can write `times: [0.5]` instead of the
314
+ * `new Float32Array([0.5])` boilerplate. writeArrayField walks both shapes
315
+ * via the same byte-copy path so runtime semantics are identical.
316
+ */
317
+ export type InputShapeOf<S extends ComponentSchema> = {
318
+ [K in keyof S]: FieldInputType<S[K]>;
319
+ };
320
+ /** @internal Barrel-only check for the id=0 Entity import-order invariant. */
321
+ export declare function isComponentDefinitionOrderValid(): boolean;
322
+ /** @internal Read the owner-assigned identity for storage/archetype code. */
323
+ export declare function componentId(component: Component): ComponentId;
324
+ /** @internal Derive the flat type map from the fields SSOT. */
325
+ export declare function componentSchema<const C extends Component>(component: C): Readonly<SchemaOf<C>>;
326
+ /** Numeric identifier for a component type, used by bitmask matching and archetype edges. */
327
+ export type ComponentId = number;
328
+ export type ComponentStorage = 'table' | 'sparse';
329
+ declare const __componentBrand: unique symbol;
330
+ /**
331
+ * Opaque component token. Carries the component name `N` as a string-literal
332
+ * type parameter (lifted from the `defineComponent` call site via `<const N>`)
333
+ * and the schema-shape `S` as a phantom brand so `world.get(e, Comp)` can
334
+ * return `Result<ShapeOf<S>, EcsError>` precisely.
335
+ *
336
+ * The `N` parameter defaults to `string` to keep existing single-parameter
337
+ * `Component<S>` annotations source-compatible. When inferred from a
338
+ * `defineComponent('Position', ...)` call, `N` is the literal `'Position'`,
339
+ * which lets query row/span mapped types resolve `{ [K in N]: ... }` to a
340
+ * concrete keyed object instead of a degraded index signature (KD-1).
341
+ */
342
+ export interface Component<N extends string = string, S extends ComponentSchema = ComponentSchema> {
343
+ readonly name: N;
344
+ /** The one schema projection: type, default, and enum labels per field. */
345
+ readonly fields: Readonly<Record<keyof S & string, FieldReflection>>;
346
+ readonly storage: ComponentStorage;
347
+ readonly [__componentBrand]: ShapeOf<S>;
348
+ }
349
+ /**
350
+ * One row of the global type-metadata table. Carries the type-intrinsic
351
+ * properties a field type has regardless of which component declares it.
352
+ *
353
+ * - `byteSize` — element byte width for the column-storage scalar; `undefined`
354
+ * for families whose storage byte size is not a fixed per-type constant
355
+ * (variable buffer / array slot ids are u32-stored, surfaced via `storage`).
356
+ * - `viewCtor` — TypedArray constructor for the column storage; `undefined`
357
+ * for families without a direct TypedArray column.
358
+ * - `storage` — the column-storage scalar type this field routes to (every
359
+ * vocab family stores a u32 slot id / handle).
360
+ * - `isScalar` — member of the 11 concrete scalar types
361
+ * (`f32`/`f64`/`i32`/`u32`/`i16`/`u16`/`i8`/`u8`/`bool`/`enum`/`ref`).
362
+ * - `isManaged` — routed through `UniqueRefStore` (string / ref<T>).
363
+ * - `isBuffer` — a `buffer` / `buffer<N>` managed-byte slot.
364
+ * - `isEntityRef` — the single-entity `entity` reference keyword.
365
+ * - `isArray` — an `array<T>` / `array<T,N>` keyword.
366
+ */
367
+ export interface TypeMetadataRow {
368
+ readonly byteSize: number | undefined;
369
+ readonly viewCtor: Float32ArrayConstructor | Float64ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int8ArrayConstructor | Uint8ArrayConstructor | undefined;
370
+ readonly storage: ScalarFieldType;
371
+ readonly isScalar: boolean;
372
+ readonly isManaged: boolean;
373
+ readonly isBuffer: boolean;
374
+ readonly isEntityRef: boolean;
375
+ readonly isArray: boolean;
376
+ }
377
+ /**
378
+ * Global per-type metadata table. Keyed by concrete scalar type (11) plus
379
+ * vocab family (6 — `entity` / `string` / `buffer` / `ref` / `handle` /
380
+ * `array`). The `ref` key is shared by the legacy scalar and the vocab family
381
+ * (see header). Every vocab family stores a u32 slot id / handle.
382
+ *
383
+ * Built once at module load; frozen so downstream consumers (column.ts /
384
+ * archetype.ts / world.ts, migrated M2) read a stable single source.
385
+ */
386
+ export declare const TYPE_METADATA: Readonly<Record<string, TypeMetadataRow>>;
387
+ /**
388
+ * Pre-parsed `array<T>` / `array<T,N>` reflection. Bare length sentinel
389
+ * (D-A1 user ruling): `length` present => fixed-capacity, `length === undefined`
390
+ * => variable-capacity. No `isVariable` / `kind` field — both are losslessly
391
+ * derivable from `length` presence (architecture-principles.md #2 Derive). This
392
+ * is exactly the existing `parseManagedArraySchema` return shape (zero shape
393
+ * change).
394
+ */
395
+ export interface ArrayMeta {
396
+ readonly elementType: ManagedArrayElementType;
397
+ readonly length?: number;
398
+ }
399
+ /**
400
+ * Input field-descriptor object (D-A3). The second `defineComponent` argument
401
+ * may declare each field either as a bare type keyword (legacy flat form,
402
+ * still accepted through M2; migrated repo-wide in M3) or as a descriptor
403
+ * object aggregating `type` + `default` + semantic `shape` + field-level
404
+ * `meta`.
405
+ *
406
+ * - `type` — the schema field-type keyword (a parametrized string such as
407
+ * `'array<f32,3>'` / `'unique<MaterialAsset>'` is used verbatim, D-A2).
408
+ * - `default` — layer-2 default value; retained in the field reflection row.
409
+ * - `shape` — producer-owned semantic shape tag for schema consumers; it does
410
+ * not change ECS storage or runtime value semantics.
411
+ * - `meta` — field-level open namespace; aggregated into `component.meta`. The
412
+ * infra gives no key special meaning (open map, OOS-1).
413
+ * - `transient` — when `true`, scene collect skips this field (D-5). Same word,
414
+ * same meaning as the component-level `transient` flag, with granularity sunk
415
+ * to the field level: a field that is derived/reconstructable (e.g. a resolved
416
+ * world mat4) is excluded from serialization while its component's persisted
417
+ * fields still round-trip. Absent (the common case) means the field is
418
+ * serialized.
419
+ * - `labels` — for an `enum` field ONLY: the label→numeric-value map (e.g.
420
+ * `{ static: 0, dynamic: 1, kinematic: 2 }`). An `enum` field stores a bare
421
+ * `u32` variant index; the human-readable names historically lived in a
422
+ * SEPARATE per-package const map (`RigidBodyTypeValue`) + comment table, so no
423
+ * schema consumer could read them and the two could drift. Declaring `labels`
424
+ * attaches that map to the field itself (SSOT-adjacent): it is aggregated into
425
+ * `component.fields[field].labels` and surfaced by reflection consumers (the
426
+ * editor's `describeComponent`, inspector UIs, validation hints) so a
427
+ * docs-only user learns the legal variants + their integers from the schema
428
+ * alone. Pass the EXISTING `*Value` const map here (Derive, don't Duplicate —
429
+ * one object, two consumers). Absent for non-enum fields / enums that opt out.
430
+ */
431
+ export interface FieldDescriptor<T extends SchemaFieldType = SchemaFieldType> {
432
+ readonly type: T;
433
+ readonly default?: FieldValueType<T>;
434
+ /** Semantic authoring shape; storage still follows `type`. */
435
+ readonly shape?: FieldShapeKind;
436
+ readonly meta?: Readonly<Record<string, unknown>>;
437
+ readonly transient?: boolean;
438
+ readonly labels?: Readonly<Record<string, number>>;
439
+ }
440
+ /**
441
+ * Per-field reflection produced at registration time and read off
442
+ * `component.fields[fieldName]` (D-A3). Carries the pre-parsed facts: the
443
+ * field `type`, its `default` (if any), semantic `shape` (if declared), — for
444
+ * `array<...>` fields only — the pre-parsed `arrayMeta` (parse happens once at
445
+ * registration, AC-03c), and the field-level `transient` flag (D-5) when
446
+ * declared.
447
+ *
448
+ * `transient` mirrors the component-level `Component.transient` (same word,
449
+ * same meaning): scene collect skips a `transient` field just as it skips a
450
+ * `transient` component. Granularity is sunk to the field level so a component
451
+ * can persist most of its fields while excluding a derived/reconstructable one
452
+ * (e.g. `Transform.world`). Absent means the field participates in
453
+ * serialization.
454
+ */
455
+ export interface FieldReflection {
456
+ readonly type: SchemaFieldType;
457
+ readonly default?: unknown;
458
+ /** Producer-declared semantic shape, when storage type alone is insufficient. */
459
+ readonly shape?: FieldShapeKind;
460
+ readonly arrayMeta?: ArrayMeta;
461
+ readonly transient?: boolean;
462
+ /**
463
+ * For an `enum` field: the label→numeric-value map declared on the field
464
+ * descriptor (see `FieldDescriptor.labels`). Lets a schema consumer resolve a
465
+ * variant name ↔ its stored `u32` index without a separate const map. Absent
466
+ * for non-enum fields / enums that did not declare labels.
467
+ */
468
+ readonly labels?: Readonly<Record<string, number>>;
469
+ }
470
+ /**
471
+ * One input field-spec value: either the bare type keyword (legacy flat form)
472
+ * or a field-descriptor object. Accepting both keeps the ~44 flat-string
473
+ * call-sites + ~55 test files green through M1/M2 while the field-descriptor
474
+ * form is migrated in repo-wide in M3 (D-A7 / D-A8 shrink the migration
475
+ * surface to the input side only).
476
+ */
477
+ export type FieldSpec<T extends SchemaFieldType = SchemaFieldType> = T | FieldDescriptor<T>;
478
+ /** An input field-spec map: field-name -> bare keyword | field-descriptor. */
479
+ export type FieldsInput = Record<string, FieldSpec>;
480
+ /**
481
+ * Project an input field-spec map down to its flat `ComponentSchema` shape
482
+ * (field-name -> type keyword). A bare-keyword spec maps to itself (identity,
483
+ * so existing flat-string call-sites infer exactly as before); a descriptor
484
+ * spec maps to its `type`. This keeps `Component<N, SchemaOf<F>>` driving every
485
+ * downstream type (ShapeOf / query row/span projection / TypedArrayFor) unchanged.
486
+ */
487
+ export type SchemaOf<F extends FieldsInput | Component> = F extends Component<string, infer S> ? S : F extends FieldsInput ? {
488
+ [K in keyof F]: F[K] extends FieldDescriptor<infer T> ? T : F[K] extends SchemaFieldType ? F[K] : never;
489
+ } : never;
490
+ /** Optional configuration for `defineComponent` (w4, M3 consumer; w21 layer-2 defaults). */
491
+ export interface DefineComponentOptions {
492
+ readonly storage?: ComponentStorage;
493
+ /**
494
+ * When `true`, the component is skipped by scene collect
495
+ * (rootsToSceneAsset). The component stays in archetype columns and
496
+ * participates normally in queries / world.get at runtime.
497
+ *
498
+ * Default: `false`. Mirror targets of relationship components should
499
+ * declare `transient: true` so they are not serialized (their state is
500
+ * rebuilt by the mirror hook after instantiateScene).
501
+ */
502
+ readonly transient?: boolean;
503
+ /**
504
+ * Component-level open metadata namespace. Entries are copied into
505
+ * `Component.meta` at registration; the ECS core assigns no meaning to any
506
+ * key. Component-level entries win over field-level entries with the same
507
+ * key, and consumers may extend the mutable map after registration.
508
+ */
509
+ readonly meta?: Readonly<Record<string, unknown>>;
510
+ }
511
+ /**
512
+ * Define a component. Returns a frozen opaque token with exactly three runtime
513
+ * facts: `.name`, `.fields`, and `.storage`. Numeric identity, flat schema,
514
+ * and defaults are owner projections held outside the token.
515
+ *
516
+ * The second argument accepts each field either as a bare type keyword
517
+ * ('f32', 'array<entity>', ...) or as a field-descriptor object
518
+ * `{ type, default?, meta? }` (D-A3). The single `FieldsInput` overload
519
+ * handles both forms — bare keywords are identity through `SchemaOf<F>`.
520
+ *
521
+ * The `<const N>` modifier lifts `name` to its string-literal type so the
522
+ * returned `Component<N, SchemaOf<S>>` drives precise key-based mapped types
523
+ * downstream (for example QueryRow and QuerySpan projections). At runtime `name` is a plain
524
+ * string.
525
+ *
526
+ * Schema-field validation accepts both the legacy scalar tier
527
+ * (`ScalarFieldType`, 11 keywords) and the schema-vocab tier
528
+ * (`SchemaVocabKeyword`, 8 patterns including `array<T,N>` / `array<T>` /
529
+ * `buffer` / `buffer<N>`). Mismatched values raise
530
+ * `SchemaUnsupportedFieldError`. Illegal `array<...>` element types
531
+ * (e.g. `array<ref<X>>`) raise `ManagedArrayElementTypeNotAllowedError`
532
+ * (AC-03 runtime fail-safe).
533
+ *
534
+ * Relationship roles are declared through `defineRelationship`; component
535
+ * definitions contain only schema vocabulary and no mirror metadata.
536
+ *
537
+ * @throws SchemaUnsupportedFieldError for any field type not in the supported
538
+ * set, or a field-descriptor object missing its `type`.
539
+ * @throws ManagedArrayElementTypeNotAllowedError when an `array<...>`
540
+ * keyword carries an illegal element type.
541
+ * @throws RelationshipMirrorComponentNotRegisteredError when
542
+ * `relationship.mirror` names a component not yet defined.
543
+ * @throws RelationshipMirrorFieldTypeMismatchError when the mirror's
544
+ * `relationship.field` is missing or not typed `'array<entity>'`.
545
+ */
546
+ export declare function defineComponent<const N extends string, const S extends FieldsInput>(name: N, fields: S, options?: DefineComponentOptions): Component<N, SchemaOf<S>>;
547
+ export declare class ComponentInUseError extends Error {
548
+ readonly name = "ComponentInUseError";
549
+ readonly code: "component-in-use";
550
+ readonly expected = "the component to have no live entity or scheduled-system references";
551
+ readonly hint = "Remove owning systems and component values before disposing the registration lease.";
552
+ readonly detail: {
553
+ readonly componentName: string;
554
+ };
555
+ constructor(componentName: string);
556
+ }
557
+ export declare class ComponentNameConflictError extends Error {
558
+ readonly name = "ComponentNameConflictError";
559
+ readonly code: "component-name-conflict";
560
+ readonly expected = "one component token per name in a World";
561
+ readonly hint = "Use the token already registered in this World or choose a distinct component name.";
562
+ readonly detail: {
563
+ readonly componentName: string;
564
+ };
565
+ constructor(componentName: string);
566
+ }
567
+ export type ComponentCatalogError = ComponentInUseError | ComponentNameConflictError;
568
+ export interface ComponentLease {
569
+ readonly component: Component;
570
+ dispose(): Result<void, ComponentInUseError>;
571
+ }
572
+ /** World-local discovery and ownership boundary for plugin-installed component vocabulary. */
573
+ export declare class ComponentCatalog {
574
+ private readonly inUse;
575
+ private readonly registrations;
576
+ constructor(inUse: (component: Component) => boolean);
577
+ register(component: Component): Result<ComponentLease, ComponentNameConflictError>;
578
+ resolve(name: string): Component | undefined;
579
+ entries(): ReadonlyMap<string, Component>;
580
+ }
581
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAYA,OAAO,EAAO,KAAK,MAAM,EAAM,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAMpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAK5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAyBzD,oDAAoD;AACpD,QAAA,MAAM,gBAAgB;;;;;;;;;;;;CAYZ,CAAC;AAEX,6EAA6E;AAC7E,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAE5D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,uBAAuB,GAAG,eAAe,GAAG,QAAQ,GAAG,UAAU,MAAM,GAAG,CAAC;AAEvF;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,QAAQ,GACR,UAAU,MAAM,GAAG,GACnB,UAAU,MAAM,GAAG,GACnB,UAAU,MAAM,GAAG,GACnB,QAAQ,GACR,SAAS,uBAAuB,KAAK,MAAM,GAAG,GAC9C,SAAS,uBAAuB,GAAG,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,kBAAkB,CAAC;AAEnE;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,SAAS,GACT,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,OAAO,GACP,WAAW,CAAC;AAEhB;;;;;;;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