@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
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,763 @@
|
|
|
1
|
+
import type { QuerySpanUnavailableReason } from './errors/query-and-component-errors';
|
|
2
|
+
export { ComponentNotDefinedError, QueryDataRequiresFieldsError, QueryDescriptorConflictError, QueryIterationActiveError, QueryIterationInvalidatedError, QuerySpanUnavailableError, type QuerySpanUnavailableReason, RemoveEssentialComponentError, SpawnDataUnknownFieldError, } from './errors/query-and-component-errors';
|
|
3
|
+
export { RelationshipDetachMismatchError, RelationshipMirrorComponentNotRegisteredError, RelationshipMirrorFieldTypeMismatchError, RelationshipSelfCycleError, RelationshipTargetReadonlyError, } from './errors/relationship-errors';
|
|
4
|
+
export { SharedFieldInvalidValueError, SpriteInstancesCountMismatchError, SpriteInstancesMutuallyExclusiveWithInstancesError, SpriteInstancesRequiresSpriteShaderError, } from './errors/sprite-and-shared-errors';
|
|
5
|
+
export { ComponentFieldInvalidValueError, ComponentNumericValueInvalidError, ManagedArrayInvalidValueError, ResourceInvalidValueError, ScheduleScopeMismatchError, SpawnLightInvalidBoundsError, SpriteAnimationInvalidError, TimeConfigInvalidError, TimeDeltaInvalidError, validateEnumFieldValues, validateNumericFieldValues, } from './errors/validation-errors';
|
|
6
|
+
export { SharedKernelEligibilityError, SharedKernelFailureError, WorldPoisonedError, } from './execution/shared-kernel';
|
|
7
|
+
/**
|
|
8
|
+
* Thrown when an attempt is made to encode an entity index that does not fit
|
|
9
|
+
* in 24 bits (i.e. >= 2^24 = 16_777_216).
|
|
10
|
+
*
|
|
11
|
+
* `.code = 'entity-index-overflow'`
|
|
12
|
+
* `.hint` — suggests reducing entity count or investigating leaks.
|
|
13
|
+
*/
|
|
14
|
+
export declare class EntityIndexOverflowError extends RangeError {
|
|
15
|
+
readonly name = "EntityIndexOverflowError";
|
|
16
|
+
readonly code: "entity-index-overflow";
|
|
17
|
+
readonly hint: string;
|
|
18
|
+
constructor(index: number);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Thrown when `defineComponent` is given a field type that is not in the
|
|
22
|
+
* supported scalar field type set.
|
|
23
|
+
*
|
|
24
|
+
* `.code = 'schema-unsupported-field'`
|
|
25
|
+
* `.hint` — lists all supported scalar field types.
|
|
26
|
+
*/
|
|
27
|
+
export declare class SchemaUnsupportedFieldError extends Error {
|
|
28
|
+
readonly name = "SchemaUnsupportedFieldError";
|
|
29
|
+
readonly code: "schema-unsupported-field";
|
|
30
|
+
readonly hint: string;
|
|
31
|
+
constructor(fieldName: string, fieldType: string);
|
|
32
|
+
}
|
|
33
|
+
export declare class SparseStorageRequiresTagError extends Error {
|
|
34
|
+
readonly name = "SparseStorageRequiresTagError";
|
|
35
|
+
readonly code: "sparse-storage-requires-tag";
|
|
36
|
+
readonly expected = "sparse components have an empty schema and no relationship metadata";
|
|
37
|
+
readonly hint = "remove all fields and relationship metadata, or use storage: table";
|
|
38
|
+
readonly detail: {
|
|
39
|
+
readonly componentName: string;
|
|
40
|
+
};
|
|
41
|
+
constructor(componentName: string);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Thrown (or returned via the `Result` err branch — `r.ok === false`, `r.error`)
|
|
45
|
+
* when get/set/addComponent/removeComponent is called on an entity that has
|
|
46
|
+
* been despawned (stale handle).
|
|
47
|
+
*
|
|
48
|
+
* `.code = 'stale-entity'`
|
|
49
|
+
* `.hint` — includes operation name, expected/actual generation, and component name.
|
|
50
|
+
* Enhanced fields: `.component`, `.operation`, `.expectedGeneration`, `.actualGeneration`.
|
|
51
|
+
*/
|
|
52
|
+
export declare class StaleEntityError extends Error {
|
|
53
|
+
readonly name = "StaleEntityError";
|
|
54
|
+
readonly code: "stale-entity";
|
|
55
|
+
readonly hint: string;
|
|
56
|
+
/** Component name involved in the operation (undefined when the operation does not target a specific component). */
|
|
57
|
+
readonly component: string | undefined;
|
|
58
|
+
/** The component-level operation that triggered this error (e.g. 'get' / 'set' / 'add' / 'remove'). Entity-level operations like `despawn` are not surfaced here — see `EntityHandle` lifecycle errors. */
|
|
59
|
+
readonly operation: string | undefined;
|
|
60
|
+
/** The generation the caller expected (from the entity handle). */
|
|
61
|
+
readonly expectedGeneration: number | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* The actual generation found in the entity pool. `-1` is the sentinel
|
|
64
|
+
* value for entities never allocated (slot was never occupied), as opposed
|
|
65
|
+
* to allocated-then-despawned entities which carry a real (incremented)
|
|
66
|
+
* generation number.
|
|
67
|
+
*/
|
|
68
|
+
readonly actualGeneration: number | undefined;
|
|
69
|
+
constructor(entityId: number, index: number, generation: number, enhanced?: {
|
|
70
|
+
component?: string;
|
|
71
|
+
operation: string;
|
|
72
|
+
expectedGeneration: number;
|
|
73
|
+
actualGeneration: number;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Returned via the `Result` err branch (`r.ok === false`, `r.error`) when
|
|
78
|
+
* addComponent tries to add a component that the entity already possesses.
|
|
79
|
+
*
|
|
80
|
+
* `.code = 'component-already-present'`
|
|
81
|
+
* `.hint` — suggests using `set()` to update values instead.
|
|
82
|
+
*/
|
|
83
|
+
export declare class ComponentAlreadyPresentError extends Error {
|
|
84
|
+
readonly name = "ComponentAlreadyPresentError";
|
|
85
|
+
readonly code: "component-already-present";
|
|
86
|
+
readonly hint: string;
|
|
87
|
+
constructor(entityId: number, componentName: string);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Returned via the `Result` err branch (`r.ok === false`, `r.error`) when
|
|
91
|
+
* removeComponent / set is called for a component the entity does not possess.
|
|
92
|
+
*
|
|
93
|
+
* `.code = 'component-not-present'`
|
|
94
|
+
* `.hint` — suggests checking with query or inspect().
|
|
95
|
+
*/
|
|
96
|
+
export declare class ComponentNotPresentError extends Error {
|
|
97
|
+
readonly name = "ComponentNotPresentError";
|
|
98
|
+
readonly code: "component-not-present";
|
|
99
|
+
readonly hint: string;
|
|
100
|
+
constructor(entityId: number, componentName: string);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Thrown when DAG Schedule detects a cyclic dependency among systems.
|
|
104
|
+
*
|
|
105
|
+
* `.code = 'cyclic-dependency'`
|
|
106
|
+
* `.hint` — includes the cycle path and suggests removing one constraint.
|
|
107
|
+
* `.detail` — `{ code: 'cyclic-dependency'; cycle: readonly string[] }` contains the
|
|
108
|
+
* structured cycle path for programmatic consumption.
|
|
109
|
+
*/
|
|
110
|
+
export declare class CyclicDependencyError extends Error {
|
|
111
|
+
readonly name = "CyclicDependencyError";
|
|
112
|
+
readonly code: "cyclic-dependency";
|
|
113
|
+
readonly expected = "the schedule dependency graph is acyclic";
|
|
114
|
+
readonly hint: string;
|
|
115
|
+
/** Structured cycle path — programmatic consumers read this, not the message. */
|
|
116
|
+
readonly detail: {
|
|
117
|
+
readonly code: 'cyclic-dependency';
|
|
118
|
+
readonly cycle: readonly string[];
|
|
119
|
+
};
|
|
120
|
+
constructor(cycle: readonly string[]);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Returned via `Result.err` from `world.addSystems`
|
|
124
|
+
* when a SystemSet token fails local structural validation.
|
|
125
|
+
*
|
|
126
|
+
* The sole public invalid-token error type (D-2a). Covers all rejection
|
|
127
|
+
* scenarios: plain-object cast, unregistered name, stale token after
|
|
128
|
+
* overwrite, and cross-realm copies.
|
|
129
|
+
*
|
|
130
|
+
* `.code = 'system-set-not-registered'`
|
|
131
|
+
* `.expected` — the name of the unregistered token.
|
|
132
|
+
* `.hint` — suggests passing the current token to the owning World schedule.
|
|
133
|
+
* `.detail` — `{ code, name, registered }` where `registered` is a deterministic snapshot
|
|
134
|
+
* of the current World-local schedule keys.
|
|
135
|
+
*/
|
|
136
|
+
export declare class SystemSetNotRegisteredError extends Error {
|
|
137
|
+
readonly name = "SystemSetNotRegisteredError";
|
|
138
|
+
readonly code: "system-set-not-registered";
|
|
139
|
+
/** The name carried by the rejected token. */
|
|
140
|
+
readonly expected: string;
|
|
141
|
+
readonly hint: string;
|
|
142
|
+
/** Deterministic snapshot of the current World-local schedule for repair. */
|
|
143
|
+
readonly detail: {
|
|
144
|
+
readonly code: 'system-set-not-registered';
|
|
145
|
+
readonly name: string;
|
|
146
|
+
readonly registered: readonly string[];
|
|
147
|
+
};
|
|
148
|
+
constructor(name: string, registered: readonly string[]);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Factory for {@link SystemSetNotRegisteredError}. Consumed by
|
|
152
|
+
* {@link validateSystemSetTokens} (w4) and the two mutation entry points.
|
|
153
|
+
*/
|
|
154
|
+
export declare function systemSetNotRegistered(name: string, registered: readonly string[]): SystemSetNotRegisteredError;
|
|
155
|
+
/**
|
|
156
|
+
* Closed-set ScheduleMutationError code union (M2 — plan-strategy D-3).
|
|
157
|
+
*
|
|
158
|
+
* Schedule add-only API (`removeSystem` / `replaceSystem`) returns
|
|
159
|
+
* `Result<void, ScheduleMutationError>` carrying one of these codes. The
|
|
160
|
+
* `@forgeax/engine-remote` layer (M3) bridges these strings to JSON-RPC
|
|
161
|
+
* `RemoteErrorCode` 1:1 — keeping ECS free of console / wire dependencies.
|
|
162
|
+
*
|
|
163
|
+
* - `system-before-unknown` — name argument does not match any registered system.
|
|
164
|
+
* - `system-name-conflict` — reserved for the M3 inject path; surfaced from
|
|
165
|
+
* schedule when callers inject a name that already exists.
|
|
166
|
+
* - `cyclic-injection` — schedule build detected a cycle introduced by
|
|
167
|
+
* the mutation; carries the cycle path in `.detail.cycle`.
|
|
168
|
+
*/
|
|
169
|
+
export type ScheduleMutationErrorCode = 'system-before-unknown';
|
|
170
|
+
export interface ScheduleMutationErrorDetail {
|
|
171
|
+
readonly cycle?: readonly string[];
|
|
172
|
+
readonly candidates?: readonly string[];
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Returned via `Result.err` from `world.removeSystem` / `world.replaceSystem`.
|
|
176
|
+
*
|
|
177
|
+
* `.code` is the closed-set string SSOT consumed by the M3 console bridge;
|
|
178
|
+
* `.hint` carries an AI-friendly self-repair suggestion; `.detail` is the
|
|
179
|
+
* discriminated payload (cycle path for `cyclic-injection`, candidate list
|
|
180
|
+
* for `system-before-unknown`).
|
|
181
|
+
*/
|
|
182
|
+
export declare class ScheduleMutationError extends Error {
|
|
183
|
+
readonly name = "ScheduleMutationError";
|
|
184
|
+
readonly code: ScheduleMutationErrorCode;
|
|
185
|
+
readonly hint: string;
|
|
186
|
+
readonly detail: ScheduleMutationErrorDetail;
|
|
187
|
+
constructor(code: ScheduleMutationErrorCode, message: string, hint: string, detail?: ScheduleMutationErrorDetail);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Thrown when getResource is called with a key that does not exist.
|
|
191
|
+
*
|
|
192
|
+
* `.code = 'resource-not-found'`
|
|
193
|
+
* `.hint` — suggests using `world.insertResource()` first.
|
|
194
|
+
*/
|
|
195
|
+
export declare class ResourceNotFoundError extends Error {
|
|
196
|
+
readonly name = "ResourceNotFoundError";
|
|
197
|
+
readonly code: "resource-not-found";
|
|
198
|
+
readonly hint: string;
|
|
199
|
+
constructor(key: string);
|
|
200
|
+
}
|
|
201
|
+
export declare class ChangeEpochExhaustedError extends Error {
|
|
202
|
+
readonly name = "ChangeEpochExhaustedError";
|
|
203
|
+
readonly code: "change-epoch-exhausted";
|
|
204
|
+
readonly expected = "mutationEpoch < Number.MAX_SAFE_INTEGER";
|
|
205
|
+
readonly hint = "Rebuild the World before performing another mutation.";
|
|
206
|
+
readonly detail: {
|
|
207
|
+
readonly epoch: number;
|
|
208
|
+
};
|
|
209
|
+
constructor(epoch: number);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Thrown when insertResource/removeResource is called on a World-owned
|
|
213
|
+
* protected resource (Time or FixedTime).
|
|
214
|
+
*
|
|
215
|
+
* `.code = 'resource-protected'`
|
|
216
|
+
* `.hint` — suggests using `world.update(delta)` or reading the resource.
|
|
217
|
+
* `.expected` — the resource name that was rejected.
|
|
218
|
+
*/
|
|
219
|
+
export declare class ProtectedResourceError extends Error {
|
|
220
|
+
readonly name = "ProtectedResourceError";
|
|
221
|
+
readonly code: "resource-protected";
|
|
222
|
+
readonly hint: string;
|
|
223
|
+
readonly expected: string;
|
|
224
|
+
constructor(resourceName: string, operation: 'insert' | 'remove');
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Thrown / returned via `Result.err` when UniqueRefStore.alloc encounters a
|
|
228
|
+
* slot whose refcount has already dropped to zero (sentinel for a released
|
|
229
|
+
* slot reused without re-init).
|
|
230
|
+
*
|
|
231
|
+
* `.code = 'unique-ref-released'`
|
|
232
|
+
* `.detail = { handle, target }`
|
|
233
|
+
* `.hint` — recommends checking handle lifetime against owner despawn.
|
|
234
|
+
*/
|
|
235
|
+
export declare class UniqueRefReleasedError extends Error {
|
|
236
|
+
readonly name = "UniqueRefReleasedError";
|
|
237
|
+
readonly code: "unique-ref-released";
|
|
238
|
+
readonly hint: string;
|
|
239
|
+
readonly expected: string;
|
|
240
|
+
readonly detail: {
|
|
241
|
+
readonly handle: number;
|
|
242
|
+
readonly target: string;
|
|
243
|
+
};
|
|
244
|
+
constructor(handle: number, target: string);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Thrown / returned via `Result.err` when UniqueRefStore.release is called on
|
|
248
|
+
* a handle whose refcount is already zero (double-free).
|
|
249
|
+
*
|
|
250
|
+
* `.code = 'unique-ref-double-release'`
|
|
251
|
+
* `.detail = { handle, target }`
|
|
252
|
+
* `.hint` — recommends auditing the release-loop entry points (set / removeComponent / despawn).
|
|
253
|
+
*/
|
|
254
|
+
export declare class UniqueRefDoubleReleaseError extends Error {
|
|
255
|
+
readonly name = "UniqueRefDoubleReleaseError";
|
|
256
|
+
readonly code: "unique-ref-double-release";
|
|
257
|
+
readonly hint: string;
|
|
258
|
+
readonly expected: string;
|
|
259
|
+
readonly detail: {
|
|
260
|
+
readonly handle: number;
|
|
261
|
+
readonly target: string;
|
|
262
|
+
};
|
|
263
|
+
constructor(handle: number, target: string);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Thrown / returned via `Result.err` when SharedRefStore.resolve / .retain is
|
|
267
|
+
* called on a handle whose refcount has already dropped to zero (slot released).
|
|
268
|
+
*
|
|
269
|
+
* `.code = 'shared-ref-released'`
|
|
270
|
+
* `.detail = { handle, target }`
|
|
271
|
+
* `.hint` — recommends checking handle lifetime against owner / consumer release.
|
|
272
|
+
*/
|
|
273
|
+
export declare class SharedRefReleasedError extends Error {
|
|
274
|
+
readonly name = "SharedRefReleasedError";
|
|
275
|
+
readonly code: "shared-ref-released";
|
|
276
|
+
readonly hint: string;
|
|
277
|
+
readonly expected: string;
|
|
278
|
+
readonly detail: {
|
|
279
|
+
readonly handle: number;
|
|
280
|
+
readonly target: string;
|
|
281
|
+
};
|
|
282
|
+
constructor(handle: number, target: string);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Thrown / returned via `Result.err` when SharedRefStore.release is called on
|
|
286
|
+
* a handle whose refcount is already zero (double-release). Distinct from the
|
|
287
|
+
* UniqueRef family because shared release is rc--, not direct slot drop —
|
|
288
|
+
* AI users debug this by reading `.detail.rc` (always 0 here) alongside the
|
|
289
|
+
* payload-presence signal.
|
|
290
|
+
*
|
|
291
|
+
* `.code = 'shared-ref-double-release'`
|
|
292
|
+
* `.detail = { handle, target, rc }`
|
|
293
|
+
* `.hint` — recommends auditing the producer / consumer release pairs.
|
|
294
|
+
*/
|
|
295
|
+
export declare class SharedRefDoubleReleaseError extends Error {
|
|
296
|
+
readonly name = "SharedRefDoubleReleaseError";
|
|
297
|
+
readonly code: "shared-ref-double-release";
|
|
298
|
+
readonly hint: string;
|
|
299
|
+
readonly expected: string;
|
|
300
|
+
readonly detail: {
|
|
301
|
+
readonly handle: number;
|
|
302
|
+
readonly target: string;
|
|
303
|
+
readonly rc: number;
|
|
304
|
+
};
|
|
305
|
+
constructor(handle: number, target: string, rc: number);
|
|
306
|
+
}
|
|
307
|
+
/** Raised before SharedRefStore mutates slot state for a nullish payload. */
|
|
308
|
+
export declare class SharedRefPayloadInvalidError extends Error {
|
|
309
|
+
readonly name = "SharedRefPayloadInvalidError";
|
|
310
|
+
readonly code: "shared-ref-payload-invalid";
|
|
311
|
+
readonly expected = "a non-null, non-undefined shared payload";
|
|
312
|
+
readonly hint = "Allocate a concrete payload and let its owning effect dispose it.";
|
|
313
|
+
readonly detail: {
|
|
314
|
+
readonly target: string;
|
|
315
|
+
readonly actual: 'null' | 'undefined';
|
|
316
|
+
};
|
|
317
|
+
constructor(target: string, actual: 'null' | 'undefined');
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Returned via `Result.err` when a builtin-tier slot (`slot < BUILTIN_BASE`)
|
|
321
|
+
* is passed to SharedRefStore.alloc / retain / release / resolve
|
|
322
|
+
* (feat-20260614 M6 D-15). The SharedRefStore manages ONLY user-tier slots
|
|
323
|
+
* (`>= BUILTIN_BASE`); builtin asset payloads are process-static and owned by
|
|
324
|
+
* the package that authored their builtin handle, never reference-counted by
|
|
325
|
+
* this World store.
|
|
326
|
+
*
|
|
327
|
+
* `.code = 'builtin-slot-not-owned'`
|
|
328
|
+
* `.detail = { slot }`
|
|
329
|
+
* `.hint` — points the caller back to the builtin handle owner.
|
|
330
|
+
*/
|
|
331
|
+
export declare class BuiltinSlotNotOwnedError extends Error {
|
|
332
|
+
readonly name = "BuiltinSlotNotOwnedError";
|
|
333
|
+
readonly code: "builtin-slot-not-owned";
|
|
334
|
+
readonly hint: string;
|
|
335
|
+
readonly expected: string;
|
|
336
|
+
readonly detail: {
|
|
337
|
+
readonly slot: number;
|
|
338
|
+
};
|
|
339
|
+
constructor(slot: number);
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Returned via `Result.err` when SharedRefStore.resolve / .retain / .release
|
|
343
|
+
* is called with a handle whose generation no longer matches the store's
|
|
344
|
+
* current generation for that slot — the slot was released and re-allocated
|
|
345
|
+
* to a different payload. Distinct from `'shared-ref-released'` (slot empty,
|
|
346
|
+
* never re-allocated): stale means the slot IS live but belongs to a newer
|
|
347
|
+
* allocation.
|
|
348
|
+
*
|
|
349
|
+
* `.code = 'shared-ref-stale'`
|
|
350
|
+
* `.detail = { slot, expectedGeneration, actualGeneration }`
|
|
351
|
+
* `.hint` — recommends re-acquiring the handle from AssetRegistry.
|
|
352
|
+
*/
|
|
353
|
+
export declare class SharedRefStaleError extends Error {
|
|
354
|
+
readonly name = "SharedRefStaleError";
|
|
355
|
+
readonly code: "shared-ref-stale";
|
|
356
|
+
readonly hint: string;
|
|
357
|
+
readonly expected: string;
|
|
358
|
+
readonly detail: {
|
|
359
|
+
readonly slot: number;
|
|
360
|
+
readonly expectedGeneration: number;
|
|
361
|
+
readonly actualGeneration: number;
|
|
362
|
+
};
|
|
363
|
+
constructor(slot: number, expectedGeneration: number, actualGeneration: number);
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Returned via `Result.err` when UniqueRefStore.resolve / .release is
|
|
367
|
+
* called with a handle whose generation no longer matches the store's
|
|
368
|
+
* current generation for that slot — the slot was released and re-allocated.
|
|
369
|
+
* Distinct from `'unique-ref-released'` (slot empty). UniqueRefStore has
|
|
370
|
+
* no retain method; the stale surface is resolve + release only.
|
|
371
|
+
*
|
|
372
|
+
* `.code = 'unique-ref-stale'`
|
|
373
|
+
* `.detail = { slot, expectedGeneration, actualGeneration }`
|
|
374
|
+
* `.hint` — recommends re-acquiring the handle from the producing system.
|
|
375
|
+
*/
|
|
376
|
+
export declare class UniqueRefStaleError extends Error {
|
|
377
|
+
readonly name = "UniqueRefStaleError";
|
|
378
|
+
readonly code: "unique-ref-stale";
|
|
379
|
+
readonly hint: string;
|
|
380
|
+
readonly expected: string;
|
|
381
|
+
readonly detail: {
|
|
382
|
+
readonly slot: number;
|
|
383
|
+
readonly expectedGeneration: number;
|
|
384
|
+
readonly actualGeneration: number;
|
|
385
|
+
};
|
|
386
|
+
constructor(slot: number, expectedGeneration: number, actualGeneration: number);
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Thrown / returned via `Result.err` when BufferPool indexing reads or writes
|
|
390
|
+
* an offset outside the slot's `[0, size)` byte range. Triggers are limited
|
|
391
|
+
* to the `buffer:<N>` and managed-array-element-buffer paths; the
|
|
392
|
+
* `'string'` schema vocab no longer routes through this code (collapsed onto
|
|
393
|
+
* the managed-ref dispatch by feat-20260515-string-managed-collapse — JS
|
|
394
|
+
* string capacity is bounded by the host runtime, not by BufferPool buckets).
|
|
395
|
+
*
|
|
396
|
+
* `.code = 'managed-buffer-out-of-bounds'`
|
|
397
|
+
* `.detail = { index, size }`
|
|
398
|
+
* `.hint` — points at the field's `'buffer'` / `buffer<N>` schema declaration.
|
|
399
|
+
*/
|
|
400
|
+
export declare class ManagedBufferOutOfBoundsError extends RangeError {
|
|
401
|
+
readonly name = "ManagedBufferOutOfBoundsError";
|
|
402
|
+
readonly code: "managed-buffer-out-of-bounds";
|
|
403
|
+
readonly hint: string;
|
|
404
|
+
readonly expected: string;
|
|
405
|
+
readonly detail: {
|
|
406
|
+
readonly index: number;
|
|
407
|
+
readonly size: number;
|
|
408
|
+
};
|
|
409
|
+
constructor(index: number, size: number);
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Thrown / returned via `Result.err` when BufferPool resize is asked to shrink
|
|
413
|
+
* a slot below its current allocated size — the pool only grows.
|
|
414
|
+
*
|
|
415
|
+
* `.code = 'managed-buffer-shrink-not-supported'`
|
|
416
|
+
* `.detail = { requested, current }`
|
|
417
|
+
* `.hint` — directs callers to allocate a fresh slot if a smaller buffer is needed.
|
|
418
|
+
*/
|
|
419
|
+
export declare class ManagedBufferShrinkNotSupportedError extends Error {
|
|
420
|
+
readonly name = "ManagedBufferShrinkNotSupportedError";
|
|
421
|
+
readonly code: "managed-buffer-shrink-not-supported";
|
|
422
|
+
readonly hint: string;
|
|
423
|
+
readonly expected: string;
|
|
424
|
+
readonly detail: {
|
|
425
|
+
readonly requested: number;
|
|
426
|
+
readonly current: number;
|
|
427
|
+
};
|
|
428
|
+
constructor(requested: number, current: number);
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Returned via `Result.err` from `world.set` when a `buffer<N>` field is
|
|
432
|
+
* written with a `Uint8Array` whose `byteLength` does not equal the
|
|
433
|
+
* schema-declared fixed size `N`. AI users resize their payload to exactly
|
|
434
|
+
* `N` bytes (zero-pad or truncate at the producer) before calling `world.set`.
|
|
435
|
+
*
|
|
436
|
+
* `.code = 'fixed-size-mismatch'`
|
|
437
|
+
* `.detail = { expected, actual }`
|
|
438
|
+
* `.hint` — points at the producer's payload sizing.
|
|
439
|
+
*/
|
|
440
|
+
export declare class FixedSizeMismatchError extends Error {
|
|
441
|
+
readonly name = "FixedSizeMismatchError";
|
|
442
|
+
readonly code: "fixed-size-mismatch";
|
|
443
|
+
readonly hint: string;
|
|
444
|
+
readonly expected: string;
|
|
445
|
+
readonly detail: {
|
|
446
|
+
readonly expected: number;
|
|
447
|
+
readonly actual: number;
|
|
448
|
+
};
|
|
449
|
+
constructor(fieldName: string, expected: number, actual: number);
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Surfaced via the Layer-3 ErrorHandler from
|
|
453
|
+
* `packages/runtime/src/render-system-extract.ts` defensive entry when an
|
|
454
|
+
* `Instances.transforms` array<f32> length violates the column-major mat4
|
|
455
|
+
* stride contract (`length % 16 === 0`). Locates the failure adjacent to the
|
|
456
|
+
* extract pipeline rather than at GPU upload (plan-strategy §2.4 D-P2 +
|
|
457
|
+
* §8.3 hint SSOT).
|
|
458
|
+
*
|
|
459
|
+
* `.code = 'instance-transforms-stride-mismatch'`
|
|
460
|
+
* `.detail = { actualLength, expectedStride: 16 }`
|
|
461
|
+
* `.hint` — names the stride invariant + the call sites to audit.
|
|
462
|
+
*/
|
|
463
|
+
export declare class InstanceTransformsStrideMismatchError extends Error {
|
|
464
|
+
readonly name = "InstanceTransformsStrideMismatchError";
|
|
465
|
+
readonly code: "instance-transforms-stride-mismatch";
|
|
466
|
+
readonly hint: string;
|
|
467
|
+
readonly expected: string;
|
|
468
|
+
readonly detail: {
|
|
469
|
+
readonly actualLength: number;
|
|
470
|
+
readonly expectedStride: 16;
|
|
471
|
+
};
|
|
472
|
+
constructor(actualLength: number);
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Thrown by `defineComponent` when an `array<T>` / `array<T,N>` schema field
|
|
476
|
+
* carries an element type outside the legal whitelist (scalars + entity).
|
|
477
|
+
* Forms like `array<ref<X>>` / `array<handle<X>>` / `array<buffer:N>` /
|
|
478
|
+
* `array<array<...>>` are rejected (AC-03 runtime fail-safe). The TS layer
|
|
479
|
+
* blocks these forms at compile time; this error is the runtime backstop for
|
|
480
|
+
* `as unknown as SchemaFieldType` casts.
|
|
481
|
+
*
|
|
482
|
+
* `.code = 'managed-array-element-type-not-allowed'`
|
|
483
|
+
* `.detail = { fieldName, elementType, hint }`
|
|
484
|
+
* `.hint` — lists the whitelist of legal element types.
|
|
485
|
+
*/
|
|
486
|
+
export declare class ManagedArrayElementTypeNotAllowedError extends Error {
|
|
487
|
+
readonly name = "ManagedArrayElementTypeNotAllowedError";
|
|
488
|
+
readonly code: "managed-array-element-type-not-allowed";
|
|
489
|
+
readonly hint: string;
|
|
490
|
+
readonly expected: string;
|
|
491
|
+
readonly detail: {
|
|
492
|
+
readonly fieldName: string;
|
|
493
|
+
readonly elementType: string;
|
|
494
|
+
readonly hint: string;
|
|
495
|
+
};
|
|
496
|
+
constructor(fieldName: string, elementType: string);
|
|
497
|
+
}
|
|
498
|
+
/** Closed union of every `.code` literal carried by EcsError instances. */
|
|
499
|
+
export type EcsErrorCode = 'stale-entity' | 'component-already-present' | 'component-not-present' | 'cyclic-dependency' | 'resource-not-found' | 'time-delta-invalid' | 'time-config-invalid' | 'schedule-scope-mismatch' | ScheduleMutationErrorCode | 'unique-ref-released' | 'unique-ref-double-release' | 'shared-ref-released' | 'shared-ref-double-release' | 'shared-ref-payload-invalid' | 'builtin-slot-not-owned' | 'shared-ref-stale' | 'unique-ref-stale' | 'managed-buffer-out-of-bounds' | 'managed-buffer-shrink-not-supported' | 'fixed-size-mismatch' | 'relationship-self-cycle' | 'relationship-detach-mismatch' | 'remove-essential-component' | 'spawn-data-unknown-field' | 'shared-field-invalid-value' | 'system-set-not-registered' | 'component-field-invalid-value' | 'component-numeric-value-invalid' | 'managed-array-invalid-value' | 'shared-kernel-ineligible' | 'shared-kernel-failed' | 'world-poisoned' | 'command-failed' | 'system-failed';
|
|
500
|
+
/**
|
|
501
|
+
* Discriminated `.detail` payload per `.code`.
|
|
502
|
+
*
|
|
503
|
+
* Narrowed via `switch (err.code)` against `EcsErrorCode`. Empty-detail entries
|
|
504
|
+
* (legacy errors without `.detail`) are intentionally omitted from this map —
|
|
505
|
+
* only the w5 family + `cyclic-injection` carry structured payloads today.
|
|
506
|
+
*/
|
|
507
|
+
export type EcsErrorDetail = {
|
|
508
|
+
readonly code: 'shared-kernel-ineligible';
|
|
509
|
+
readonly kernelName: string;
|
|
510
|
+
readonly reason: string;
|
|
511
|
+
} | {
|
|
512
|
+
readonly code: 'shared-kernel-failed';
|
|
513
|
+
readonly kernelName: string;
|
|
514
|
+
readonly worldIdentity: string;
|
|
515
|
+
readonly cause: unknown;
|
|
516
|
+
readonly partialWrite: boolean;
|
|
517
|
+
readonly retryable: false;
|
|
518
|
+
} | {
|
|
519
|
+
readonly code: 'world-poisoned';
|
|
520
|
+
readonly worldIdentity: string;
|
|
521
|
+
readonly fault: unknown;
|
|
522
|
+
} | {
|
|
523
|
+
readonly code: 'sparse-storage-requires-tag';
|
|
524
|
+
readonly componentName: string;
|
|
525
|
+
} | {
|
|
526
|
+
readonly code: 'query-descriptor-conflict';
|
|
527
|
+
readonly componentName: string;
|
|
528
|
+
readonly roles: readonly string[];
|
|
529
|
+
} | {
|
|
530
|
+
readonly code: 'query-data-requires-fields';
|
|
531
|
+
readonly componentName: string;
|
|
532
|
+
} | {
|
|
533
|
+
readonly code: 'query-span-unavailable';
|
|
534
|
+
readonly reason: QuerySpanUnavailableReason;
|
|
535
|
+
} | {
|
|
536
|
+
readonly code: 'query-iteration-invalidated';
|
|
537
|
+
readonly expectedStructureEpoch: number;
|
|
538
|
+
readonly actualStructureEpoch: number;
|
|
539
|
+
} | {
|
|
540
|
+
readonly code: 'query-iteration-active';
|
|
541
|
+
} | {
|
|
542
|
+
readonly code: 'change-epoch-exhausted';
|
|
543
|
+
readonly epoch: number;
|
|
544
|
+
} | {
|
|
545
|
+
readonly code: 'unique-ref-released';
|
|
546
|
+
readonly handle: number;
|
|
547
|
+
readonly target: string;
|
|
548
|
+
} | {
|
|
549
|
+
readonly code: 'unique-ref-double-release';
|
|
550
|
+
readonly handle: number;
|
|
551
|
+
readonly target: string;
|
|
552
|
+
} | {
|
|
553
|
+
readonly code: 'shared-ref-released';
|
|
554
|
+
readonly handle: number;
|
|
555
|
+
readonly target: string;
|
|
556
|
+
} | {
|
|
557
|
+
readonly code: 'shared-ref-double-release';
|
|
558
|
+
readonly handle: number;
|
|
559
|
+
readonly target: string;
|
|
560
|
+
readonly rc: number;
|
|
561
|
+
} | {
|
|
562
|
+
readonly code: 'shared-ref-payload-invalid';
|
|
563
|
+
readonly target: string;
|
|
564
|
+
readonly actual: 'null' | 'undefined';
|
|
565
|
+
} | {
|
|
566
|
+
readonly code: 'builtin-slot-not-owned';
|
|
567
|
+
readonly slot: number;
|
|
568
|
+
} | {
|
|
569
|
+
readonly code: 'shared-ref-stale';
|
|
570
|
+
readonly slot: number;
|
|
571
|
+
readonly expectedGeneration: number;
|
|
572
|
+
readonly actualGeneration: number;
|
|
573
|
+
} | {
|
|
574
|
+
readonly code: 'unique-ref-stale';
|
|
575
|
+
readonly slot: number;
|
|
576
|
+
readonly expectedGeneration: number;
|
|
577
|
+
readonly actualGeneration: number;
|
|
578
|
+
} | {
|
|
579
|
+
readonly code: 'managed-buffer-out-of-bounds';
|
|
580
|
+
readonly index: number;
|
|
581
|
+
readonly size: number;
|
|
582
|
+
} | {
|
|
583
|
+
readonly code: 'managed-buffer-shrink-not-supported';
|
|
584
|
+
readonly requested: number;
|
|
585
|
+
readonly current: number;
|
|
586
|
+
} | {
|
|
587
|
+
readonly code: 'managed-array-element-type-not-allowed';
|
|
588
|
+
readonly fieldName: string;
|
|
589
|
+
readonly elementType: string;
|
|
590
|
+
readonly hint: string;
|
|
591
|
+
} | {
|
|
592
|
+
readonly code: 'fixed-size-mismatch';
|
|
593
|
+
readonly expected: number;
|
|
594
|
+
readonly actual: number;
|
|
595
|
+
} | {
|
|
596
|
+
readonly code: 'instance-transforms-stride-mismatch';
|
|
597
|
+
readonly actualLength: number;
|
|
598
|
+
readonly expectedStride: 16;
|
|
599
|
+
} | {
|
|
600
|
+
readonly code: 'spawn-light-invalid-bounds';
|
|
601
|
+
readonly field: 'range' | 'innerOuter' | 'outerNinety';
|
|
602
|
+
readonly got: number;
|
|
603
|
+
} | {
|
|
604
|
+
readonly code: 'resource-invalid-value';
|
|
605
|
+
readonly receivedMode: number;
|
|
606
|
+
readonly receivedKey?: string;
|
|
607
|
+
} | {
|
|
608
|
+
readonly code: 'sprite-animation-invalid';
|
|
609
|
+
readonly field: 'regions-length';
|
|
610
|
+
readonly regionsLength: number;
|
|
611
|
+
readonly frameCount: number;
|
|
612
|
+
} | {
|
|
613
|
+
readonly code: 'sprite-animation-invalid';
|
|
614
|
+
readonly field: 'frame-duration';
|
|
615
|
+
readonly frameDuration: number;
|
|
616
|
+
} | {
|
|
617
|
+
readonly code: 'relationship-self-cycle';
|
|
618
|
+
readonly component: string;
|
|
619
|
+
readonly entity: number;
|
|
620
|
+
readonly ancestor: number;
|
|
621
|
+
} | {
|
|
622
|
+
readonly code: 'relationship-mirror-component-not-registered';
|
|
623
|
+
readonly component: string;
|
|
624
|
+
readonly mirror: string;
|
|
625
|
+
} | {
|
|
626
|
+
readonly code: 'relationship-mirror-field-type-mismatch';
|
|
627
|
+
readonly component: string;
|
|
628
|
+
readonly mirror: string;
|
|
629
|
+
readonly field: string;
|
|
630
|
+
readonly actualType: string;
|
|
631
|
+
} | {
|
|
632
|
+
readonly code: 'relationship-detach-mismatch';
|
|
633
|
+
readonly component: string;
|
|
634
|
+
readonly child: number;
|
|
635
|
+
readonly expectedParent: number;
|
|
636
|
+
readonly actualParent: number;
|
|
637
|
+
} | {
|
|
638
|
+
readonly code: 'component-not-defined';
|
|
639
|
+
readonly name: string;
|
|
640
|
+
} | {
|
|
641
|
+
readonly code: 'remove-essential-component';
|
|
642
|
+
readonly componentName: string;
|
|
643
|
+
} | {
|
|
644
|
+
readonly code: 'scene-override-type-mismatch';
|
|
645
|
+
readonly comp: string;
|
|
646
|
+
readonly field: string;
|
|
647
|
+
readonly expectedType: string;
|
|
648
|
+
readonly actualType: unknown;
|
|
649
|
+
} | {
|
|
650
|
+
readonly code: 'spawn-data-unknown-field';
|
|
651
|
+
readonly component: string;
|
|
652
|
+
readonly field: string;
|
|
653
|
+
readonly knownFields: readonly string[];
|
|
654
|
+
} | {
|
|
655
|
+
readonly code: 'sprite-instances-count-mismatch';
|
|
656
|
+
readonly transformsLength: number;
|
|
657
|
+
readonly regionsLength: number;
|
|
658
|
+
readonly expectedStride: {
|
|
659
|
+
readonly transforms: 16;
|
|
660
|
+
readonly regions: 4;
|
|
661
|
+
};
|
|
662
|
+
} | {
|
|
663
|
+
readonly code: 'sprite-instances-requires-sprite-shader';
|
|
664
|
+
readonly entityId: number;
|
|
665
|
+
readonly observedMaterialShaderId: string;
|
|
666
|
+
} | {
|
|
667
|
+
readonly code: 'sprite-instances-mutually-exclusive-with-instances';
|
|
668
|
+
readonly entityId: number;
|
|
669
|
+
} | {
|
|
670
|
+
readonly code: 'shared-field-invalid-value';
|
|
671
|
+
readonly component: string;
|
|
672
|
+
readonly field: string;
|
|
673
|
+
readonly fieldType: string;
|
|
674
|
+
readonly actualValue: unknown;
|
|
675
|
+
readonly index?: number;
|
|
676
|
+
} | {
|
|
677
|
+
readonly code: 'system-set-not-registered';
|
|
678
|
+
readonly name: string;
|
|
679
|
+
readonly registered: readonly string[];
|
|
680
|
+
} | {
|
|
681
|
+
readonly code: 'component-field-invalid-value';
|
|
682
|
+
readonly entity: number | undefined;
|
|
683
|
+
readonly component: string;
|
|
684
|
+
readonly field: string;
|
|
685
|
+
readonly received: unknown;
|
|
686
|
+
readonly allowedValues: Readonly<Record<string, number>>;
|
|
687
|
+
} | {
|
|
688
|
+
readonly code: 'component-numeric-value-invalid';
|
|
689
|
+
readonly entity: number | undefined;
|
|
690
|
+
readonly component: string;
|
|
691
|
+
readonly field: string;
|
|
692
|
+
readonly received: number;
|
|
693
|
+
readonly index?: number;
|
|
694
|
+
} | {
|
|
695
|
+
readonly code: 'managed-array-invalid-value';
|
|
696
|
+
readonly component: string;
|
|
697
|
+
readonly field: string;
|
|
698
|
+
readonly fieldType: string;
|
|
699
|
+
readonly actualValue: unknown;
|
|
700
|
+
} | {
|
|
701
|
+
readonly code: 'cyclic-dependency';
|
|
702
|
+
readonly cycle: readonly string[];
|
|
703
|
+
} | {
|
|
704
|
+
readonly code: 'command-failed';
|
|
705
|
+
readonly systemName: string;
|
|
706
|
+
readonly schedule: string;
|
|
707
|
+
readonly commandIndex: number;
|
|
708
|
+
readonly commandKind: CommandKind;
|
|
709
|
+
readonly cause: unknown;
|
|
710
|
+
} | {
|
|
711
|
+
readonly code: 'system-failed';
|
|
712
|
+
readonly systemName: string;
|
|
713
|
+
readonly schedule: string;
|
|
714
|
+
readonly cause: unknown;
|
|
715
|
+
readonly lastCommittedCommand: CommandCommitEvidence | null;
|
|
716
|
+
};
|
|
717
|
+
/**
|
|
718
|
+
* Layer-3 error envelope routed through managed-storage callbacks. Callers
|
|
719
|
+
* narrow `detail` through the source-owned `EcsErrorDetail` union.
|
|
720
|
+
*/
|
|
721
|
+
export interface ManagedArrayErrorEnvelope {
|
|
722
|
+
readonly code: EcsErrorCode;
|
|
723
|
+
readonly hint: string;
|
|
724
|
+
readonly expected: string;
|
|
725
|
+
readonly detail: unknown;
|
|
726
|
+
}
|
|
727
|
+
export type CommandKind = 'spawn' | 'despawn' | 'addComponent' | 'removeComponent';
|
|
728
|
+
export interface CommandCommitEvidence {
|
|
729
|
+
readonly index: number;
|
|
730
|
+
readonly kind: CommandKind;
|
|
731
|
+
}
|
|
732
|
+
/** Expected command preflight failure, with the exact batch location. */
|
|
733
|
+
export declare class CommandFailedError extends Error {
|
|
734
|
+
readonly name = "CommandFailedError";
|
|
735
|
+
readonly code: "command-failed";
|
|
736
|
+
readonly expected = "all deferred commands pass preflight before commit";
|
|
737
|
+
readonly hint = "Inspect detail.cause, repair the command at detail.commandIndex, and run the World again.";
|
|
738
|
+
readonly cause: unknown;
|
|
739
|
+
readonly detail: {
|
|
740
|
+
readonly systemName: string;
|
|
741
|
+
readonly schedule: string;
|
|
742
|
+
readonly commandIndex: number;
|
|
743
|
+
readonly commandKind: CommandKind;
|
|
744
|
+
readonly cause: unknown;
|
|
745
|
+
};
|
|
746
|
+
constructor(systemName: string, schedule: string, commandIndex: number, commandKind: CommandKind, cause: unknown);
|
|
747
|
+
}
|
|
748
|
+
/** Unknown system failure. The World is poisoned because row writes may exist. */
|
|
749
|
+
export declare class SystemFailedError extends Error {
|
|
750
|
+
readonly name = "SystemFailedError";
|
|
751
|
+
readonly code: "system-failed";
|
|
752
|
+
readonly expected = "a system completes without throwing or returning a failed Result";
|
|
753
|
+
readonly hint = "Inspect detail.cause, stop using this poisoned World, and rebuild it from the owning App.";
|
|
754
|
+
readonly cause: unknown;
|
|
755
|
+
readonly detail: {
|
|
756
|
+
readonly systemName: string;
|
|
757
|
+
readonly schedule: string;
|
|
758
|
+
readonly cause: unknown;
|
|
759
|
+
readonly lastCommittedCommand: CommandCommitEvidence | null;
|
|
760
|
+
};
|
|
761
|
+
constructor(systemName: string, schedule: string, cause: unknown, lastCommittedCommand?: CommandCommitEvidence | null);
|
|
762
|
+
}
|
|
763
|
+
//# sourceMappingURL=errors.d.ts.map
|