@awesome-ecs/abstract 0.33.0 → 0.34.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.
Files changed (36) hide show
  1. package/README.md +119 -124
  2. package/dist/components/index.cjs.map +1 -1
  3. package/dist/components/index.d.cts +2 -2
  4. package/dist/components/index.d.mts +2 -2
  5. package/dist/components/index.mjs.map +1 -1
  6. package/dist/entities/index.cjs +4 -0
  7. package/dist/entities/index.cjs.map +1 -1
  8. package/dist/entities/index.d.cts +3 -3
  9. package/dist/entities/index.d.mts +3 -3
  10. package/dist/entities/index.mjs +4 -1
  11. package/dist/entities/index.mjs.map +1 -1
  12. package/dist/factories/index.cjs.map +1 -1
  13. package/dist/factories/index.d.cts +1 -1
  14. package/dist/factories/index.d.mts +1 -1
  15. package/dist/factories/index.mjs.map +1 -1
  16. package/dist/{index-DXbpfhHa.d.mts → index-B3DqdxE6.d.mts} +2 -2
  17. package/dist/{index--9JJtMKF.d.mts → index-BanhgPCc.d.mts} +34 -22
  18. package/dist/{index-CPGVaS-_.d.cts → index-BivyWazf.d.cts} +183 -172
  19. package/dist/{index-0hg5PXZe.d.cts → index-CSaKdQe-.d.cts} +34 -22
  20. package/dist/{index-BOS-47DQ.d.mts → index-DGyDijY7.d.mts} +183 -172
  21. package/dist/{index-HeCQLTSE.d.cts → index-DMZSrHoB.d.cts} +134 -101
  22. package/dist/{index-Tznk33g6.d.mts → index-Dbwzlrgp.d.mts} +134 -101
  23. package/dist/{index-Bl7Cf9gi.d.cts → index-aVjnG975.d.cts} +2 -2
  24. package/dist/pipelines/index.d.cts +1 -1
  25. package/dist/pipelines/index.d.mts +1 -1
  26. package/dist/systems/index.cjs.map +1 -1
  27. package/dist/systems/index.d.cts +11 -5
  28. package/dist/systems/index.d.mts +11 -5
  29. package/dist/systems/index.mjs.map +1 -1
  30. package/dist/{types-COxeVghs.d.cts → types-BaCGIrym.d.cts} +1 -1
  31. package/dist/{types-UnqKSA14.d.mts → types-BaCGIrym.d.mts} +1 -1
  32. package/dist/utils/index.cjs.map +1 -1
  33. package/dist/utils/index.d.cts +2 -2
  34. package/dist/utils/index.d.mts +2 -2
  35. package/dist/utils/index.mjs.map +1 -1
  36. package/package.json +2 -2
package/README.md CHANGED
@@ -1,124 +1,119 @@
1
- # Awesome ECS - Abstract Package
2
-
3
- ## Overview
4
-
5
- The Abstract package defines all core interfaces and abstractions for the Entity-Component-System (ECS) framework. It provides the foundational contracts that all other packages implement, including:
6
-
7
- - **Components**: Data-storage contracts
8
- - **Entities**: Container contracts for components and relationships
9
- - **Pipelines**: Middleware-based execution chains
10
- - **Systems**: Modular logic execution patterns
11
- - **Utilities**: Serialization, events, and scheduling
12
-
13
- This package has **zero external dependencies** and serves as the contract layer for the entire ECS framework.
14
-
15
- ## Core Concepts
16
-
17
- ### Components (`src/components/`)
18
-
19
- Components are **data-only containers**. They should never contain business logic.
20
-
21
- ```typescript
22
- import { IComponent } from "@awesome-ecs/abstract";
23
-
24
- export class HealthComponent implements IComponent {
25
- readonly componentType = ComponentType.health;
26
- readonly isSerializable = true; // Include in snapshots
27
-
28
- current: number = 100;
29
- max: number = 100;
30
- }
31
- ```
32
-
33
- **Key interfaces:**
34
- - `IComponent`: Base component interface with `componentType` and `isSerializable`
35
- - `IdentityComponent`: Mandatory component tracking entity UID and model
36
-
37
- ### Entities (`src/entities/`)
38
-
39
- Entities are immutable **containers of components** and **proxies to other entities**. They never directly reference other entities—they use proxies for loose coupling.
40
-
41
- ```typescript
42
- export class GridEntity extends EntityBase<GridModel> {
43
- // Strongly-typed component getters
44
- get coordinates(): CoordinatesComponent {
45
- return this.getComponent(ComponentType.coordinates);
46
- }
47
-
48
- // Entity proxies for relationships (not direct references)
49
- get sceneProxy(): EntityProxy<SceneEntity> {
50
- return this.getProxy(EntityType.scene);
51
- }
52
- }
53
- ```
54
-
55
- **Key files:**
56
- - `entity.ts`: Base `IEntity` interface and `EntityTypeUid` types
57
- - `entity-proxies.ts`: `EntityProxy` for loose-coupling relationships
58
- - `entity-snapshot.ts`: `IEntitySnapshot` for serialization
59
- - `entity-runtime-scheduler.ts`: `IEntityUpdate` and `IEntityRuntimeScheduler` for dirty mailboxes, cadence, and batched runtime dispatch
60
- - `entity-repository.ts`: `IEntityRepository` for entity lookups
61
- - `entity-events.ts`: `IEntityEvents` for reactive patterns
62
-
63
- ### Pipelines (`src/pipelines/`)
64
-
65
- Pipelines execute **middleware chains** with two phases:
66
-
67
- 1. **dispatch(context)**: Main execution phase
68
- 2. **cleanup(context)**: Resource cleanup phase
69
-
70
- ```typescript
71
- export interface IPipeline<TContext extends IPipelineContext> {
72
- use(middleware: IMiddleware<TContext>): this;
73
- dispatch(context: Partial<TContext>): void | Promise<void>;
74
- cleanup(context: Partial<TContext>): void | Promise<void>;
75
- }
76
- ```
77
-
78
- **Key files:**
79
- - `pipeline.ts`: Core `IPipeline` interface
80
- - `middleware.ts`: `IMiddleware` contract (action + optional cleanup)
81
- - `middleware-runner.ts`: Middleware execution engine
82
- - `pipeline-context.ts`: Context passed to middleware
83
- - `pipeline-runner.ts`: Pipeline execution orchestration
84
-
85
- ### Systems (`src/systems/`)
86
-
87
- Systems are **modular logic units** that operate on entities. They implement the middleware pattern.
88
-
89
- **Pipeline-based systems:**
90
- - `system-middleware.ts`: `ISystemMiddleware<TEntity>` - middleware for a specific entity type
91
- - `system-context.ts`: Context passed to system middleware (entity, events, repository, etc.)
92
-
93
- **Module-based organization:**
94
- - `systems-module.ts`: `ISystemsModule<TEntity>` - groups related systems targeting an entity type
95
- - `systems-module-builder.ts`: `ISystemsModuleBuilder<TEntity>` - fluent builder for pipeline registration
96
- - `systems-module-repository.ts`: Module lifecycle and registration
97
-
98
- **Runtime execution:**
99
- - `systems-runtime.ts`: `ISystemsRuntime` - core tick-based execution loop
100
- - `systems-runtime-context.ts`: Context for runtime execution
101
- - `systems-runtime-middleware.ts`: Middleware for runtime operations
102
-
103
- ### Utilities (`src/utils/`)
104
-
105
- - `types.ts`: Common types (`Immutable`, `BooleanProps`, `Readonly`)
106
- - `json-serializer.ts`: JSON serialization contracts
107
- - `logger.ts`: Logging interface
108
- - `performance-timer.ts`: Performance measurement
109
-
110
- ## Key Design Principles
111
-
112
- 1. **Components are data-only** - no behavior, just properties
113
- 2. **Entities are immutable** - modifications through systems only
114
- 3. **Relationships use proxies** - loose coupling between entities
115
- 4. **Systems are middleware** - pluggable into pipelines
116
- 5. **Pipelines are composable** - middleware chains with dispatch + cleanup
117
-
118
- ## What's NOT in Abstract
119
-
120
- - Concrete entity implementations (→ @awesome-ecs/core)
121
- - System module base classes (→ @awesome-ecs/core)
122
- - Component factories (→ @awesome-ecs/core)
123
- - Multi-threading (→ @awesome-ecs/workers)
124
- - AI patterns (→ @awesome-ecs/ai)
1
+ # Awesome ECS - Abstract Package
2
+
3
+ ## Overview
4
+
5
+ The Abstract package defines all core interfaces and abstractions for the Entity-Component-System (ECS) framework. It provides the foundational contracts that all other packages implement, including:
6
+
7
+ - **Components**: Data-storage contracts
8
+ - **Entities**: Materialized view contracts for components and proxy references
9
+ - **Pipelines**: Middleware-based execution chains
10
+ - **Systems**: Modular logic execution patterns
11
+ - **Utilities**: Serialization, events, and scheduling
12
+
13
+ This package has **zero external dependencies** and serves as the contract layer for the entire ECS framework.
14
+
15
+ ## Core Concepts
16
+
17
+ ### Components (`src/components/`)
18
+
19
+ Components are **data-only containers**. They should never contain business logic.
20
+
21
+ ```typescript
22
+ import { IComponent } from "@awesome-ecs/abstract";
23
+
24
+ export class HealthComponent implements IComponent {
25
+ readonly componentType = ComponentType.health;
26
+ readonly isSerializable = true; // Include in snapshots
27
+
28
+ current: number = 100;
29
+ max: number = 100;
30
+ }
31
+ ```
32
+
33
+ **Key interfaces:**
34
+ - `IComponent`: Base component interface with `componentType` and `isSerializable`
35
+ - `IdentityComponent`: Mandatory component tracking entity UID and model
36
+
37
+ ### Entities (`src/entities/`)
38
+
39
+ Entities are immutable contracts over identity, components, and explicit typed proxy fields.
40
+
41
+ ```typescript
42
+ import { EntityProxy, IEntityWith } from '@awesome-ecs/abstract/entities';
43
+
44
+ export interface GridEntity extends IEntityWith<GridModel> {
45
+ readonly coordinates: CoordinatesComponent;
46
+ readonly sceneProxy: EntityProxy<SceneEntity>;
47
+ }
48
+ ```
49
+
50
+ **Key files:**
51
+ - `entity.ts`: Base `IEntity` interface and `EntityTypeUid` types
52
+ - `entity-proxies.ts`: `EntityProxy` for loose-coupling relationships
53
+ - `entity-snapshot.ts`: `IEntitySnapshot` for serialization
54
+ - `entity-runtime-scheduler.ts`: `IEntityUpdate`, the lean `IEntityRuntimeScheduler` runtime contract, and `IEntityRuntimeSchedulerInspector` for tooling/debug surfaces that need mailbox and schedule snapshots
55
+ - `entity-repository.ts`: `IEntityRepository` for entity lookups
56
+ - `entity-events.ts`: `IEntityEvents` for reactive patterns
57
+
58
+ ### Pipelines (`src/pipelines/`)
59
+
60
+ Pipelines execute **middleware chains** with two phases:
61
+
62
+ 1. **dispatch(context)**: Main execution phase
63
+ 2. **cleanup(context)**: Resource cleanup phase
64
+
65
+ ```typescript
66
+ export interface IPipeline<TContext extends IPipelineContext> {
67
+ use(middleware: IMiddleware<TContext>): this;
68
+ dispatch(context: Partial<TContext>): void | Promise<void>;
69
+ cleanup(context: Partial<TContext>): void | Promise<void>;
70
+ }
71
+ ```
72
+
73
+ **Key files:**
74
+ - `pipeline.ts`: Core `IPipeline` interface
75
+ - `middleware.ts`: `IMiddleware` contract (action + optional cleanup)
76
+ - `middleware-runner.ts`: Middleware execution engine
77
+ - `pipeline-context.ts`: Context passed to middleware
78
+ - `pipeline-runner.ts`: Pipeline execution orchestration
79
+
80
+ ### Systems (`src/systems/`)
81
+
82
+ Systems are **modular logic units** that operate on entities. They implement the middleware pattern.
83
+
84
+ **Pipeline-based systems:**
85
+ - `system-middleware.ts`: `ISystemMiddleware<TEntity>` - middleware for a specific entity type
86
+ - `system-context.ts`: Context passed to system middleware (entity, events, repository, etc.)
87
+
88
+ **Module-based organization:**
89
+ - `systems-module.ts`: `ISystemsModule<TEntity>` - groups related systems targeting an entity type
90
+ - `systems-module-builder.ts`: `ISystemsModuleBuilder<TEntity>` - fluent builder for pipeline registration
91
+ - `systems-module-repository.ts`: Module lifecycle and registration
92
+
93
+ **Runtime execution:**
94
+ - `systems-runtime.ts`: `ISystemsRuntime` - core tick-based execution loop
95
+ - `systems-runtime-context.ts`: Context for runtime execution
96
+ - `systems-runtime-middleware.ts`: Middleware for runtime operations
97
+
98
+ ### Utilities (`src/utils/`)
99
+
100
+ - `types.ts`: Common types (`Immutable`, `BooleanProps`, `Readonly`)
101
+ - `json-serializer.ts`: JSON serialization contracts
102
+ - `logger.ts`: Logging interface
103
+ - `performance-timer.ts`: Performance measurement
104
+
105
+ ## Key Design Principles
106
+
107
+ 1. **Components are data-only** - no behavior, just properties
108
+ 2. **Entities are immutable** - modifications through systems only
109
+ 3. **Relationships are backed by proxies** - proxy fields expose typed lookup refs; systems resolve proxy handles or full entities explicitly when needed
110
+ 4. **Systems are middleware** - pluggable into pipelines
111
+ 5. **Pipelines are composable** - middleware chains with dispatch + cleanup
112
+
113
+ ## What's NOT in Abstract
114
+
115
+ - Concrete entity implementations (→ @awesome-ecs/core)
116
+ - System module base classes (→ @awesome-ecs/core)
117
+ - Component factories (→ @awesome-ecs/core)
118
+ - Multi-threading (→ @awesome-ecs/workers)
119
+ - AI patterns (→ @awesome-ecs/ai)
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/components/identity-component.ts"],"sourcesContent":["import { EntityTypeUid, IEntityModel } from '../entities/entity';\nimport { Immutable } from '../utils/types';\nimport { IComponent } from './component';\n\n/**\n * The `BasicComponentType` enum defines the types of basic components available.\n */\nexport enum BasicComponentType {\n identity = 'identity'\n}\n\n/**\n * The mandatory metadata component for every entity.\n * Contains core information that defines what an entity is and when it was last updated.\n * This component is immutable after creation and uniquely identifies each entity.\n *\n * @template TModel - The entity model type containing initialization data.\n */\nexport interface IdentityComponent<TModel extends IEntityModel> extends IComponent {\n /**\n * The entity type classification.\n * Categorizes entities into logical types, allowing systems to selectively operate on specific entity categories.\n */\n readonly entityType: EntityTypeUid;\n\n /**\n * The initialization model for this entity.\n * Provides the minimal data structure used when the entity was first created.\n * Serves as a reference point for the entity's initial configuration.\n *\n * @type {Immutable<TModel>}\n */\n readonly model: Immutable<TModel>;\n\n /**\n * The timestamp of the entity's last system update.\n * Useful for calculating elapsed time (delta time) between consecutive updates.\n * Helps systems make time-aware decisions.\n *\n * @type {Date | undefined}\n */\n readonly lastUpdated?: Date;\n}\n"],"mappings":";;;;;AAOA,IAAY,qBAAL,yBAAA,oBAAA;CACL,mBAAA,cAAA;;AACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/components/identity-component.ts"],"sourcesContent":["import type { EntityTypeUid, IEntityModel } from '../entities/entity';\r\nimport type { IEntityProxy } from '../entities/entity-proxies';\r\nimport { Immutable } from '../utils/types';\r\nimport { IComponent } from './component';\r\n\r\n/**\r\n * The `BasicComponentType` enum defines the types of basic components available.\r\n */\r\nexport enum BasicComponentType {\r\n identity = 'identity'\r\n}\r\n\r\n/**\r\n * The mandatory metadata component for every entity.\r\n * Contains core information that defines what an entity is and when it was last updated.\r\n * This component is immutable after creation and uniquely identifies each entity.\r\n *\r\n * @template TModel - The entity model type containing initialization data.\r\n */\r\nexport interface IdentityComponent<TModel extends IEntityModel> extends IComponent {\r\n /**\r\n * The entity type classification.\r\n * Categorizes entities into logical types, allowing systems to selectively operate on specific entity categories.\r\n */\r\n readonly entityType: EntityTypeUid;\r\n\r\n /**\r\n * The initialization model for this entity.\r\n * Provides the minimal data structure used when the entity was first created.\r\n * Serves as a reference point for the entity's initial configuration.\r\n *\r\n * @type {Immutable<TModel>}\r\n */\r\n readonly model: Immutable<TModel>;\r\n\r\n /**\r\n * The proxy for this entity, derived from `entityType` and `model.uid`.\r\n */\r\n readonly proxy: IEntityProxy;\r\n\r\n /**\r\n * The timestamp of the entity's last system update.\r\n * Useful for calculating elapsed time (delta time) between consecutive updates.\r\n * Helps systems make time-aware decisions.\r\n *\r\n * @type {Date | undefined}\r\n */\r\n readonly lastUpdated?: Date;\r\n}\r\n"],"mappings":";;;;;AAQA,IAAY,qBAAL,yBAAA,oBAAA;CACL,mBAAA,cAAA;;AACF,EAAA,CAAA,CAAA"}
@@ -1,2 +1,2 @@
1
- import { _ as ConfigOption, g as ConfigCustomControlOptions, h as IComponentWithConfig, m as IComponent, n as IdentityComponent, p as ComponentTypeUid, t as BasicComponentType, v as ConfigRecord } from "../index-HeCQLTSE.cjs";
2
- export { BasicComponentType, ComponentTypeUid, ConfigCustomControlOptions, ConfigOption, ConfigRecord, IComponent, IComponentWithConfig, IdentityComponent };
1
+ import { C as ConfigCustomControlOptions, S as IComponentWithConfig, T as ConfigRecord, b as ComponentTypeUid, t as IComponentRepository, v as BasicComponentType, w as ConfigOption, x as IComponent, y as IdentityComponent } from "../index-DMZSrHoB.cjs";
2
+ export { BasicComponentType, ComponentTypeUid, ConfigCustomControlOptions, ConfigOption, ConfigRecord, IComponent, IComponentRepository, IComponentWithConfig, IdentityComponent };
@@ -1,2 +1,2 @@
1
- import { _ as ConfigOption, g as ConfigCustomControlOptions, h as IComponentWithConfig, m as IComponent, n as IdentityComponent, p as ComponentTypeUid, t as BasicComponentType, v as ConfigRecord } from "../index-Tznk33g6.mjs";
2
- export { BasicComponentType, ComponentTypeUid, ConfigCustomControlOptions, ConfigOption, ConfigRecord, IComponent, IComponentWithConfig, IdentityComponent };
1
+ import { C as ConfigCustomControlOptions, S as IComponentWithConfig, T as ConfigRecord, b as ComponentTypeUid, t as IComponentRepository, v as BasicComponentType, w as ConfigOption, x as IComponent, y as IdentityComponent } from "../index-Dbwzlrgp.mjs";
2
+ export { BasicComponentType, ComponentTypeUid, ConfigCustomControlOptions, ConfigOption, ConfigRecord, IComponent, IComponentRepository, IComponentWithConfig, IdentityComponent };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/components/identity-component.ts"],"sourcesContent":["import { EntityTypeUid, IEntityModel } from '../entities/entity';\nimport { Immutable } from '../utils/types';\nimport { IComponent } from './component';\n\n/**\n * The `BasicComponentType` enum defines the types of basic components available.\n */\nexport enum BasicComponentType {\n identity = 'identity'\n}\n\n/**\n * The mandatory metadata component for every entity.\n * Contains core information that defines what an entity is and when it was last updated.\n * This component is immutable after creation and uniquely identifies each entity.\n *\n * @template TModel - The entity model type containing initialization data.\n */\nexport interface IdentityComponent<TModel extends IEntityModel> extends IComponent {\n /**\n * The entity type classification.\n * Categorizes entities into logical types, allowing systems to selectively operate on specific entity categories.\n */\n readonly entityType: EntityTypeUid;\n\n /**\n * The initialization model for this entity.\n * Provides the minimal data structure used when the entity was first created.\n * Serves as a reference point for the entity's initial configuration.\n *\n * @type {Immutable<TModel>}\n */\n readonly model: Immutable<TModel>;\n\n /**\n * The timestamp of the entity's last system update.\n * Useful for calculating elapsed time (delta time) between consecutive updates.\n * Helps systems make time-aware decisions.\n *\n * @type {Date | undefined}\n */\n readonly lastUpdated?: Date;\n}\n"],"mappings":";;;;AAOA,IAAY,qBAAL,yBAAA,oBAAA;CACL,mBAAA,cAAA;;AACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/components/identity-component.ts"],"sourcesContent":["import type { EntityTypeUid, IEntityModel } from '../entities/entity';\r\nimport type { IEntityProxy } from '../entities/entity-proxies';\r\nimport { Immutable } from '../utils/types';\r\nimport { IComponent } from './component';\r\n\r\n/**\r\n * The `BasicComponentType` enum defines the types of basic components available.\r\n */\r\nexport enum BasicComponentType {\r\n identity = 'identity'\r\n}\r\n\r\n/**\r\n * The mandatory metadata component for every entity.\r\n * Contains core information that defines what an entity is and when it was last updated.\r\n * This component is immutable after creation and uniquely identifies each entity.\r\n *\r\n * @template TModel - The entity model type containing initialization data.\r\n */\r\nexport interface IdentityComponent<TModel extends IEntityModel> extends IComponent {\r\n /**\r\n * The entity type classification.\r\n * Categorizes entities into logical types, allowing systems to selectively operate on specific entity categories.\r\n */\r\n readonly entityType: EntityTypeUid;\r\n\r\n /**\r\n * The initialization model for this entity.\r\n * Provides the minimal data structure used when the entity was first created.\r\n * Serves as a reference point for the entity's initial configuration.\r\n *\r\n * @type {Immutable<TModel>}\r\n */\r\n readonly model: Immutable<TModel>;\r\n\r\n /**\r\n * The proxy for this entity, derived from `entityType` and `model.uid`.\r\n */\r\n readonly proxy: IEntityProxy;\r\n\r\n /**\r\n * The timestamp of the entity's last system update.\r\n * Useful for calculating elapsed time (delta time) between consecutive updates.\r\n * Helps systems make time-aware decisions.\r\n *\r\n * @type {Date | undefined}\r\n */\r\n readonly lastUpdated?: Date;\r\n}\r\n"],"mappings":";;;;AAQA,IAAY,qBAAL,yBAAA,oBAAA;CACL,mBAAA,cAAA;;AACF,EAAA,CAAA,CAAA"}
@@ -1,4 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/entities/context-repository.ts
3
+ const SYSTEM_CONTEXT_KEY = Symbol("systemContext");
4
+ //#endregion
2
5
  //#region src/entities/entity-scheduler.ts
3
6
  let EntityUpdateType = /* @__PURE__ */ function(EntityUpdateType) {
4
7
  EntityUpdateType["update"] = "update";
@@ -13,6 +16,7 @@ let SchedulerPauseType = /* @__PURE__ */ function(SchedulerPauseType) {
13
16
  }({});
14
17
  //#endregion
15
18
  exports.EntityUpdateType = EntityUpdateType;
19
+ exports.SYSTEM_CONTEXT_KEY = SYSTEM_CONTEXT_KEY;
16
20
  exports.SchedulerPauseType = SchedulerPauseType;
17
21
 
18
22
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/entities/entity-scheduler.ts"],"sourcesContent":["import { EntityTypeUid, EntityUid, IEntity, IEntityModel } from './entity';\nimport { IEntityConfigSnapshot } from './entity-config';\nimport { IEntityEvent, IEventData } from './entity-events';\nimport { IEntityProxy } from './entity-proxies';\nimport { IEntitySnapshot } from './entity-snapshot';\n\nexport enum EntityUpdateType {\n update = 'update',\n remove = 'remove'\n}\n\nexport interface IEntityUpdate {\n readonly type: EntityUpdateType;\n readonly entity: IEntityProxy;\n readonly model?: IEntityModel;\n readonly snapshot?: IEntitySnapshot;\n readonly config?: IEntityConfigSnapshot;\n}\n\nexport interface IEntityDispatchGroup {\n readonly entityType: EntityTypeUid;\n readonly updates: ReadonlyArray<IEntityUpdate>;\n readonly dirtyUpdates: number;\n readonly scheduledUpdates: number;\n readonly removeUpdates: number;\n readonly pipelineMask?: number;\n}\n\nexport type EntityRuntimePendingGroupOptions = {\n readonly includeFrameSubscriptions?: boolean;\n};\n\nexport type EntitySchedule = {\n readonly proxy: IEntityProxy;\n readonly intervalMs?: number;\n};\n\nexport type EntityPriorityModel = {\n readonly defaultPriority?: number;\n readonly entityTypes?: ReadonlyMap<EntityTypeUid, number>;\n};\n\nexport enum SchedulerPauseType {\n full = 'full',\n perFrame = 'perFrame',\n intervals = 'intervals'\n}\n\nexport interface IEntityRuntimeScheduler {\n readonly dirtyCount: number;\n readonly rawDirtyCount: number;\n readonly pendingCount: number;\n\n enqueue(update: IEntityUpdate): void;\n enqueueEvent(entity: IEntityProxy, event: IEntityEvent<IEventData>): void;\n enqueueEvents(entity: IEntityProxy, events: ReadonlyArray<IEntityEvent<IEventData>>): void;\n\n schedule(proxy: IEntityProxy, intervalMs?: number): void;\n removeSchedule(proxy: IEntityProxy): void;\n hasSchedule(proxy: IEntityProxy): boolean;\n\n takePendingGroups(\n maxItems?: number,\n options?: EntityRuntimePendingGroupOptions\n ): ReadonlyArray<IEntityDispatchGroup>;\n}\n"],"mappings":";;AAMA,IAAY,mBAAL,yBAAA,kBAAA;CACL,iBAAA,YAAA;CACA,iBAAA,YAAA;;AACF,EAAA,CAAA,CAAA;AAiCA,IAAY,qBAAL,yBAAA,oBAAA;CACL,mBAAA,UAAA;CACA,mBAAA,cAAA;CACA,mBAAA,eAAA;;AACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/entities/context-repository.ts","../../src/entities/entity-scheduler.ts"],"sourcesContent":["import type { IEntityProxy } from './entity-proxies';\r\n\r\nexport const SYSTEM_CONTEXT_KEY = Symbol('systemContext');\r\n\r\nexport interface IContextRepository {\r\n get<TContext>(proxy: IEntityProxy, key: string | symbol): TContext | undefined;\r\n set<TContext>(proxy: IEntityProxy, key: string | symbol, context: TContext): TContext;\r\n delete(proxy: IEntityProxy, key: string | symbol): boolean;\r\n deleteAll(proxy: IEntityProxy): boolean;\r\n}\r\n","import { EntityTypeUid, IEntityModel } from './entity';\r\nimport { IEntityConfigSnapshot } from './entity-config';\r\nimport { IEntityEvent, IEventData } from './entity-events';\r\nimport { IEntityProxy } from './entity-proxies';\r\nimport { IEntitySnapshot } from './entity-snapshot';\r\n\r\nexport enum EntityUpdateType {\r\n update = 'update',\r\n remove = 'remove'\r\n}\r\n\r\nexport interface IEntityUpdate {\r\n readonly type: EntityUpdateType;\r\n readonly entity: IEntityProxy;\r\n readonly model?: IEntityModel;\r\n readonly snapshot?: IEntitySnapshot;\r\n readonly config?: IEntityConfigSnapshot;\r\n}\r\n\r\nexport interface IEntityDispatchGroup {\r\n readonly entityType: EntityTypeUid;\r\n readonly updates: ReadonlyArray<IEntityUpdate>;\r\n readonly dirtyUpdates: number;\r\n readonly scheduledUpdates: number;\r\n readonly removeUpdates: number;\r\n readonly pipelineMask?: number;\r\n}\r\n\r\nexport type EntityRuntimePendingGroupOptions = {\r\n readonly includeFrameSubscriptions?: boolean;\r\n};\r\n\r\nexport type EntitySchedule = {\r\n readonly proxy: IEntityProxy;\r\n readonly intervalMs?: number;\r\n};\r\n\r\nexport type EntityPriorityModel = {\r\n readonly defaultPriority?: number;\r\n readonly entityTypes?: ReadonlyMap<EntityTypeUid, number>;\r\n};\r\n\r\nexport enum SchedulerPauseType {\r\n full = 'full',\r\n perFrame = 'perFrame',\r\n intervals = 'intervals'\r\n}\r\n\r\nexport interface IEntityRuntimeScheduler {\r\n enqueue(update: IEntityUpdate): void;\r\n enqueueEvent(entity: IEntityProxy, event: IEntityEvent<IEventData>): void;\r\n enqueueEvents(entity: IEntityProxy, events: ReadonlyArray<IEntityEvent<IEventData>>): void;\r\n clearDirtyUpdates(): void;\r\n\r\n schedule(proxy: IEntityProxy, intervalMs?: number): void;\r\n removeSchedule(proxy: IEntityProxy): void;\r\n hasSchedule(proxy: IEntityProxy): boolean;\r\n clearSchedules(): void;\r\n\r\n takePendingGroups(\r\n maxItems?: number,\r\n options?: EntityRuntimePendingGroupOptions\r\n ): ReadonlyArray<IEntityDispatchGroup>;\r\n\r\n skipEntityType(entityType: EntityTypeUid): void;\r\n unskipEntityType(entityType: EntityTypeUid): void;\r\n pause(type?: SchedulerPauseType): void;\r\n resume(): void;\r\n}\r\n\r\nexport interface IEntityRuntimeSchedulerInspector extends IEntityRuntimeScheduler {\r\n readonly dirtyCount: number;\r\n readonly frameSubscriptions: ReadonlySet<IEntityProxy>;\r\n readonly isPaused: boolean;\r\n readonly pauseType: SchedulerPauseType | null;\r\n readonly pendingGroupCount: number;\r\n readonly pendingCount: number;\r\n readonly rawDirtyCount: number;\r\n readonly schedules: ReadonlyArray<EntitySchedule>;\r\n readonly skippedEntityTypes: ReadonlySet<EntityTypeUid>;\r\n\r\n inspectDirtyUpdates(): ReadonlyArray<IEntityUpdate>;\r\n}\r\n"],"mappings":";;AAEA,MAAa,qBAAqB,OAAO,eAAe;;;ACIxD,IAAY,mBAAL,yBAAA,kBAAA;CACL,iBAAA,YAAA;CACA,iBAAA,YAAA;;AACF,EAAA,CAAA,CAAA;AAiCA,IAAY,qBAAL,yBAAA,oBAAA;CACL,mBAAA,UAAA;CACA,mBAAA,cAAA;CACA,mBAAA,eAAA;;AACF,EAAA,CAAA,CAAA"}
@@ -1,3 +1,3 @@
1
- import { a as IEntity, c as IEntityProxy, d as RequiredProxies, f as TypedEntityProxy, i as EntityUid, l as IEntityProxyRepository, o as IEntityModel, r as EntityTypeUid, s as EntityProxy, u as ProxyTypesOf } from "../index-HeCQLTSE.cjs";
2
- import { _ as IEntityEventsManager, a as IEntityDispatchGroup, b as IEntityConfigSnapshot, c as SchedulerPauseType, d as IEntityRepository, f as EntityEventSubscriptionFilter, g as IEntityEventsDispatcher, h as IEntityEvent, i as EntityUpdateType, l as IEntitySnapshot, m as EntityEventUid, n as EntityRuntimePendingGroupOptions, o as IEntityRuntimeScheduler, p as EntityEventSubscriptionOptions, r as EntitySchedule, s as IEntityUpdate, t as EntityPriorityModel, u as IEntitySnapshotProvider, v as IEventData, y as IEntityContextCache } from "../index-0hg5PXZe.cjs";
3
- export { EntityEventSubscriptionFilter, EntityEventSubscriptionOptions, EntityEventUid, EntityPriorityModel, EntityProxy, EntityRuntimePendingGroupOptions, EntitySchedule, EntityTypeUid, EntityUid, EntityUpdateType, IEntity, IEntityConfigSnapshot, IEntityContextCache, IEntityDispatchGroup, IEntityEvent, IEntityEventsDispatcher, IEntityEventsManager, IEntityModel, IEntityProxy, IEntityProxyRepository, IEntityRepository, IEntityRuntimeScheduler, IEntitySnapshot, IEntitySnapshotProvider, IEntityUpdate, IEventData, ProxyTypesOf, RequiredProxies, SchedulerPauseType, TypedEntityProxy };
1
+ import { _ as ModelOf, a as IEntityProxy, c as RequiredProxies, d as EntityUid, f as IEntity, g as IEntityWith, h as IEntitySpec, i as EntityProxyManyLookup, l as TypedEntityProxy, m as IEntityModelRef, n as EntityProxy, o as IEntityProxyRepository, p as IEntityModel, r as EntityProxyLookup, s as ProxyTypesOf, u as EntityTypeUid } from "../index-DMZSrHoB.cjs";
2
+ import { S as SYSTEM_CONTEXT_KEY, _ as IEntityEventsDispatcher, a as IEntityDispatchGroup, b as IEntityConfigSnapshot, c as IEntityUpdate, d as IEntitySnapshotProvider, f as IEntityRepository, g as IEntityEvent, h as EntityEventUid, i as EntityUpdateType, l as SchedulerPauseType, m as EntityEventSubscriptionOptions, n as EntityRuntimePendingGroupOptions, o as IEntityRuntimeScheduler, p as EntityEventSubscriptionFilter, r as EntitySchedule, s as IEntityRuntimeSchedulerInspector, t as EntityPriorityModel, u as IEntitySnapshot, v as IEntityEventsManager, x as IContextRepository, y as IEventData } from "../index-CSaKdQe-.cjs";
3
+ export { EntityEventSubscriptionFilter, EntityEventSubscriptionOptions, EntityEventUid, EntityPriorityModel, EntityProxy, EntityProxyLookup, EntityProxyManyLookup, EntityRuntimePendingGroupOptions, EntitySchedule, EntityTypeUid, EntityUid, EntityUpdateType, IContextRepository, IEntity, IEntityConfigSnapshot, IEntityDispatchGroup, IEntityEvent, IEntityEventsDispatcher, IEntityEventsManager, IEntityModel, IEntityModelRef, IEntityProxy, IEntityProxyRepository, IEntityRepository, IEntityRuntimeScheduler, IEntityRuntimeSchedulerInspector, IEntitySnapshot, IEntitySnapshotProvider, IEntitySpec, IEntityUpdate, IEntityWith, IEventData, ModelOf, ProxyTypesOf, RequiredProxies, SYSTEM_CONTEXT_KEY, SchedulerPauseType, TypedEntityProxy };
@@ -1,3 +1,3 @@
1
- import { a as IEntity, c as IEntityProxy, d as RequiredProxies, f as TypedEntityProxy, i as EntityUid, l as IEntityProxyRepository, o as IEntityModel, r as EntityTypeUid, s as EntityProxy, u as ProxyTypesOf } from "../index-Tznk33g6.mjs";
2
- import { _ as IEntityEventsManager, a as IEntityDispatchGroup, b as IEntityConfigSnapshot, c as SchedulerPauseType, d as IEntityRepository, f as EntityEventSubscriptionFilter, g as IEntityEventsDispatcher, h as IEntityEvent, i as EntityUpdateType, l as IEntitySnapshot, m as EntityEventUid, n as EntityRuntimePendingGroupOptions, o as IEntityRuntimeScheduler, p as EntityEventSubscriptionOptions, r as EntitySchedule, s as IEntityUpdate, t as EntityPriorityModel, u as IEntitySnapshotProvider, v as IEventData, y as IEntityContextCache } from "../index--9JJtMKF.mjs";
3
- export { EntityEventSubscriptionFilter, EntityEventSubscriptionOptions, EntityEventUid, EntityPriorityModel, EntityProxy, EntityRuntimePendingGroupOptions, EntitySchedule, EntityTypeUid, EntityUid, EntityUpdateType, IEntity, IEntityConfigSnapshot, IEntityContextCache, IEntityDispatchGroup, IEntityEvent, IEntityEventsDispatcher, IEntityEventsManager, IEntityModel, IEntityProxy, IEntityProxyRepository, IEntityRepository, IEntityRuntimeScheduler, IEntitySnapshot, IEntitySnapshotProvider, IEntityUpdate, IEventData, ProxyTypesOf, RequiredProxies, SchedulerPauseType, TypedEntityProxy };
1
+ import { _ as ModelOf, a as IEntityProxy, c as RequiredProxies, d as EntityUid, f as IEntity, g as IEntityWith, h as IEntitySpec, i as EntityProxyManyLookup, l as TypedEntityProxy, m as IEntityModelRef, n as EntityProxy, o as IEntityProxyRepository, p as IEntityModel, r as EntityProxyLookup, s as ProxyTypesOf, u as EntityTypeUid } from "../index-Dbwzlrgp.mjs";
2
+ import { S as SYSTEM_CONTEXT_KEY, _ as IEntityEventsDispatcher, a as IEntityDispatchGroup, b as IEntityConfigSnapshot, c as IEntityUpdate, d as IEntitySnapshotProvider, f as IEntityRepository, g as IEntityEvent, h as EntityEventUid, i as EntityUpdateType, l as SchedulerPauseType, m as EntityEventSubscriptionOptions, n as EntityRuntimePendingGroupOptions, o as IEntityRuntimeScheduler, p as EntityEventSubscriptionFilter, r as EntitySchedule, s as IEntityRuntimeSchedulerInspector, t as EntityPriorityModel, u as IEntitySnapshot, v as IEntityEventsManager, x as IContextRepository, y as IEventData } from "../index-BanhgPCc.mjs";
3
+ export { EntityEventSubscriptionFilter, EntityEventSubscriptionOptions, EntityEventUid, EntityPriorityModel, EntityProxy, EntityProxyLookup, EntityProxyManyLookup, EntityRuntimePendingGroupOptions, EntitySchedule, EntityTypeUid, EntityUid, EntityUpdateType, IContextRepository, IEntity, IEntityConfigSnapshot, IEntityDispatchGroup, IEntityEvent, IEntityEventsDispatcher, IEntityEventsManager, IEntityModel, IEntityModelRef, IEntityProxy, IEntityProxyRepository, IEntityRepository, IEntityRuntimeScheduler, IEntityRuntimeSchedulerInspector, IEntitySnapshot, IEntitySnapshotProvider, IEntitySpec, IEntityUpdate, IEntityWith, IEventData, ModelOf, ProxyTypesOf, RequiredProxies, SYSTEM_CONTEXT_KEY, SchedulerPauseType, TypedEntityProxy };
@@ -1,3 +1,6 @@
1
+ //#region src/entities/context-repository.ts
2
+ const SYSTEM_CONTEXT_KEY = Symbol("systemContext");
3
+ //#endregion
1
4
  //#region src/entities/entity-scheduler.ts
2
5
  let EntityUpdateType = /* @__PURE__ */ function(EntityUpdateType) {
3
6
  EntityUpdateType["update"] = "update";
@@ -11,6 +14,6 @@ let SchedulerPauseType = /* @__PURE__ */ function(SchedulerPauseType) {
11
14
  return SchedulerPauseType;
12
15
  }({});
13
16
  //#endregion
14
- export { EntityUpdateType, SchedulerPauseType };
17
+ export { EntityUpdateType, SYSTEM_CONTEXT_KEY, SchedulerPauseType };
15
18
 
16
19
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/entities/entity-scheduler.ts"],"sourcesContent":["import { EntityTypeUid, EntityUid, IEntity, IEntityModel } from './entity';\nimport { IEntityConfigSnapshot } from './entity-config';\nimport { IEntityEvent, IEventData } from './entity-events';\nimport { IEntityProxy } from './entity-proxies';\nimport { IEntitySnapshot } from './entity-snapshot';\n\nexport enum EntityUpdateType {\n update = 'update',\n remove = 'remove'\n}\n\nexport interface IEntityUpdate {\n readonly type: EntityUpdateType;\n readonly entity: IEntityProxy;\n readonly model?: IEntityModel;\n readonly snapshot?: IEntitySnapshot;\n readonly config?: IEntityConfigSnapshot;\n}\n\nexport interface IEntityDispatchGroup {\n readonly entityType: EntityTypeUid;\n readonly updates: ReadonlyArray<IEntityUpdate>;\n readonly dirtyUpdates: number;\n readonly scheduledUpdates: number;\n readonly removeUpdates: number;\n readonly pipelineMask?: number;\n}\n\nexport type EntityRuntimePendingGroupOptions = {\n readonly includeFrameSubscriptions?: boolean;\n};\n\nexport type EntitySchedule = {\n readonly proxy: IEntityProxy;\n readonly intervalMs?: number;\n};\n\nexport type EntityPriorityModel = {\n readonly defaultPriority?: number;\n readonly entityTypes?: ReadonlyMap<EntityTypeUid, number>;\n};\n\nexport enum SchedulerPauseType {\n full = 'full',\n perFrame = 'perFrame',\n intervals = 'intervals'\n}\n\nexport interface IEntityRuntimeScheduler {\n readonly dirtyCount: number;\n readonly rawDirtyCount: number;\n readonly pendingCount: number;\n\n enqueue(update: IEntityUpdate): void;\n enqueueEvent(entity: IEntityProxy, event: IEntityEvent<IEventData>): void;\n enqueueEvents(entity: IEntityProxy, events: ReadonlyArray<IEntityEvent<IEventData>>): void;\n\n schedule(proxy: IEntityProxy, intervalMs?: number): void;\n removeSchedule(proxy: IEntityProxy): void;\n hasSchedule(proxy: IEntityProxy): boolean;\n\n takePendingGroups(\n maxItems?: number,\n options?: EntityRuntimePendingGroupOptions\n ): ReadonlyArray<IEntityDispatchGroup>;\n}\n"],"mappings":";AAMA,IAAY,mBAAL,yBAAA,kBAAA;CACL,iBAAA,YAAA;CACA,iBAAA,YAAA;;AACF,EAAA,CAAA,CAAA;AAiCA,IAAY,qBAAL,yBAAA,oBAAA;CACL,mBAAA,UAAA;CACA,mBAAA,cAAA;CACA,mBAAA,eAAA;;AACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/entities/context-repository.ts","../../src/entities/entity-scheduler.ts"],"sourcesContent":["import type { IEntityProxy } from './entity-proxies';\r\n\r\nexport const SYSTEM_CONTEXT_KEY = Symbol('systemContext');\r\n\r\nexport interface IContextRepository {\r\n get<TContext>(proxy: IEntityProxy, key: string | symbol): TContext | undefined;\r\n set<TContext>(proxy: IEntityProxy, key: string | symbol, context: TContext): TContext;\r\n delete(proxy: IEntityProxy, key: string | symbol): boolean;\r\n deleteAll(proxy: IEntityProxy): boolean;\r\n}\r\n","import { EntityTypeUid, IEntityModel } from './entity';\r\nimport { IEntityConfigSnapshot } from './entity-config';\r\nimport { IEntityEvent, IEventData } from './entity-events';\r\nimport { IEntityProxy } from './entity-proxies';\r\nimport { IEntitySnapshot } from './entity-snapshot';\r\n\r\nexport enum EntityUpdateType {\r\n update = 'update',\r\n remove = 'remove'\r\n}\r\n\r\nexport interface IEntityUpdate {\r\n readonly type: EntityUpdateType;\r\n readonly entity: IEntityProxy;\r\n readonly model?: IEntityModel;\r\n readonly snapshot?: IEntitySnapshot;\r\n readonly config?: IEntityConfigSnapshot;\r\n}\r\n\r\nexport interface IEntityDispatchGroup {\r\n readonly entityType: EntityTypeUid;\r\n readonly updates: ReadonlyArray<IEntityUpdate>;\r\n readonly dirtyUpdates: number;\r\n readonly scheduledUpdates: number;\r\n readonly removeUpdates: number;\r\n readonly pipelineMask?: number;\r\n}\r\n\r\nexport type EntityRuntimePendingGroupOptions = {\r\n readonly includeFrameSubscriptions?: boolean;\r\n};\r\n\r\nexport type EntitySchedule = {\r\n readonly proxy: IEntityProxy;\r\n readonly intervalMs?: number;\r\n};\r\n\r\nexport type EntityPriorityModel = {\r\n readonly defaultPriority?: number;\r\n readonly entityTypes?: ReadonlyMap<EntityTypeUid, number>;\r\n};\r\n\r\nexport enum SchedulerPauseType {\r\n full = 'full',\r\n perFrame = 'perFrame',\r\n intervals = 'intervals'\r\n}\r\n\r\nexport interface IEntityRuntimeScheduler {\r\n enqueue(update: IEntityUpdate): void;\r\n enqueueEvent(entity: IEntityProxy, event: IEntityEvent<IEventData>): void;\r\n enqueueEvents(entity: IEntityProxy, events: ReadonlyArray<IEntityEvent<IEventData>>): void;\r\n clearDirtyUpdates(): void;\r\n\r\n schedule(proxy: IEntityProxy, intervalMs?: number): void;\r\n removeSchedule(proxy: IEntityProxy): void;\r\n hasSchedule(proxy: IEntityProxy): boolean;\r\n clearSchedules(): void;\r\n\r\n takePendingGroups(\r\n maxItems?: number,\r\n options?: EntityRuntimePendingGroupOptions\r\n ): ReadonlyArray<IEntityDispatchGroup>;\r\n\r\n skipEntityType(entityType: EntityTypeUid): void;\r\n unskipEntityType(entityType: EntityTypeUid): void;\r\n pause(type?: SchedulerPauseType): void;\r\n resume(): void;\r\n}\r\n\r\nexport interface IEntityRuntimeSchedulerInspector extends IEntityRuntimeScheduler {\r\n readonly dirtyCount: number;\r\n readonly frameSubscriptions: ReadonlySet<IEntityProxy>;\r\n readonly isPaused: boolean;\r\n readonly pauseType: SchedulerPauseType | null;\r\n readonly pendingGroupCount: number;\r\n readonly pendingCount: number;\r\n readonly rawDirtyCount: number;\r\n readonly schedules: ReadonlyArray<EntitySchedule>;\r\n readonly skippedEntityTypes: ReadonlySet<EntityTypeUid>;\r\n\r\n inspectDirtyUpdates(): ReadonlyArray<IEntityUpdate>;\r\n}\r\n"],"mappings":";AAEA,MAAa,qBAAqB,OAAO,eAAe;;;ACIxD,IAAY,mBAAL,yBAAA,kBAAA;CACL,iBAAA,YAAA;CACA,iBAAA,YAAA;;AACF,EAAA,CAAA,CAAA;AAiCA,IAAY,qBAAL,yBAAA,oBAAA;CACL,mBAAA,UAAA;CACA,mBAAA,cAAA;CACA,mBAAA,eAAA;;AACF,EAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/factories/pipeline-factory.ts"],"sourcesContent":["import type { IPipelineContext } from '../pipelines';\nimport { IPipeline } from '../pipelines/pipeline';\n\n/**\n * Category identifier for grouping performance metrics.\n * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.\n */\nexport type PipelineCategoryName = string;\n\n/**\n * Built-in metric categories for classifying pipeline and middleware performance entries.\n *\n * - `module` — System module pipelines (initialize, config, update, render, sync phases).\n * - `runtime` — Runtime orchestration pipeline and its middleware.\n * - `system` — Individual system middleware within a module pipeline.\n */\nexport enum PipelineCategory {\n module = 'module',\n runtime = 'runtime',\n system = 'system'\n}\n\n/**\n * Options for identifying and categorizing performance metrics on pipelines.\n */\nexport type PipelineOptions = {\n /** Display name for the pipeline in performance metrics. */\n pipelineName: string;\n /** Category assigned to pipeline-level metric entries. */\n pipelineCategory: PipelineCategoryName;\n /** Category assigned to per-middleware metric entries within this pipeline. */\n middlewareCategory: PipelineCategoryName;\n};\n\n/**\n * Creates pipeline instances for various contexts.\n * Abstracts pipeline creation to support different implementations.\n * Used by the system to instantiate pipelines without coupling to specific implementations.\n */\nexport interface IPipelineFactory {\n /**\n * Creates a new pipeline for the specified context type.\n * @template TContext - The context type for the pipeline. Must extend IPipelineContext.\n * @param options - Optional performance metric options (name, category) for the pipeline.\n * @returns A new pipeline instance ready for middleware registration.\n */\n createPipeline<TContext extends IPipelineContext>(options?: PipelineOptions): IPipeline<TContext>;\n}\n"],"mappings":";;;;;;;;;AAgBA,IAAY,mBAAL,yBAAA,kBAAA;CACL,iBAAA,YAAA;CACA,iBAAA,aAAA;CACA,iBAAA,YAAA;;AACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/factories/pipeline-factory.ts"],"sourcesContent":["import type { IPipelineContext } from '../pipelines';\r\nimport { IPipeline } from '../pipelines/pipeline';\r\n\r\n/**\r\n * Category identifier for grouping performance metrics.\r\n * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.\r\n */\r\nexport type PipelineCategoryName = string;\r\n\r\n/**\r\n * Built-in metric categories for classifying pipeline and middleware performance entries.\r\n *\r\n * - `module` — System module pipelines (initialize, config, update, render, sync phases).\r\n * - `runtime` — Runtime orchestration pipeline and its middleware.\r\n * - `system` — Individual system middleware within a module pipeline.\r\n */\r\nexport enum PipelineCategory {\r\n module = 'module',\r\n runtime = 'runtime',\r\n system = 'system'\r\n}\r\n\r\n/**\r\n * Options for identifying and categorizing performance metrics on pipelines.\r\n */\r\nexport type PipelineOptions = {\r\n /** Display name for the pipeline in performance metrics. */\r\n pipelineName: string;\r\n /** Category assigned to pipeline-level metric entries. */\r\n pipelineCategory: PipelineCategoryName;\r\n /** Category assigned to per-middleware metric entries within this pipeline. */\r\n middlewareCategory: PipelineCategoryName;\r\n};\r\n\r\n/**\r\n * Creates pipeline instances for various contexts.\r\n * Abstracts pipeline creation to support different implementations.\r\n * Used by the system to instantiate pipelines without coupling to specific implementations.\r\n */\r\nexport interface IPipelineFactory {\r\n /**\r\n * Creates a new pipeline for the specified context type.\r\n * @template TContext - The context type for the pipeline. Must extend IPipelineContext.\r\n * @param options - Optional performance metric options (name, category) for the pipeline.\r\n * @returns A new pipeline instance ready for middleware registration.\r\n */\r\n createPipeline<TContext extends IPipelineContext>(options?: PipelineOptions): IPipeline<TContext>;\r\n}\r\n"],"mappings":";;;;;;;;;AAgBA,IAAY,mBAAL,yBAAA,kBAAA;CACL,iBAAA,YAAA;CACA,iBAAA,aAAA;CACA,iBAAA,YAAA;;AACF,EAAA,CAAA,CAAA"}
@@ -1,2 +1,2 @@
1
- import { _ as PipelineCategoryName, g as PipelineCategory, h as IPipelineFactory, t as ISystemsFactory, v as PipelineOptions, y as IContextFactory } from "../index-CPGVaS-_.cjs";
1
+ import { c as PipelineCategoryName, l as PipelineOptions, o as IPipelineFactory, s as PipelineCategory, t as ISystemsFactory, u as IContextFactory } from "../index-BivyWazf.cjs";
2
2
  export { IContextFactory, IPipelineFactory, ISystemsFactory, PipelineCategory, PipelineCategoryName, PipelineOptions };
@@ -1,2 +1,2 @@
1
- import { _ as PipelineCategoryName, g as PipelineCategory, h as IPipelineFactory, t as ISystemsFactory, v as PipelineOptions, y as IContextFactory } from "../index-BOS-47DQ.mjs";
1
+ import { c as PipelineCategoryName, l as PipelineOptions, o as IPipelineFactory, s as PipelineCategory, t as ISystemsFactory, u as IContextFactory } from "../index-DGyDijY7.mjs";
2
2
  export { IContextFactory, IPipelineFactory, ISystemsFactory, PipelineCategory, PipelineCategoryName, PipelineOptions };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/factories/pipeline-factory.ts"],"sourcesContent":["import type { IPipelineContext } from '../pipelines';\nimport { IPipeline } from '../pipelines/pipeline';\n\n/**\n * Category identifier for grouping performance metrics.\n * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.\n */\nexport type PipelineCategoryName = string;\n\n/**\n * Built-in metric categories for classifying pipeline and middleware performance entries.\n *\n * - `module` — System module pipelines (initialize, config, update, render, sync phases).\n * - `runtime` — Runtime orchestration pipeline and its middleware.\n * - `system` — Individual system middleware within a module pipeline.\n */\nexport enum PipelineCategory {\n module = 'module',\n runtime = 'runtime',\n system = 'system'\n}\n\n/**\n * Options for identifying and categorizing performance metrics on pipelines.\n */\nexport type PipelineOptions = {\n /** Display name for the pipeline in performance metrics. */\n pipelineName: string;\n /** Category assigned to pipeline-level metric entries. */\n pipelineCategory: PipelineCategoryName;\n /** Category assigned to per-middleware metric entries within this pipeline. */\n middlewareCategory: PipelineCategoryName;\n};\n\n/**\n * Creates pipeline instances for various contexts.\n * Abstracts pipeline creation to support different implementations.\n * Used by the system to instantiate pipelines without coupling to specific implementations.\n */\nexport interface IPipelineFactory {\n /**\n * Creates a new pipeline for the specified context type.\n * @template TContext - The context type for the pipeline. Must extend IPipelineContext.\n * @param options - Optional performance metric options (name, category) for the pipeline.\n * @returns A new pipeline instance ready for middleware registration.\n */\n createPipeline<TContext extends IPipelineContext>(options?: PipelineOptions): IPipeline<TContext>;\n}\n"],"mappings":";;;;;;;;AAgBA,IAAY,mBAAL,yBAAA,kBAAA;CACL,iBAAA,YAAA;CACA,iBAAA,aAAA;CACA,iBAAA,YAAA;;AACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/factories/pipeline-factory.ts"],"sourcesContent":["import type { IPipelineContext } from '../pipelines';\r\nimport { IPipeline } from '../pipelines/pipeline';\r\n\r\n/**\r\n * Category identifier for grouping performance metrics.\r\n * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.\r\n */\r\nexport type PipelineCategoryName = string;\r\n\r\n/**\r\n * Built-in metric categories for classifying pipeline and middleware performance entries.\r\n *\r\n * - `module` — System module pipelines (initialize, config, update, render, sync phases).\r\n * - `runtime` — Runtime orchestration pipeline and its middleware.\r\n * - `system` — Individual system middleware within a module pipeline.\r\n */\r\nexport enum PipelineCategory {\r\n module = 'module',\r\n runtime = 'runtime',\r\n system = 'system'\r\n}\r\n\r\n/**\r\n * Options for identifying and categorizing performance metrics on pipelines.\r\n */\r\nexport type PipelineOptions = {\r\n /** Display name for the pipeline in performance metrics. */\r\n pipelineName: string;\r\n /** Category assigned to pipeline-level metric entries. */\r\n pipelineCategory: PipelineCategoryName;\r\n /** Category assigned to per-middleware metric entries within this pipeline. */\r\n middlewareCategory: PipelineCategoryName;\r\n};\r\n\r\n/**\r\n * Creates pipeline instances for various contexts.\r\n * Abstracts pipeline creation to support different implementations.\r\n * Used by the system to instantiate pipelines without coupling to specific implementations.\r\n */\r\nexport interface IPipelineFactory {\r\n /**\r\n * Creates a new pipeline for the specified context type.\r\n * @template TContext - The context type for the pipeline. Must extend IPipelineContext.\r\n * @param options - Optional performance metric options (name, category) for the pipeline.\r\n * @returns A new pipeline instance ready for middleware registration.\r\n */\r\n createPipeline<TContext extends IPipelineContext>(options?: PipelineOptions): IPipeline<TContext>;\r\n}\r\n"],"mappings":";;;;;;;;AAgBA,IAAY,mBAAL,yBAAA,kBAAA;CACL,iBAAA,YAAA;CACA,iBAAA,aAAA;CACA,iBAAA,YAAA;;AACF,EAAA,CAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- import { r as Immutable } from "./types-UnqKSA14.mjs";
1
+ import { r as Immutable } from "./types-BaCGIrym.mjs";
2
2
 
3
3
  //#region src/pipelines/pipeline-context.d.ts
4
4
  /**
@@ -215,4 +215,4 @@ interface IPipelineRunner<TContext extends IPipelineContext> {
215
215
  }
216
216
  //#endregion
217
217
  export { IParentMiddleware as a, IMiddleware as c, IParentContext as i, IPipelineContext as l, INestedContext as n, IPipeline as o, INestedMiddleware as r, IMiddlewareRunner as s, IPipelineRunner as t, PipelineDispatch as u };
218
- //# sourceMappingURL=index-DXbpfhHa.d.mts.map
218
+ //# sourceMappingURL=index-B3DqdxE6.d.mts.map
@@ -1,6 +1,15 @@
1
- import { a as IEntity, c as IEntityProxy, i as EntityUid, m as IComponent, n as IdentityComponent, o as IEntityModel, p as ComponentTypeUid, r as EntityTypeUid, v as ConfigRecord } from "./index-Tznk33g6.mjs";
2
- import { n as DeepPartial } from "./types-UnqKSA14.mjs";
1
+ import { T as ConfigRecord, a as IEntityProxy, b as ComponentTypeUid, f as IEntity, p as IEntityModel, u as EntityTypeUid, x as IComponent, y as IdentityComponent } from "./index-Dbwzlrgp.mjs";
2
+ import { n as DeepPartial } from "./types-BaCGIrym.mjs";
3
3
 
4
+ //#region src/entities/context-repository.d.ts
5
+ declare const SYSTEM_CONTEXT_KEY: unique symbol;
6
+ interface IContextRepository {
7
+ get<TContext>(proxy: IEntityProxy, key: string | symbol): TContext | undefined;
8
+ set<TContext>(proxy: IEntityProxy, key: string | symbol, context: TContext): TContext;
9
+ delete(proxy: IEntityProxy, key: string | symbol): boolean;
10
+ deleteAll(proxy: IEntityProxy): boolean;
11
+ }
12
+ //#endregion
4
13
  //#region src/entities/entity-config.d.ts
5
14
  /**
6
15
  * Config-only entity state update.
@@ -14,18 +23,6 @@ interface IEntityConfigSnapshot<TConfig extends ConfigRecord = ConfigRecord> {
14
23
  readonly components: Record<ComponentTypeUid, DeepPartial<TConfig>>;
15
24
  }
16
25
  //#endregion
17
- //#region src/entities/entity-context-cache.d.ts
18
- /**
19
- * Flat per-entity key-value storage for runtime-owned cached context objects.
20
- */
21
- interface IEntityContextCache {
22
- get<T>(entityUid: EntityUid, key: string | symbol): T | undefined;
23
- set(entityUid: EntityUid, key: string | symbol, value: unknown): void;
24
- has(entityUid: EntityUid, key?: string | symbol): boolean;
25
- getEntries(entityUid: EntityUid): IterableIterator<[string | symbol, unknown]> | undefined;
26
- disposeEntity(entityUid: EntityUid): void;
27
- }
28
- //#endregion
29
26
  //#region src/entities/entity-events.d.ts
30
27
  /**
31
28
  * Represents a unique identifier for an entity event.
@@ -193,14 +190,14 @@ interface IEntityRepository {
193
190
  * @param proxy - Reference to the entity to retrieve.
194
191
  * @returns The requested entity.
195
192
  */
196
- get<TEntity extends IEntity>(proxy: IEntityProxy): TEntity;
193
+ getEntity<TEntity extends IEntity>(proxy: IEntityProxy): TEntity | undefined;
197
194
  /**
198
195
  * Retrieves all entities of a specific type.
199
196
  * @template TEntity - The entity type to retrieve.
200
197
  * @param entityType - The type identifier to filter by.
201
198
  * @returns Array of all entities matching the type.
202
199
  */
203
- getAll<TEntity extends IEntity>(entityType: EntityTypeUid): TEntity[];
200
+ getEntities<TEntity extends IEntity>(entityType: EntityTypeUid): TEntity[];
204
201
  /**
205
202
  * Iterates over all entities regardless of type.
206
203
  * @returns An iterator over all stored entities.
@@ -210,7 +207,7 @@ interface IEntityRepository {
210
207
  * Stores or updates an entity.
211
208
  * @param entity - The entity to store.
212
209
  */
213
- set(entity: IEntity): void;
210
+ set<TEntity extends IEntity>(entity: TEntity): TEntity;
214
211
  /**
215
212
  * Removes an entity from storage.
216
213
  * @param proxy - Reference to the entity to remove.
@@ -307,17 +304,32 @@ declare enum SchedulerPauseType {
307
304
  intervals = "intervals"
308
305
  }
309
306
  interface IEntityRuntimeScheduler {
310
- readonly dirtyCount: number;
311
- readonly rawDirtyCount: number;
312
- readonly pendingCount: number;
313
307
  enqueue(update: IEntityUpdate): void;
314
308
  enqueueEvent(entity: IEntityProxy, event: IEntityEvent<IEventData>): void;
315
309
  enqueueEvents(entity: IEntityProxy, events: ReadonlyArray<IEntityEvent<IEventData>>): void;
310
+ clearDirtyUpdates(): void;
316
311
  schedule(proxy: IEntityProxy, intervalMs?: number): void;
317
312
  removeSchedule(proxy: IEntityProxy): void;
318
313
  hasSchedule(proxy: IEntityProxy): boolean;
314
+ clearSchedules(): void;
319
315
  takePendingGroups(maxItems?: number, options?: EntityRuntimePendingGroupOptions): ReadonlyArray<IEntityDispatchGroup>;
316
+ skipEntityType(entityType: EntityTypeUid): void;
317
+ unskipEntityType(entityType: EntityTypeUid): void;
318
+ pause(type?: SchedulerPauseType): void;
319
+ resume(): void;
320
+ }
321
+ interface IEntityRuntimeSchedulerInspector extends IEntityRuntimeScheduler {
322
+ readonly dirtyCount: number;
323
+ readonly frameSubscriptions: ReadonlySet<IEntityProxy>;
324
+ readonly isPaused: boolean;
325
+ readonly pauseType: SchedulerPauseType | null;
326
+ readonly pendingGroupCount: number;
327
+ readonly pendingCount: number;
328
+ readonly rawDirtyCount: number;
329
+ readonly schedules: ReadonlyArray<EntitySchedule>;
330
+ readonly skippedEntityTypes: ReadonlySet<EntityTypeUid>;
331
+ inspectDirtyUpdates(): ReadonlyArray<IEntityUpdate>;
320
332
  }
321
333
  //#endregion
322
- export { IEntityEventsManager as _, IEntityDispatchGroup as a, IEntityConfigSnapshot as b, SchedulerPauseType as c, IEntityRepository as d, EntityEventSubscriptionFilter as f, IEntityEventsDispatcher as g, IEntityEvent as h, EntityUpdateType as i, IEntitySnapshot as l, EntityEventUid as m, EntityRuntimePendingGroupOptions as n, IEntityRuntimeScheduler as o, EntityEventSubscriptionOptions as p, EntitySchedule as r, IEntityUpdate as s, EntityPriorityModel as t, IEntitySnapshotProvider as u, IEventData as v, IEntityContextCache as y };
323
- //# sourceMappingURL=index--9JJtMKF.d.mts.map
334
+ export { SYSTEM_CONTEXT_KEY as S, IEntityEventsDispatcher as _, IEntityDispatchGroup as a, IEntityConfigSnapshot as b, IEntityUpdate as c, IEntitySnapshotProvider as d, IEntityRepository as f, IEntityEvent as g, EntityEventUid as h, EntityUpdateType as i, SchedulerPauseType as l, EntityEventSubscriptionOptions as m, EntityRuntimePendingGroupOptions as n, IEntityRuntimeScheduler as o, EntityEventSubscriptionFilter as p, EntitySchedule as r, IEntityRuntimeSchedulerInspector as s, EntityPriorityModel as t, IEntitySnapshot as u, IEntityEventsManager as v, IContextRepository as x, IEventData as y };
335
+ //# sourceMappingURL=index-BanhgPCc.d.mts.map