@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.
- package/LICENSE +202 -0
- package/README.md +278 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/__fixtures__/field-shape-fixture.d.ts +16 -0
- package/dist/__fixtures__/field-shape-fixture.d.ts.map +1 -0
- package/dist/__tests__/__fixtures__/inspect-scripts.snapshot.d.ts +3 -0
- package/dist/__tests__/__fixtures__/inspect-scripts.snapshot.d.ts.map +1 -0
- package/dist/__tests__/archetype.unit.test.d.ts +2 -0
- package/dist/__tests__/archetype.unit.test.d.ts.map +1 -0
- package/dist/__tests__/array-handle-element.test-d.d.ts +2 -0
- package/dist/__tests__/array-handle-element.test-d.d.ts.map +1 -0
- package/dist/__tests__/buffer-array-vocab.test-d.d.ts +2 -0
- package/dist/__tests__/buffer-array-vocab.test-d.d.ts.map +1 -0
- package/dist/__tests__/buffer-field-input-widen.unit.test.d.ts +2 -0
- package/dist/__tests__/buffer-field-input-widen.unit.test.d.ts.map +1 -0
- package/dist/__tests__/buffer-pool.test-d.d.ts +2 -0
- package/dist/__tests__/buffer-pool.test-d.d.ts.map +1 -0
- package/dist/__tests__/change-detection.unit.test.d.ts +2 -0
- package/dist/__tests__/change-detection.unit.test.d.ts.map +1 -0
- package/dist/__tests__/command-buffer.test.d.ts +2 -0
- package/dist/__tests__/command-buffer.test.d.ts.map +1 -0
- package/dist/__tests__/commands-deferred.unit.test.d.ts +2 -0
- package/dist/__tests__/commands-deferred.unit.test.d.ts.map +1 -0
- package/dist/__tests__/component-catalog.test.d.ts +2 -0
- package/dist/__tests__/component-catalog.test.d.ts.map +1 -0
- package/dist/__tests__/component-definition-identity.unit.test.d.ts +2 -0
- package/dist/__tests__/component-definition-identity.unit.test.d.ts.map +1 -0
- package/dist/__tests__/component-nan-preflight.unit.test.d.ts +2 -0
- package/dist/__tests__/component-nan-preflight.unit.test.d.ts.map +1 -0
- package/dist/__tests__/component-schema.test-d.d.ts +2 -0
- package/dist/__tests__/component-schema.test-d.d.ts.map +1 -0
- package/dist/__tests__/component-schema.test.d.ts +2 -0
- package/dist/__tests__/component-schema.test.d.ts.map +1 -0
- package/dist/__tests__/define-component-options.test-d.d.ts +2 -0
- package/dist/__tests__/define-component-options.test-d.d.ts.map +1 -0
- package/dist/__tests__/deprecated-vocab-rejection.unit.test.d.ts +2 -0
- package/dist/__tests__/deprecated-vocab-rejection.unit.test.d.ts.map +1 -0
- package/dist/__tests__/despawn-all.unit.test.d.ts +2 -0
- package/dist/__tests__/despawn-all.unit.test.d.ts.map +1 -0
- package/dist/__tests__/ecs-core-reduction.characterization.test.d.ts +2 -0
- package/dist/__tests__/ecs-core-reduction.characterization.test.d.ts.map +1 -0
- package/dist/__tests__/ecs-core-reduction.perf.test.d.ts +2 -0
- package/dist/__tests__/ecs-core-reduction.perf.test.d.ts.map +1 -0
- package/dist/__tests__/ecs-error-code-31.test-d.d.ts +2 -0
- package/dist/__tests__/ecs-error-code-31.test-d.d.ts.map +1 -0
- package/dist/__tests__/entity-disabling.unit.test.d.ts +2 -0
- package/dist/__tests__/entity-disabling.unit.test.d.ts.map +1 -0
- package/dist/__tests__/entity-handle-codec-parity.unit.test.d.ts +2 -0
- package/dist/__tests__/entity-handle-codec-parity.unit.test.d.ts.map +1 -0
- package/dist/__tests__/errors.unit.test.d.ts +2 -0
- package/dist/__tests__/errors.unit.test.d.ts.map +1 -0
- package/dist/__tests__/execution-conflict-boundary.unit.test.d.ts +2 -0
- package/dist/__tests__/execution-conflict-boundary.unit.test.d.ts.map +1 -0
- package/dist/__tests__/execution-shared-storage.unit.test.d.ts +2 -0
- package/dist/__tests__/execution-shared-storage.unit.test.d.ts.map +1 -0
- package/dist/__tests__/externalization-portable-value.unit.test.d.ts +2 -0
- package/dist/__tests__/externalization-portable-value.unit.test.d.ts.map +1 -0
- package/dist/__tests__/externalization-projection.unit.test.d.ts +2 -0
- package/dist/__tests__/externalization-projection.unit.test.d.ts.map +1 -0
- package/dist/__tests__/externalization-render-read-lease.test-d.d.ts +2 -0
- package/dist/__tests__/externalization-render-read-lease.test-d.d.ts.map +1 -0
- package/dist/__tests__/externalization-render-read-lease.unit.test.d.ts +2 -0
- package/dist/__tests__/externalization-render-read-lease.unit.test.d.ts.map +1 -0
- package/dist/__tests__/externalization-root-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/externalization-root-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/field-enum-labels-reflection.test.d.ts +2 -0
- package/dist/__tests__/field-enum-labels-reflection.test.d.ts.map +1 -0
- package/dist/__tests__/field-shape-fixture.test.d.ts +2 -0
- package/dist/__tests__/field-shape-fixture.test.d.ts.map +1 -0
- package/dist/__tests__/field-transient-reflection.test.d.ts +2 -0
- package/dist/__tests__/field-transient-reflection.test.d.ts.map +1 -0
- package/dist/__tests__/field-value-type.test-d.d.ts +2 -0
- package/dist/__tests__/field-value-type.test-d.d.ts.map +1 -0
- package/dist/__tests__/fixed-update.unit.test.d.ts +2 -0
- package/dist/__tests__/fixed-update.unit.test.d.ts.map +1 -0
- package/dist/__tests__/handle.test-d.d.ts +2 -0
- package/dist/__tests__/handle.test-d.d.ts.map +1 -0
- package/dist/__tests__/hierarchy.unit.test.d.ts +2 -0
- package/dist/__tests__/hierarchy.unit.test.d.ts.map +1 -0
- package/dist/__tests__/managed-array-vocab.test-d.d.ts +2 -0
- package/dist/__tests__/managed-array-vocab.test-d.d.ts.map +1 -0
- package/dist/__tests__/minimal-example.test-d.d.ts +2 -0
- package/dist/__tests__/minimal-example.test-d.d.ts.map +1 -0
- package/dist/__tests__/name-read-types.test-d.d.ts +2 -0
- package/dist/__tests__/name-read-types.test-d.d.ts.map +1 -0
- package/dist/__tests__/plugin-service.test.d.ts +2 -0
- package/dist/__tests__/plugin-service.test.d.ts.map +1 -0
- package/dist/__tests__/query-combinations.unit.test.d.ts +2 -0
- package/dist/__tests__/query-combinations.unit.test.d.ts.map +1 -0
- package/dist/__tests__/query-light-extract-flat-column-ratio.perf.test.d.ts +2 -0
- package/dist/__tests__/query-light-extract-flat-column-ratio.perf.test.d.ts.map +1 -0
- package/dist/__tests__/query-storage-trends.perf.test.d.ts +2 -0
- package/dist/__tests__/query-storage-trends.perf.test.d.ts.map +1 -0
- package/dist/__tests__/query-trs-flat-column-ratio.perf.test.d.ts +2 -0
- package/dist/__tests__/query-trs-flat-column-ratio.perf.test.d.ts.map +1 -0
- package/dist/__tests__/query.unit.test.d.ts +2 -0
- package/dist/__tests__/query.unit.test.d.ts.map +1 -0
- package/dist/__tests__/relationship-index.perf.test.d.ts +2 -0
- package/dist/__tests__/relationship-index.perf.test.d.ts.map +1 -0
- package/dist/__tests__/relationship-index.test.d.ts +2 -0
- package/dist/__tests__/relationship-index.test.d.ts.map +1 -0
- package/dist/__tests__/scalar-field-type-owner.test-d.d.ts +2 -0
- package/dist/__tests__/scalar-field-type-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/schedule-determinism.unit.test.d.ts +2 -0
- package/dist/__tests__/schedule-determinism.unit.test.d.ts.map +1 -0
- package/dist/__tests__/schedule-inspection.unit.test.d.ts +2 -0
- package/dist/__tests__/schedule-inspection.unit.test.d.ts.map +1 -0
- package/dist/__tests__/schedule-scope-error.unit.test.d.ts +2 -0
- package/dist/__tests__/schedule-scope-error.unit.test.d.ts.map +1 -0
- package/dist/__tests__/schedule-token.unit.test.d.ts +2 -0
- package/dist/__tests__/schedule-token.unit.test.d.ts.map +1 -0
- package/dist/__tests__/schema-vocab.test-d.d.ts +2 -0
- package/dist/__tests__/schema-vocab.test-d.d.ts.map +1 -0
- package/dist/__tests__/serialization.unit.test.d.ts +2 -0
- package/dist/__tests__/serialization.unit.test.d.ts.map +1 -0
- package/dist/__tests__/shared-kernel-eligibility.test-d.d.ts +2 -0
- package/dist/__tests__/shared-kernel-eligibility.test-d.d.ts.map +1 -0
- package/dist/__tests__/shared-kernel-eligibility.unit.test.d.ts +2 -0
- package/dist/__tests__/shared-kernel-eligibility.unit.test.d.ts.map +1 -0
- package/dist/__tests__/shared-ref-store.unit.test.d.ts +2 -0
- package/dist/__tests__/shared-ref-store.unit.test.d.ts.map +1 -0
- package/dist/__tests__/sparse-tag.unit.test.d.ts +2 -0
- package/dist/__tests__/sparse-tag.unit.test.d.ts.map +1 -0
- package/dist/__tests__/spawn-field-error.test-d.d.ts +2 -0
- package/dist/__tests__/spawn-field-error.test-d.d.ts.map +1 -0
- package/dist/__tests__/stale-error.test-d.d.ts +2 -0
- package/dist/__tests__/stale-error.test-d.d.ts.map +1 -0
- package/dist/__tests__/string-view-symmetry.test-d.d.ts +2 -0
- package/dist/__tests__/string-view-symmetry.test-d.d.ts.map +1 -0
- package/dist/__tests__/string-vocab.test-d.d.ts +2 -0
- package/dist/__tests__/string-vocab.test-d.d.ts.map +1 -0
- package/dist/__tests__/structure-epoch-boundaries.unit.test.d.ts +2 -0
- package/dist/__tests__/structure-epoch-boundaries.unit.test.d.ts.map +1 -0
- package/dist/__tests__/structure-epoch.unit.test.d.ts +2 -0
- package/dist/__tests__/structure-epoch.unit.test.d.ts.map +1 -0
- package/dist/__tests__/table-archetype-mapping.unit.test.d.ts +2 -0
- package/dist/__tests__/table-archetype-mapping.unit.test.d.ts.map +1 -0
- package/dist/__tests__/time.unit.test.d.ts +2 -0
- package/dist/__tests__/time.unit.test.d.ts.map +1 -0
- package/dist/__tests__/types.test-d.d.ts +2 -0
- package/dist/__tests__/types.test-d.d.ts.map +1 -0
- package/dist/__tests__/unique-ref-store.unit.test.d.ts +2 -0
- package/dist/__tests__/unique-ref-store.unit.test.d.ts.map +1 -0
- package/dist/__tests__/utils/handle-numeric.d.ts +14 -0
- package/dist/__tests__/utils/handle-numeric.d.ts.map +1 -0
- package/dist/__tests__/validation-root-surface.unit.test.d.ts +2 -0
- package/dist/__tests__/validation-root-surface.unit.test.d.ts.map +1 -0
- package/dist/__tests__/visibility-atomic-write.unit.test.d.ts +2 -0
- package/dist/__tests__/visibility-atomic-write.unit.test.d.ts.map +1 -0
- package/dist/__tests__/world-change-journal.unit.test.d.ts +2 -0
- package/dist/__tests__/world-change-journal.unit.test.d.ts.map +1 -0
- package/dist/__tests__/world-characterization.unit.test.d.ts +2 -0
- package/dist/__tests__/world-characterization.unit.test.d.ts.map +1 -0
- package/dist/__tests__/world-consumer-inference.test-d.d.ts +2 -0
- package/dist/__tests__/world-consumer-inference.test-d.d.ts.map +1 -0
- package/dist/__tests__/world-health.contract.test.d.ts +2 -0
- package/dist/__tests__/world-health.contract.test.d.ts.map +1 -0
- package/dist/__tests__/world-inspection.test.d.ts +2 -0
- package/dist/__tests__/world-inspection.test.d.ts.map +1 -0
- package/dist/__tests__/world-internal-identity.unit.test.d.ts +2 -0
- package/dist/__tests__/world-internal-identity.unit.test.d.ts.map +1 -0
- package/dist/__tests__/world-managed-roundtrip.unit.test.d.ts +2 -0
- package/dist/__tests__/world-managed-roundtrip.unit.test.d.ts.map +1 -0
- package/dist/__tests__/world-scheduling.m4.test.d.ts +2 -0
- package/dist/__tests__/world-scheduling.m4.test.d.ts.map +1 -0
- package/dist/__tests__/world-unique-roundtrip.unit.test.d.ts +2 -0
- package/dist/__tests__/world-unique-roundtrip.unit.test.d.ts.map +1 -0
- package/dist/__tests__/world.test-d.d.ts +2 -0
- package/dist/__tests__/world.test-d.d.ts.map +1 -0
- package/dist/buffer-pool.d.ts +109 -0
- package/dist/buffer-pool.d.ts.map +1 -0
- package/dist/commands.d.ts +93 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/component-default-fallback.d.ts +88 -0
- package/dist/component-default-fallback.d.ts.map +1 -0
- package/dist/component-schema.d.ts +34 -0
- package/dist/component-schema.d.ts.map +1 -0
- package/dist/component-value-validate.d.ts +29 -0
- package/dist/component-value-validate.d.ts.map +1 -0
- package/dist/component.d.ts +581 -0
- package/dist/component.d.ts.map +1 -0
- package/dist/entity-handle.d.ts +68 -0
- package/dist/entity-handle.d.ts.map +1 -0
- package/dist/entity.d.ts +86 -0
- package/dist/entity.d.ts.map +1 -0
- package/dist/errors/query-and-component-errors.d.ts +132 -0
- package/dist/errors/query-and-component-errors.d.ts.map +1 -0
- package/dist/errors/relationship-errors.d.ts +112 -0
- package/dist/errors/relationship-errors.d.ts.map +1 -0
- package/dist/errors/sprite-and-shared-errors.d.ts +107 -0
- package/dist/errors/sprite-and-shared-errors.d.ts.map +1 -0
- package/dist/errors/validation-errors.d.ts +229 -0
- package/dist/errors/validation-errors.d.ts.map +1 -0
- package/dist/errors.d.ts +763 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/execution/shared-kernel.d.ts +106 -0
- package/dist/execution/shared-kernel.d.ts.map +1 -0
- package/dist/externalization/index.d.ts +31 -0
- package/dist/externalization/index.d.ts.map +1 -0
- package/dist/externalization/index.mjs +298 -0
- package/dist/externalization/index.mjs.map +1 -0
- package/dist/index.d.ts +261 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +7422 -0
- package/dist/index.mjs.map +1 -0
- package/dist/internal.mjs +479 -0
- package/dist/internal.mjs.map +1 -0
- package/dist/plugin-service.d.ts +11 -0
- package/dist/plugin-service.d.ts.map +1 -0
- package/dist/projection/index.d.ts +103 -0
- package/dist/projection/index.d.ts.map +1 -0
- package/dist/projection/index.mjs +615 -0
- package/dist/projection/index.mjs.map +1 -0
- package/dist/query/query.d.ts +58 -0
- package/dist/query/query.d.ts.map +1 -0
- package/dist/relationship-index.d.ts +81 -0
- package/dist/relationship-index.d.ts.map +1 -0
- package/dist/resource.d.ts +70 -0
- package/dist/resource.d.ts.map +1 -0
- package/dist/schedule-token.d.ts +16 -0
- package/dist/schedule-token.d.ts.map +1 -0
- package/dist/schedule.d.ts +271 -0
- package/dist/schedule.d.ts.map +1 -0
- package/dist/shared-ref-store.d.ts +144 -0
- package/dist/shared-ref-store.d.ts.map +1 -0
- package/dist/shared.d.ts +3 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.mjs +364 -0
- package/dist/shared.mjs.map +1 -0
- package/dist/storage/archetype-graph.d.ts +54 -0
- package/dist/storage/archetype-graph.d.ts.map +1 -0
- package/dist/storage/archetype.d.ts +23 -0
- package/dist/storage/archetype.d.ts.map +1 -0
- package/dist/storage/change-detection.d.ts +40 -0
- package/dist/storage/change-detection.d.ts.map +1 -0
- package/dist/storage/column.d.ts +111 -0
- package/dist/storage/column.d.ts.map +1 -0
- package/dist/storage/table.d.ts +29 -0
- package/dist/storage/table.d.ts.map +1 -0
- package/dist/time.d.ts +57 -0
- package/dist/time.d.ts.map +1 -0
- package/dist/unique-ref-store.d.ts +105 -0
- package/dist/unique-ref-store.d.ts.map +1 -0
- package/dist/world-change-journal.d.ts +34 -0
- package/dist/world-change-journal.d.ts.map +1 -0
- package/dist/world-component-access.d.ts +265 -0
- package/dist/world-component-access.d.ts.map +1 -0
- package/dist/world-component-storage.d.ts +282 -0
- package/dist/world-component-storage.d.ts.map +1 -0
- package/dist/world-core.d.ts +39 -0
- package/dist/world-core.d.ts.map +1 -0
- package/dist/world-entity-lifecycle.d.ts +30 -0
- package/dist/world-entity-lifecycle.d.ts.map +1 -0
- package/dist/world-internal.d.ts +14 -0
- package/dist/world-internal.d.ts.map +1 -0
- package/dist/world-scheduling.d.ts +30 -0
- package/dist/world-scheduling.d.ts.map +1 -0
- package/dist/world.d.ts +620 -0
- package/dist/world.d.ts.map +1 -0
- package/package.json +77 -0
- package/src/__fixtures__/field-shape-fixture.ts +30 -0
- package/src/__tests__/__fixtures__/inspect-scripts.snapshot.ts +2 -0
- package/src/__tests__/archetype.unit.test.ts +1837 -0
- package/src/__tests__/array-handle-element.test-d.ts +34 -0
- package/src/__tests__/buffer-array-vocab.test-d.ts +53 -0
- package/src/__tests__/buffer-field-input-widen.unit.test.ts +99 -0
- package/src/__tests__/buffer-pool.test-d.ts +32 -0
- package/src/__tests__/change-detection.unit.test.ts +86 -0
- package/src/__tests__/command-buffer.test.ts +179 -0
- package/src/__tests__/commands-deferred.unit.test.ts +68 -0
- package/src/__tests__/component-catalog.test.ts +59 -0
- package/src/__tests__/component-definition-identity.unit.test.ts +24 -0
- package/src/__tests__/component-nan-preflight.unit.test.ts +186 -0
- package/src/__tests__/component-schema.test-d.ts +119 -0
- package/src/__tests__/component-schema.test.ts +55 -0
- package/src/__tests__/define-component-options.test-d.ts +35 -0
- package/src/__tests__/deprecated-vocab-rejection.unit.test.ts +59 -0
- package/src/__tests__/despawn-all.unit.test.ts +17 -0
- package/src/__tests__/ecs-core-reduction.characterization.test.ts +130 -0
- package/src/__tests__/ecs-core-reduction.perf.test.ts +260 -0
- package/src/__tests__/ecs-error-code-31.test-d.ts +42 -0
- package/src/__tests__/entity-disabling.unit.test.ts +37 -0
- package/src/__tests__/entity-handle-codec-parity.unit.test.ts +126 -0
- package/src/__tests__/errors.unit.test.ts +1456 -0
- package/src/__tests__/execution-conflict-boundary.unit.test.ts +123 -0
- package/src/__tests__/execution-shared-storage.unit.test.ts +40 -0
- package/src/__tests__/externalization-portable-value.unit.test.ts +275 -0
- package/src/__tests__/externalization-projection.unit.test.ts +325 -0
- package/src/__tests__/externalization-render-read-lease.test-d.ts +30 -0
- package/src/__tests__/externalization-render-read-lease.unit.test.ts +79 -0
- package/src/__tests__/externalization-root-surface.unit.test.ts +33 -0
- package/src/__tests__/field-enum-labels-reflection.test.ts +66 -0
- package/src/__tests__/field-shape-fixture.test.ts +61 -0
- package/src/__tests__/field-transient-reflection.test.ts +59 -0
- package/src/__tests__/field-value-type.test-d.ts +57 -0
- package/src/__tests__/fixed-update.unit.test.ts +78 -0
- package/src/__tests__/handle.test-d.ts +86 -0
- package/src/__tests__/hierarchy.unit.test.ts +2534 -0
- package/src/__tests__/managed-array-vocab.test-d.ts +137 -0
- package/src/__tests__/minimal-example.test-d.ts +42 -0
- package/src/__tests__/name-read-types.test-d.ts +72 -0
- package/src/__tests__/plugin-service.test.ts +13 -0
- package/src/__tests__/query-combinations.unit.test.ts +42 -0
- package/src/__tests__/query-light-extract-flat-column-ratio.perf.test.ts +252 -0
- package/src/__tests__/query-storage-trends.perf.test.ts +104 -0
- package/src/__tests__/query-trs-flat-column-ratio.perf.test.ts +194 -0
- package/src/__tests__/query.unit.test.ts +196 -0
- package/src/__tests__/relationship-index.perf.test.ts +126 -0
- package/src/__tests__/relationship-index.test.ts +70 -0
- package/src/__tests__/scalar-field-type-owner.test-d.ts +71 -0
- package/src/__tests__/schedule-determinism.unit.test.ts +36 -0
- package/src/__tests__/schedule-inspection.unit.test.ts +81 -0
- package/src/__tests__/schedule-scope-error.unit.test.ts +63 -0
- package/src/__tests__/schedule-token.unit.test.ts +54 -0
- package/src/__tests__/schema-vocab.test-d.ts +103 -0
- package/src/__tests__/serialization.unit.test.ts +2740 -0
- package/src/__tests__/shared-kernel-eligibility.test-d.ts +18 -0
- package/src/__tests__/shared-kernel-eligibility.unit.test.ts +78 -0
- package/src/__tests__/shared-ref-store.unit.test.ts +646 -0
- package/src/__tests__/sparse-tag.unit.test.ts +201 -0
- package/src/__tests__/spawn-field-error.test-d.ts +41 -0
- package/src/__tests__/stale-error.test-d.ts +208 -0
- package/src/__tests__/string-view-symmetry.test-d.ts +26 -0
- package/src/__tests__/string-vocab.test-d.ts +49 -0
- package/src/__tests__/structure-epoch-boundaries.unit.test.ts +39 -0
- package/src/__tests__/structure-epoch.unit.test.ts +48 -0
- package/src/__tests__/table-archetype-mapping.unit.test.ts +78 -0
- package/src/__tests__/time.unit.test.ts +79 -0
- package/src/__tests__/types.test-d.ts +38 -0
- package/src/__tests__/unique-ref-store.unit.test.ts +348 -0
- package/src/__tests__/utils/handle-numeric.ts +30 -0
- package/src/__tests__/validation-root-surface.unit.test.ts +15 -0
- package/src/__tests__/visibility-atomic-write.unit.test.ts +82 -0
- package/src/__tests__/world-change-journal.unit.test.ts +97 -0
- package/src/__tests__/world-characterization.unit.test.ts +408 -0
- package/src/__tests__/world-consumer-inference.test-d.ts +16 -0
- package/src/__tests__/world-health.contract.test.ts +87 -0
- package/src/__tests__/world-inspection.test.ts +37 -0
- package/src/__tests__/world-internal-identity.unit.test.ts +17 -0
- package/src/__tests__/world-managed-roundtrip.unit.test.ts +98 -0
- package/src/__tests__/world-scheduling.m4.test.ts +52 -0
- package/src/__tests__/world-unique-roundtrip.unit.test.ts +357 -0
- package/src/__tests__/world.test-d.ts +156 -0
- package/src/buffer-pool.ts +357 -0
- package/src/commands.ts +644 -0
- package/src/component-default-fallback.ts +236 -0
- package/src/component-schema.ts +92 -0
- package/src/component-value-validate.ts +135 -0
- package/src/component.ts +1268 -0
- package/src/entity-handle.ts +104 -0
- package/src/entity.ts +140 -0
- package/src/errors/query-and-component-errors.ts +200 -0
- package/src/errors/relationship-errors.ts +198 -0
- package/src/errors/sprite-and-shared-errors.ts +231 -0
- package/src/errors/validation-errors.ts +506 -0
- package/src/errors.ts +1464 -0
- package/src/execution/shared-kernel.ts +392 -0
- package/src/externalization/index.ts +170 -0
- package/src/index.ts +414 -0
- package/src/plugin-service.ts +35 -0
- package/src/projection/index.ts +318 -0
- package/src/query/query.ts +606 -0
- package/src/relationship-index.ts +175 -0
- package/src/resource.ts +106 -0
- package/src/schedule-token.ts +40 -0
- package/src/schedule.ts +846 -0
- package/src/shared-ref-store.ts +418 -0
- package/src/shared.ts +23 -0
- package/src/storage/archetype-graph.ts +166 -0
- package/src/storage/archetype.ts +78 -0
- package/src/storage/change-detection.ts +231 -0
- package/src/storage/column.ts +247 -0
- package/src/storage/table.ts +153 -0
- package/src/time.ts +122 -0
- package/src/unique-ref-store.ts +278 -0
- package/src/world-change-journal.ts +84 -0
- package/src/world-component-access.ts +1421 -0
- package/src/world-component-storage.ts +1178 -0
- package/src/world-core.ts +74 -0
- package/src/world-entity-lifecycle.ts +539 -0
- package/src/world-internal.ts +75 -0
- package/src/world-scheduling.ts +499 -0
- package/src/world.ts +1399 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import type { BufferPool } from './buffer-pool';
|
|
2
|
+
import { type ArrayMeta, type Component, type ComponentSchema, type ManagedArrayElementType, type ShapeOf } from './component';
|
|
3
|
+
import { type EntityHandle } from './entity-handle';
|
|
4
|
+
import type { ManagedArrayErrorEnvelope } from './errors';
|
|
5
|
+
type ErrorContext = {
|
|
6
|
+
readonly systemName: string;
|
|
7
|
+
};
|
|
8
|
+
import type { SharedRefStore } from './shared-ref-store';
|
|
9
|
+
import { type Archetype } from './storage/archetype';
|
|
10
|
+
import { type ArchetypeGraph } from './storage/archetype-graph';
|
|
11
|
+
import { type FieldView } from './storage/column';
|
|
12
|
+
import type { UniqueRefStore } from './unique-ref-store';
|
|
13
|
+
import type { EntityRecord } from './world';
|
|
14
|
+
export interface ComponentStorageState {
|
|
15
|
+
readonly graph: ArchetypeGraph;
|
|
16
|
+
readonly records: EntityRecord[];
|
|
17
|
+
readonly bufferPool: BufferPool;
|
|
18
|
+
readonly uniqueRefs: UniqueRefStore;
|
|
19
|
+
readonly sharedRefs: SharedRefStore;
|
|
20
|
+
routeError(err: unknown, ctx: ErrorContext): void;
|
|
21
|
+
}
|
|
22
|
+
export declare class ComponentStorage {
|
|
23
|
+
private readonly state;
|
|
24
|
+
constructor(state: ComponentStorageState);
|
|
25
|
+
private get records();
|
|
26
|
+
private table;
|
|
27
|
+
private get bufferPool();
|
|
28
|
+
private get uniqueRefs();
|
|
29
|
+
private get sharedRefs();
|
|
30
|
+
private routeError;
|
|
31
|
+
readArrayView(arch: Archetype, component: Component, row: number, fieldName: string): FieldView | undefined;
|
|
32
|
+
readRow<S extends ComponentSchema>(arch: Archetype, component: Component<string, S>, row: number): ShapeOf<S>;
|
|
33
|
+
/**
|
|
34
|
+
* Write the full packed entity handle into the row's essential id=0 `Entity`
|
|
35
|
+
* column (`self` field). Called by `spawn` / `_materializePendingEntity`
|
|
36
|
+
* after the row is appended (feat-20260602 / plan-strategy D-3). The column
|
|
37
|
+
* always exists -- `createArchetype` folds the Entity column into every
|
|
38
|
+
* archetype -- so this is a direct u32 store, no readRow/writeRow walk.
|
|
39
|
+
*/
|
|
40
|
+
writeEntitySelf(arch: Archetype, row: number, handle: EntityHandle): void;
|
|
41
|
+
writeRow<S extends ComponentSchema>(arch: Archetype, component: Component<string, S>, row: number, value: ShapeOf<S>): void;
|
|
42
|
+
/**
|
|
43
|
+
* Release every managed-resource field on `component` for the row at
|
|
44
|
+
* `row` in `arch`. Walks the schema once and delegates each field to
|
|
45
|
+
* `releaseManagedFieldOnRow` (feat-20260614 M2 SSOT). Family coverage
|
|
46
|
+
* (per-field) lives in that helper's JSDoc.
|
|
47
|
+
*
|
|
48
|
+
* Naming note (D-6 whitelist): the prefix `managed` here means
|
|
49
|
+
* `managed = ECS-tracked` — i.e. fields whose lifecycle the ECS
|
|
50
|
+
* actively releases on despawn / overwrite / removeComponent. It does
|
|
51
|
+
* NOT refer to the retired `'managed' | 'unmanaged'` Handle brand
|
|
52
|
+
* (renamed to `'unique' | 'shared'` in feat-20260614 M1). The helper
|
|
53
|
+
* walks BOTH `'unique<T>'` and `'shared<T>'` fields because both are
|
|
54
|
+
* ECS-tracked from the column's perspective; the per-field dispatch
|
|
55
|
+
* inside `releaseManagedFieldOnRow` distinguishes drop-on-despawn
|
|
56
|
+
* (unique) vs ref-counted release (shared).
|
|
57
|
+
*
|
|
58
|
+
* Skips sentinel slots (handle / id 0) and missing stores. Failures
|
|
59
|
+
* (double release / lookup mismatch) route to the Layer 3 ErrorHandler so
|
|
60
|
+
* the despawn / removeComponent chain never aborts (charter: explicit-
|
|
61
|
+
* failure boundary; the chain is total).
|
|
62
|
+
*
|
|
63
|
+
* Four release paths route through this helper (AC-11, plan §6 M2):
|
|
64
|
+
* 1. `world.despawn(e)` - every component on `e`.
|
|
65
|
+
* 2. `world.removeComponent(e, C)` - the removed component only.
|
|
66
|
+
* 3. `world.set` ref/string/buffer overwrite - per-field, before the new
|
|
67
|
+
* value lands in the column.
|
|
68
|
+
* 4. `writeArrayField` set arm prior-slot release (variable array<T>).
|
|
69
|
+
*
|
|
70
|
+
* After feat-20260614 M2 SSOT collapse the schema-field 3-arm dispatch
|
|
71
|
+
* lives in `releaseManagedFieldOnRow` (one site); this method walks the
|
|
72
|
+
* component schema and delegates per field.
|
|
73
|
+
*
|
|
74
|
+
* BufferPool slot id is reusable post-release: same-bucket free-list LIFO
|
|
75
|
+
* (D-7) returns the freed id on the next `alloc(byteLength)`. Tests:
|
|
76
|
+
* `__tests__/managed-array-release.test.ts` (w10) +
|
|
77
|
+
* `__tests__/world-managed-roundtrip.unit.test.ts` (w3 net-zero matrix).
|
|
78
|
+
*/
|
|
79
|
+
releaseManagedRefsOnRow(arch: Archetype, component: Component, row: number): void;
|
|
80
|
+
/**
|
|
81
|
+
* SSOT release dispatch for a single managed field on a row (feat-20260614
|
|
82
|
+
* M2 / D-2). Inspects the component schema's field type and routes to the
|
|
83
|
+
* matching release path:
|
|
84
|
+
*
|
|
85
|
+
* - `'unique<T>'` / `'string'` (`isManagedField`) — release the
|
|
86
|
+
* UniqueRefStore handle u32 stored in the column.
|
|
87
|
+
* - `'buffer'` variable (`isManagedBufferField`) — release the
|
|
88
|
+
* BufferPool slot id stored in the column. Fixed `'buffer<N>'` is
|
|
89
|
+
* inline stride-N (feat-20260602) and has no slot to release.
|
|
90
|
+
* - `array<T>` variable (`isManagedArrayField`) — release the
|
|
91
|
+
* BufferPool slot id in the primary column + zero the column and the
|
|
92
|
+
* `<fieldName>:count` sidecar so post-recycle reads observe count=0
|
|
93
|
+
* (defense-in-depth; the swap-pop row migration overwrites both
|
|
94
|
+
* columns anyway). Fixed `array<T,N>` is inline stride-N — nothing to
|
|
95
|
+
* release.
|
|
96
|
+
*
|
|
97
|
+
* Sentinel handle / slot id 0 short-circuits silently. Double-release /
|
|
98
|
+
* lookup mismatch routes via Layer 3 ErrorHandler so the despawn /
|
|
99
|
+
* removeComponent / set chain never aborts (charter explicit-failure
|
|
100
|
+
* boundary; the chain is total).
|
|
101
|
+
*
|
|
102
|
+
* SceneInstance state alloc/release rollback at world.ts:3494/3522 stays
|
|
103
|
+
* a direct `uniqueRefs.release(stateRef)` (research Finding 1.8 / D-5):
|
|
104
|
+
* those two sites are alloc-pair rollback, not schema-field dispatch.
|
|
105
|
+
*
|
|
106
|
+
* Naming note (D-6 whitelist): `releaseManagedFieldOnRow` uses
|
|
107
|
+
* `managed = ECS-tracked` — every field family this dispatcher knows
|
|
108
|
+
* (`'unique<T>'`, `'shared<T>'`, `'string'`, variable `'buffer'`,
|
|
109
|
+
* variable `'array<T>'`) is one whose lifecycle the ECS owns. The
|
|
110
|
+
* `'managed' | 'unmanaged'` Handle brand is gone (M1 renamed to
|
|
111
|
+
* `'unique' | 'shared'`); the helper name was deliberately kept
|
|
112
|
+
* because `managed` here is a column-side semantic, not a brand label.
|
|
113
|
+
*/
|
|
114
|
+
releaseManagedFieldOnRow(arch: Archetype, component: Component, row: number, fieldName: string): void;
|
|
115
|
+
/**
|
|
116
|
+
* Release a single managed handle u32. Routes failures through Layer 3.
|
|
117
|
+
* Slot-0 sentinel short-circuits silently (no error); already-released
|
|
118
|
+
* slots surface `unique-ref-double-release` through the ErrorHandler so
|
|
119
|
+
* AI users see the structured payload (`.code` / `.hint` / `.expected` /
|
|
120
|
+
* `.detail`) - charter explicit-failure boundary.
|
|
121
|
+
*
|
|
122
|
+
* Helper-internal only after feat-20260614 M2 (AC-03 grep gate). External
|
|
123
|
+
* callers route via `releaseManagedFieldOnRow`.
|
|
124
|
+
*/
|
|
125
|
+
releaseManagedRefHandle(handleU32: number, componentName: string, fieldName: string): void;
|
|
126
|
+
/**
|
|
127
|
+
* Release a single shared-ref handle u32 (feat-20260614 M4 / AC-08).
|
|
128
|
+
* Decrements the SharedRefStore refcount; the slot drops on rc 1 -> 0.
|
|
129
|
+
* Slot-0 sentinel short-circuits silently. Already-released slots route
|
|
130
|
+
* `shared-ref-double-release` through Layer 3 ErrorHandler so AI users
|
|
131
|
+
* see structured payloads (charter explicit-failure boundary).
|
|
132
|
+
*
|
|
133
|
+
* Mirrors `releaseManagedRefHandle` in shape; the store + error code are
|
|
134
|
+
* the only differences. Helper-internal — external callers route via
|
|
135
|
+
* `releaseManagedFieldOnRow` (D-2 SSOT).
|
|
136
|
+
*/
|
|
137
|
+
releaseSharedRefHandle(handleU32: number, componentName: string, fieldName: string): void;
|
|
138
|
+
/**
|
|
139
|
+
* Retain a single `shared<T>` scalar slot id (feat-20260614 M5 / D-5).
|
|
140
|
+
* Mirrors `releaseSharedRefHandle`; called from spawn / set scalar write
|
|
141
|
+
* paths so each ECS holder participates in the SharedRefStore rc.
|
|
142
|
+
* Sentinel slot 0 is a no-op. Failures (handle already released) route
|
|
143
|
+
* via Layer 3 ErrorHandler so the spawn / set chain stays total.
|
|
144
|
+
*/
|
|
145
|
+
retainSharedScalarHandle(handleU32: number, componentName: string, fieldName: string): void;
|
|
146
|
+
/**
|
|
147
|
+
* Release a single managed buffer slot id. Routes failures through Layer 3.
|
|
148
|
+
* Slot id 0 (sentinel for unallocated buffer fields) short-circuits
|
|
149
|
+
* silently. M2 v1 release surface is total - `BufferPool.release` returns
|
|
150
|
+
* `Result<void, never>` for unknown ids, so the chain stays noise-free.
|
|
151
|
+
*
|
|
152
|
+
* Helper-internal only after feat-20260614 M2 (AC-03 grep gate). External
|
|
153
|
+
* callers route via `releaseManagedFieldOnRow`.
|
|
154
|
+
*/
|
|
155
|
+
releaseManagedBufferSlot(slotId: number, componentName: string, fieldName: string): void;
|
|
156
|
+
/**
|
|
157
|
+
* Bridge a Layer-3 ErrorHandler call from a `ManagedArrayErrorEnvelope`.
|
|
158
|
+
* The envelope shape (`code / hint / expected / detail`) already mirrors
|
|
159
|
+
* the EcsError contract; this helper only attaches the systemName context
|
|
160
|
+
* so AI users can correlate the error with the holder component / field.
|
|
161
|
+
*/
|
|
162
|
+
routeArrayError(err: ManagedArrayErrorEnvelope, componentName: string, fieldName: string): void;
|
|
163
|
+
/**
|
|
164
|
+
* Write the value of an `array<T>` / `array<T,N>` field at `row` (D-3 +
|
|
165
|
+
/**
|
|
166
|
+
* Write an `array<T>` / `array<T,N>` field's payload at `row` (M1 / w7,
|
|
167
|
+
* D-1; feat-20260614 M2 / D-3). Spawn and set both delegate here without
|
|
168
|
+
* an `operation` parameter — the caller's calling convention encodes the
|
|
169
|
+
* difference:
|
|
170
|
+
* - Set path: caller invokes `releaseManagedFieldOnRow(arch, comp, row,
|
|
171
|
+
* fieldName)` BEFORE this method to release the prior slot (variable
|
|
172
|
+
* `array<T>`). Fixed `array<T,N>` is inline stride-N (feat-20260602)
|
|
173
|
+
* and has no slot to release on either path.
|
|
174
|
+
* - Spawn path: caller does NOT call the helper — fresh rows treat any
|
|
175
|
+
* non-zero u32 in the column as stale swap-pop debris owned by the
|
|
176
|
+
* migrated entity in the new archetype.
|
|
177
|
+
*
|
|
178
|
+
* Body:
|
|
179
|
+
* - Alloc a fresh BufferPool slot of `payload.length * elementBytes`.
|
|
180
|
+
* - Copy bytes from the payload's typed-array buffer into the slot view.
|
|
181
|
+
* - Persist slot id in the primary u32 column. For `array<T>` (variable),
|
|
182
|
+
* persist the live count in the sidecar `<fieldName>:count` column.
|
|
183
|
+
*
|
|
184
|
+
* Errors flow through `routeArrayError` with a uniform `World.write` label.
|
|
185
|
+
*/
|
|
186
|
+
writeArrayField(arch: Archetype, component: Component, row: number, fieldName: string, _fieldType: string, arrayMeta: ArrayMeta, raw: unknown): void;
|
|
187
|
+
/**
|
|
188
|
+
* Walk the first `count` u32 handles in `bytes` and call
|
|
189
|
+
* `SharedRefStore.retain` on each non-sentinel slot id (feat-20260614 M4 /
|
|
190
|
+
* D-3). Failures route via Layer 3 ErrorHandler so the write chain stays
|
|
191
|
+
* total; charter explicit-failure boundary lets AI users see structured
|
|
192
|
+
* `shared-ref-released` payloads when retaining a stale handle.
|
|
193
|
+
*
|
|
194
|
+
* Helper-internal -- only called from `writeArrayField`'s `'shared'` arm.
|
|
195
|
+
*/
|
|
196
|
+
retainSharedArrayElements(bytes: Uint8Array, count: number): void;
|
|
197
|
+
/**
|
|
198
|
+
* Walk the first `count` u32 handles in `bytes` and call
|
|
199
|
+
* `SharedRefStore.release` on each non-sentinel slot id (feat-20260614 M4 /
|
|
200
|
+
* D-3). Mirrors `retainSharedArrayElements`; called from
|
|
201
|
+
* `releaseManagedFieldOnRow`'s array arm BEFORE the BufferPool slot is
|
|
202
|
+
* released so the underlying bytes are still valid.
|
|
203
|
+
*/
|
|
204
|
+
releaseSharedArrayElements(bytes: Uint8Array, count: number): void;
|
|
205
|
+
writeArrayElementAt(bytes: Uint8Array, idx: number, elementType: ManagedArrayElementType, value: number): void;
|
|
206
|
+
readArrayElementAt(bytes: Uint8Array, idx: number, elementType: ManagedArrayElementType): number;
|
|
207
|
+
/**
|
|
208
|
+
* Materialise a fresh `TypedArray` snapshot for an `array<T,N>` /
|
|
209
|
+
* `array<T>` field at `row` (plan-strategy §2.2 -- read-only snapshot
|
|
210
|
+
* contract; mutations route through `world.set` / `world.push` /
|
|
211
|
+
* `world.pop`).
|
|
212
|
+
*
|
|
213
|
+
* **Transient view contract (feat-20260602):** for fixed `array<T,N>`
|
|
214
|
+
* columns the returned `TypedArray` aliases the inline column buffer
|
|
215
|
+
* directly (`col.view.subarray(row * arity, ...)`); for variable
|
|
216
|
+
* `array<T>` columns it aliases the live `BufferPool` slot bytes
|
|
217
|
+
* (zero-copy; `pool.view(slotId)` is the SSOT byte region). In both
|
|
218
|
+
* cases the view is valid only until the next structural change. Writing
|
|
219
|
+
* into the snapshot is undefined behaviour -- the contract is read-only
|
|
220
|
+
* and the implementation may switch to a copy in the future without
|
|
221
|
+
* breaking AI users who consume only `length` / index reads.
|
|
222
|
+
*
|
|
223
|
+
* For variable arrays the typed-array length matches the live count from
|
|
224
|
+
* the sidecar `<fieldName>:count` column; for fixed arrays it matches the
|
|
225
|
+
* schema-declared `N`. `entity` element fields surface as a `Uint32Array`
|
|
226
|
+
* view (Entity packs slot+gen into u32).
|
|
227
|
+
*/
|
|
228
|
+
materializeArrayView(arch: Archetype, component: Component, row: number, fieldName: string, elementType: ManagedArrayElementType, fixedLength: number | undefined, slotId: number): Float32Array | Float64Array | Int32Array | Uint32Array | Int16Array | Uint16Array | Int8Array | Uint8Array;
|
|
229
|
+
/**
|
|
230
|
+
* Migrate an entity from srcArch to targetArch.
|
|
231
|
+
* Copies all shared component data, then removes from src via swap-pop.
|
|
232
|
+
*
|
|
233
|
+
* AC-04 carry-over contract (M4): for every component that survives the
|
|
234
|
+
* migration (i.e. the target archetype carries the same `compId`), every
|
|
235
|
+
* field column's u32 value is copied verbatim from src to target. This
|
|
236
|
+
* preserves every managed resource handle in place:
|
|
237
|
+
*
|
|
238
|
+
* - `ref<T>` field - the u32 (managed handle = (slot << 8) | gen) is
|
|
239
|
+
* bit-equal across migrate, so `Object.is` on the
|
|
240
|
+
* handle holds and `UniqueRefStore.resolve` returns
|
|
241
|
+
* the same payload object reference (per-(slot, gen)
|
|
242
|
+
* wrapper singleton, D-3).
|
|
243
|
+
* - `buffer<N>` field - fixed-capacity inline stride-N `u8` column
|
|
244
|
+
* (feat-20260602): the N bytes are copied verbatim
|
|
245
|
+
* by the generic per-column row copy, so the live
|
|
246
|
+
* bytes survive byte-for-byte. No BufferPool slot
|
|
247
|
+
* (only variable `buffer` carries a pool slot id).
|
|
248
|
+
* - `entity` field - the u32 (encoded slot+gen) is bit-equal across
|
|
249
|
+
* migrate.
|
|
250
|
+
* - `array<T,N>` field - fixed-capacity inline stride-N column
|
|
251
|
+
* (feat-20260602): the N elements live contiguously
|
|
252
|
+
* in the column row and are copied verbatim by the
|
|
253
|
+
* generic per-column row copy, so they survive
|
|
254
|
+
* byte-for-byte (no BufferPool slot). The TypedArray
|
|
255
|
+
* snapshot is rematerialised on every `world.get`
|
|
256
|
+
* (D-4 no cache); we do NOT guarantee `Object.is` on
|
|
257
|
+
* the wrapper — only the underlying bytes (D-R7 weak
|
|
258
|
+
* carry-over).
|
|
259
|
+
* - `array<T>` field - dual u32 columns: primary slot id + sidecar
|
|
260
|
+
* `<fieldName>:count`. Both columns are copied via
|
|
261
|
+
* the generic per-column loop below, so count and
|
|
262
|
+
* slot id stay in lock-step. Capacity is derived
|
|
263
|
+
* from `BufferPool.view(slotId).byteLength /
|
|
264
|
+
* elementBytes` and is therefore preserved by the
|
|
265
|
+
* slot-id carry-over alone (no separate column).
|
|
266
|
+
*
|
|
267
|
+
* Negative invariant: this routine MUST NOT call UniqueRefStore.release /
|
|
268
|
+
* BufferPool.release for surviving components. The pre-migrate release
|
|
269
|
+
* loop lives at `removeComponent` (only for the component being removed)
|
|
270
|
+
* and `despawn` (every component); migrate is only a column copy. The
|
|
271
|
+
* array-field release-loop split (D-3 / D-5) further guarantees that
|
|
272
|
+
* spawn into a vacated row treats stale slot-id debris as no-op (the slot
|
|
273
|
+
* is owned by the migrated entity in the new archetype) — see
|
|
274
|
+
* `writeArrayField`'s `operation: 'spawn' | 'set'` discriminant.
|
|
275
|
+
* Tests: `__tests__/managed-carry-over.test.ts` (w16),
|
|
276
|
+
* `__tests__/managed-array-carry-over.test.ts` (w8).
|
|
277
|
+
*/
|
|
278
|
+
migrateEntity(record: EntityRecord, srcArch: Archetype, targetArch: Archetype): void;
|
|
279
|
+
moveEntityArchetype(record: EntityRecord, srcArch: Archetype, targetArch: Archetype): void;
|
|
280
|
+
}
|
|
281
|
+
export {};
|
|
282
|
+
//# sourceMappingURL=world-component-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world-component-storage.d.ts","sourceRoot":"","sources":["../src/world-component-storage.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,eAAe,EAQpB,KAAK,uBAAuB,EAC5B,KAAK,OAAO,EAEb,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAmB,KAAK,YAAY,EAAiC,MAAM,iBAAiB,CAAC;AACpG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE1D,KAAK,YAAY,GA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AO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,GAAG,IAAI;CAmB3F"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BufferPool } from './buffer-pool';
|
|
2
|
+
import type { RelationshipIndex } from './relationship-index';
|
|
3
|
+
import type { SharedRefStore } from './shared-ref-store';
|
|
4
|
+
import { type ArchetypeGraph } from './storage/archetype-graph';
|
|
5
|
+
import { WorldChangeJournal } from './storage/change-detection';
|
|
6
|
+
import type { UniqueRefStore } from './unique-ref-store';
|
|
7
|
+
import type { EntityRecord } from './world';
|
|
8
|
+
interface WorldStorageCore {
|
|
9
|
+
readonly graph: ArchetypeGraph;
|
|
10
|
+
readonly records: EntityRecord[];
|
|
11
|
+
readonly freeIndices: number[];
|
|
12
|
+
readonly bufferPool: BufferPool;
|
|
13
|
+
readonly uniqueRefs: UniqueRefStore;
|
|
14
|
+
readonly sharedRefs: SharedRefStore;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Package-private state authority for World. A World is the public facade;
|
|
18
|
+
* this object is the only owner of archetype storage, entity records, managed
|
|
19
|
+
* stores, epochs, and bounded change evidence.
|
|
20
|
+
*/
|
|
21
|
+
export declare class WorldCore {
|
|
22
|
+
readonly identity: string;
|
|
23
|
+
readonly uniqueRefs: UniqueRefStore;
|
|
24
|
+
readonly sharedRefs: SharedRefStore;
|
|
25
|
+
readonly storage: WorldStorageCore;
|
|
26
|
+
readonly componentMutationEpochs: number[];
|
|
27
|
+
readonly changeJournal: WorldChangeJournal;
|
|
28
|
+
/** One packed reverse index per relationship source component. */
|
|
29
|
+
readonly relationshipIndexes: Map<number, RelationshipIndex>;
|
|
30
|
+
mutationEpoch: number;
|
|
31
|
+
structureEpoch: number;
|
|
32
|
+
constructor(sharedStorage: boolean);
|
|
33
|
+
get graph(): ArchetypeGraph;
|
|
34
|
+
get records(): EntityRecord[];
|
|
35
|
+
get freeIndices(): number[];
|
|
36
|
+
get bufferPool(): BufferPool;
|
|
37
|
+
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c,SAAK;gBAEP,aAAa,EAAE,OAAO;IAOlC,IAAI,KAAK,mBAER;IAED,IAAI,OAAO,mBAEV;IAED,IAAI,WAAW,aAEd;IAED,IAAI,UAAU,eAEb;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Result } from '@forgeax/engine-types';
|
|
2
|
+
import type { Component, ComponentSchema, InputShapeOf } from './component';
|
|
3
|
+
import { type EntityHandle } from './entity-handle';
|
|
4
|
+
import type { EcsError, World } from './world';
|
|
5
|
+
/**
|
|
6
|
+
* Core implementation of `spawn` with a relationship reentry guard.
|
|
7
|
+
*
|
|
8
|
+
* @param internal - `true` when relationship maintenance creates a mirror.
|
|
9
|
+
*/
|
|
10
|
+
export declare function spawnCore(world: World, componentDatas: {
|
|
11
|
+
component: Component;
|
|
12
|
+
data: Partial<Record<string, unknown>>;
|
|
13
|
+
}[], internal: boolean): Result<EntityHandle, EcsError>;
|
|
14
|
+
/**
|
|
15
|
+
* Core implementation of `despawn` with a linked-spawn cascade guard.
|
|
16
|
+
*
|
|
17
|
+
* @param internal - `true` while recursively retiring linked children.
|
|
18
|
+
*/
|
|
19
|
+
export declare function despawnCore(world: World, entity: EntityHandle, internal: boolean): Result<void, EcsError>;
|
|
20
|
+
/** Attach a child and maintain the relationship mirror through component storage. */
|
|
21
|
+
export declare function worldAddChild<S extends ComponentSchema>(world: World, parent: EntityHandle, child: EntityHandle, component: Component<string, S>, data: Partial<InputShapeOf<S>>): Result<void, EcsError>;
|
|
22
|
+
/** Detach a child only when its current relationship target matches `parent`. */
|
|
23
|
+
export declare function worldRemoveChild<S extends ComponentSchema>(world: World, parent: EntityHandle, child: EntityHandle, component: Component<string, S>): Result<void, EcsError>;
|
|
24
|
+
/** Move a child to a new parent after cycle validation and old-mirror detachment. */
|
|
25
|
+
export declare function worldReparent<S extends ComponentSchema>(world: World, child: EntityHandle, newParent: EntityHandle, component: Component<string, S>, data: Partial<InputShapeOf<S>>): Result<void, EcsError>;
|
|
26
|
+
/** Iterate ancestors in child-to-root order while safely terminating corrupt cycles. */
|
|
27
|
+
export declare function worldIterAncestors(world: World, entity: EntityHandle): Iterable<EntityHandle>;
|
|
28
|
+
/** Iterate descendants depth-first through relationship mirror lists. */
|
|
29
|
+
export declare function worldIterDescendants(world: World, entity: EntityHandle): Iterable<EntityHandle>;
|
|
30
|
+
//# sourceMappingURL=world-entity-lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world-entity-lifecycle.d.ts","sourceRoot":"","sources":["../src/world-entity-lifecycle.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgC,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAW,MAAM,aAAa,CAAC;AAKrF,OAAO,EAEL,KAAK,YAAY,EAIlB,MAAM,iBAAiB,CAAC;AAczB,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAQ/C;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,EAAE,EAClF,QAAQ,EAAE,OAAO,GAChB,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,CA0DhC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,OAAO,GAChB,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CA+DxB;AAED,qFAAqF;AACrF,wBAAgB,aAAa,CAAC,CAAC,SAAS,eAAe,EACrD,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,EAC/B,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAC7B,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CA+CxB;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,eAAe,EACxD,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,GAC9B,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CA6CxB;AAED,qFAAqF;AACrF,wBAAgB,aAAa,CAAC,CAAC,SAAS,eAAe,EACrD,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,EAC/B,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAC7B,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAiDxB;AAED,wFAAwF;AACxF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC,CAkD7F;AAED,yEAAyE;AACzE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC,CAuC/F"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ECS package-internal World seam.
|
|
3
|
+
*
|
|
4
|
+
* This module is intentionally not re-exported by the package entry points.
|
|
5
|
+
* It keeps implementation access out of World's discoverable API while
|
|
6
|
+
* retaining direct bound calls for the hot query and structural paths.
|
|
7
|
+
*/
|
|
8
|
+
export declare const worldInternal: unique symbol;
|
|
9
|
+
type InternalName = 'addComponentCore' | 'allocateIndex' | 'allocatePendingEntity' | 'cancelPendingEntity' | 'despawnCore' | 'getArrayView' | 'getBufferPool' | 'getChangeCursor' | 'getClockWriter' | 'getComponentChange' | 'getComponentMutationEpoch' | 'getEntityArchetype' | 'getFixedAccumulator' | 'getFreeIndices' | 'getGraph' | 'getMutationEpoch' | 'getQueryRow' | 'getRecords' | 'getRelationshipEpoch' | 'getRelationshipTargetEntities' | 'getResources' | 'getSchedule' | 'getSchedules' | 'getSharedRefs' | 'getStructureEpoch' | 'getUniqueRefs' | 'lookupAlive' | 'markComponentAdded' | 'markComponentChanged' | 'markComponentRangeChanged' | 'markComponentsAdded' | 'markDerivedComponentChanges' | 'markStructureChanged' | 'materializePendingEntity' | 'nextMutationEpoch' | 'poisonExecution' | 'preflightComponentData' | 'readChangesSince' | 'readRow' | 'recordIsLive' | 'relationshipOnInsert' | 'relationshipOnRemove' | 'releaseManagedRefsOnRow' | 'removeComponentChange' | 'removeComponentCore' | 'removeEntityChanges' | 'routeError' | 'setFixedAccumulator' | 'setQueryRow' | 'spawnCore' | 'writeEntitySelf' | 'writeRow';
|
|
10
|
+
export type WorldInternal = {
|
|
11
|
+
readonly [K in InternalName]: (...args: any[]) => any;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=world-internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world-internal.d.ts","sourceRoot":"","sources":["../src/world-internal.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,eAAO,MAAM,aAAa,EAAE,OAAO,MAEC,CAAC;AAErC,KAAK,YAAY,GACb,kBAAkB,GAClB,eAAe,GACf,uBAAuB,GACvB,qBAAqB,GACrB,aAAa,GACb,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,oBAAoB,GACpB,2BAA2B,GAC3B,oBAAoB,GACpB,qBAAqB,GACrB,gBAAgB,GAChB,UAAU,GACV,kBAAkB,GAClB,aAAa,GACb,YAAY,GACZ,sBAAsB,GACtB,+BAA+B,GAC/B,cAAc,GACd,aAAa,GACb,cAAc,GACd,eAAe,GACf,mBAAmB,GACnB,eAAe,GACf,aAAa,GACb,oBAAoB,GACpB,sBAAsB,GACtB,2BAA2B,GAC3B,qBAAqB,GACrB,6BAA6B,GAC7B,sBAAsB,GACtB,0BAA0B,GAC1B,mBAAmB,GACnB,iBAAiB,GACjB,wBAAwB,GACxB,kBAAkB,GAClB,SAAS,GACT,cAAc,GACd,sBAAsB,GACtB,sBAAsB,GACtB,yBAAyB,GACzB,uBAAuB,GACvB,qBAAqB,GACrB,qBAAqB,GACrB,YAAY,GACZ,qBAAqB,GACrB,aAAa,GACb,WAAW,GACX,iBAAiB,GACjB,UAAU,CAAC;AAEf,MAAM,MAAM,aAAa,GAAG;IAE1B,QAAQ,EAAE,CAAC,IAAI,YAAY,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG;CACtD,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Handle } from '@forgeax/engine-types';
|
|
2
|
+
import { type Result } from '@forgeax/engine-types';
|
|
3
|
+
import { CommandFailedError, CyclicDependencyError, ScheduleScopeMismatchError, SystemFailedError, type SystemSetNotRegisteredError, TimeConfigInvalidError, TimeDeltaInvalidError } from './errors';
|
|
4
|
+
import { SharedKernelFailureError, WorldPoisonedError } from './execution/shared-kernel';
|
|
5
|
+
import type { QueryDescriptor } from './query/query';
|
|
6
|
+
import { type SystemDescriptor, type SystemSet, removeSystem as scheduleRemoveSystem, replaceSystem as scheduleReplaceSystem } from './schedule';
|
|
7
|
+
import { type ScheduleToken } from './schedule-token';
|
|
8
|
+
import type { World, WorldInspection, WorldScheduleData } from './world';
|
|
9
|
+
type ResourceKey = string | {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function worldAddSystem<const Qs extends ReadonlyArray<QueryDescriptor>>(world: World, token: ScheduleToken, descriptor: SystemDescriptor<Qs>): Result<void, ScheduleScopeMismatchError>;
|
|
13
|
+
export declare function worldRemoveSystem(world: World, token: ScheduleToken, name: string): ReturnType<typeof scheduleRemoveSystem> | Result<never, ScheduleScopeMismatchError>;
|
|
14
|
+
export declare function worldReplaceSystem<const Qs extends ReadonlyArray<QueryDescriptor>>(world: World, token: ScheduleToken, name: string, descriptor: SystemDescriptor<Qs>): ReturnType<typeof scheduleReplaceSystem> | Result<never, ScheduleScopeMismatchError>;
|
|
15
|
+
export declare function worldAddSystems<const Qs extends ReadonlyArray<QueryDescriptor>>(world: World, token: ScheduleToken, set: SystemSet, systems: ReadonlyArray<SystemDescriptor<Qs>>): Result<void, SystemSetNotRegisteredError | ScheduleScopeMismatchError>;
|
|
16
|
+
export declare function worldUpdate(world: World, deltaSeconds?: number): Result<void, TimeDeltaInvalidError | TimeConfigInvalidError | ScheduleScopeMismatchError | WorldPoisonedError | CommandFailedError | SystemFailedError | CyclicDependencyError | SharedKernelFailureError>;
|
|
17
|
+
export declare function worldInsertResource<T>(world: World, key: ResourceKey, value: T): void;
|
|
18
|
+
export declare function worldGetResource<T>(world: World, key: ResourceKey): T;
|
|
19
|
+
export declare function worldHasResource(world: World, key: ResourceKey): boolean;
|
|
20
|
+
export declare function worldRemoveResource(world: World, key: ResourceKey): void;
|
|
21
|
+
export declare function worldInspect(world: World): WorldInspection;
|
|
22
|
+
/** Project schedule registration into a JSON-safe graph for tooling and AI inspection. */
|
|
23
|
+
export declare function worldScheduleData(world: World): ReadonlyArray<WorldScheduleData>;
|
|
24
|
+
/** Control-plane guard used before releasing a World-local component registration. */
|
|
25
|
+
export declare function worldScheduleUsesComponent(world: World, component: object): boolean;
|
|
26
|
+
export declare function worldAllocUniqueRef<Target extends string, T>(world: World, target: Target, payload: T, onRelease?: (payload: T) => void): Handle<Target, 'unique'>;
|
|
27
|
+
export declare function worldAllocSharedRef<Target extends string, T>(world: World, target: Target, payload: T): Handle<Target, 'shared'>;
|
|
28
|
+
export declare function worldInternSharedRef<Target extends string, T extends object>(world: World, target: Target, payload: T): Handle<Target, 'shared'>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=world-scheduling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world-scheduling.d.ts","sourceRoot":"","sources":["../src/world-scheduling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EAErB,0BAA0B,EAC1B,iBAAiB,EACjB,KAAK,2BAA2B,EAChC,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAClB,OAAO,EAIL,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAOrD,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAGd,YAAY,IAAI,oBAAoB,EACpC,aAAa,IAAI,qBAAqB,EACvC,MAAM,YAAY,CAAC;AACpB,OAAO,EAAgC,KAAK,aAAa,EAAU,MAAM,kBAAkB,CAAC;AAG5F,OAAO,KAAK,EACV,KAAK,EACL,eAAe,EACf,iBAAiB,EAGlB,MAAM,SAAS,CAAC;AAIjB,KAAK,WAAW,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAyCtD,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,SAAS,aAAa,CAAC,eAAe,CAAC,EAC5E,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,aAAa,EACpB,UAAU,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAC/B,MAAM,CAAC,IAAI,EAAE,0BAA0B,CAAC,CAM1C;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,aAAa,EACpB,IAA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