@oasys/oecs 0.5.4 → 0.6.0
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/CHANGELOG.md +1223 -266
- package/README.md +217 -112
- package/dist/core/ecs/access_check.d.cts +29 -29
- package/dist/core/ecs/access_check.d.ts +29 -29
- package/dist/core/ecs/access_check.d.ts.map +1 -1
- package/dist/core/ecs/archetype.d.cts +217 -209
- package/dist/core/ecs/archetype.d.ts +217 -209
- package/dist/core/ecs/archetype.d.ts.map +1 -1
- package/dist/core/ecs/archetype_closure.d.cts +23 -0
- package/dist/core/ecs/archetype_closure.d.ts +23 -0
- package/dist/core/ecs/archetype_closure.d.ts.map +1 -0
- package/dist/core/ecs/archetype_graph.d.cts +33 -33
- package/dist/core/ecs/archetype_graph.d.ts +33 -33
- package/dist/core/ecs/archetype_graph.d.ts.map +1 -1
- package/dist/core/ecs/archetype_types.d.cts +55 -0
- package/dist/core/ecs/archetype_types.d.ts +55 -0
- package/dist/core/ecs/archetype_types.d.ts.map +1 -0
- package/dist/core/ecs/change_feed.d.cts +53 -0
- package/dist/core/ecs/change_feed.d.ts +53 -0
- package/dist/core/ecs/change_feed.d.ts.map +1 -0
- package/dist/core/ecs/changed_query.d.cts +36 -0
- package/dist/core/ecs/changed_query.d.ts +36 -0
- package/dist/core/ecs/changed_query.d.ts.map +1 -0
- package/dist/core/ecs/chunk_columns.d.cts +49 -0
- package/dist/core/ecs/chunk_columns.d.ts +49 -0
- package/dist/core/ecs/chunk_columns.d.ts.map +1 -0
- package/dist/core/ecs/command_log.d.cts +26 -26
- package/dist/core/ecs/command_log.d.ts +26 -26
- package/dist/core/ecs/command_log.d.ts.map +1 -1
- package/dist/core/ecs/component.d.cts +43 -42
- package/dist/core/ecs/component.d.ts +43 -42
- package/dist/core/ecs/component.d.ts.map +1 -1
- package/dist/core/ecs/component_registry.d.cts +53 -0
- package/dist/core/ecs/component_registry.d.ts +53 -0
- package/dist/core/ecs/component_registry.d.ts.map +1 -0
- package/dist/core/ecs/compute_backend.d.cts +18 -7
- package/dist/core/ecs/compute_backend.d.ts +18 -7
- package/dist/core/ecs/compute_backend.d.ts.map +1 -1
- package/dist/core/ecs/deferred_commands.d.cts +15 -14
- package/dist/core/ecs/deferred_commands.d.ts +15 -14
- package/dist/core/ecs/deferred_commands.d.ts.map +1 -1
- package/dist/core/ecs/dispatch_trace.d.cts +32 -31
- package/dist/core/ecs/dispatch_trace.d.ts +32 -31
- package/dist/core/ecs/dispatch_trace.d.ts.map +1 -1
- package/dist/core/ecs/ecs.d.cts +289 -270
- package/dist/core/ecs/ecs.d.ts +289 -270
- package/dist/core/ecs/ecs.d.ts.map +1 -1
- package/dist/core/ecs/ecs_memory.d.cts +134 -136
- package/dist/core/ecs/ecs_memory.d.ts +134 -136
- package/dist/core/ecs/ecs_memory.d.ts.map +1 -1
- package/dist/core/ecs/ecs_options.d.cts +89 -0
- package/dist/core/ecs/ecs_options.d.ts +89 -0
- package/dist/core/ecs/ecs_options.d.ts.map +1 -0
- package/dist/core/ecs/entity.d.cts +4 -4
- package/dist/core/ecs/entity.d.ts +4 -4
- package/dist/core/ecs/entity_allocator.d.cts +20 -18
- package/dist/core/ecs/entity_allocator.d.ts +20 -18
- package/dist/core/ecs/entity_allocator.d.ts.map +1 -1
- package/dist/core/ecs/event.d.cts +36 -22
- package/dist/core/ecs/event.d.ts +36 -22
- package/dist/core/ecs/event.d.ts.map +1 -1
- package/dist/core/ecs/facades.d.cts +12 -126
- package/dist/core/ecs/facades.d.ts +12 -126
- package/dist/core/ecs/facades.d.ts.map +1 -1
- package/dist/core/ecs/frame_stepper.d.cts +12 -12
- package/dist/core/ecs/frame_stepper.d.ts +12 -12
- package/dist/core/ecs/frame_stepper.d.ts.map +1 -1
- package/dist/core/ecs/frame_trace.d.cts +32 -32
- package/dist/core/ecs/frame_trace.d.ts +32 -32
- package/dist/core/ecs/frame_trace.d.ts.map +1 -1
- package/dist/core/ecs/host_commands.d.cts +103 -85
- package/dist/core/ecs/host_commands.d.ts +103 -85
- package/dist/core/ecs/host_commands.d.ts.map +1 -1
- package/dist/core/ecs/index.d.cts +21 -11
- package/dist/core/ecs/index.d.ts +21 -11
- package/dist/core/ecs/index.d.ts.map +1 -1
- package/dist/core/ecs/observer.d.cts +39 -120
- package/dist/core/ecs/observer.d.ts +39 -120
- package/dist/core/ecs/observer.d.ts.map +1 -1
- package/dist/core/ecs/phase.d.cts +79 -0
- package/dist/core/ecs/phase.d.ts +79 -0
- package/dist/core/ecs/phase.d.ts.map +1 -0
- package/dist/core/ecs/plugin.d.cts +125 -0
- package/dist/core/ecs/plugin.d.ts +125 -0
- package/dist/core/ecs/plugin.d.ts.map +1 -0
- package/dist/core/ecs/plugin_slots.d.cts +26 -0
- package/dist/core/ecs/plugin_slots.d.ts +26 -0
- package/dist/core/ecs/plugin_slots.d.ts.map +1 -0
- package/dist/core/ecs/query.d.cts +208 -578
- package/dist/core/ecs/query.d.ts +208 -578
- package/dist/core/ecs/query.d.ts.map +1 -1
- package/dist/core/ecs/query_cache.d.cts +130 -0
- package/dist/core/ecs/query_cache.d.ts +130 -0
- package/dist/core/ecs/query_cache.d.ts.map +1 -0
- package/dist/core/ecs/query_registry.d.cts +47 -0
- package/dist/core/ecs/query_registry.d.ts +47 -0
- package/dist/core/ecs/query_registry.d.ts.map +1 -0
- package/dist/core/ecs/query_terms.d.cts +126 -0
- package/dist/core/ecs/query_terms.d.ts +126 -0
- package/dist/core/ecs/query_terms.d.ts.map +1 -0
- package/dist/core/ecs/ref.d.cts +100 -39
- package/dist/core/ecs/ref.d.ts +100 -39
- package/dist/core/ecs/ref.d.ts.map +1 -1
- package/dist/core/ecs/relation.d.cts +101 -182
- package/dist/core/ecs/relation.d.ts +101 -182
- package/dist/core/ecs/relation.d.ts.map +1 -1
- package/dist/core/ecs/resource.d.cts +13 -13
- package/dist/core/ecs/resource.d.ts +13 -13
- package/dist/core/ecs/resource_registry.d.cts +5 -5
- package/dist/core/ecs/resource_registry.d.ts +5 -5
- package/dist/core/ecs/resource_registry.d.ts.map +1 -1
- package/dist/core/ecs/row_kinds.d.cts +24 -0
- package/dist/core/ecs/row_kinds.d.ts +24 -0
- package/dist/core/ecs/row_kinds.d.ts.map +1 -0
- package/dist/core/ecs/run_condition.d.cts +23 -23
- package/dist/core/ecs/run_condition.d.ts +23 -23
- package/dist/core/ecs/run_condition.d.ts.map +1 -1
- package/dist/core/ecs/schedule.d.cts +91 -120
- package/dist/core/ecs/schedule.d.ts +91 -120
- package/dist/core/ecs/schedule.d.ts.map +1 -1
- package/dist/core/ecs/schedule_plan.d.cts +33 -0
- package/dist/core/ecs/schedule_plan.d.ts +33 -0
- package/dist/core/ecs/schedule_plan.d.ts.map +1 -0
- package/dist/core/ecs/snapshot.d.cts +77 -0
- package/dist/core/ecs/snapshot.d.ts +77 -0
- package/dist/core/ecs/snapshot.d.ts.map +1 -0
- package/dist/core/ecs/snapshot_mount.d.cts +42 -0
- package/dist/core/ecs/snapshot_mount.d.ts +42 -0
- package/dist/core/ecs/snapshot_mount.d.ts.map +1 -0
- package/dist/core/ecs/sparse_store.d.cts +108 -51
- package/dist/core/ecs/sparse_store.d.ts +108 -51
- package/dist/core/ecs/sparse_store.d.ts.map +1 -1
- package/dist/core/ecs/store.d.cts +527 -473
- package/dist/core/ecs/store.d.ts +527 -473
- package/dist/core/ecs/store.d.ts.map +1 -1
- package/dist/core/ecs/store_layout_listener.d.cts +6 -6
- package/dist/core/ecs/store_layout_listener.d.ts +6 -6
- package/dist/core/ecs/store_types.d.cts +122 -0
- package/dist/core/ecs/store_types.d.ts +122 -0
- package/dist/core/ecs/store_types.d.ts.map +1 -0
- package/dist/core/ecs/system.d.cts +146 -61
- package/dist/core/ecs/system.d.ts +146 -61
- package/dist/core/ecs/system.d.ts.map +1 -1
- package/dist/core/ecs/system_context.d.cts +296 -0
- package/dist/core/ecs/system_context.d.ts +296 -0
- package/dist/core/ecs/system_context.d.ts.map +1 -0
- package/dist/core/ecs/system_set.d.cts +48 -0
- package/dist/core/ecs/system_set.d.ts +48 -0
- package/dist/core/ecs/system_set.d.ts.map +1 -0
- package/dist/core/ecs/utils/arrays.d.cts +15 -1
- package/dist/core/ecs/utils/arrays.d.ts +15 -1
- package/dist/core/ecs/utils/arrays.d.ts.map +1 -1
- package/dist/core/ecs/utils/error.d.cts +82 -6
- package/dist/core/ecs/utils/error.d.ts +82 -6
- package/dist/core/ecs/utils/error.d.ts.map +1 -1
- package/dist/core/ecs/utils/plugin_error.d.cts +10 -0
- package/dist/core/ecs/utils/plugin_error.d.ts +10 -0
- package/dist/core/ecs/utils/plugin_error.d.ts.map +1 -0
- package/dist/core/restore_errors.d.cts +30 -0
- package/dist/core/restore_errors.d.ts +30 -0
- package/dist/core/restore_errors.d.ts.map +1 -0
- package/dist/core/store/action_ring.d.cts +44 -44
- package/dist/core/store/action_ring.d.ts +44 -44
- package/dist/core/store/action_ring.d.ts.map +1 -1
- package/dist/core/store/allocator.d.cts +149 -95
- package/dist/core/store/allocator.d.ts +149 -95
- package/dist/core/store/allocator.d.ts.map +1 -1
- package/dist/core/store/buffer_backed_column.d.cts +17 -17
- package/dist/core/store/buffer_backed_column.d.ts +17 -17
- package/dist/core/store/buffer_backed_column.d.ts.map +1 -1
- package/dist/core/store/column_store.d.cts +124 -86
- package/dist/core/store/column_store.d.ts +124 -86
- package/dist/core/store/column_store.d.ts.map +1 -1
- package/dist/core/store/command_dispatch.d.cts +14 -15
- package/dist/core/store/command_dispatch.d.ts +14 -15
- package/dist/core/store/command_dispatch.d.ts.map +1 -1
- package/dist/core/store/command_ring.d.cts +36 -39
- package/dist/core/store/command_ring.d.ts +36 -39
- package/dist/core/store/command_ring.d.ts.map +1 -1
- package/dist/core/store/descriptor.d.cts +34 -17
- package/dist/core/store/descriptor.d.ts +34 -17
- package/dist/core/store/descriptor.d.ts.map +1 -1
- package/dist/core/store/entity_index.d.cts +34 -35
- package/dist/core/store/entity_index.d.ts +34 -35
- package/dist/core/store/entity_index.d.ts.map +1 -1
- package/dist/core/store/event_ring.d.cts +36 -38
- package/dist/core/store/event_ring.d.ts +36 -38
- package/dist/core/store/event_ring.d.ts.map +1 -1
- package/dist/core/store/extend.d.cts +13 -7
- package/dist/core/store/extend.d.ts +13 -7
- package/dist/core/store/extend.d.ts.map +1 -1
- package/dist/core/store/grow.d.cts +2 -2
- package/dist/core/store/grow.d.ts +2 -2
- package/dist/core/store/grow.d.ts.map +1 -1
- package/dist/core/store/header.d.cts +31 -27
- package/dist/core/store/header.d.ts +31 -27
- package/dist/core/store/header.d.ts.map +1 -1
- package/dist/core/store/index.d.cts +10 -10
- package/dist/core/store/index.d.ts +10 -10
- package/dist/core/store/index.d.ts.map +1 -1
- package/dist/core/store/layout_ops.d.cts +71 -62
- package/dist/core/store/layout_ops.d.ts +71 -62
- package/dist/core/store/layout_ops.d.ts.map +1 -1
- package/dist/core/store/region_table.d.cts +28 -21
- package/dist/core/store/region_table.d.ts +28 -21
- package/dist/core/store/region_table.d.ts.map +1 -1
- package/dist/core/store/snapshot.d.cts +31 -16
- package/dist/core/store/snapshot.d.ts +31 -16
- package/dist/core/store/snapshot.d.ts.map +1 -1
- package/dist/core/store/state_hash.d.cts +12 -12
- package/dist/core/store/state_hash.d.ts +12 -12
- package/dist/core/store/state_hash.d.ts.map +1 -1
- package/dist/core/store/store_regions.d.cts +10 -10
- package/dist/core/store/store_regions.d.ts +10 -10
- package/dist/core/store/store_regions.d.ts.map +1 -1
- package/dist/core/store/vendored_abi/abi.d.cts +27 -2
- package/dist/core/store/vendored_abi/abi.d.ts +27 -2
- package/dist/core/store/vendored_abi/abi.d.ts.map +1 -1
- package/dist/host_commands-B2KMx8O2.cjs +1 -0
- package/dist/host_commands-ClVPvhSa.cjs +2 -0
- package/dist/host_commands-CwxVQS1z.js +1524 -0
- package/dist/host_commands-nJvTy88E.js +1667 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +15 -10
- package/dist/index.d.ts +15 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.development.cjs +1 -1
- package/dist/index.development.js +5804 -5203
- package/dist/index.js +5323 -4764
- package/dist/internal.cjs +2 -2
- package/dist/internal.d.cts +5 -2
- package/dist/internal.d.ts +5 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.development.cjs +1 -1
- package/dist/internal.development.js +70 -20
- package/dist/internal.js +138 -83
- package/dist/plugins/abi-D3V-QUSf.cjs +1 -0
- package/dist/plugins/abi-NP8pNxpd.js +42 -0
- package/dist/plugins/arrays-Dr_1hCjL.js +28 -0
- package/dist/plugins/arrays-Dt-Joc4i.cjs +1 -0
- package/dist/plugins/assertions-gtDVfbnQ.js +6 -0
- package/dist/plugins/assertions-z5GQd_bB.cjs +1 -0
- package/dist/{extensions → plugins}/editor/editor.d.cts +54 -54
- package/dist/{extensions → plugins}/editor/editor.d.ts +54 -54
- package/dist/plugins/editor/editor.d.ts.map +1 -0
- package/dist/{extensions → plugins}/editor/field_handle.d.cts +12 -12
- package/dist/{extensions → plugins}/editor/field_handle.d.ts +12 -12
- package/dist/plugins/editor/field_handle.d.ts.map +1 -0
- package/dist/plugins/editor/index.d.cts +22 -0
- package/dist/plugins/editor/index.d.ts +22 -0
- package/dist/plugins/editor/index.d.ts.map +1 -0
- package/dist/plugins/editor.cjs +1 -0
- package/dist/plugins/editor.d.cts +1 -0
- package/dist/plugins/editor.d.ts +1 -0
- package/dist/plugins/editor.development.cjs +1 -0
- package/dist/{extensions/editor/index.development.js → plugins/editor.development.js} +81 -64
- package/dist/{extensions/editor/index.js → plugins/editor.js} +81 -64
- package/dist/plugins/events/event_channel.d.cts +13 -0
- package/dist/plugins/events/event_channel.d.ts +13 -0
- package/dist/plugins/events/event_channel.d.ts.map +1 -0
- package/dist/plugins/events/event_registry.d.cts +22 -0
- package/dist/plugins/events/event_registry.d.ts +22 -0
- package/dist/plugins/events/event_registry.d.ts.map +1 -0
- package/dist/plugins/events/facade.d.cts +26 -0
- package/dist/plugins/events/facade.d.ts +26 -0
- package/dist/plugins/events/facade.d.ts.map +1 -0
- package/dist/plugins/events/index.d.cts +10 -0
- package/dist/plugins/events/index.d.ts +10 -0
- package/dist/plugins/events/index.d.ts.map +1 -0
- package/dist/plugins/events.cjs +1 -0
- package/dist/plugins/events.d.cts +1 -0
- package/dist/plugins/events.d.ts +1 -0
- package/dist/plugins/events.development.cjs +1 -0
- package/dist/plugins/events.development.js +174 -0
- package/dist/plugins/events.js +159 -0
- package/dist/plugins/observers/index.d.cts +23 -0
- package/dist/plugins/observers/index.d.ts +23 -0
- package/dist/plugins/observers/index.d.ts.map +1 -0
- package/dist/plugins/observers/observer_registry.d.cts +101 -0
- package/dist/plugins/observers/observer_registry.d.ts +101 -0
- package/dist/plugins/observers/observer_registry.d.ts.map +1 -0
- package/dist/plugins/observers.cjs +1 -0
- package/dist/plugins/observers.d.cts +1 -0
- package/dist/plugins/observers.d.ts +1 -0
- package/dist/plugins/observers.development.cjs +1 -0
- package/dist/plugins/observers.development.js +431 -0
- package/dist/plugins/observers.js +403 -0
- package/dist/plugins/relation_store-BsoegrZh.js +313 -0
- package/dist/plugins/relation_store-DQKSnxsm.cjs +1 -0
- package/dist/plugins/relation_store-RBhpcE28.cjs +1 -0
- package/dist/plugins/relation_store-RqW5Snx6.js +328 -0
- package/dist/plugins/relations/builtin_relations.d.cts +48 -0
- package/dist/plugins/relations/builtin_relations.d.ts +48 -0
- package/dist/plugins/relations/builtin_relations.d.ts.map +1 -0
- package/dist/plugins/relations/facade.d.cts +73 -0
- package/dist/plugins/relations/facade.d.ts +73 -0
- package/dist/plugins/relations/facade.d.ts.map +1 -0
- package/dist/plugins/relations/index.d.cts +11 -0
- package/dist/plugins/relations/index.d.ts +11 -0
- package/dist/plugins/relations/index.d.ts.map +1 -0
- package/dist/{core/ecs → plugins/relations}/relation_service.d.cts +85 -97
- package/dist/{core/ecs → plugins/relations}/relation_service.d.ts +85 -97
- package/dist/plugins/relations/relation_service.d.ts.map +1 -0
- package/dist/plugins/relations/relation_store.d.cts +177 -0
- package/dist/plugins/relations/relation_store.d.ts +177 -0
- package/dist/plugins/relations/relation_store.d.ts.map +1 -0
- package/dist/plugins/relations.cjs +1 -0
- package/dist/plugins/relations.d.cts +1 -0
- package/dist/plugins/relations.d.ts +1 -0
- package/dist/plugins/relations.development.cjs +1 -0
- package/dist/plugins/relations.development.js +603 -0
- package/dist/plugins/relations.js +553 -0
- package/dist/plugins/snapshots/index.d.cts +33 -0
- package/dist/plugins/snapshots/index.d.ts +33 -0
- package/dist/plugins/snapshots/index.d.ts.map +1 -0
- package/dist/plugins/snapshots/resume.d.cts +57 -0
- package/dist/plugins/snapshots/resume.d.ts +57 -0
- package/dist/plugins/snapshots/resume.d.ts.map +1 -0
- package/dist/plugins/snapshots/snapshot_service.d.cts +59 -0
- package/dist/plugins/snapshots/snapshot_service.d.ts +59 -0
- package/dist/plugins/snapshots/snapshot_service.d.ts.map +1 -0
- package/dist/plugins/snapshots.cjs +1 -0
- package/dist/plugins/snapshots.d.cts +1 -0
- package/dist/plugins/snapshots.d.ts +1 -0
- package/dist/plugins/snapshots.development.cjs +1 -0
- package/dist/plugins/snapshots.development.js +737 -0
- package/dist/plugins/snapshots.js +737 -0
- package/dist/plugins/solid/index.d.cts +8 -0
- package/dist/plugins/solid/index.d.ts +8 -0
- package/dist/plugins/solid/index.d.ts.map +1 -0
- package/dist/plugins/solid/solid.d.cts +97 -0
- package/dist/plugins/solid/solid.d.ts +97 -0
- package/dist/plugins/solid/solid.d.ts.map +1 -0
- package/dist/plugins/solid.cjs +1 -0
- package/dist/plugins/solid.d.cts +1 -0
- package/dist/plugins/solid.d.ts +1 -0
- package/dist/plugins/solid.development.cjs +1 -0
- package/dist/plugins/solid.development.js +319 -0
- package/dist/plugins/solid.js +319 -0
- package/dist/plugins/workers/index.d.cts +75 -0
- package/dist/plugins/workers/index.d.ts +75 -0
- package/dist/plugins/workers/index.d.ts.map +1 -0
- package/dist/plugins/workers/node_threads.d.cts +25 -0
- package/dist/plugins/workers/node_threads.d.ts +25 -0
- package/dist/plugins/workers/node_threads.d.ts.map +1 -0
- package/dist/plugins/workers/plan.d.cts +61 -0
- package/dist/plugins/workers/plan.d.ts +61 -0
- package/dist/plugins/workers/plan.d.ts.map +1 -0
- package/dist/plugins/workers/pool.d.cts +144 -0
- package/dist/plugins/workers/pool.d.ts +144 -0
- package/dist/plugins/workers/pool.d.ts.map +1 -0
- package/dist/plugins/workers/protocol.d.cts +112 -0
- package/dist/plugins/workers/protocol.d.ts +112 -0
- package/dist/plugins/workers/protocol.d.ts.map +1 -0
- package/dist/plugins/workers/worker_bind.d.cts +64 -0
- package/dist/plugins/workers/worker_bind.d.ts +64 -0
- package/dist/plugins/workers/worker_bind.d.ts.map +1 -0
- package/dist/plugins/workers/worker_loop.d.cts +14 -0
- package/dist/plugins/workers/worker_loop.d.ts +14 -0
- package/dist/plugins/workers/worker_loop.d.ts.map +1 -0
- package/dist/plugins/workers.cjs +1 -0
- package/dist/plugins/workers.d.cts +1 -0
- package/dist/plugins/workers.d.ts +1 -0
- package/dist/plugins/workers.development.cjs +1 -0
- package/dist/plugins/workers.development.js +596 -0
- package/dist/plugins/workers.js +474 -0
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.d.cts +4 -4
- package/dist/primitives.d.ts +4 -4
- package/dist/primitives.development.cjs +1 -1
- package/dist/primitives.development.js +66 -22
- package/dist/primitives.js +66 -22
- package/dist/shared-BKl12xF1.js +132 -0
- package/dist/shared-Dk-pACZT.cjs +1 -0
- package/dist/shared.cjs +1 -1
- package/dist/shared.d.cts +7 -7
- package/dist/shared.d.ts +7 -7
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.development.cjs +1 -1
- package/dist/shared.development.js +4 -3
- package/dist/shared.js +4 -3
- package/dist/topological_sort-Cc_yXqPT.js +346 -0
- package/dist/topological_sort-vp1imU6D.cjs +1 -0
- package/dist/type_primitives/assertions.d.cts +12 -16
- package/dist/type_primitives/assertions.d.ts +12 -16
- package/dist/type_primitives/assertions.d.ts.map +1 -1
- package/dist/type_primitives/binary_heap/binary_heap.d.cts +2 -6
- package/dist/type_primitives/binary_heap/binary_heap.d.ts +2 -6
- package/dist/type_primitives/binary_heap/binary_heap.d.ts.map +1 -1
- package/dist/type_primitives/bitset/bitset.d.cts +7 -11
- package/dist/type_primitives/bitset/bitset.d.ts +7 -11
- package/dist/type_primitives/bitset/bitset.d.ts.map +1 -1
- package/dist/type_primitives/brand.d.cts +2 -7
- package/dist/type_primitives/brand.d.ts +2 -7
- package/dist/type_primitives/brand.d.ts.map +1 -1
- package/dist/type_primitives/error.d.cts +1 -2
- package/dist/type_primitives/error.d.ts +1 -2
- package/dist/type_primitives/error.d.ts.map +1 -1
- package/dist/type_primitives/index.d.cts +1 -1
- package/dist/type_primitives/index.d.ts +1 -1
- package/dist/type_primitives/sparse_map/sparse_map.d.cts +3 -7
- package/dist/type_primitives/sparse_map/sparse_map.d.ts +3 -7
- package/dist/type_primitives/sparse_map/sparse_map.d.ts.map +1 -1
- package/dist/type_primitives/sparse_set/sparse_set.d.cts +2 -6
- package/dist/type_primitives/sparse_set/sparse_set.d.ts +2 -6
- package/dist/type_primitives/sparse_set/sparse_set.d.ts.map +1 -1
- package/dist/type_primitives/topological_sort/topological_sort.d.cts +1 -5
- package/dist/type_primitives/topological_sort/topological_sort.d.ts +1 -5
- package/dist/type_primitives/topological_sort/topological_sort.d.ts.map +1 -1
- package/dist/type_primitives/typed_arrays/typed_arrays.d.cts +16 -15
- package/dist/type_primitives/typed_arrays/typed_arrays.d.ts +16 -15
- package/dist/type_primitives/typed_arrays/typed_arrays.d.ts.map +1 -1
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/version.d.cts +3 -3
- package/dist/version.d.ts +3 -3
- package/dist/worker.cjs +1 -0
- package/dist/worker.d.cts +17 -0
- package/dist/worker.d.ts +17 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.development.cjs +1 -0
- package/dist/worker.development.js +253 -0
- package/dist/worker.js +253 -0
- package/package.json +363 -191
- package/dist/core/ecs/builtin_relations.d.cts +0 -43
- package/dist/core/ecs/builtin_relations.d.ts +0 -43
- package/dist/core/ecs/builtin_relations.d.ts.map +0 -1
- package/dist/core/ecs/event_registry.d.cts +0 -22
- package/dist/core/ecs/event_registry.d.ts +0 -22
- package/dist/core/ecs/event_registry.d.ts.map +0 -1
- package/dist/core/ecs/relation_service.d.ts.map +0 -1
- package/dist/core/ecs/resume.d.cts +0 -85
- package/dist/core/ecs/resume.d.ts +0 -85
- package/dist/core/ecs/resume.d.ts.map +0 -1
- package/dist/core/ecs/snapshot_service.d.cts +0 -94
- package/dist/core/ecs/snapshot_service.d.ts +0 -94
- package/dist/core/ecs/snapshot_service.d.ts.map +0 -1
- package/dist/extensions/editor/editor.d.ts.map +0 -1
- package/dist/extensions/editor/field_handle.d.ts.map +0 -1
- package/dist/extensions/editor/index.cjs +0 -1
- package/dist/extensions/editor/index.d.cts +0 -21
- package/dist/extensions/editor/index.d.ts +0 -21
- package/dist/extensions/editor/index.d.ts.map +0 -1
- package/dist/extensions/editor/index.development.cjs +0 -1
- package/dist/extensions/reactive/ecs_sync.d.cts +0 -214
- package/dist/extensions/reactive/ecs_sync.d.ts +0 -214
- package/dist/extensions/reactive/ecs_sync.d.ts.map +0 -1
- package/dist/extensions/reactive/index.cjs +0 -1
- package/dist/extensions/reactive/index.d.cts +0 -23
- package/dist/extensions/reactive/index.d.ts +0 -23
- package/dist/extensions/reactive/index.d.ts.map +0 -1
- package/dist/extensions/reactive/index.development.cjs +0 -1
- package/dist/extensions/reactive/index.development.js +0 -215
- package/dist/extensions/reactive/index.js +0 -215
- package/dist/extensions/solid/index.cjs +0 -1
- package/dist/extensions/solid/index.d.cts +0 -6
- package/dist/extensions/solid/index.d.ts +0 -6
- package/dist/extensions/solid/index.d.ts.map +0 -1
- package/dist/extensions/solid/index.development.cjs +0 -1
- package/dist/extensions/solid/index.development.js +0 -40
- package/dist/extensions/solid/index.js +0 -36
- package/dist/extensions/solid/kernel_solid.d.cts +0 -45
- package/dist/extensions/solid/kernel_solid.d.ts +0 -45
- package/dist/extensions/solid/kernel_solid.d.ts.map +0 -1
- package/dist/host_commands-BlR3oZ3x.js +0 -2406
- package/dist/host_commands-C2cpU3yC.cjs +0 -1
- package/dist/internal-BoxWl4dG.js +0 -2565
- package/dist/internal-CGBEwfeB.cjs +0 -2
- package/dist/interop-CT-REx0W.cjs +0 -1
- package/dist/interop-CcY6ASQc.js +0 -18
- package/dist/interop-DqxleBo7.js +0 -18
- package/dist/interop-T1HZ-Dpa.cjs +0 -1
- package/dist/kernel-Cz2Kxlwl.js +0 -240
- package/dist/kernel-DgyrLFjW.js +0 -227
- package/dist/kernel-sw7ScKWu.cjs +0 -1
- package/dist/kernel-yWV3XnAb.cjs +0 -1
- package/dist/reactive/array.d.cts +0 -24
- package/dist/reactive/array.d.ts +0 -24
- package/dist/reactive/array.d.ts.map +0 -1
- package/dist/reactive/index.cjs +0 -1
- package/dist/reactive/index.d.cts +0 -11
- package/dist/reactive/index.d.ts +0 -11
- package/dist/reactive/index.d.ts.map +0 -1
- package/dist/reactive/index.development.cjs +0 -1
- package/dist/reactive/index.development.js +0 -18
- package/dist/reactive/index.js +0 -18
- package/dist/reactive/interop.d.cts +0 -19
- package/dist/reactive/interop.d.ts +0 -19
- package/dist/reactive/interop.d.ts.map +0 -1
- package/dist/reactive/kernel.d.cts +0 -73
- package/dist/reactive/kernel.d.ts +0 -73
- package/dist/reactive/kernel.d.ts.map +0 -1
- package/dist/reactive/map.d.cts +0 -16
- package/dist/reactive/map.d.ts +0 -16
- package/dist/reactive/map.d.ts.map +0 -1
- package/dist/reactive/shallow.d.cts +0 -11
- package/dist/reactive/shallow.d.ts +0 -11
- package/dist/reactive/shallow.d.ts.map +0 -1
- package/dist/reactive/struct.d.cts +0 -10
- package/dist/reactive/struct.d.ts +0 -10
- package/dist/reactive/struct.d.ts.map +0 -1
- package/dist/shallow-Bs39EPh1.js +0 -150
- package/dist/shallow-C5YmTbtb.cjs +0 -1
- package/dist/shallow-CiFC70Dz.js +0 -159
- package/dist/shallow-DQ8aG51_.cjs +0 -1
- package/dist/shared-B4v0L1cw.js +0 -109
- package/dist/shared-DU78k0pU.cjs +0 -1
- package/dist/topological_sort-BDvEyb9W.cjs +0 -1
- package/dist/topological_sort-DK6EjpWa.js +0 -135
- package/dist/typed_arrays-D3NmwtCG.cjs +0 -1
- package/dist/typed_arrays-DIVwVy5_.js +0 -258
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Brand } from '../../type_primitives/index.js';
|
|
1
|
+
import { Brand, BitSet, TypedArrayTag } from '../../type_primitives/index.js';
|
|
2
2
|
import { EntityID } from './entity.js';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* value is the registration order, stable for the lifetime of the ECS. */
|
|
3
|
+
import { Archetype } from './archetype.js';
|
|
4
|
+
import { QueryTerms } from './query_terms.js';
|
|
5
|
+
import { SparseComponentDef, SparseComponentID, SparseComponentStore } from './sparse_store.js';
|
|
7
6
|
export type RelationID = Brand<number, "relation_id">;
|
|
8
7
|
declare const __relationBrand: unique symbol;
|
|
9
8
|
/** A relation's registration-time cardinality: `exclusive` = one target per
|
|
@@ -17,9 +16,9 @@ export type RelationDef<C extends RelationCardinality = RelationCardinality> = R
|
|
|
17
16
|
/** Access sentinel for the `(*, T)` wildcard query iteration
|
|
18
17
|
* (`Query.forEachRelatedTo`). A `(*, T)` term reads **every** registered
|
|
19
18
|
* relation's reverse index to find sources of `T`, so it can't name a specific
|
|
20
|
-
* relation in `relationReads` the way `
|
|
19
|
+
* relation in `relationReads` the way `andRelation(R)` (`(R, *)`) can. A
|
|
21
20
|
* system that iterates a `(*, T)` wildcard lists `ANY_RELATION` in `relationReads`
|
|
22
|
-
* instead
|
|
21
|
+
* instead. `accessCheck.assertRelationReadAny` honors it. The numeric value is a
|
|
23
22
|
* reserved sentinel far past any real registration-order relation id (relations are
|
|
24
23
|
* minted from 0 upward), so it can never collide with a registered relation. */
|
|
25
24
|
export declare const ANY_RELATION: RelationDef;
|
|
@@ -27,21 +26,21 @@ export declare const ANY_RELATION: RelationDef;
|
|
|
27
26
|
* **targets** is destroyed. Chosen per-relation at registration, run at
|
|
28
27
|
* destroy-flush (and the immediate-destroy path) off the reverse index:
|
|
29
28
|
*
|
|
30
|
-
* - **`delete
|
|
31
|
-
* recursively for chains
|
|
32
|
-
* - **`clear
|
|
33
|
-
* - **`orphan
|
|
29
|
+
* - **`delete`**, cascade: destroy every source of the dead target too,
|
|
30
|
+
* recursively for chains and trees (the canonical ChildOf case).
|
|
31
|
+
* - **`clear`**, remove the relation from every source. The sources survive.
|
|
32
|
+
* - **`orphan`**, leave the link intact but dangling. Reads stay safe (the
|
|
34
33
|
* reverse index is `EntityID`-keyed, so the dead handle never aliases a
|
|
35
|
-
* recycled slot)
|
|
34
|
+
* recycled slot). `targetOf` returns a dead handle until the source
|
|
36
35
|
* re-targets or is removed. This is the original behaviour and the default.
|
|
37
36
|
*/
|
|
38
37
|
export type OnDeleteTarget = "delete" | "clear" | "orphan";
|
|
39
38
|
/** Default on-target-delete policy: leave the link dangling (the original
|
|
40
39
|
* behaviour, zero change for callers that don't opt in). */
|
|
41
40
|
export declare const DEFAULT_ON_DELETE_TARGET: OnDeleteTarget;
|
|
42
|
-
/** Registration options. `exclusive` (one target per source) is the default
|
|
43
|
-
*
|
|
44
|
-
* exclusive
|
|
41
|
+
/** Registration options. `exclusive` (one target per source) is the default.
|
|
42
|
+
* Pass `{ multi: true }` for a multi-target relation. The two are mutually
|
|
43
|
+
* exclusive, the union makes `{ exclusive: true, multi: true }` a compile
|
|
45
44
|
* error (it also throws at runtime, for JS callers). `onDeleteTarget` selects
|
|
46
45
|
* the cleanup policy applied to sources when a target is destroyed (default
|
|
47
46
|
* `orphan`). */
|
|
@@ -58,186 +57,106 @@ export type RelationOptions = {
|
|
|
58
57
|
* sparse component. Field 0 of a single-field schema. */
|
|
59
58
|
export declare const RELATION_TARGET_FIELD = "target";
|
|
60
59
|
/** Receives one canonical `(source index, sorted targets)` set during a fold
|
|
61
|
-
* over a multi relation's forward sets. Targets are ascending by id
|
|
60
|
+
* over a multi relation's forward sets. Targets are ascending by id. Empty sets
|
|
62
61
|
* are never yielded (see `forEachCanonicalTargetSet`). */
|
|
63
62
|
export type CanonicalTargetSetFn = (sourceIndex: number, targets: readonly EntityID[]) => void;
|
|
64
63
|
/** Receives one canonical `(source, target)` pair during a fold over a
|
|
65
64
|
* relation's forward links. Sources ascend by entity index, each source's
|
|
66
|
-
* targets ascend by id
|
|
65
|
+
* targets ascend by id, the determinism order. */
|
|
67
66
|
export type CanonicalPairFn = (source: EntityID, target: EntityID) => void;
|
|
68
67
|
/** Maps a source entity **index** to its full `EntityID` (generation from the
|
|
69
68
|
* live slot). Supplied by `Store`, which owns entity generations. */
|
|
70
69
|
export type MakeSourceID = (index: number) => EntityID;
|
|
71
|
-
/** One relation's
|
|
72
|
-
* base owns the cardinality-agnostic **reverse index** (target → sources, keyed
|
|
73
|
-
* by full `EntityID` so a recycled slot can't alias a dead target's sources) and
|
|
74
|
-
* a handle on the backing `SparseComponentStore`; the forward representation and
|
|
75
|
-
* its sparse interaction are owned by the concrete `ExclusiveRelationStore` /
|
|
76
|
-
* `MultiRelationStore` (built by `makeRelationStore`).
|
|
70
|
+
/** One relation's side state, as the digest and the snapshot codec see it.
|
|
77
71
|
*
|
|
78
|
-
* The
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
export declare abstract class RelationStore {
|
|
86
|
-
/** `true` → one target per source (target in the sparse field); `false` →
|
|
87
|
-
* a set of targets per source. The cardinality discriminant survives as a
|
|
88
|
-
* field because it is part of the snapshot header and the traversal/`targetOf`
|
|
89
|
-
* mode guards — but the forward *mechanics* are virtual, not branched on it. */
|
|
72
|
+
* The relations plugin owns the class. Two core-adjacent readers walk it and
|
|
73
|
+
* neither needs the forward mutators: `Store.stateHash` folds the multi target
|
|
74
|
+
* sets, and the snapshot service serializes and rebuilds them. The narrow view
|
|
75
|
+
* is what lets those two speak about a relation store without the plugin. */
|
|
76
|
+
export interface RelationStoreView {
|
|
77
|
+
/** `true` → one target per source, and the target rides the backing sparse
|
|
78
|
+
* field. `false` → a target set per source, held beside the sparse tag. */
|
|
90
79
|
readonly exclusive: boolean;
|
|
91
|
-
/**
|
|
92
|
-
*
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
*
|
|
96
|
-
* safely. `Store` reads this at destroy-flush off `sourcesOf`. */
|
|
97
|
-
readonly onDeleteTarget: OnDeleteTarget;
|
|
98
|
-
/** The backing sparse store instance. Owned for registration/liveness by
|
|
99
|
-
* `Store`, but the relation drives the forward/membership rows on it directly
|
|
100
|
-
* — that is the cardinality interaction this class now encapsulates. */
|
|
101
|
-
protected readonly _store: SparseComponentStore;
|
|
102
|
-
/** target `EntityID` → set of source `EntityID`s. Keyed by the full id, not
|
|
103
|
-
* the index, so a recycled target slot can't alias a dead target's sources.
|
|
104
|
-
* An entry is dropped the moment its set empties (`unlinkReverse`). */
|
|
105
|
-
private readonly _reverse;
|
|
106
|
-
constructor(exclusive: boolean, sparse: SparseComponentDef, store: SparseComponentStore, onDeleteTarget: OnDeleteTarget);
|
|
107
|
-
/** Record that `src` points at `tgt` in the reverse index. */
|
|
108
|
-
protected linkReverse(tgt: EntityID, src: EntityID): void;
|
|
109
|
-
/** Drop the `src → tgt` edge from the reverse index, removing the target's
|
|
110
|
-
* entry entirely once its last source is gone (so a dead-target key doesn't
|
|
111
|
-
* linger with an empty set). */
|
|
112
|
-
protected unlinkReverse(tgt: EntityID, src: EntityID): void;
|
|
113
|
-
/** Drop every reverse-index entry whose **target** is no longer alive,
|
|
114
|
-
* returning the count dropped. The `orphan` policy intentionally
|
|
115
|
-
* leaves a destroyed target's reverse entry intact (the link dangles
|
|
116
|
-
* safely), so a long-lived source that orphan-points at a stream of
|
|
117
|
-
* short-lived targets and never re-targets/dies accumulates dead-target keys
|
|
118
|
-
* without bound. This is the reclaim primitive behind `Store.compactRelations`
|
|
119
|
-
* — a cold path the host calls at scene/snapshot boundaries. It is
|
|
120
|
-
* cardinality-free (reverse-index only), so it lives on the base unchanged.
|
|
121
|
-
*
|
|
122
|
-
* Pure index reclaim: the **forward** links (the exclusive sparse target
|
|
123
|
-
* field, the multi forward set) are left untouched, so `targetOf` /
|
|
124
|
-
* `targetsOf` still return the dangling dead handle exactly as `orphan`
|
|
125
|
-
* promises. The reverse index is derived, so dropping a dead-target entry
|
|
126
|
-
* changes nothing observable except `sourcesOf` on that dead handle (which
|
|
127
|
-
* goes from the dangling sources to `[]` — meaningless either way, the target
|
|
128
|
-
* is gone) and is faithfully rebuilt by snapshot/restore from the surviving
|
|
129
|
-
* forward links. Only the **target** role can leak here: a destroyed *source*
|
|
130
|
-
* is already unlinked from every reverse set by `purgeSource`, so a live
|
|
131
|
-
* target's set never holds a dead source. `isAlive` is supplied by `Store`,
|
|
132
|
-
* which owns entity liveness. Deleting during `Map` key iteration is
|
|
133
|
-
* well-defined — already-visited and not-yet-reached keys are unaffected. */
|
|
134
|
-
pruneDeadReverse(isAlive: (id: EntityID) => boolean): number;
|
|
135
|
-
/** Sources that point at `tgt`, ascending by id (deterministic, cold-path
|
|
136
|
-
* sort) — empty when none. */
|
|
137
|
-
sourcesOf(tgt: EntityID): EntityID[];
|
|
138
|
-
/** Drop every derived side index — the reverse index and (for multi) the
|
|
139
|
-
* forward target sets. Restore path only (`restoreRelations`): the side
|
|
140
|
-
* indices are rebuilt from scratch, so they're cleared first to stay
|
|
141
|
-
* idempotent when restoring into a dirty world. The backing sparse store is
|
|
142
|
-
* cleared separately by `restoreSparseStores`. */
|
|
80
|
+
/** Fold `cb` over the multi forward target sets in canonical order, and do
|
|
81
|
+
* nothing for an exclusive relation. */
|
|
82
|
+
forEachCanonicalTargetSet(cb: CanonicalTargetSetFn): void;
|
|
83
|
+
/** Drop every derived side index. The restore path clears before it
|
|
84
|
+
* rebuilds, so restoring into a dirty world is idempotent. */
|
|
143
85
|
resetIndices(): void;
|
|
144
|
-
/**
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
/** Add a `(R, tgt)` link from `src`, keeping forward link + membership +
|
|
149
|
-
* reverse index in lockstep. Exclusive: replaces any existing target
|
|
150
|
-
* (idempotent if `tgt` is already the target). Multi: adds to the set
|
|
151
|
-
* (idempotent on a duplicate), establishing the membership tag on the first
|
|
152
|
-
* target. `src` must be live — `Store` checks before delegating. */
|
|
153
|
-
abstract link(src: EntityID, tgt: EntityID): void;
|
|
154
|
-
/** Remove `(R, tgt)` from `src` — or, when `tgt` is omitted, every target of
|
|
155
|
-
* `src` — keeping forward link + membership + reverse index in lockstep. A
|
|
156
|
-
* no-op when the link isn't present. */
|
|
157
|
-
abstract unlink(src: EntityID, tgt?: EntityID): void;
|
|
158
|
-
/** Purge a destroyed **source**: drop its forward link(s) and unlink it from
|
|
159
|
-
* every target's reverse set, but leave the sparse **membership** row alone —
|
|
160
|
-
* `Store._purgeSparse` drops that (for every store) right after, so this
|
|
161
|
-
* runs first and must not double-remove. */
|
|
162
|
-
abstract purgeSource(src: EntityID): void;
|
|
163
|
-
/** The single target of source `index`, or `undefined`. Exclusive reads the
|
|
164
|
-
* sparse field; multi has no single target and returns `undefined` (matching
|
|
165
|
-
* the production `targetOf`-on-multi read, which the `DEV` guard rejects). */
|
|
166
|
-
abstract singleTarget(index: number): EntityID | undefined;
|
|
167
|
-
/** All targets of source `index`, ascending by id — one or zero for
|
|
168
|
-
* exclusive, the full sorted set for multi. The symmetric counterpart to
|
|
169
|
-
* `sourcesOf`. */
|
|
170
|
-
abstract targetsOf(index: number): EntityID[];
|
|
171
|
-
/** Whether source `index` holds any target under this relation (sparse
|
|
172
|
-
* membership). */
|
|
173
|
-
abstract has(index: number): boolean;
|
|
174
|
-
/** Fold `cb` over this relation's **multi** forward target sets in canonical
|
|
175
|
-
* order (sources ascending by index, each source's targets ascending by id),
|
|
176
|
-
* skipping empty sets. The single source of truth for the canonical multi
|
|
177
|
-
* traversal shared by `stateHash`, `snapshotRelations`, and `pairsOf`.
|
|
178
|
-
* Exclusive relations contribute via the sparse store, so this
|
|
179
|
-
* is a no-op for them. */
|
|
180
|
-
abstract forEachCanonicalTargetSet(cb: CanonicalTargetSetFn): void;
|
|
181
|
-
/** Fold `cb` over every `(source, target)` pair of this relation in canonical
|
|
182
|
-
* order — the `(R, *)` wildcard drive order. `makeId` maps a source
|
|
183
|
-
* index to its full `EntityID`. Exclusive rides the backing store's
|
|
184
|
-
* `canonicalIndices`; multi rides `forEachCanonicalTargetSet`. */
|
|
185
|
-
abstract forEachCanonicalPair(makeId: MakeSourceID, cb: CanonicalPairFn): void;
|
|
186
|
-
/** Rebuild the reverse index from the forward links after a restore.
|
|
187
|
-
* Exclusive reads it back from the just-restored sparse target field (the
|
|
188
|
-
* reverse index is never serialized); multi already rebuilt its reverse edges
|
|
189
|
-
* in `restoreAddTarget`, so this is a no-op for it. `makeId` maps a source
|
|
190
|
-
* index to its full `EntityID`. */
|
|
191
|
-
abstract rebuildReverseFromForward(makeId: MakeSourceID): void;
|
|
192
|
-
/** Restore one decoded multi forward edge `(source index → tgt)` plus its
|
|
193
|
-
* reverse edge (the source's full `EntityID` is `src`). Multi only — the
|
|
194
|
-
* snapshot header guards exclusive relations out before this is reached, so
|
|
195
|
-
* the exclusive override throws defensively. */
|
|
196
|
-
abstract restoreAddTarget(index: number, tgt: EntityID, src: EntityID): void;
|
|
86
|
+
/** Restore one decoded multi forward edge and its reverse edge. */
|
|
87
|
+
restoreAddTarget(index: number, tgt: EntityID, src: EntityID): void;
|
|
88
|
+
/** Rebuild the reverse index from the forward links after a restore. */
|
|
89
|
+
rebuildReverse(createId: MakeSourceID): void;
|
|
197
90
|
}
|
|
198
|
-
/**
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
* u32 relationCount
|
|
216
|
-
* repeat relationCount times (registration / id order):
|
|
217
|
-
* u32 isMulti
|
|
218
|
-
* if multi:
|
|
219
|
-
* u32 sourceCount
|
|
220
|
-
* repeat sourceCount times (ascending source index):
|
|
221
|
-
* u32 sourceIndex
|
|
222
|
-
* u32 targetCount
|
|
223
|
-
* f64 × targetCount (target EntityIDs, ascending) */
|
|
224
|
-
export declare function snapshotRelations(relations: readonly RelationStore[]): Uint8Array;
|
|
225
|
-
/** Rebuild every relation's side indices from a `snapshotRelations` buffer and
|
|
226
|
-
* the already-restored sparse stores. Each relation's indices are reset first
|
|
227
|
-
* (idempotent into a dirty world), then:
|
|
91
|
+
/** What the relation service needs from `Store`, nothing more. The accessor
|
|
92
|
+
* members re-read the live field on every call, so capacity growth that
|
|
93
|
+
* reallocates `generations`, `entityArchetypes` or `entityRows` is always
|
|
94
|
+
* observed. Never cache their return values across mutations. */
|
|
95
|
+
export interface RelationServiceHost {
|
|
96
|
+
isAlive(id: EntityID): boolean;
|
|
97
|
+
hasSparse(entityId: EntityID, def: SparseComponentDef): boolean;
|
|
98
|
+
pushSparseStore(fieldNames: string[], fieldTypes: TypedArrayTag[]): SparseComponentDef;
|
|
99
|
+
sparseStoreOf(def: SparseComponentDef): SparseComponentStore;
|
|
100
|
+
sparseStores(): readonly SparseComponentStore[];
|
|
101
|
+
generations(): Int32Array;
|
|
102
|
+
entityArchetypes(): Int32Array;
|
|
103
|
+
entityRows(): Int32Array;
|
|
104
|
+
archetypes(): readonly Archetype[];
|
|
105
|
+
forEachSparseMatch(include: BitSet, exclude: BitSet | null, anyOf: BitSet | null, terms: QueryTerms, denseArchetypes: readonly Archetype[], cb: (entityId: EntityID) => void): void;
|
|
106
|
+
}
|
|
107
|
+
/** The relation service, as everything outside the plugin sees it.
|
|
228
108
|
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
* (generation from the live slot) so reverse edges key correctly.
|
|
233
|
-
* - **exclusive** — only the reset happens here; the reverse index is rebuilt
|
|
234
|
-
* by the caller from the backing sparse store (which already round-tripped
|
|
235
|
-
* through `restoreSparseStores`), since this function can't read it.
|
|
109
|
+
* `Store.relations` is public, so this is the whole crossing surface and not
|
|
110
|
+
* the world's half alone. The plugin's class implements it, and the compiler
|
|
111
|
+
* holds the two in step.
|
|
236
112
|
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
|
|
113
|
+
* `purgeSource` and `cleanupTarget` are the one hot coupling: a dying entity
|
|
114
|
+
* loses its source role, and a target-death policy may cascade. Both sit
|
|
115
|
+
* behind a null test the destroy loop hoists, so a world without the plugin
|
|
116
|
+
* pays neither. Everything else is registration, a query driver or a `ctx`
|
|
117
|
+
* call, and cold. */
|
|
118
|
+
export interface RelationHooks {
|
|
119
|
+
/** The registry, in registration order. `Store.stateHash` and the snapshot
|
|
120
|
+
* service walk it. */
|
|
121
|
+
readonly stores: readonly RelationStoreView[];
|
|
122
|
+
/** Registered relation kinds. The destroy paths gate on this. */
|
|
123
|
+
readonly count: number;
|
|
124
|
+
/** Whether any relation registered a non-`orphan` `onDeleteTarget`. The
|
|
125
|
+
* destroy paths gate the reverse-index walk on it. */
|
|
126
|
+
readonly hasTargetCleanup: boolean;
|
|
127
|
+
/** Drop a destroyed entity's forward links and its reverse edges, and leave
|
|
128
|
+
* the sparse membership row to `Store`. Runs before the sparse purge. */
|
|
129
|
+
purgeSource(entityId: EntityID): void;
|
|
130
|
+
/** Apply each relation's target-death policy to the sources of a destroyed
|
|
131
|
+
* target. A `delete` policy appends the doomed sources to `cascade`. */
|
|
132
|
+
cleanupTarget(targetId: EntityID, cascade: EntityID[]): void;
|
|
133
|
+
/** Register a relation kind. The facade's typed overloads sit on top. */
|
|
134
|
+
registerRelation(opts?: RelationOptions): RelationDef;
|
|
135
|
+
addRelation(src: EntityID, def: RelationDef, tgt: EntityID): void;
|
|
136
|
+
removeRelation(src: EntityID, def: RelationDef, tgt?: EntityID): void;
|
|
137
|
+
targetOf(src: EntityID, def: RelationDef): EntityID | undefined;
|
|
138
|
+
targetsOf(src: EntityID, def: RelationDef): EntityID[];
|
|
139
|
+
sourcesOf(tgt: EntityID, def: RelationDef): EntityID[];
|
|
140
|
+
hasRelation(src: EntityID, def: RelationDef): boolean;
|
|
141
|
+
/** Every `(source, target)` pair of one relation, the `(R, *)` wildcard. */
|
|
142
|
+
pairsOf(def: RelationDef): readonly (readonly [EntityID, EntityID])[];
|
|
143
|
+
/** Every `(relation, source)` pointing at `tgt`, the `(*, T)` wildcard. */
|
|
144
|
+
sourcesOfAny(tgt: EntityID): readonly (readonly [RelationDef, EntityID])[];
|
|
145
|
+
/** The chain from `src` up to its root, nearest ancestor first. */
|
|
146
|
+
ancestorsOf(src: EntityID, def: RelationDef): EntityID[];
|
|
147
|
+
/** The root of the chain `src` sits on. */
|
|
148
|
+
rootOf(src: EntityID, def: RelationDef): EntityID;
|
|
149
|
+
/** The subtree under `root`, breadth-first, parents before children. */
|
|
150
|
+
cascadeOf(root: EntityID, def: RelationDef): EntityID[];
|
|
151
|
+
/** Drop every reverse entry whose target died, and report the count. */
|
|
152
|
+
compactRelations(): number;
|
|
153
|
+
/** The backing sparse component of a relation, which the query terms
|
|
154
|
+
* compose against. */
|
|
155
|
+
relationBackingSparseId(def: RelationDef): SparseComponentID;
|
|
156
|
+
/** Drive a `(*, T)` wildcard query. */
|
|
157
|
+
forEachTargetMatch(target: EntityID, include: BitSet, exclude: BitSet | null, anyOf: BitSet | null, terms: QueryTerms, cb: (entityId: EntityID) => void): void;
|
|
158
|
+
/** Drive a `hierarchy(R)` query, parents before children. */
|
|
159
|
+
forEachHierarchyMatch(include: BitSet, exclude: BitSet | null, anyOf: BitSet | null, terms: QueryTerms, denseArchetypes: readonly Archetype[], relation: RelationDef, maxDepth: number, cb: (entityId: EntityID) => void): void;
|
|
160
|
+
}
|
|
242
161
|
export {};
|
|
243
162
|
//# sourceMappingURL=relation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relation.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/relation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"relation.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/relation.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/***
|
|
2
|
-
* Resource
|
|
2
|
+
* Resource. Typed singleton key-value storage.
|
|
3
3
|
*
|
|
4
4
|
* Resources are global singletons that don't belong to any entity.
|
|
5
5
|
* Think: time, input state, camera config, game settings.
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
* phantom type parameter, so reads are type-safe at compile time.
|
|
10
10
|
*
|
|
11
11
|
* Lifecycle. A resource is register-once *until removed*: a second
|
|
12
|
-
* `
|
|
13
|
-
* `
|
|
14
|
-
* key to be registered again
|
|
12
|
+
* `ecs.resources.register` for a live key throws RESOURCE_ALREADY_REGISTERED,
|
|
13
|
+
* but `ecs.resources.remove(key)` drops it (failing closed on a missing key)
|
|
14
|
+
* and frees the key to be registered again, the present → absent → present axis. Removal is
|
|
15
15
|
* access-checked as a *write* (a system must declare the key in `resourceWrites`),
|
|
16
|
-
* and resources stay out of `stateHash` and snapshot
|
|
16
|
+
* and resources stay out of `stateHash` and snapshot and resume regardless, so a
|
|
17
17
|
* lifecycle change never perturbs the determinism hash.
|
|
18
18
|
*
|
|
19
19
|
* Usage:
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
*
|
|
28
28
|
***/
|
|
29
29
|
/**
|
|
30
|
-
* `T` is deliberately
|
|
30
|
+
* `T` is deliberately invariant (via the function-typed phantom, an `in out`
|
|
31
31
|
* annotation is not legal on an intersection alias, so the structure carries
|
|
32
|
-
* the variance)
|
|
32
|
+
* the variance). A key is used for both reads (`resource`, covariant) and
|
|
33
33
|
* writes (`setResource`, contravariant), so either one-sided variance is a
|
|
34
|
-
* soundness hole
|
|
35
|
-
* `ResourceKey<Animal
|
|
34
|
+
* soundness hole. A covariant `T` let `ResourceKey<Cat>` widen to
|
|
35
|
+
* `ResourceKey<Animal>`, and `setResource` then stored a `Dog` behind a `Cat`
|
|
36
36
|
* key. Invariance also makes keys with different `T` mutually unassignable,
|
|
37
|
-
* which is what the typed system seam's `resourceReads
|
|
38
|
-
* narrowing keys on (
|
|
39
|
-
* declaration lists) must use `ResourceKey<any
|
|
37
|
+
* which is what the typed system seam's `resourceReads` and `resourceWrites`
|
|
38
|
+
* narrowing keys on (system.ts). Schema-erased positions (access checks,
|
|
39
|
+
* declaration lists) must use `ResourceKey<any>`, `ResourceKey<unknown>` no
|
|
40
40
|
* longer erases.
|
|
41
41
|
*/
|
|
42
42
|
declare const __resourceValue: unique symbol;
|
|
@@ -45,7 +45,7 @@ export type ResourceKey<T> = symbol & {
|
|
|
45
45
|
};
|
|
46
46
|
export declare function resourceKey<T>(name: string): ResourceKey<T>;
|
|
47
47
|
/** Recover a key's value type: `ResourceValueOf<typeof TimeRes>` is the Time
|
|
48
|
-
* shape. The typed `SystemContext` resource surface infers the
|
|
48
|
+
* shape. The typed `SystemContext` resource surface infers the key type (to
|
|
49
49
|
* check it against the declared-access union) and recovers `T` through this,
|
|
50
50
|
* instead of taking `ResourceKey<T>` directly. */
|
|
51
51
|
export type ResourceValueOf<K> = K extends ResourceKey<infer T> ? T : never;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/***
|
|
2
|
-
* Resource
|
|
2
|
+
* Resource. Typed singleton key-value storage.
|
|
3
3
|
*
|
|
4
4
|
* Resources are global singletons that don't belong to any entity.
|
|
5
5
|
* Think: time, input state, camera config, game settings.
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
* phantom type parameter, so reads are type-safe at compile time.
|
|
10
10
|
*
|
|
11
11
|
* Lifecycle. A resource is register-once *until removed*: a second
|
|
12
|
-
* `
|
|
13
|
-
* `
|
|
14
|
-
* key to be registered again
|
|
12
|
+
* `ecs.resources.register` for a live key throws RESOURCE_ALREADY_REGISTERED,
|
|
13
|
+
* but `ecs.resources.remove(key)` drops it (failing closed on a missing key)
|
|
14
|
+
* and frees the key to be registered again, the present → absent → present axis. Removal is
|
|
15
15
|
* access-checked as a *write* (a system must declare the key in `resourceWrites`),
|
|
16
|
-
* and resources stay out of `stateHash` and snapshot
|
|
16
|
+
* and resources stay out of `stateHash` and snapshot and resume regardless, so a
|
|
17
17
|
* lifecycle change never perturbs the determinism hash.
|
|
18
18
|
*
|
|
19
19
|
* Usage:
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
*
|
|
28
28
|
***/
|
|
29
29
|
/**
|
|
30
|
-
* `T` is deliberately
|
|
30
|
+
* `T` is deliberately invariant (via the function-typed phantom, an `in out`
|
|
31
31
|
* annotation is not legal on an intersection alias, so the structure carries
|
|
32
|
-
* the variance)
|
|
32
|
+
* the variance). A key is used for both reads (`resource`, covariant) and
|
|
33
33
|
* writes (`setResource`, contravariant), so either one-sided variance is a
|
|
34
|
-
* soundness hole
|
|
35
|
-
* `ResourceKey<Animal
|
|
34
|
+
* soundness hole. A covariant `T` let `ResourceKey<Cat>` widen to
|
|
35
|
+
* `ResourceKey<Animal>`, and `setResource` then stored a `Dog` behind a `Cat`
|
|
36
36
|
* key. Invariance also makes keys with different `T` mutually unassignable,
|
|
37
|
-
* which is what the typed system seam's `resourceReads
|
|
38
|
-
* narrowing keys on (
|
|
39
|
-
* declaration lists) must use `ResourceKey<any
|
|
37
|
+
* which is what the typed system seam's `resourceReads` and `resourceWrites`
|
|
38
|
+
* narrowing keys on (system.ts). Schema-erased positions (access checks,
|
|
39
|
+
* declaration lists) must use `ResourceKey<any>`, `ResourceKey<unknown>` no
|
|
40
40
|
* longer erases.
|
|
41
41
|
*/
|
|
42
42
|
declare const __resourceValue: unique symbol;
|
|
@@ -45,7 +45,7 @@ export type ResourceKey<T> = symbol & {
|
|
|
45
45
|
};
|
|
46
46
|
export declare function resourceKey<T>(name: string): ResourceKey<T>;
|
|
47
47
|
/** Recover a key's value type: `ResourceValueOf<typeof TimeRes>` is the Time
|
|
48
|
-
* shape. The typed `SystemContext` resource surface infers the
|
|
48
|
+
* shape. The typed `SystemContext` resource surface infers the key type (to
|
|
49
49
|
* check it against the declared-access union) and recovers `T` through this,
|
|
50
50
|
* instead of taking `ResourceKey<T>` directly. */
|
|
51
51
|
export type ResourceValueOf<K> = K extends ResourceKey<infer T> ? T : never;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/***
|
|
2
|
-
* ResourceRegistry
|
|
2
|
+
* ResourceRegistry, the world's symbol-keyed resource dictionary.
|
|
3
3
|
*
|
|
4
|
-
* Extracted from `Store`, which keeps one-line delegations
|
|
4
|
+
* Extracted from `Store`, which keeps one-line delegations. Fully
|
|
5
5
|
* self-contained (no Store reach-back). Resources stay out of `stateHash` and
|
|
6
|
-
* out of snapshot
|
|
6
|
+
* out of snapshot and resume. This is host-side state, not simulation state.
|
|
7
7
|
***/
|
|
8
8
|
export declare class ResourceRegistry {
|
|
9
|
-
private readonly
|
|
9
|
+
private readonly _values;
|
|
10
10
|
register(key: symbol, value: unknown): void;
|
|
11
11
|
get(key: symbol): unknown;
|
|
12
12
|
set(key: symbol, value: unknown): void;
|
|
13
13
|
/** Drop a resource from the world. Fails closed on a missing key (mirrors
|
|
14
|
-
* `get`
|
|
14
|
+
* `get` and `set`). Afterwards the key is free to `register` again, the
|
|
15
15
|
* present → absent → present lifecycle. Purely a host-side
|
|
16
16
|
* dictionary delete with no determinism-hash effect. */
|
|
17
17
|
remove(key: symbol): void;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/***
|
|
2
|
-
* ResourceRegistry
|
|
2
|
+
* ResourceRegistry, the world's symbol-keyed resource dictionary.
|
|
3
3
|
*
|
|
4
|
-
* Extracted from `Store`, which keeps one-line delegations
|
|
4
|
+
* Extracted from `Store`, which keeps one-line delegations. Fully
|
|
5
5
|
* self-contained (no Store reach-back). Resources stay out of `stateHash` and
|
|
6
|
-
* out of snapshot
|
|
6
|
+
* out of snapshot and resume. This is host-side state, not simulation state.
|
|
7
7
|
***/
|
|
8
8
|
export declare class ResourceRegistry {
|
|
9
|
-
private readonly
|
|
9
|
+
private readonly _values;
|
|
10
10
|
register(key: symbol, value: unknown): void;
|
|
11
11
|
get(key: symbol): unknown;
|
|
12
12
|
set(key: symbol, value: unknown): void;
|
|
13
13
|
/** Drop a resource from the world. Fails closed on a missing key (mirrors
|
|
14
|
-
* `get`
|
|
14
|
+
* `get` and `set`). Afterwards the key is free to `register` again, the
|
|
15
15
|
* present → absent → present lifecycle. Purely a host-side
|
|
16
16
|
* dictionary delete with no determinism-hash effect. */
|
|
17
17
|
remove(key: symbol): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource_registry.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/resource_registry.ts"],"names":[],"mappings":"AAAA;;;;;;KAMK;AAIL,qBAAa,gBAAgB;IAC5B,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"resource_registry.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/resource_registry.ts"],"names":[],"mappings":"AAAA;;;;;;KAMK;AAIL,qBAAa,gBAAgB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmC;IAEpD,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAW3C,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAWzB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAW7C;;;4DAGwD;IACjD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAWzB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAGhC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AnyTypedArray } from '../../type_primitives/index.cjs';
|
|
2
|
+
/** A view of `buf`'s bytes whose class depends on the element width alone. The
|
|
3
|
+
* unsigned class of each width, and `Float64Array` for eight bytes. A column
|
|
4
|
+
* that already has that class is returned as is. The view has an explicit
|
|
5
|
+
* length, so it is a fixed-length view on every backing. */
|
|
6
|
+
export declare function widthView(kind: number, buf: AnyTypedArray): AnyTypedArray;
|
|
7
|
+
/** The stored representation of `v` in a column of kind `kind`, as the
|
|
8
|
+
* width-canonical view of that column (`widthView`) reads it back. A store of
|
|
9
|
+
* the result through that view leaves the same bytes as a store of `v` through
|
|
10
|
+
* the true view: the integer kinds keep the low bits of `ToInt32(v)`, which is
|
|
11
|
+
* what each typed array keeps. `f32` rounds through a scratch `Float32Array`
|
|
12
|
+
* `f64` is itself. */
|
|
13
|
+
export declare function toWidthBits(kind: number, v: number): number;
|
|
14
|
+
/** Read one element through the access site of the column's class, found from
|
|
15
|
+
* the column itself. For the mixed-type accessor in ref.ts, which knows the
|
|
16
|
+
* column but not its tag. */
|
|
17
|
+
export declare function readElemOf(buf: AnyTypedArray, row: number): number;
|
|
18
|
+
/** The pair of `readElemOf`. */
|
|
19
|
+
export declare function writeElemOf(buf: AnyTypedArray, row: number, v: number): void;
|
|
20
|
+
/** Write one element through the access site of its kind. For the per-field
|
|
21
|
+
* paths (`writeFields`, `writeFlatElem`), where the column is known one at a
|
|
22
|
+
* time. */
|
|
23
|
+
export declare function writeElem(kind: number, buf: AnyTypedArray, row: number, v: number): void;
|
|
24
|
+
//# sourceMappingURL=row_kinds.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AnyTypedArray } from '../../type_primitives/index.js';
|
|
2
|
+
/** A view of `buf`'s bytes whose class depends on the element width alone. The
|
|
3
|
+
* unsigned class of each width, and `Float64Array` for eight bytes. A column
|
|
4
|
+
* that already has that class is returned as is. The view has an explicit
|
|
5
|
+
* length, so it is a fixed-length view on every backing. */
|
|
6
|
+
export declare function widthView(kind: number, buf: AnyTypedArray): AnyTypedArray;
|
|
7
|
+
/** The stored representation of `v` in a column of kind `kind`, as the
|
|
8
|
+
* width-canonical view of that column (`widthView`) reads it back. A store of
|
|
9
|
+
* the result through that view leaves the same bytes as a store of `v` through
|
|
10
|
+
* the true view: the integer kinds keep the low bits of `ToInt32(v)`, which is
|
|
11
|
+
* what each typed array keeps. `f32` rounds through a scratch `Float32Array`
|
|
12
|
+
* `f64` is itself. */
|
|
13
|
+
export declare function toWidthBits(kind: number, v: number): number;
|
|
14
|
+
/** Read one element through the access site of the column's class, found from
|
|
15
|
+
* the column itself. For the mixed-type accessor in ref.ts, which knows the
|
|
16
|
+
* column but not its tag. */
|
|
17
|
+
export declare function readElemOf(buf: AnyTypedArray, row: number): number;
|
|
18
|
+
/** The pair of `readElemOf`. */
|
|
19
|
+
export declare function writeElemOf(buf: AnyTypedArray, row: number, v: number): void;
|
|
20
|
+
/** Write one element through the access site of its kind. For the per-field
|
|
21
|
+
* paths (`writeFields`, `writeFlatElem`), where the column is known one at a
|
|
22
|
+
* time. */
|
|
23
|
+
export declare function writeElem(kind: number, buf: AnyTypedArray, row: number, v: number): void;
|
|
24
|
+
//# sourceMappingURL=row_kinds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row_kinds.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/row_kinds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqCK;AAEL,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAgB3D;;;4DAG4D;AAC5D,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,aAAa,CAYzE;AAOD;;;;;sBAKsB;AACtB,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAgB3D;AAED;;6BAE6B;AAC7B,wBAAgB,UAAU,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAmBlE;AAED,gCAAgC;AAChC,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CA2B5E;AAED;;WAEW;AACX,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CA2BxF"}
|