@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,68 @@
1
+ /**
2
+ * Branded `number` representing an Entity handle. Stored as a JS `number` but
3
+ * holds the u32 bit pattern (generation << 24) | index.
4
+ *
5
+ * The phantom `__entity` brand prevents accidental mixing with other numbers.
6
+ *
7
+ * Naming: the type-space alias is `EntityHandle` (the branded number that
8
+ * identifies a row). The same-named value-space `Entity` re-exported from the
9
+ * package barrel is the id=0 component token (see `./entity`).
10
+ */
11
+ export type EntityHandle = number & {
12
+ readonly __entity: unique symbol;
13
+ };
14
+ /** Maximum representable entity index (2^24 - 1 = 16_777_215). Re-exports codec MAX_SLOT. */
15
+ export declare const ENTITY_MAX_INDEX: number;
16
+ /** Maximum representable generation (2^8 - 1 = 255). Re-exports codec MAX_GEN. */
17
+ export declare const ENTITY_MAX_GENERATION = 255;
18
+ /**
19
+ * Sentinel u32 value reserved for the "null entity" slot in `entity`-typed
20
+ * component fields.
21
+ *
22
+ * The encoding `(gen << 24) | index` yields `0xFFFFFFFF` only at the very
23
+ * last valid (gen=255, index=0xFFFFFF) entity, which retires permanently on
24
+ * its first despawn (D-08). Carving out this single bit pattern as the null
25
+ * sentinel costs at most one slot at the far edge of the entity space.
26
+ *
27
+ * Stored u32 column reads compare against `ENTITY_NULL_RAW` first; the
28
+ * column-level `Entity | null` decode lives in `world.readRow`.
29
+ *
30
+ * Scene-as-World-Blueprint anchor (feat-20260514 w12, R-8 lockdown):
31
+ * This module (`packages/ecs/src/entity.ts`) is the canonical export site
32
+ * for the entity null sentinel. Downstream consumers (M2 instantiate
33
+ * layer 3 fallback for `'entity'`-typed component fields, w22) must import
34
+ * from the package barrel:
35
+ *
36
+ * import { ENTITY_NULL_RAW } from '@forgeax/engine-ecs'
37
+ *
38
+ * The raw `0xFFFFFFFF` literal MUST NOT be duplicated at consumer sites
39
+ * (charter proposition 1: SSOT lives here). The decoded JS-side value is
40
+ * `null` (returned by `world.get(e, C).<entityField>`). Layer 3 default
41
+ * for `'entity'` keyword fields stores `ENTITY_NULL_RAW` into the u32
42
+ * column, which decodes back to `null` on read. ecs-managed-buffer feat
43
+ * export verification (w12 grep): see `packages/ecs/src/index.ts` line
44
+ * re-exporting this constant alongside `ENTITY_MAX_GENERATION /
45
+ * ENTITY_MAX_INDEX`. No add-only fallback re-export is required at this
46
+ * time.
47
+ */
48
+ export declare const ENTITY_NULL_RAW = 4294967295;
49
+ /**
50
+ * Encode (index, generation) into a u32 entity handle.
51
+ *
52
+ * Delegates to shared codec `pack(index, generation)` after ecs-specific
53
+ * overflow validation. The `>>> 0` anti-ToInt32 guard is inherited from the
54
+ * codec (D-7 hard constraint).
55
+ *
56
+ * @throws EntityIndexOverflowError when `index > ENTITY_MAX_INDEX` or `index < 0`.
57
+ */
58
+ export declare function encodeEntity(index: number, generation: number): EntityHandle;
59
+ /** Decode a u32 entity handle into its (index, generation) pair via shared codec. */
60
+ export declare function decodeEntity(entity: EntityHandle): {
61
+ index: number;
62
+ generation: number;
63
+ };
64
+ /** Extract just the index slot from an entity handle via shared codec. */
65
+ export declare function entityIndex(entity: EntityHandle): number;
66
+ /** Extract just the generation slot from an entity handle via shared codec. */
67
+ export declare function entityGeneration(entity: EntityHandle): number;
68
+ //# sourceMappingURL=entity-handle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-handle.d.ts","sourceRoot":"","sources":["../src/entity-handle.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC;AAEzE,6FAA6F;AAC7F,eAAO,MAAM,gBAAgB,QAAW,CAAC;AAEzC,kFAAkF;AAClF,eAAO,MAAM,qBAAqB,MAAU,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,eAAe,aAAa,CAAC;AAE1C;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,YAAY,CAK5E;AAED,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAMxF;AAED,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAExD;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAE7D"}
@@ -0,0 +1,86 @@
1
+ import type { ComponentId } from './component';
2
+ /**
3
+ * The id=0 essential `Entity` component. Its single `self` field carries the
4
+ * full packed entity handle for the row it sits on (written at spawn time).
5
+ *
6
+ * Naming convention (feat-20260611-ecs-storage-naming-ssot):
7
+ *
8
+ * - Value-space `Entity` (this const) is the id=0 component token. It is
9
+ * looked up by name (`'Entity'`) at component-registration time and used
10
+ * as a value (`world.spawn`, `world.get(entity, Entity)`).
11
+ * - Type-space `EntityHandle` (the branded number, exported from `../entity`)
12
+ * is the row-identifier handle type. It is used in `: EntityHandle`
13
+ * annotations.
14
+ *
15
+ * The two no longer share a name -- the prior intentional coexistence (a
16
+ * single `Entity` symbol carrying both meanings via TS namespace merging) was
17
+ * dropped because two-roles-one-name created repeated AI-user confusion when
18
+ * reading `: Entity` annotations (is this the handle or the token?). The id=0
19
+ * component token's name (the literal string `'Entity'`) is preserved for
20
+ * runtime stability; only the type-space alias was renamed.
21
+ *
22
+ * @example Read an entity's own handle through a query:
23
+ * const query = world.query({ read: [Transform] }).unwrap();
24
+ * for (const row of query) {
25
+ * const handle = row.entity;
26
+ * }
27
+ *
28
+ * @example Use `world.get` as a general liveness probe:
29
+ * const r = world.get(e, Entity);
30
+ * if (!r.ok) { // r.error.code === 'stale-entity' for a despawned handle
31
+ * }
32
+ */
33
+ export declare const Entity: import("./component").Component<"Entity", {
34
+ readonly self: "entity";
35
+ }>;
36
+ /**
37
+ * Marks an entity as disabled.
38
+ *
39
+ * Queries exclude this tag by default. Add `Disabled` to a query's `with`
40
+ * tuple when the query must inspect or re-enable disabled entities.
41
+ */
42
+ export declare const Disabled: import("./component").Component<"Disabled", {}>;
43
+ /**
44
+ * SSOT for component ids that are essential to every archetype. Every archetype
45
+ * carries the columns named by these ids unconditionally (they cannot be added
46
+ * or removed via `addComponent` / `removeComponent`). Currently only `Entity`
47
+ * is essential -- the row-identity column that lets every entity read its own
48
+ * packed handle (`world.get(e, Entity).self === e`) through the same column
49
+ * path as any other component (feat-20260602 / charter P4).
50
+ *
51
+ * Frozen so consumers cannot mutate the SSOT. The barrel
52
+ * (`packages/ecs/src/index.ts`) re-exports this constant so the AI-facing
53
+ * `import { ESSENTIAL_COMPONENT_IDS } from '@forgeax/engine-ecs'` works.
54
+ *
55
+ * Physical location is `packages/ecs/src/entity.ts` -- the module that owns
56
+ * the `defineComponent('Entity', ...)` call, so reading the owner identity
57
+ * immediately after registration is well-defined. tweak-20260612-ecs-concept-
58
+ * compression lifted this file back from the historical `components/entity.ts`
59
+ * after `entity-handle.ts` freed up the `entity.ts` slot.
60
+ */
61
+ export declare const ESSENTIAL_COMPONENT_IDS: ReadonlyArray<ComponentId>;
62
+ /**
63
+ * Fold the essential component ids (currently `[componentId(Entity)]`) into a caller-
64
+ * supplied id list. Returns a NEW array; never mutates the input.
65
+ *
66
+ * - If `ids` already contains every essential id, returns a deduped copy
67
+ * (idempotent under repeated folding).
68
+ * - Otherwise, returns `[...essential, ...ids]` with duplicates of the
69
+ * essential ids removed.
70
+ *
71
+ * The empty input maps to `[componentId(Entity)]` -- the bare-archetype shape that a
72
+ * `world.spawn()` (no components) materialises.
73
+ *
74
+ * Single SSOT consumed by both `archetypeKey` (string-key fold) and
75
+ * `createArchetype` (column-build fold) so the two sites can never disagree
76
+ * on which ids are essential. Hot-path correctness is on `createArchetype`'s
77
+ * side: misalignment between key and columns silently drops fields.
78
+ *
79
+ * @example
80
+ * foldEssentials([2, 5, 7]) // [componentId(Entity), 2, 5, 7]
81
+ * foldEssentials([componentId(Entity), 2, 5]) // [componentId(Entity), 2, 5]
82
+ * foldEssentials([componentId(Entity), componentId(Entity)]) // [componentId(Entity)]
83
+ * foldEssentials([]) // [componentId(Entity)]
84
+ */
85
+ export declare function foldEssentials(ids: ReadonlyArray<ComponentId>): ComponentId[];
86
+ //# sourceMappingURL=entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../src/entity.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,MAAM;;EAKjB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,iDAAkC,CAAC;AAExD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,uBAAuB,EAAE,aAAa,CAAC,WAAW,CAE7D,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,WAAW,EAAE,CAgB7E"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Returned via `Result.err` from `world.removeComponent` when the caller tries
3
+ * to remove an essential (undeletable) component
4
+ * (feat-20260602-archetype-stores-full-packed-entity M1 / w3, plan-strategy
5
+ * D-3). The only essential component today is the id=0 `Entity` component: every
6
+ * archetype carries it unconditionally as the row's own packed handle, so
7
+ * removing it is structurally meaningless. The code name is deliberately
8
+ * generic (`remove-essential-component`, not entity-specific) so a future second
9
+ * essential component reuses it without a rename.
10
+ *
11
+ * `.code = 'remove-essential-component'`
12
+ * `.detail = { componentName }`
13
+ * `.hint` — names the essential component + states it cannot be removed.
14
+ */
15
+ export declare class RemoveEssentialComponentError extends Error {
16
+ readonly name = "RemoveEssentialComponentError";
17
+ readonly code: "remove-essential-component";
18
+ readonly hint: string;
19
+ readonly expected: string;
20
+ readonly detail: {
21
+ readonly componentName: string;
22
+ };
23
+ constructor(componentName: string);
24
+ }
25
+ /**
26
+ * Returned via the `Result` err branch when `instantiate` encounters a
27
+ * SceneAsset entity whose `components` map references a component name that was
28
+ * never passed to `defineComponent`.
29
+ *
30
+ * `.code = 'component-not-defined'`
31
+ * `.detail.name` — the offending component name.
32
+ *
33
+ * Promoting this to a class (rather than a bare object literal) keeps the
34
+ * scene-instantiate failure surface inside the `EcsError` class union, so the
35
+ * documented two-level narrow `cause instanceof EcsError` actually matches it
36
+ * (docs/feedbacks/2026-06-03 §6.2 Tier 4.2). `expected` / `hint` accept
37
+ * per-call overrides because the parent-passthrough (ChildOf) site needs a
38
+ * distinct message from the generic entity-component site.
39
+ */
40
+ export declare class ComponentNotDefinedError extends Error {
41
+ readonly name = "ComponentNotDefinedError";
42
+ readonly code: "component-not-defined";
43
+ readonly hint: string;
44
+ readonly expected: string;
45
+ readonly detail: {
46
+ readonly name: string;
47
+ };
48
+ constructor(componentName: string, opts?: {
49
+ expected?: string;
50
+ hint?: string;
51
+ });
52
+ }
53
+ /**
54
+ * Returned via `Result.err` from `world.spawn` / `world.addComponent` /
55
+ * `world.instantiateScene` / `Commands.spawn` when the caller-supplied
56
+ * data payload carries a key that is not declared in the target component's
57
+ * schema. The pre-fix behaviour silently dropped unknown keys inside
58
+ * `fillComponentDefaults` (which walked schema keys, never raw keys), so a
59
+ * typo like `MeshRenderer { material: h }` (singular legacy field name; the
60
+ * current schema has `materials: array<...>`) produced an empty-defaults row
61
+ * + an invisible / mid-grey entity downstream. Surfacing the typo at the
62
+ * spawn boundary collapses a class of "renders wrong, looks like a graphics
63
+ * bug" reports into a single explicit error.
64
+ *
65
+ * `.code = 'spawn-data-unknown-field'`
66
+ * `.detail = { component, field, knownFields }`
67
+ * `.hint` — names the offending field and lists the schema's known fields.
68
+ */
69
+ export declare class SpawnDataUnknownFieldError extends Error {
70
+ readonly name = "SpawnDataUnknownFieldError";
71
+ readonly code: "spawn-data-unknown-field";
72
+ readonly hint: string;
73
+ readonly expected: string;
74
+ readonly detail: {
75
+ readonly component: string;
76
+ readonly field: string;
77
+ readonly knownFields: readonly string[];
78
+ };
79
+ constructor(componentName: string, fieldName: string, knownFields: readonly string[]);
80
+ }
81
+ export type QuerySpanUnavailableReason = 'optional-data' | 'row-change-filter' | 'sparse-component';
82
+ export declare class QueryDescriptorConflictError extends Error {
83
+ readonly name = "QueryDescriptorConflictError";
84
+ readonly code: "query-descriptor-conflict";
85
+ readonly expected = "each component occupies one descriptor role";
86
+ readonly hint: string;
87
+ readonly detail: {
88
+ readonly componentName: string;
89
+ readonly roles: readonly string[];
90
+ };
91
+ constructor(componentName: string, roles: readonly string[]);
92
+ }
93
+ export declare class QueryDataRequiresFieldsError extends Error {
94
+ readonly name = "QueryDataRequiresFieldsError";
95
+ readonly code: "query-data-requires-fields";
96
+ readonly expected = "a component with at least one data field";
97
+ readonly hint: string;
98
+ readonly detail: {
99
+ readonly componentName: string;
100
+ };
101
+ constructor(componentName: string);
102
+ }
103
+ export declare class QuerySpanUnavailableError extends Error {
104
+ readonly name = "QuerySpanUnavailableError";
105
+ readonly code: "query-span-unavailable";
106
+ readonly expected = "a descriptor whose rows form contiguous table ranges";
107
+ readonly hint = "Use row iteration or split the query.";
108
+ readonly detail: {
109
+ readonly reason: QuerySpanUnavailableReason;
110
+ };
111
+ constructor(reason: QuerySpanUnavailableReason);
112
+ }
113
+ export declare class QueryIterationInvalidatedError extends Error {
114
+ readonly name = "QueryIterationInvalidatedError";
115
+ readonly code: "query-iteration-invalidated";
116
+ readonly expected: string;
117
+ readonly hint = "Use deferred Commands for structural mutation, then restart iteration.";
118
+ readonly detail: {
119
+ readonly expectedStructureEpoch: number;
120
+ readonly actualStructureEpoch: number;
121
+ };
122
+ constructor(expectedStructureEpoch: number, actualStructureEpoch: number);
123
+ }
124
+ export declare class QueryIterationActiveError extends Error {
125
+ readonly name = "QueryIterationActiveError";
126
+ readonly code: "query-iteration-active";
127
+ readonly expected = "one active iterator per Query";
128
+ readonly hint = "Complete the active iterator or create an independent Query.";
129
+ readonly detail: {};
130
+ constructor();
131
+ }
132
+ //# sourceMappingURL=query-and-component-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-and-component-errors.d.ts","sourceRoot":"","sources":["../../src/errors/query-and-component-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;IACtD,SAAkB,IAAI,mCAAmC;IACzD,QAAQ,CAAC,IAAI,EAAG,4BAA4B,CAAU;IACtD,QAAQ,CAAC,IAAI,EA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,CAAC;QACxC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;KACvC,CAAC;gBAEU,sBAAsB,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM;CAQzE;AAED,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,SAAkB,IAAI,+BAA+B;IACrD,QAAQ,CAAC,IAAI,EAAG,wBAAwB,CAAU;IAClD,QAAQ,CAAC,QAAQ,mCAAmC;IACpD,QAAQ,CAAC,IAAI,kEAAkE;IAC/E,QAAQ,CAAC,MAAM,KAAM;;CAKtB"}
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Returned via `Result.err` from `world.addChild` / `world.reparent` (M3) when
3
+ * a hierarchy write would form a cycle — either the child is its own parent
4
+ * (self-loop) or the proposed parent is already a descendant of the child
5
+ * (ancestor-walk hit). The `.detail` carries both the offending child entity
6
+ * and the ancestor entity that closed the cycle so AI users can locate the
7
+ * loop without re-walking the graph.
8
+ *
9
+ * `.code = 'relationship-self-cycle'`
10
+ * `.detail = { component, entity, ancestor }`
11
+ * `.hint` — names the child + ancestor that would close the cycle.
12
+ */
13
+ export declare class RelationshipSelfCycleError extends Error {
14
+ readonly name = "RelationshipSelfCycleError";
15
+ readonly code: "relationship-self-cycle";
16
+ readonly hint: string;
17
+ readonly expected: string;
18
+ readonly detail: {
19
+ readonly component: string;
20
+ readonly entity: number;
21
+ readonly ancestor: number;
22
+ };
23
+ constructor(component: string, entity: number, ancestor: number);
24
+ }
25
+ /**
26
+ * Thrown by `defineComponent` (feat-20260602 M2) when a component declares a
27
+ * `relationship.mirror` naming a component that has not yet been defined
28
+ * (AC-09). AI users defineComponent the mirror before the holder (mirror-then-
29
+ * holder order).
30
+ *
31
+ * The `.code` literal `relationship-mirror-component-not-registered` is kept
32
+ * unchanged across the M2 migration (deliberate terminology trade-off:
33
+ * external `.code` stability over wording precision); only the `.hint` text
34
+ * drops the register/registered phrasing in favour of defineComponent ordering
35
+ * guidance.
36
+ *
37
+ * `.code = 'relationship-mirror-component-not-registered'`
38
+ * `.detail = { component, mirror }`
39
+ * `.hint` — names the holder + the undefined mirror component.
40
+ */
41
+ export declare class RelationshipMirrorComponentNotRegisteredError extends Error {
42
+ readonly name = "RelationshipMirrorComponentNotRegisteredError";
43
+ readonly code: "relationship-mirror-component-not-registered";
44
+ readonly hint: string;
45
+ readonly expected: string;
46
+ readonly detail: {
47
+ readonly component: string;
48
+ readonly mirror: string;
49
+ };
50
+ constructor(component: string, mirror: string);
51
+ }
52
+ /**
53
+ * Thrown by `defineComponent` (feat-20260602 M2) when the
54
+ * `relationship.field` on the mirror component is missing or its schema type
55
+ * is not the only legal back-reference storage shape `array<entity>`
56
+ * (AC-11 b). AI users declare the mirror field as `'array<entity>'`.
57
+ *
58
+ * `.code = 'relationship-mirror-field-type-mismatch'`
59
+ * `.detail = { component, mirror, field, actualType }`
60
+ * `.hint` — names the holder + mirror field + the type observed.
61
+ */
62
+ export declare class RelationshipMirrorFieldTypeMismatchError extends Error {
63
+ readonly name = "RelationshipMirrorFieldTypeMismatchError";
64
+ readonly code: "relationship-mirror-field-type-mismatch";
65
+ readonly hint: string;
66
+ readonly expected: string;
67
+ readonly detail: {
68
+ readonly component: string;
69
+ readonly mirror: string;
70
+ readonly field: string;
71
+ readonly actualType: string;
72
+ };
73
+ constructor(component: string, mirror: string, field: string, actualType: string);
74
+ }
75
+ /**
76
+ * Returned via `Result.err` from `world.removeChild` (M3) when the `parent`
77
+ * argument does not match the child's current relationship parent (the child
78
+ * lacks the relationship component, or it points at a different parent). The
79
+ * `.detail` carries the expected (argument) parent + the actual current parent
80
+ * so AI users can reconcile their model.
81
+ *
82
+ * `.code = 'relationship-detach-mismatch'`
83
+ * `.detail = { component, child, expectedParent, actualParent }`
84
+ * `actualParent === ENTITY_NULL_RAW` (0) signals the child has no relationship.
85
+ * `.hint` — names the child + the parent mismatch.
86
+ */
87
+ export declare class RelationshipDetachMismatchError extends Error {
88
+ readonly name = "RelationshipDetachMismatchError";
89
+ readonly code: "relationship-detach-mismatch";
90
+ readonly hint: string;
91
+ readonly expected: string;
92
+ readonly detail: {
93
+ readonly component: string;
94
+ readonly child: number;
95
+ readonly expectedParent: number;
96
+ readonly actualParent: number;
97
+ };
98
+ constructor(component: string, child: number, expectedParent: number, actualParent: number);
99
+ }
100
+ /** Returned when callers attempt to mutate an engine-maintained target list. */
101
+ export declare class RelationshipTargetReadonlyError extends Error {
102
+ readonly name = "RelationshipTargetReadonlyError";
103
+ readonly code: "component-field-invalid-value";
104
+ readonly expected = "relationship source mutation";
105
+ readonly hint: string;
106
+ readonly detail: {
107
+ readonly component: string;
108
+ readonly operation: string;
109
+ };
110
+ constructor(component: string, operation: string);
111
+ }
112
+ //# sourceMappingURL=relationship-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationship-errors.d.ts","sourceRoot":"","sources":["../../src/errors/relationship-errors.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;GAWG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,SAAkB,IAAI,gCAAgC;IACtD,QAAQ,CAAC,IAAI,EAAG,yBAAyB,CAAU;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE;QACf,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;KAC3B,CAAC;gBAEU,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAgBhE;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,6CAA8C,SAAQ,KAAK;IACtE,SAAkB,IAAI,mDAAmD;IACzE,QAAQ,CAAC,IAAI,EAAG,8CAA8C,CAAU;IACxE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CA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EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;CAiB3F;AAED,gFAAgF;AAChF,qBAAa,+BAAgC,SAAQ,KAAK;IACxD,SAAkB,IAAI,qCAAqC;IAC3D,QAAQ,CAAC,IAAI,EAAG,+BAA+B,CAAU;IACzD,QAAQ,CAAC,QAAQ,kCAAkC;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE;QACf,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;KAC5B,CAAC;gBAEU,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAMjD"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * feat-20260713-mount-override-component-add-and-shared-ref-round M2 / w9 —
3
+ * `.code = 'shared-field-invalid-value'`.
4
+ *
5
+ * A `shared<T>` scalar / `array<shared<T>>` element must be a resolved numeric
6
+ * Handle. A raw GUID string / `{ guid }` / `{ kind }` object (the
7
+ * pre-resolution shape a sidecar hands an AI user) used to be silently coerced
8
+ * to the all-zero sentinel by the column packer / scalar write path, so a
9
+ * mis-bound reference read back as `0` / `[0,0,0,0]` and rendered blank with no
10
+ * error. `validateComponentDataKeys` only checks key NAMES, not value types;
11
+ * this error closes the value-type gap at all three write entries
12
+ * (spawn / addComponent / set). `.detail.field` + `.detail.fieldType` name the
13
+ * offending field; `.detail.index` locates the array element (undefined for the
14
+ * scalar form).
15
+ *
16
+ * `.detail = { component, field, fieldType, actualValue, index? }`
17
+ * `.hint` — names the field and points at `AssetRegistry.load + allocSharedRef`.
18
+ */
19
+ export declare class SharedFieldInvalidValueError extends Error {
20
+ readonly name = "SharedFieldInvalidValueError";
21
+ readonly code: "shared-field-invalid-value";
22
+ readonly hint: string;
23
+ readonly expected: string;
24
+ readonly detail: {
25
+ readonly component: string;
26
+ readonly field: string;
27
+ readonly fieldType: string;
28
+ readonly actualValue: unknown;
29
+ readonly index?: number;
30
+ };
31
+ constructor(componentName: string, fieldName: string, fieldType: string, actualValue: unknown, index?: number);
32
+ }
33
+ /**
34
+ * Thrown / returned via Layer-3 error route when `SpriteInstances.transforms`
35
+ * (stride 16 — column-major mat4 per instance) and `SpriteInstances.regions`
36
+ * (stride 4 — per-instance UV vec4) instance counts disagree at render-system-
37
+ * extract entry.
38
+ *
39
+ * `.code = 'sprite-instances-count-mismatch'`
40
+ * `.detail = { transformsLength, regionsLength, expectedStride: { transforms: 16, regions: 4 } }`
41
+ * `.hint` — instructs the AI user to enforce
42
+ * `transforms.length / 16 === regions.length / 4`.
43
+ */
44
+ export declare class SpriteInstancesCountMismatchError extends Error {
45
+ readonly name = "SpriteInstancesCountMismatchError";
46
+ readonly code: "sprite-instances-count-mismatch";
47
+ readonly hint: string;
48
+ readonly expected: string;
49
+ readonly detail: {
50
+ readonly code: 'sprite-instances-count-mismatch';
51
+ readonly transformsLength: number;
52
+ readonly regionsLength: number;
53
+ readonly expectedStride: {
54
+ readonly transforms: 16;
55
+ readonly regions: 4;
56
+ };
57
+ };
58
+ constructor(transformsLength: number, regionsLength: number);
59
+ }
60
+ /**
61
+ * Thrown / returned via Layer-3 error route when an entity carrying
62
+ * `SpriteInstances` references a MaterialAsset whose first pass shader is not
63
+ * `'forgeax::sprite'`. Detected at render-system-extract entry (M3 w13).
64
+ *
65
+ * `.code = 'sprite-instances-requires-sprite-shader'`
66
+ * `.detail = { entityId, observedMaterialShaderId }`
67
+ * `.hint` — instructs the AI user to bind a MaterialAsset whose first pass
68
+ * `shader` is `'forgeax::sprite'` or `'forgeax::sprite-lit'`.
69
+ *
70
+ * feat-20260624-sprite-lit-shading-model-pure-2d-lighting M1' / t6:
71
+ * sprite-lit walks the same per-instance UV region vertex path as sprite
72
+ * (VsOut byte-identical, paramSchema mirror); both shader ids are accepted.
73
+ */
74
+ export declare class SpriteInstancesRequiresSpriteShaderError extends Error {
75
+ readonly name = "SpriteInstancesRequiresSpriteShaderError";
76
+ readonly code: "sprite-instances-requires-sprite-shader";
77
+ readonly hint: string;
78
+ readonly expected: string;
79
+ readonly detail: {
80
+ readonly code: 'sprite-instances-requires-sprite-shader';
81
+ readonly entityId: number;
82
+ readonly observedMaterialShaderId: string;
83
+ };
84
+ constructor(entityId: number, observedMaterialShaderId: string);
85
+ }
86
+ /**
87
+ * Thrown / returned via Layer-3 error route when the same entity carries both
88
+ * `Instances` (3D per-instance mat4) and `SpriteInstances` (2D per-instance
89
+ * mat4 + UV region). The two primitives are peers — pick one. Detected at
90
+ * render-system-extract entry (M3 w13).
91
+ *
92
+ * `.code = 'sprite-instances-mutually-exclusive-with-instances'`
93
+ * `.detail = { entityId }`
94
+ * `.hint` — instructs the AI user to remove one of the two components.
95
+ */
96
+ export declare class SpriteInstancesMutuallyExclusiveWithInstancesError extends Error {
97
+ readonly name = "SpriteInstancesMutuallyExclusiveWithInstancesError";
98
+ readonly code: "sprite-instances-mutually-exclusive-with-instances";
99
+ readonly hint: string;
100
+ readonly expected: string;
101
+ readonly detail: {
102
+ readonly code: 'sprite-instances-mutually-exclusive-with-instances';
103
+ readonly entityId: number;
104
+ };
105
+ constructor(entityId: number);
106
+ }
107
+ //# sourceMappingURL=sprite-and-shared-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sprite-and-shared-errors.d.ts","sourceRoot":"","sources":["../../src/errors/sprite-and-shared-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,SAAkB,IAAI,kCAAkC;IACxD,QAAQ,CAAC,IAAI,EAAG,4BAA4B,CAAU;IACtD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE;QACf,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,KAAK,EAAE,M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