@sharpee/world-model 0.9.62-beta → 0.9.66-beta
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/README.md +0 -0
- package/package.json +17 -30
- package/LICENSE +0 -21
- package/dist-npm/annotations/index.d.ts +0 -2
- package/dist-npm/annotations/index.d.ts.map +0 -1
- package/dist-npm/annotations/index.js +0 -18
- package/dist-npm/annotations/index.js.map +0 -1
- package/dist-npm/annotations/types.d.ts +0 -35
- package/dist-npm/annotations/types.d.ts.map +0 -1
- package/dist-npm/annotations/types.js +0 -9
- package/dist-npm/annotations/types.js.map +0 -1
- package/dist-npm/behaviors/attack.d.ts +0 -52
- package/dist-npm/behaviors/attack.d.ts.map +0 -1
- package/dist-npm/behaviors/attack.js +0 -161
- package/dist-npm/behaviors/attack.js.map +0 -1
- package/dist-npm/behaviors/behavior.d.ts +0 -67
- package/dist-npm/behaviors/behavior.d.ts.map +0 -1
- package/dist-npm/behaviors/behavior.js +0 -80
- package/dist-npm/behaviors/behavior.js.map +0 -1
- package/dist-npm/behaviors/index.d.ts +0 -21
- package/dist-npm/behaviors/index.d.ts.map +0 -1
- package/dist-npm/behaviors/index.js +0 -39
- package/dist-npm/behaviors/index.js.map +0 -1
- package/dist-npm/capabilities/action-interceptor.d.ts +0 -169
- package/dist-npm/capabilities/action-interceptor.d.ts.map +0 -1
- package/dist-npm/capabilities/action-interceptor.js +0 -15
- package/dist-npm/capabilities/action-interceptor.js.map +0 -1
- package/dist-npm/capabilities/capability-behavior.d.ts +0 -112
- package/dist-npm/capabilities/capability-behavior.d.ts.map +0 -1
- package/dist-npm/capabilities/capability-behavior.js +0 -9
- package/dist-npm/capabilities/capability-behavior.js.map +0 -1
- package/dist-npm/capabilities/capability-defaults.d.ts +0 -67
- package/dist-npm/capabilities/capability-defaults.d.ts.map +0 -1
- package/dist-npm/capabilities/capability-defaults.js +0 -81
- package/dist-npm/capabilities/capability-defaults.js.map +0 -1
- package/dist-npm/capabilities/capability-helpers.d.ts +0 -76
- package/dist-npm/capabilities/capability-helpers.d.ts.map +0 -1
- package/dist-npm/capabilities/capability-helpers.js +0 -112
- package/dist-npm/capabilities/capability-helpers.js.map +0 -1
- package/dist-npm/capabilities/capability-registry.d.ts +0 -115
- package/dist-npm/capabilities/capability-registry.d.ts.map +0 -1
- package/dist-npm/capabilities/capability-registry.js +0 -136
- package/dist-npm/capabilities/capability-registry.js.map +0 -1
- package/dist-npm/capabilities/entity-builder.d.ts +0 -79
- package/dist-npm/capabilities/entity-builder.d.ts.map +0 -1
- package/dist-npm/capabilities/entity-builder.js +0 -116
- package/dist-npm/capabilities/entity-builder.js.map +0 -1
- package/dist-npm/capabilities/index.d.ts +0 -16
- package/dist-npm/capabilities/index.d.ts.map +0 -1
- package/dist-npm/capabilities/index.js +0 -56
- package/dist-npm/capabilities/index.js.map +0 -1
- package/dist-npm/capabilities/interceptor-helpers.d.ts +0 -74
- package/dist-npm/capabilities/interceptor-helpers.d.ts.map +0 -1
- package/dist-npm/capabilities/interceptor-helpers.js +0 -111
- package/dist-npm/capabilities/interceptor-helpers.js.map +0 -1
- package/dist-npm/capabilities/interceptor-registry.d.ts +0 -125
- package/dist-npm/capabilities/interceptor-registry.d.ts.map +0 -1
- package/dist-npm/capabilities/interceptor-registry.js +0 -176
- package/dist-npm/capabilities/interceptor-registry.js.map +0 -1
- package/dist-npm/capabilities/types.d.ts +0 -35
- package/dist-npm/capabilities/types.d.ts.map +0 -1
- package/dist-npm/capabilities/types.js +0 -16
- package/dist-npm/capabilities/types.js.map +0 -1
- package/dist-npm/commands/command-types.d.ts +0 -30
- package/dist-npm/commands/command-types.d.ts.map +0 -1
- package/dist-npm/commands/command-types.js +0 -6
- package/dist-npm/commands/command-types.js.map +0 -1
- package/dist-npm/commands/index.d.ts +0 -7
- package/dist-npm/commands/index.d.ts.map +0 -1
- package/dist-npm/commands/index.js +0 -23
- package/dist-npm/commands/index.js.map +0 -1
- package/dist-npm/commands/parsed-command.d.ts +0 -204
- package/dist-npm/commands/parsed-command.d.ts.map +0 -1
- package/dist-npm/commands/parsed-command.js +0 -25
- package/dist-npm/commands/parsed-command.js.map +0 -1
- package/dist-npm/commands/validated-command.d.ts +0 -52
- package/dist-npm/commands/validated-command.d.ts.map +0 -1
- package/dist-npm/commands/validated-command.js +0 -8
- package/dist-npm/commands/validated-command.js.map +0 -1
- package/dist-npm/constants/action-failures.d.ts +0 -54
- package/dist-npm/constants/action-failures.d.ts.map +0 -1
- package/dist-npm/constants/action-failures.js +0 -68
- package/dist-npm/constants/action-failures.js.map +0 -1
- package/dist-npm/constants/directions.d.ts +0 -32
- package/dist-npm/constants/directions.d.ts.map +0 -1
- package/dist-npm/constants/directions.js +0 -53
- package/dist-npm/constants/directions.js.map +0 -1
- package/dist-npm/constants/if-events.d.ts +0 -5
- package/dist-npm/constants/if-events.d.ts.map +0 -1
- package/dist-npm/constants/if-events.js +0 -10
- package/dist-npm/constants/if-events.js.map +0 -1
- package/dist-npm/constants/index.d.ts +0 -9
- package/dist-npm/constants/index.d.ts.map +0 -1
- package/dist-npm/constants/index.js +0 -25
- package/dist-npm/constants/index.js.map +0 -1
- package/dist-npm/entities/entity-store.d.ts +0 -66
- package/dist-npm/entities/entity-store.d.ts.map +0 -1
- package/dist-npm/entities/entity-store.js +0 -116
- package/dist-npm/entities/entity-store.js.map +0 -1
- package/dist-npm/entities/entity-types.d.ts +0 -40
- package/dist-npm/entities/entity-types.d.ts.map +0 -1
- package/dist-npm/entities/entity-types.js +0 -56
- package/dist-npm/entities/entity-types.js.map +0 -1
- package/dist-npm/entities/if-entity.d.ts +0 -314
- package/dist-npm/entities/if-entity.d.ts.map +0 -1
- package/dist-npm/entities/if-entity.js +0 -621
- package/dist-npm/entities/if-entity.js.map +0 -1
- package/dist-npm/entities/index.d.ts +0 -5
- package/dist-npm/entities/index.d.ts.map +0 -1
- package/dist-npm/entities/index.js +0 -13
- package/dist-npm/entities/index.js.map +0 -1
- package/dist-npm/events/types.d.ts +0 -45
- package/dist-npm/events/types.d.ts.map +0 -1
- package/dist-npm/events/types.js +0 -9
- package/dist-npm/events/types.js.map +0 -1
- package/dist-npm/examples/event-handler-registration.d.ts +0 -14
- package/dist-npm/examples/event-handler-registration.d.ts.map +0 -1
- package/dist-npm/examples/event-handler-registration.js +0 -158
- package/dist-npm/examples/event-handler-registration.js.map +0 -1
- package/dist-npm/extensions/base-extension.d.ts +0 -69
- package/dist-npm/extensions/base-extension.d.ts.map +0 -1
- package/dist-npm/extensions/base-extension.js +0 -83
- package/dist-npm/extensions/base-extension.js.map +0 -1
- package/dist-npm/extensions/index.d.ts +0 -11
- package/dist-npm/extensions/index.d.ts.map +0 -1
- package/dist-npm/extensions/index.js +0 -39
- package/dist-npm/extensions/index.js.map +0 -1
- package/dist-npm/extensions/loader.d.ts +0 -52
- package/dist-npm/extensions/loader.d.ts.map +0 -1
- package/dist-npm/extensions/loader.js +0 -177
- package/dist-npm/extensions/loader.js.map +0 -1
- package/dist-npm/extensions/manager.d.ts +0 -68
- package/dist-npm/extensions/manager.d.ts.map +0 -1
- package/dist-npm/extensions/manager.js +0 -164
- package/dist-npm/extensions/manager.js.map +0 -1
- package/dist-npm/extensions/registry.d.ts +0 -100
- package/dist-npm/extensions/registry.d.ts.map +0 -1
- package/dist-npm/extensions/registry.js +0 -193
- package/dist-npm/extensions/registry.js.map +0 -1
- package/dist-npm/extensions/types.d.ts +0 -226
- package/dist-npm/extensions/types.d.ts.map +0 -1
- package/dist-npm/extensions/types.js +0 -28
- package/dist-npm/extensions/types.js.map +0 -1
- package/dist-npm/index.d.ts +0 -40
- package/dist-npm/index.d.ts.map +0 -1
- package/dist-npm/index.js +0 -70
- package/dist-npm/index.js.map +0 -1
- package/dist-npm/interfaces/command-executor.d.ts +0 -17
- package/dist-npm/interfaces/command-executor.d.ts.map +0 -1
- package/dist-npm/interfaces/command-executor.js +0 -6
- package/dist-npm/interfaces/command-executor.js.map +0 -1
- package/dist-npm/interfaces/command-processor.d.ts +0 -17
- package/dist-npm/interfaces/command-processor.d.ts.map +0 -1
- package/dist-npm/interfaces/command-processor.js +0 -6
- package/dist-npm/interfaces/command-processor.js.map +0 -1
- package/dist-npm/interfaces/command-validator.d.ts +0 -17
- package/dist-npm/interfaces/command-validator.d.ts.map +0 -1
- package/dist-npm/interfaces/command-validator.js +0 -6
- package/dist-npm/interfaces/command-validator.js.map +0 -1
- package/dist-npm/interfaces/index.d.ts +0 -8
- package/dist-npm/interfaces/index.d.ts.map +0 -1
- package/dist-npm/interfaces/index.js +0 -24
- package/dist-npm/interfaces/index.js.map +0 -1
- package/dist-npm/interfaces/language-provider.d.ts +0 -86
- package/dist-npm/interfaces/language-provider.d.ts.map +0 -1
- package/dist-npm/interfaces/language-provider.js +0 -14
- package/dist-npm/interfaces/language-provider.js.map +0 -1
- package/dist-npm/interfaces/parser.d.ts +0 -16
- package/dist-npm/interfaces/parser.d.ts.map +0 -1
- package/dist-npm/interfaces/parser.js +0 -6
- package/dist-npm/interfaces/parser.js.map +0 -1
- package/dist-npm/scope/index.d.ts +0 -8
- package/dist-npm/scope/index.d.ts.map +0 -1
- package/dist-npm/scope/index.js +0 -24
- package/dist-npm/scope/index.js.map +0 -1
- package/dist-npm/scope/scope-evaluator.d.ts +0 -58
- package/dist-npm/scope/scope-evaluator.d.ts.map +0 -1
- package/dist-npm/scope/scope-evaluator.js +0 -207
- package/dist-npm/scope/scope-evaluator.js.map +0 -1
- package/dist-npm/scope/scope-registry.d.ts +0 -59
- package/dist-npm/scope/scope-registry.d.ts.map +0 -1
- package/dist-npm/scope/scope-registry.js +0 -182
- package/dist-npm/scope/scope-registry.js.map +0 -1
- package/dist-npm/scope/scope-rule.d.ts +0 -86
- package/dist-npm/scope/scope-rule.d.ts.map +0 -1
- package/dist-npm/scope/scope-rule.js +0 -7
- package/dist-npm/scope/scope-rule.js.map +0 -1
- package/dist-npm/services/ScopeService.d.ts +0 -8
- package/dist-npm/services/ScopeService.d.ts.map +0 -1
- package/dist-npm/services/ScopeService.js +0 -19
- package/dist-npm/services/ScopeService.js.map +0 -1
- package/dist-npm/services/index.d.ts +0 -2
- package/dist-npm/services/index.d.ts.map +0 -1
- package/dist-npm/services/index.js +0 -6
- package/dist-npm/services/index.js.map +0 -1
- package/dist-npm/test-structure.d.ts +0 -3
- package/dist-npm/test-structure.d.ts.map +0 -1
- package/dist-npm/test-structure.js +0 -26
- package/dist-npm/test-structure.js.map +0 -1
- package/dist-npm/traits/actor/actorBehavior.d.ts +0 -121
- package/dist-npm/traits/actor/actorBehavior.d.ts.map +0 -1
- package/dist-npm/traits/actor/actorBehavior.js +0 -288
- package/dist-npm/traits/actor/actorBehavior.js.map +0 -1
- package/dist-npm/traits/actor/actorTrait.d.ts +0 -158
- package/dist-npm/traits/actor/actorTrait.d.ts.map +0 -1
- package/dist-npm/traits/actor/actorTrait.js +0 -152
- package/dist-npm/traits/actor/actorTrait.js.map +0 -1
- package/dist-npm/traits/actor/index.d.ts +0 -3
- package/dist-npm/traits/actor/index.d.ts.map +0 -1
- package/dist-npm/traits/actor/index.js +0 -11
- package/dist-npm/traits/actor/index.js.map +0 -1
- package/dist-npm/traits/all-traits.d.ts +0 -95
- package/dist-npm/traits/all-traits.d.ts.map +0 -1
- package/dist-npm/traits/all-traits.js +0 -178
- package/dist-npm/traits/all-traits.js.map +0 -1
- package/dist-npm/traits/attached/attachedTrait.d.ts +0 -61
- package/dist-npm/traits/attached/attachedTrait.d.ts.map +0 -1
- package/dist-npm/traits/attached/attachedTrait.js +0 -36
- package/dist-npm/traits/attached/attachedTrait.js.map +0 -1
- package/dist-npm/traits/attached/index.d.ts +0 -2
- package/dist-npm/traits/attached/index.d.ts.map +0 -1
- package/dist-npm/traits/attached/index.js +0 -18
- package/dist-npm/traits/attached/index.js.map +0 -1
- package/dist-npm/traits/breakable/breakableBehavior.d.ts +0 -43
- package/dist-npm/traits/breakable/breakableBehavior.d.ts.map +0 -1
- package/dist-npm/traits/breakable/breakableBehavior.js +0 -70
- package/dist-npm/traits/breakable/breakableBehavior.js.map +0 -1
- package/dist-npm/traits/breakable/breakableTrait.d.ts +0 -22
- package/dist-npm/traits/breakable/breakableTrait.d.ts.map +0 -1
- package/dist-npm/traits/breakable/breakableTrait.js +0 -25
- package/dist-npm/traits/breakable/breakableTrait.js.map +0 -1
- package/dist-npm/traits/breakable/index.d.ts +0 -3
- package/dist-npm/traits/breakable/index.d.ts.map +0 -1
- package/dist-npm/traits/breakable/index.js +0 -8
- package/dist-npm/traits/breakable/index.js.map +0 -1
- package/dist-npm/traits/button/buttonTrait.d.ts +0 -53
- package/dist-npm/traits/button/buttonTrait.d.ts.map +0 -1
- package/dist-npm/traits/button/buttonTrait.js +0 -36
- package/dist-npm/traits/button/buttonTrait.js.map +0 -1
- package/dist-npm/traits/button/index.d.ts +0 -2
- package/dist-npm/traits/button/index.d.ts.map +0 -1
- package/dist-npm/traits/button/index.js +0 -18
- package/dist-npm/traits/button/index.js.map +0 -1
- package/dist-npm/traits/climbable/climbableBehavior.d.ts +0 -37
- package/dist-npm/traits/climbable/climbableBehavior.d.ts.map +0 -1
- package/dist-npm/traits/climbable/climbableBehavior.js +0 -70
- package/dist-npm/traits/climbable/climbableBehavior.js.map +0 -1
- package/dist-npm/traits/climbable/climbableTrait.d.ts +0 -31
- package/dist-npm/traits/climbable/climbableTrait.d.ts.map +0 -1
- package/dist-npm/traits/climbable/climbableTrait.js +0 -47
- package/dist-npm/traits/climbable/climbableTrait.js.map +0 -1
- package/dist-npm/traits/climbable/index.d.ts +0 -6
- package/dist-npm/traits/climbable/index.d.ts.map +0 -1
- package/dist-npm/traits/climbable/index.js +0 -22
- package/dist-npm/traits/climbable/index.js.map +0 -1
- package/dist-npm/traits/clothing/clothingTrait.d.ts +0 -58
- package/dist-npm/traits/clothing/clothingTrait.d.ts.map +0 -1
- package/dist-npm/traits/clothing/clothingTrait.js +0 -78
- package/dist-npm/traits/clothing/clothingTrait.js.map +0 -1
- package/dist-npm/traits/clothing/index.d.ts +0 -2
- package/dist-npm/traits/clothing/index.d.ts.map +0 -1
- package/dist-npm/traits/clothing/index.js +0 -19
- package/dist-npm/traits/clothing/index.js.map +0 -1
- package/dist-npm/traits/combatant/combatantBehavior.d.ts +0 -70
- package/dist-npm/traits/combatant/combatantBehavior.d.ts.map +0 -1
- package/dist-npm/traits/combatant/combatantBehavior.js +0 -155
- package/dist-npm/traits/combatant/combatantBehavior.js.map +0 -1
- package/dist-npm/traits/combatant/combatantTrait.d.ts +0 -98
- package/dist-npm/traits/combatant/combatantTrait.d.ts.map +0 -1
- package/dist-npm/traits/combatant/combatantTrait.js +0 -122
- package/dist-npm/traits/combatant/combatantTrait.js.map +0 -1
- package/dist-npm/traits/combatant/index.d.ts +0 -3
- package/dist-npm/traits/combatant/index.d.ts.map +0 -1
- package/dist-npm/traits/combatant/index.js +0 -8
- package/dist-npm/traits/combatant/index.js.map +0 -1
- package/dist-npm/traits/container/container-utils.d.ts +0 -39
- package/dist-npm/traits/container/container-utils.d.ts.map +0 -1
- package/dist-npm/traits/container/container-utils.js +0 -72
- package/dist-npm/traits/container/container-utils.js.map +0 -1
- package/dist-npm/traits/container/containerBehavior.d.ts +0 -94
- package/dist-npm/traits/container/containerBehavior.d.ts.map +0 -1
- package/dist-npm/traits/container/containerBehavior.js +0 -256
- package/dist-npm/traits/container/containerBehavior.js.map +0 -1
- package/dist-npm/traits/container/containerTrait.d.ts +0 -30
- package/dist-npm/traits/container/containerTrait.d.ts.map +0 -1
- package/dist-npm/traits/container/containerTrait.js +0 -45
- package/dist-npm/traits/container/containerTrait.js.map +0 -1
- package/dist-npm/traits/container/index.d.ts +0 -4
- package/dist-npm/traits/container/index.d.ts.map +0 -1
- package/dist-npm/traits/container/index.js +0 -14
- package/dist-npm/traits/container/index.js.map +0 -1
- package/dist-npm/traits/destructible/destructibleBehavior.d.ts +0 -57
- package/dist-npm/traits/destructible/destructibleBehavior.d.ts.map +0 -1
- package/dist-npm/traits/destructible/destructibleBehavior.js +0 -145
- package/dist-npm/traits/destructible/destructibleBehavior.js.map +0 -1
- package/dist-npm/traits/destructible/destructibleTrait.d.ts +0 -49
- package/dist-npm/traits/destructible/destructibleTrait.d.ts.map +0 -1
- package/dist-npm/traits/destructible/destructibleTrait.js +0 -43
- package/dist-npm/traits/destructible/destructibleTrait.js.map +0 -1
- package/dist-npm/traits/destructible/index.d.ts +0 -3
- package/dist-npm/traits/destructible/index.d.ts.map +0 -1
- package/dist-npm/traits/destructible/index.js +0 -8
- package/dist-npm/traits/destructible/index.js.map +0 -1
- package/dist-npm/traits/door/doorBehavior.d.ts +0 -42
- package/dist-npm/traits/door/doorBehavior.d.ts.map +0 -1
- package/dist-npm/traits/door/doorBehavior.js +0 -76
- package/dist-npm/traits/door/doorBehavior.js.map +0 -1
- package/dist-npm/traits/door/doorTrait.d.ts +0 -19
- package/dist-npm/traits/door/doorTrait.d.ts.map +0 -1
- package/dist-npm/traits/door/doorTrait.js +0 -33
- package/dist-npm/traits/door/doorTrait.js.map +0 -1
- package/dist-npm/traits/door/index.d.ts +0 -3
- package/dist-npm/traits/door/index.d.ts.map +0 -1
- package/dist-npm/traits/door/index.js +0 -9
- package/dist-npm/traits/door/index.js.map +0 -1
- package/dist-npm/traits/edible/edibleBehavior.d.ts +0 -63
- package/dist-npm/traits/edible/edibleBehavior.d.ts.map +0 -1
- package/dist-npm/traits/edible/edibleBehavior.js +0 -157
- package/dist-npm/traits/edible/edibleBehavior.js.map +0 -1
- package/dist-npm/traits/edible/edibleTrait.d.ts +0 -57
- package/dist-npm/traits/edible/edibleTrait.d.ts.map +0 -1
- package/dist-npm/traits/edible/edibleTrait.js +0 -51
- package/dist-npm/traits/edible/edibleTrait.js.map +0 -1
- package/dist-npm/traits/edible/index.d.ts +0 -3
- package/dist-npm/traits/edible/index.d.ts.map +0 -1
- package/dist-npm/traits/edible/index.js +0 -20
- package/dist-npm/traits/edible/index.js.map +0 -1
- package/dist-npm/traits/enterable/enterableTrait.d.ts +0 -33
- package/dist-npm/traits/enterable/enterableTrait.d.ts.map +0 -1
- package/dist-npm/traits/enterable/enterableTrait.js +0 -38
- package/dist-npm/traits/enterable/enterableTrait.js.map +0 -1
- package/dist-npm/traits/enterable/index.d.ts +0 -5
- package/dist-npm/traits/enterable/index.d.ts.map +0 -1
- package/dist-npm/traits/enterable/index.js +0 -21
- package/dist-npm/traits/enterable/index.js.map +0 -1
- package/dist-npm/traits/equipped/equippedTrait.d.ts +0 -46
- package/dist-npm/traits/equipped/equippedTrait.d.ts.map +0 -1
- package/dist-npm/traits/equipped/equippedTrait.js +0 -34
- package/dist-npm/traits/equipped/equippedTrait.js.map +0 -1
- package/dist-npm/traits/equipped/index.d.ts +0 -2
- package/dist-npm/traits/equipped/index.d.ts.map +0 -1
- package/dist-npm/traits/equipped/index.js +0 -6
- package/dist-npm/traits/equipped/index.js.map +0 -1
- package/dist-npm/traits/exit/exitBehavior.d.ts +0 -51
- package/dist-npm/traits/exit/exitBehavior.d.ts.map +0 -1
- package/dist-npm/traits/exit/exitBehavior.js +0 -231
- package/dist-npm/traits/exit/exitBehavior.js.map +0 -1
- package/dist-npm/traits/exit/exitTrait.d.ts +0 -41
- package/dist-npm/traits/exit/exitTrait.d.ts.map +0 -1
- package/dist-npm/traits/exit/exitTrait.js +0 -75
- package/dist-npm/traits/exit/exitTrait.js.map +0 -1
- package/dist-npm/traits/exit/index.d.ts +0 -3
- package/dist-npm/traits/exit/index.d.ts.map +0 -1
- package/dist-npm/traits/exit/index.js +0 -9
- package/dist-npm/traits/exit/index.js.map +0 -1
- package/dist-npm/traits/identity/identityBehavior.d.ts +0 -64
- package/dist-npm/traits/identity/identityBehavior.d.ts.map +0 -1
- package/dist-npm/traits/identity/identityBehavior.js +0 -154
- package/dist-npm/traits/identity/identityBehavior.js.map +0 -1
- package/dist-npm/traits/identity/identityTrait.d.ts +0 -70
- package/dist-npm/traits/identity/identityTrait.d.ts.map +0 -1
- package/dist-npm/traits/identity/identityTrait.js +0 -79
- package/dist-npm/traits/identity/identityTrait.js.map +0 -1
- package/dist-npm/traits/identity/index.d.ts +0 -3
- package/dist-npm/traits/identity/index.d.ts.map +0 -1
- package/dist-npm/traits/identity/index.js +0 -20
- package/dist-npm/traits/identity/index.js.map +0 -1
- package/dist-npm/traits/implementations.d.ts +0 -51
- package/dist-npm/traits/implementations.d.ts.map +0 -1
- package/dist-npm/traits/implementations.js +0 -145
- package/dist-npm/traits/implementations.js.map +0 -1
- package/dist-npm/traits/index.d.ts +0 -36
- package/dist-npm/traits/index.d.ts.map +0 -1
- package/dist-npm/traits/index.js +0 -62
- package/dist-npm/traits/index.js.map +0 -1
- package/dist-npm/traits/light-source/index.d.ts +0 -3
- package/dist-npm/traits/light-source/index.d.ts.map +0 -1
- package/dist-npm/traits/light-source/index.js +0 -9
- package/dist-npm/traits/light-source/index.js.map +0 -1
- package/dist-npm/traits/light-source/lightSourceBehavior.d.ts +0 -57
- package/dist-npm/traits/light-source/lightSourceBehavior.d.ts.map +0 -1
- package/dist-npm/traits/light-source/lightSourceBehavior.js +0 -135
- package/dist-npm/traits/light-source/lightSourceBehavior.js.map +0 -1
- package/dist-npm/traits/light-source/lightSourceTrait.d.ts +0 -28
- package/dist-npm/traits/light-source/lightSourceTrait.d.ts.map +0 -1
- package/dist-npm/traits/light-source/lightSourceTrait.js +0 -37
- package/dist-npm/traits/light-source/lightSourceTrait.js.map +0 -1
- package/dist-npm/traits/lockable/index.d.ts +0 -3
- package/dist-npm/traits/lockable/index.d.ts.map +0 -1
- package/dist-npm/traits/lockable/index.js +0 -20
- package/dist-npm/traits/lockable/index.js.map +0 -1
- package/dist-npm/traits/lockable/lockableBehavior.d.ts +0 -88
- package/dist-npm/traits/lockable/lockableBehavior.d.ts.map +0 -1
- package/dist-npm/traits/lockable/lockableBehavior.js +0 -196
- package/dist-npm/traits/lockable/lockableBehavior.js.map +0 -1
- package/dist-npm/traits/lockable/lockableTrait.d.ts +0 -59
- package/dist-npm/traits/lockable/lockableTrait.d.ts.map +0 -1
- package/dist-npm/traits/lockable/lockableTrait.js +0 -50
- package/dist-npm/traits/lockable/lockableTrait.js.map +0 -1
- package/dist-npm/traits/moveable-scenery/index.d.ts +0 -2
- package/dist-npm/traits/moveable-scenery/index.d.ts.map +0 -1
- package/dist-npm/traits/moveable-scenery/index.js +0 -18
- package/dist-npm/traits/moveable-scenery/index.js.map +0 -1
- package/dist-npm/traits/moveable-scenery/moveableSceneryTrait.d.ts +0 -69
- package/dist-npm/traits/moveable-scenery/moveableSceneryTrait.d.ts.map +0 -1
- package/dist-npm/traits/moveable-scenery/moveableSceneryTrait.js +0 -43
- package/dist-npm/traits/moveable-scenery/moveableSceneryTrait.js.map +0 -1
- package/dist-npm/traits/npc/index.d.ts +0 -5
- package/dist-npm/traits/npc/index.d.ts.map +0 -1
- package/dist-npm/traits/npc/index.js +0 -9
- package/dist-npm/traits/npc/index.js.map +0 -1
- package/dist-npm/traits/npc/npcTrait.d.ts +0 -128
- package/dist-npm/traits/npc/npcTrait.d.ts.map +0 -1
- package/dist-npm/traits/npc/npcTrait.js +0 -180
- package/dist-npm/traits/npc/npcTrait.js.map +0 -1
- package/dist-npm/traits/openable/index.d.ts +0 -3
- package/dist-npm/traits/openable/index.d.ts.map +0 -1
- package/dist-npm/traits/openable/index.js +0 -20
- package/dist-npm/traits/openable/index.js.map +0 -1
- package/dist-npm/traits/openable/openableBehavior.d.ts +0 -64
- package/dist-npm/traits/openable/openableBehavior.d.ts.map +0 -1
- package/dist-npm/traits/openable/openableBehavior.js +0 -109
- package/dist-npm/traits/openable/openableBehavior.js.map +0 -1
- package/dist-npm/traits/openable/openableTrait.d.ts +0 -46
- package/dist-npm/traits/openable/openableTrait.d.ts.map +0 -1
- package/dist-npm/traits/openable/openableTrait.js +0 -42
- package/dist-npm/traits/openable/openableTrait.js.map +0 -1
- package/dist-npm/traits/pullable/index.d.ts +0 -2
- package/dist-npm/traits/pullable/index.d.ts.map +0 -1
- package/dist-npm/traits/pullable/index.js +0 -18
- package/dist-npm/traits/pullable/index.js.map +0 -1
- package/dist-npm/traits/pullable/pullableTrait.d.ts +0 -81
- package/dist-npm/traits/pullable/pullableTrait.d.ts.map +0 -1
- package/dist-npm/traits/pullable/pullableTrait.js +0 -44
- package/dist-npm/traits/pullable/pullableTrait.js.map +0 -1
- package/dist-npm/traits/pushable/index.d.ts +0 -2
- package/dist-npm/traits/pushable/index.d.ts.map +0 -1
- package/dist-npm/traits/pushable/index.js +0 -18
- package/dist-npm/traits/pushable/index.js.map +0 -1
- package/dist-npm/traits/pushable/pushableTrait.d.ts +0 -81
- package/dist-npm/traits/pushable/pushableTrait.d.ts.map +0 -1
- package/dist-npm/traits/pushable/pushableTrait.js +0 -44
- package/dist-npm/traits/pushable/pushableTrait.js.map +0 -1
- package/dist-npm/traits/readable/index.d.ts +0 -3
- package/dist-npm/traits/readable/index.d.ts.map +0 -1
- package/dist-npm/traits/readable/index.js +0 -9
- package/dist-npm/traits/readable/index.js.map +0 -1
- package/dist-npm/traits/readable/readableBehavior.d.ts +0 -42
- package/dist-npm/traits/readable/readableBehavior.d.ts.map +0 -1
- package/dist-npm/traits/readable/readableBehavior.js +0 -174
- package/dist-npm/traits/readable/readableBehavior.js.map +0 -1
- package/dist-npm/traits/readable/readableTrait.d.ts +0 -37
- package/dist-npm/traits/readable/readableTrait.d.ts.map +0 -1
- package/dist-npm/traits/readable/readableTrait.js +0 -51
- package/dist-npm/traits/readable/readableTrait.js.map +0 -1
- package/dist-npm/traits/register-all.d.ts +0 -10
- package/dist-npm/traits/register-all.d.ts.map +0 -1
- package/dist-npm/traits/register-all.js +0 -19
- package/dist-npm/traits/register-all.js.map +0 -1
- package/dist-npm/traits/room/index.d.ts +0 -9
- package/dist-npm/traits/room/index.d.ts.map +0 -1
- package/dist-npm/traits/room/index.js +0 -14
- package/dist-npm/traits/room/index.js.map +0 -1
- package/dist-npm/traits/room/roomBehavior.d.ts +0 -87
- package/dist-npm/traits/room/roomBehavior.d.ts.map +0 -1
- package/dist-npm/traits/room/roomBehavior.js +0 -232
- package/dist-npm/traits/room/roomBehavior.js.map +0 -1
- package/dist-npm/traits/room/roomTrait.d.ts +0 -101
- package/dist-npm/traits/room/roomTrait.d.ts.map +0 -1
- package/dist-npm/traits/room/roomTrait.js +0 -59
- package/dist-npm/traits/room/roomTrait.js.map +0 -1
- package/dist-npm/traits/scenery/index.d.ts +0 -3
- package/dist-npm/traits/scenery/index.d.ts.map +0 -1
- package/dist-npm/traits/scenery/index.js +0 -9
- package/dist-npm/traits/scenery/index.js.map +0 -1
- package/dist-npm/traits/scenery/sceneryBehavior.d.ts +0 -21
- package/dist-npm/traits/scenery/sceneryBehavior.d.ts.map +0 -1
- package/dist-npm/traits/scenery/sceneryBehavior.js +0 -42
- package/dist-npm/traits/scenery/sceneryBehavior.js.map +0 -1
- package/dist-npm/traits/scenery/sceneryTrait.d.ts +0 -30
- package/dist-npm/traits/scenery/sceneryTrait.d.ts.map +0 -1
- package/dist-npm/traits/scenery/sceneryTrait.js +0 -39
- package/dist-npm/traits/scenery/sceneryTrait.js.map +0 -1
- package/dist-npm/traits/supporter/index.d.ts +0 -3
- package/dist-npm/traits/supporter/index.d.ts.map +0 -1
- package/dist-npm/traits/supporter/index.js +0 -9
- package/dist-npm/traits/supporter/index.js.map +0 -1
- package/dist-npm/traits/supporter/supporterBehavior.d.ts +0 -83
- package/dist-npm/traits/supporter/supporterBehavior.d.ts.map +0 -1
- package/dist-npm/traits/supporter/supporterBehavior.js +0 -210
- package/dist-npm/traits/supporter/supporterBehavior.js.map +0 -1
- package/dist-npm/traits/supporter/supporterTrait.d.ts +0 -26
- package/dist-npm/traits/supporter/supporterTrait.d.ts.map +0 -1
- package/dist-npm/traits/supporter/supporterTrait.js +0 -30
- package/dist-npm/traits/supporter/supporterTrait.js.map +0 -1
- package/dist-npm/traits/switchable/index.d.ts +0 -3
- package/dist-npm/traits/switchable/index.d.ts.map +0 -1
- package/dist-npm/traits/switchable/index.js +0 -20
- package/dist-npm/traits/switchable/index.js.map +0 -1
- package/dist-npm/traits/switchable/switchableBehavior.d.ts +0 -73
- package/dist-npm/traits/switchable/switchableBehavior.d.ts.map +0 -1
- package/dist-npm/traits/switchable/switchableBehavior.js +0 -191
- package/dist-npm/traits/switchable/switchableBehavior.js.map +0 -1
- package/dist-npm/traits/switchable/switchableTrait.d.ts +0 -61
- package/dist-npm/traits/switchable/switchableTrait.d.ts.map +0 -1
- package/dist-npm/traits/switchable/switchableTrait.js +0 -52
- package/dist-npm/traits/switchable/switchableTrait.js.map +0 -1
- package/dist-npm/traits/trait-types.d.ts +0 -81
- package/dist-npm/traits/trait-types.d.ts.map +0 -1
- package/dist-npm/traits/trait-types.js +0 -146
- package/dist-npm/traits/trait-types.js.map +0 -1
- package/dist-npm/traits/trait.d.ts +0 -44
- package/dist-npm/traits/trait.d.ts.map +0 -1
- package/dist-npm/traits/trait.js +0 -42
- package/dist-npm/traits/trait.js.map +0 -1
- package/dist-npm/traits/vehicle/index.d.ts +0 -6
- package/dist-npm/traits/vehicle/index.d.ts.map +0 -1
- package/dist-npm/traits/vehicle/index.js +0 -22
- package/dist-npm/traits/vehicle/index.js.map +0 -1
- package/dist-npm/traits/vehicle/vehicleBehavior.d.ts +0 -62
- package/dist-npm/traits/vehicle/vehicleBehavior.d.ts.map +0 -1
- package/dist-npm/traits/vehicle/vehicleBehavior.js +0 -145
- package/dist-npm/traits/vehicle/vehicleBehavior.js.map +0 -1
- package/dist-npm/traits/vehicle/vehicleTrait.d.ts +0 -77
- package/dist-npm/traits/vehicle/vehicleTrait.d.ts.map +0 -1
- package/dist-npm/traits/vehicle/vehicleTrait.js +0 -92
- package/dist-npm/traits/vehicle/vehicleTrait.js.map +0 -1
- package/dist-npm/traits/weapon/index.d.ts +0 -3
- package/dist-npm/traits/weapon/index.d.ts.map +0 -1
- package/dist-npm/traits/weapon/index.js +0 -8
- package/dist-npm/traits/weapon/index.js.map +0 -1
- package/dist-npm/traits/weapon/weaponBehavior.d.ts +0 -47
- package/dist-npm/traits/weapon/weaponBehavior.d.ts.map +0 -1
- package/dist-npm/traits/weapon/weaponBehavior.js +0 -106
- package/dist-npm/traits/weapon/weaponBehavior.js.map +0 -1
- package/dist-npm/traits/weapon/weaponTrait.d.ts +0 -67
- package/dist-npm/traits/weapon/weaponTrait.d.ts.map +0 -1
- package/dist-npm/traits/weapon/weaponTrait.js +0 -60
- package/dist-npm/traits/weapon/weaponTrait.js.map +0 -1
- package/dist-npm/traits/wearable/index.d.ts +0 -3
- package/dist-npm/traits/wearable/index.d.ts.map +0 -1
- package/dist-npm/traits/wearable/index.js +0 -20
- package/dist-npm/traits/wearable/index.js.map +0 -1
- package/dist-npm/traits/wearable/wearableBehavior.d.ts +0 -64
- package/dist-npm/traits/wearable/wearableBehavior.d.ts.map +0 -1
- package/dist-npm/traits/wearable/wearableBehavior.js +0 -142
- package/dist-npm/traits/wearable/wearableBehavior.js.map +0 -1
- package/dist-npm/traits/wearable/wearableTrait.d.ts +0 -54
- package/dist-npm/traits/wearable/wearableTrait.d.ts.map +0 -1
- package/dist-npm/traits/wearable/wearableTrait.js +0 -53
- package/dist-npm/traits/wearable/wearableTrait.js.map +0 -1
- package/dist-npm/utils/event-utils.d.ts +0 -30
- package/dist-npm/utils/event-utils.d.ts.map +0 -1
- package/dist-npm/utils/event-utils.js +0 -33
- package/dist-npm/utils/event-utils.js.map +0 -1
- package/dist-npm/world/AuthorModel.d.ts +0 -151
- package/dist-npm/world/AuthorModel.d.ts.map +0 -1
- package/dist-npm/world/AuthorModel.js +0 -416
- package/dist-npm/world/AuthorModel.js.map +0 -1
- package/dist-npm/world/SharedDataStore.d.ts +0 -24
- package/dist-npm/world/SharedDataStore.d.ts.map +0 -1
- package/dist-npm/world/SharedDataStore.js +0 -50
- package/dist-npm/world/SharedDataStore.js.map +0 -1
- package/dist-npm/world/SpatialIndex.d.ts +0 -16
- package/dist-npm/world/SpatialIndex.d.ts.map +0 -1
- package/dist-npm/world/SpatialIndex.js +0 -117
- package/dist-npm/world/SpatialIndex.js.map +0 -1
- package/dist-npm/world/VisibilityBehavior.d.ts +0 -83
- package/dist-npm/world/VisibilityBehavior.d.ts.map +0 -1
- package/dist-npm/world/VisibilityBehavior.js +0 -484
- package/dist-npm/world/VisibilityBehavior.js.map +0 -1
- package/dist-npm/world/WorldModel.d.ts +0 -301
- package/dist-npm/world/WorldModel.d.ts.map +0 -1
- package/dist-npm/world/WorldModel.js +0 -1085
- package/dist-npm/world/WorldModel.js.map +0 -1
- package/dist-npm/world/capabilities.d.ts +0 -36
- package/dist-npm/world/capabilities.d.ts.map +0 -1
- package/dist-npm/world/capabilities.js +0 -18
- package/dist-npm/world/capabilities.js.map +0 -1
- package/dist-npm/world/index.d.ts +0 -7
- package/dist-npm/world/index.d.ts.map +0 -1
- package/dist-npm/world/index.js +0 -21
- package/dist-npm/world/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capability-helpers.js","sourceRoot":"","sources":["../../src/capabilities/capability-helpers.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAyBH,0DAWC;AAgBD,sCAEC;AAQD,sDAWC;AAkBD,gDAYC;AAQD,4CAKC;AA/GD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,uBAAuB,CACrC,MAAgB,EAChB,QAAgB;IAEhB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;QAC3C,MAAM,UAAU,GAAG,KAAK,CAAC,WAAgC,CAAC;QAC1D,IAAI,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChD,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,aAAa,CAAC,MAAgB,EAAE,QAAgB;IAC9D,OAAO,uBAAuB,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,SAAS,CAAC;AACjE,CAAC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,MAAgB;IACpD,MAAM,YAAY,GAAa,EAAE,CAAC;IAElC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;QAC3C,MAAM,UAAU,GAAG,KAAK,CAAC,WAAgC,CAAC;QAC1D,IAAI,UAAU,CAAC,YAAY,EAAE,CAAC;YAC5B,YAAY,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,kBAAkB,CAChC,KAAa,EACb,QAAgB,EAChB,SAAqC;IAErC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAgC,CAAC;IAC1D,MAAM,SAAS,GAAG,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC;IAEvE,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,SAAS,IAAI,KAAK,YAAY,SAAS,CAAC;IACjD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,MAAgB;IAC/C,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;QACvD,MAAM,UAAU,GAAG,KAAK,CAAC,WAAgC,CAAC;QAC1D,OAAO,UAAU,CAAC,YAAY,IAAI,UAAU,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Capability Registry (ADR-090)
|
|
3
|
-
*
|
|
4
|
-
* Registry for trait-behavior bindings. Stories register behaviors
|
|
5
|
-
* for their traits, and the dispatch system looks them up at runtime.
|
|
6
|
-
*/
|
|
7
|
-
import { ITrait } from '../traits/trait';
|
|
8
|
-
import { CapabilityBehavior } from './capability-behavior';
|
|
9
|
-
import { CapabilityResolution, CapabilityMode } from './capability-defaults';
|
|
10
|
-
/**
|
|
11
|
-
* Options for registering a capability behavior.
|
|
12
|
-
*/
|
|
13
|
-
export interface BehaviorRegistrationOptions<T extends ITrait = ITrait> {
|
|
14
|
-
/** Priority for resolution (higher = checked first). Default: 0 */
|
|
15
|
-
priority?: number;
|
|
16
|
-
/** Override global resolution strategy for this binding */
|
|
17
|
-
resolution?: CapabilityResolution;
|
|
18
|
-
/** Override global mode for this binding */
|
|
19
|
-
mode?: CapabilityMode;
|
|
20
|
-
/** Optional runtime validation */
|
|
21
|
-
validateBinding?: (trait: T) => boolean;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Binding between a trait type, capability, and behavior.
|
|
25
|
-
*/
|
|
26
|
-
export interface TraitBehaviorBinding<T extends ITrait = ITrait> {
|
|
27
|
-
/** Trait type identifier */
|
|
28
|
-
traitType: string;
|
|
29
|
-
/** Action ID (capability) this binding handles */
|
|
30
|
-
capability: string;
|
|
31
|
-
/** The behavior that handles this trait+capability */
|
|
32
|
-
behavior: CapabilityBehavior;
|
|
33
|
-
/** Priority for resolution (higher = checked first) */
|
|
34
|
-
priority: number;
|
|
35
|
-
/** Override resolution strategy (undefined = use global default) */
|
|
36
|
-
resolution?: CapabilityResolution;
|
|
37
|
-
/** Override mode (undefined = use global default) */
|
|
38
|
-
mode?: CapabilityMode;
|
|
39
|
-
/** Optional runtime validation */
|
|
40
|
-
validateBinding?: (trait: T) => boolean;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Register a behavior for a trait+capability combination.
|
|
44
|
-
*
|
|
45
|
-
* Stories call this to register their behaviors during initialization.
|
|
46
|
-
* Each trait+capability pair can only have one behavior registered.
|
|
47
|
-
*
|
|
48
|
-
* @param traitType - The trait type identifier (e.g., 'dungeo.trait.basket_elevator')
|
|
49
|
-
* @param capability - The action ID (e.g., 'if.action.lowering')
|
|
50
|
-
* @param behavior - The behavior implementation
|
|
51
|
-
* @param options - Optional configuration (priority, resolution override, mode override)
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```typescript
|
|
55
|
-
* // Basic registration (uses global defaults)
|
|
56
|
-
* registerCapabilityBehavior(
|
|
57
|
-
* BasketElevatorTrait.type,
|
|
58
|
-
* 'if.action.lowering',
|
|
59
|
-
* BasketLoweringBehavior
|
|
60
|
-
* );
|
|
61
|
-
*
|
|
62
|
-
* // With priority and overrides
|
|
63
|
-
* registerCapabilityBehavior(
|
|
64
|
-
* TrollAxeTrait.type,
|
|
65
|
-
* 'if.action.taking',
|
|
66
|
-
* TrollAxeTakingBehavior,
|
|
67
|
-
* { priority: 100, resolution: 'any-blocks' }
|
|
68
|
-
* );
|
|
69
|
-
* ```
|
|
70
|
-
*/
|
|
71
|
-
export declare function registerCapabilityBehavior<T extends ITrait>(traitType: string, capability: string, behavior: CapabilityBehavior, options?: BehaviorRegistrationOptions<T>): void;
|
|
72
|
-
/**
|
|
73
|
-
* Get behavior for a trait instance and capability.
|
|
74
|
-
*
|
|
75
|
-
* Called by capability-dispatch actions to find the right behavior.
|
|
76
|
-
*
|
|
77
|
-
* @param trait - The trait instance
|
|
78
|
-
* @param capability - The action ID
|
|
79
|
-
* @returns The behavior, or undefined if not registered
|
|
80
|
-
*/
|
|
81
|
-
export declare function getBehaviorForCapability(trait: ITrait, capability: string): CapabilityBehavior | undefined;
|
|
82
|
-
/**
|
|
83
|
-
* Get the full binding for a trait instance and capability.
|
|
84
|
-
*
|
|
85
|
-
* Includes priority and configuration overrides. Used by dispatch helper
|
|
86
|
-
* for resolution logic.
|
|
87
|
-
*
|
|
88
|
-
* @param trait - The trait instance
|
|
89
|
-
* @param capability - The action ID
|
|
90
|
-
* @returns The binding, or undefined if not registered
|
|
91
|
-
*/
|
|
92
|
-
export declare function getBehaviorBinding(trait: ITrait, capability: string): TraitBehaviorBinding | undefined;
|
|
93
|
-
/**
|
|
94
|
-
* Check if a behavior is registered for a trait+capability.
|
|
95
|
-
*
|
|
96
|
-
* @param traitType - The trait type identifier
|
|
97
|
-
* @param capability - The action ID
|
|
98
|
-
*/
|
|
99
|
-
export declare function hasCapabilityBehavior(traitType: string, capability: string): boolean;
|
|
100
|
-
/**
|
|
101
|
-
* Unregister a behavior (primarily for testing).
|
|
102
|
-
*
|
|
103
|
-
* @param traitType - The trait type identifier
|
|
104
|
-
* @param capability - The action ID
|
|
105
|
-
*/
|
|
106
|
-
export declare function unregisterCapabilityBehavior(traitType: string, capability: string): void;
|
|
107
|
-
/**
|
|
108
|
-
* Clear all registered behaviors (for testing).
|
|
109
|
-
*/
|
|
110
|
-
export declare function clearCapabilityRegistry(): void;
|
|
111
|
-
/**
|
|
112
|
-
* Get all registered bindings (for debugging/introspection).
|
|
113
|
-
*/
|
|
114
|
-
export declare function getAllCapabilityBindings(): Map<string, TraitBehaviorBinding>;
|
|
115
|
-
//# sourceMappingURL=capability-registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capability-registry.d.ts","sourceRoot":"","sources":["../../src/capabilities/capability-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAqB,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,2BAA2B,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACpE,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,4CAA4C;IAC5C,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,kCAAkC;IAClC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC7D,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,qDAAqD;IACrD,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,kCAAkC;IAClC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC;CACzC;AAcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,MAAM,EACzD,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,CAAC,EAAE,2BAA2B,CAAC,CAAC,CAAC,GACvC,IAAI,CAkBN;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,kBAAkB,GAAG,SAAS,CAGhC;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,oBAAoB,GAAG,SAAS,CAiBlC;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAEpF;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAExF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAE5E"}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Capability Registry (ADR-090)
|
|
4
|
-
*
|
|
5
|
-
* Registry for trait-behavior bindings. Stories register behaviors
|
|
6
|
-
* for their traits, and the dispatch system looks them up at runtime.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.registerCapabilityBehavior = registerCapabilityBehavior;
|
|
10
|
-
exports.getBehaviorForCapability = getBehaviorForCapability;
|
|
11
|
-
exports.getBehaviorBinding = getBehaviorBinding;
|
|
12
|
-
exports.hasCapabilityBehavior = hasCapabilityBehavior;
|
|
13
|
-
exports.unregisterCapabilityBehavior = unregisterCapabilityBehavior;
|
|
14
|
-
exports.clearCapabilityRegistry = clearCapabilityRegistry;
|
|
15
|
-
exports.getAllCapabilityBindings = getAllCapabilityBindings;
|
|
16
|
-
/**
|
|
17
|
-
* Registry storage: key = `${traitType}:${capability}`
|
|
18
|
-
*/
|
|
19
|
-
const behaviorRegistry = new Map();
|
|
20
|
-
/**
|
|
21
|
-
* Generate registry key for trait+capability combination.
|
|
22
|
-
*/
|
|
23
|
-
function registryKey(traitType, capability) {
|
|
24
|
-
return `${traitType}:${capability}`;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Register a behavior for a trait+capability combination.
|
|
28
|
-
*
|
|
29
|
-
* Stories call this to register their behaviors during initialization.
|
|
30
|
-
* Each trait+capability pair can only have one behavior registered.
|
|
31
|
-
*
|
|
32
|
-
* @param traitType - The trait type identifier (e.g., 'dungeo.trait.basket_elevator')
|
|
33
|
-
* @param capability - The action ID (e.g., 'if.action.lowering')
|
|
34
|
-
* @param behavior - The behavior implementation
|
|
35
|
-
* @param options - Optional configuration (priority, resolution override, mode override)
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```typescript
|
|
39
|
-
* // Basic registration (uses global defaults)
|
|
40
|
-
* registerCapabilityBehavior(
|
|
41
|
-
* BasketElevatorTrait.type,
|
|
42
|
-
* 'if.action.lowering',
|
|
43
|
-
* BasketLoweringBehavior
|
|
44
|
-
* );
|
|
45
|
-
*
|
|
46
|
-
* // With priority and overrides
|
|
47
|
-
* registerCapabilityBehavior(
|
|
48
|
-
* TrollAxeTrait.type,
|
|
49
|
-
* 'if.action.taking',
|
|
50
|
-
* TrollAxeTakingBehavior,
|
|
51
|
-
* { priority: 100, resolution: 'any-blocks' }
|
|
52
|
-
* );
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
function registerCapabilityBehavior(traitType, capability, behavior, options) {
|
|
56
|
-
const key = registryKey(traitType, capability);
|
|
57
|
-
if (behaviorRegistry.has(key)) {
|
|
58
|
-
throw new Error(`Behavior already registered for trait "${traitType}" and capability "${capability}"`);
|
|
59
|
-
}
|
|
60
|
-
behaviorRegistry.set(key, {
|
|
61
|
-
traitType,
|
|
62
|
-
capability,
|
|
63
|
-
behavior,
|
|
64
|
-
priority: options?.priority ?? 0,
|
|
65
|
-
resolution: options?.resolution,
|
|
66
|
-
mode: options?.mode,
|
|
67
|
-
validateBinding: options?.validateBinding
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Get behavior for a trait instance and capability.
|
|
72
|
-
*
|
|
73
|
-
* Called by capability-dispatch actions to find the right behavior.
|
|
74
|
-
*
|
|
75
|
-
* @param trait - The trait instance
|
|
76
|
-
* @param capability - The action ID
|
|
77
|
-
* @returns The behavior, or undefined if not registered
|
|
78
|
-
*/
|
|
79
|
-
function getBehaviorForCapability(trait, capability) {
|
|
80
|
-
const binding = getBehaviorBinding(trait, capability);
|
|
81
|
-
return binding?.behavior;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Get the full binding for a trait instance and capability.
|
|
85
|
-
*
|
|
86
|
-
* Includes priority and configuration overrides. Used by dispatch helper
|
|
87
|
-
* for resolution logic.
|
|
88
|
-
*
|
|
89
|
-
* @param trait - The trait instance
|
|
90
|
-
* @param capability - The action ID
|
|
91
|
-
* @returns The binding, or undefined if not registered
|
|
92
|
-
*/
|
|
93
|
-
function getBehaviorBinding(trait, capability) {
|
|
94
|
-
const traitType = trait.constructor.type;
|
|
95
|
-
const key = registryKey(traitType, capability);
|
|
96
|
-
const binding = behaviorRegistry.get(key);
|
|
97
|
-
if (!binding) {
|
|
98
|
-
return undefined;
|
|
99
|
-
}
|
|
100
|
-
// Runtime validation if provided
|
|
101
|
-
if (binding.validateBinding && !binding.validateBinding(trait)) {
|
|
102
|
-
throw new Error(`Behavior validation failed for trait "${traitType}", capability "${capability}"`);
|
|
103
|
-
}
|
|
104
|
-
return binding;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Check if a behavior is registered for a trait+capability.
|
|
108
|
-
*
|
|
109
|
-
* @param traitType - The trait type identifier
|
|
110
|
-
* @param capability - The action ID
|
|
111
|
-
*/
|
|
112
|
-
function hasCapabilityBehavior(traitType, capability) {
|
|
113
|
-
return behaviorRegistry.has(registryKey(traitType, capability));
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Unregister a behavior (primarily for testing).
|
|
117
|
-
*
|
|
118
|
-
* @param traitType - The trait type identifier
|
|
119
|
-
* @param capability - The action ID
|
|
120
|
-
*/
|
|
121
|
-
function unregisterCapabilityBehavior(traitType, capability) {
|
|
122
|
-
behaviorRegistry.delete(registryKey(traitType, capability));
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Clear all registered behaviors (for testing).
|
|
126
|
-
*/
|
|
127
|
-
function clearCapabilityRegistry() {
|
|
128
|
-
behaviorRegistry.clear();
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Get all registered bindings (for debugging/introspection).
|
|
132
|
-
*/
|
|
133
|
-
function getAllCapabilityBindings() {
|
|
134
|
-
return new Map(behaviorRegistry);
|
|
135
|
-
}
|
|
136
|
-
//# sourceMappingURL=capability-registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capability-registry.js","sourceRoot":"","sources":["../../src/capabilities/capability-registry.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAiFH,gEAuBC;AAWD,4DAMC;AAYD,gDAoBC;AAQD,sDAEC;AAQD,oEAEC;AAKD,0DAEC;AAKD,4DAEC;AAnJD;;GAEG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAgC,CAAC;AAEjE;;GAEG;AACH,SAAS,WAAW,CAAC,SAAiB,EAAE,UAAkB;IACxD,OAAO,GAAG,SAAS,IAAI,UAAU,EAAE,CAAC;AACtC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,SAAgB,0BAA0B,CACxC,SAAiB,EACjB,UAAkB,EAClB,QAA4B,EAC5B,OAAwC;IAExC,MAAM,GAAG,GAAG,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAE/C,IAAI,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACb,0CAA0C,SAAS,qBAAqB,UAAU,GAAG,CACtF,CAAC;IACJ,CAAC;IAED,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE;QACxB,SAAS;QACT,UAAU;QACV,QAAQ;QACR,QAAQ,EAAE,OAAO,EAAE,QAAQ,IAAI,CAAC;QAChC,UAAU,EAAE,OAAO,EAAE,UAAU;QAC/B,IAAI,EAAE,OAAO,EAAE,IAAI;QACnB,eAAe,EAAE,OAAO,EAAE,eAA2D;KACtF,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,wBAAwB,CACtC,KAAa,EACb,UAAkB;IAElB,MAAM,OAAO,GAAG,kBAAkB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IACtD,OAAO,OAAO,EAAE,QAAQ,CAAC;AAC3B,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,kBAAkB,CAChC,KAAa,EACb,UAAkB;IAElB,MAAM,SAAS,GAAI,KAAK,CAAC,WAAiC,CAAC,IAAI,CAAC;IAChE,MAAM,GAAG,GAAG,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAE1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,iCAAiC;IACjC,IAAI,OAAO,CAAC,eAAe,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/D,MAAM,IAAI,KAAK,CACb,yCAAyC,SAAS,kBAAkB,UAAU,GAAG,CAClF,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,SAAiB,EAAE,UAAkB;IACzE,OAAO,gBAAgB,CAAC,GAAG,CAAC,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAClE,CAAC;AAED;;;;;GAKG;AACH,SAAgB,4BAA4B,CAAC,SAAiB,EAAE,UAAkB;IAChF,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,SAAgB,uBAAuB;IACrC,gBAAgB,CAAC,KAAK,EAAE,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,SAAgB,wBAAwB;IACtC,OAAO,IAAI,GAAG,CAAC,gBAAgB,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type-Safe Entity Builder (ADR-090)
|
|
3
|
-
*
|
|
4
|
-
* Builder pattern for creating entities with compile-time capability
|
|
5
|
-
* conflict detection. When two traits claim the same capability,
|
|
6
|
-
* TypeScript will error (and runtime will throw as backup).
|
|
7
|
-
*/
|
|
8
|
-
import { IFEntity } from '../entities';
|
|
9
|
-
import { ITrait } from '../traits/trait';
|
|
10
|
-
/**
|
|
11
|
-
* Type-safe entity builder that tracks claimed capabilities.
|
|
12
|
-
*
|
|
13
|
-
* Provides runtime checks for capability conflicts. TypeScript's
|
|
14
|
-
* type system can catch conflicts at compile time when traits
|
|
15
|
-
* declare capabilities with `as const`.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* const basket = new EntityBuilder(entity)
|
|
20
|
-
* .add(new IdentityTrait({ name: 'basket' }))
|
|
21
|
-
* .add(new ContainerTrait())
|
|
22
|
-
* .add(new BasketElevatorTrait({ ... })) // claims: lowering, raising
|
|
23
|
-
* .build();
|
|
24
|
-
*
|
|
25
|
-
* // Runtime error - duplicate capability:
|
|
26
|
-
* const bad = new EntityBuilder(entity)
|
|
27
|
-
* .add(new BasketElevatorTrait({ ... })) // claims: lowering
|
|
28
|
-
* .add(new MirrorPoleTrait({ ... })) // also claims: lowering
|
|
29
|
-
* .build(); // throws!
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export declare class EntityBuilder {
|
|
33
|
-
private entity;
|
|
34
|
-
private claimedCaps;
|
|
35
|
-
constructor(entity: IFEntity);
|
|
36
|
-
/**
|
|
37
|
-
* Add a trait to the entity.
|
|
38
|
-
*
|
|
39
|
-
* Checks for capability conflicts at runtime. If two traits
|
|
40
|
-
* claim the same capability, throws an error.
|
|
41
|
-
*
|
|
42
|
-
* @param trait - The trait to add
|
|
43
|
-
* @returns This builder for chaining
|
|
44
|
-
* @throws Error if capability conflict detected
|
|
45
|
-
*/
|
|
46
|
-
add<T extends ITrait>(trait: T): this;
|
|
47
|
-
/**
|
|
48
|
-
* Build and return the entity.
|
|
49
|
-
*/
|
|
50
|
-
build(): IFEntity;
|
|
51
|
-
/**
|
|
52
|
-
* Get all capabilities claimed so far.
|
|
53
|
-
*/
|
|
54
|
-
getClaimedCapabilities(): string[];
|
|
55
|
-
/**
|
|
56
|
-
* Find which trait claimed a capability.
|
|
57
|
-
*/
|
|
58
|
-
private findTraitWithCapability;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Create an entity builder for type-safe trait composition.
|
|
62
|
-
*
|
|
63
|
-
* This is a convenience function that wraps an existing entity
|
|
64
|
-
* in a builder. Use when you want capability conflict checking.
|
|
65
|
-
*
|
|
66
|
-
* @param entity - The entity to wrap
|
|
67
|
-
* @returns A new EntityBuilder
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* ```typescript
|
|
71
|
-
* const basket = buildEntity(world.createEntity('basket', EntityType.CONTAINER))
|
|
72
|
-
* .add(new IdentityTrait({ name: 'rusty iron basket' }))
|
|
73
|
-
* .add(new ContainerTrait({ capacity: { maxItems: 10 } }))
|
|
74
|
-
* .add(new BasketElevatorTrait({ ... }))
|
|
75
|
-
* .build();
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
export declare function buildEntity(entity: IFEntity): EntityBuilder;
|
|
79
|
-
//# sourceMappingURL=entity-builder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-builder.d.ts","sourceRoot":"","sources":["../../src/capabilities/entity-builder.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,MAAM,EAAqB,MAAM,iBAAiB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,WAAW,CAAqB;gBAE5B,MAAM,EAAE,QAAQ;IAI5B;;;;;;;;;OASG;IACH,GAAG,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAyBrC;;OAEG;IACH,KAAK,IAAI,QAAQ;IAIjB;;OAEG;IACH,sBAAsB,IAAI,MAAM,EAAE;IAIlC;;OAEG;IACH,OAAO,CAAC,uBAAuB;CAShC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,QAAQ,GAAG,aAAa,CAE3D"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Type-Safe Entity Builder (ADR-090)
|
|
4
|
-
*
|
|
5
|
-
* Builder pattern for creating entities with compile-time capability
|
|
6
|
-
* conflict detection. When two traits claim the same capability,
|
|
7
|
-
* TypeScript will error (and runtime will throw as backup).
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.EntityBuilder = void 0;
|
|
11
|
-
exports.buildEntity = buildEntity;
|
|
12
|
-
/**
|
|
13
|
-
* Type-safe entity builder that tracks claimed capabilities.
|
|
14
|
-
*
|
|
15
|
-
* Provides runtime checks for capability conflicts. TypeScript's
|
|
16
|
-
* type system can catch conflicts at compile time when traits
|
|
17
|
-
* declare capabilities with `as const`.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* const basket = new EntityBuilder(entity)
|
|
22
|
-
* .add(new IdentityTrait({ name: 'basket' }))
|
|
23
|
-
* .add(new ContainerTrait())
|
|
24
|
-
* .add(new BasketElevatorTrait({ ... })) // claims: lowering, raising
|
|
25
|
-
* .build();
|
|
26
|
-
*
|
|
27
|
-
* // Runtime error - duplicate capability:
|
|
28
|
-
* const bad = new EntityBuilder(entity)
|
|
29
|
-
* .add(new BasketElevatorTrait({ ... })) // claims: lowering
|
|
30
|
-
* .add(new MirrorPoleTrait({ ... })) // also claims: lowering
|
|
31
|
-
* .build(); // throws!
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
class EntityBuilder {
|
|
35
|
-
entity;
|
|
36
|
-
claimedCaps = new Set();
|
|
37
|
-
constructor(entity) {
|
|
38
|
-
this.entity = entity;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Add a trait to the entity.
|
|
42
|
-
*
|
|
43
|
-
* Checks for capability conflicts at runtime. If two traits
|
|
44
|
-
* claim the same capability, throws an error.
|
|
45
|
-
*
|
|
46
|
-
* @param trait - The trait to add
|
|
47
|
-
* @returns This builder for chaining
|
|
48
|
-
* @throws Error if capability conflict detected
|
|
49
|
-
*/
|
|
50
|
-
add(trait) {
|
|
51
|
-
const traitClass = trait.constructor;
|
|
52
|
-
const newCaps = traitClass.capabilities ?? [];
|
|
53
|
-
// Check for capability conflicts
|
|
54
|
-
for (const cap of newCaps) {
|
|
55
|
-
if (this.claimedCaps.has(cap)) {
|
|
56
|
-
// Find which trait already claimed it
|
|
57
|
-
const existingTrait = this.findTraitWithCapability(cap);
|
|
58
|
-
const existingType = existingTrait
|
|
59
|
-
? existingTrait.constructor.type
|
|
60
|
-
: 'unknown';
|
|
61
|
-
throw new Error(`Entity "${this.entity.id}": capability "${cap}" already claimed by trait "${existingType}". ` +
|
|
62
|
-
`New trait "${traitClass.type}" cannot also claim it.`);
|
|
63
|
-
}
|
|
64
|
-
this.claimedCaps.add(cap);
|
|
65
|
-
}
|
|
66
|
-
this.entity.add(trait);
|
|
67
|
-
return this;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Build and return the entity.
|
|
71
|
-
*/
|
|
72
|
-
build() {
|
|
73
|
-
return this.entity;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Get all capabilities claimed so far.
|
|
77
|
-
*/
|
|
78
|
-
getClaimedCapabilities() {
|
|
79
|
-
return Array.from(this.claimedCaps);
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Find which trait claimed a capability.
|
|
83
|
-
*/
|
|
84
|
-
findTraitWithCapability(capability) {
|
|
85
|
-
for (const trait of this.entity.traits.values()) {
|
|
86
|
-
const traitClass = trait.constructor;
|
|
87
|
-
if (traitClass.capabilities?.includes(capability)) {
|
|
88
|
-
return trait;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return undefined;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
exports.EntityBuilder = EntityBuilder;
|
|
95
|
-
/**
|
|
96
|
-
* Create an entity builder for type-safe trait composition.
|
|
97
|
-
*
|
|
98
|
-
* This is a convenience function that wraps an existing entity
|
|
99
|
-
* in a builder. Use when you want capability conflict checking.
|
|
100
|
-
*
|
|
101
|
-
* @param entity - The entity to wrap
|
|
102
|
-
* @returns A new EntityBuilder
|
|
103
|
-
*
|
|
104
|
-
* @example
|
|
105
|
-
* ```typescript
|
|
106
|
-
* const basket = buildEntity(world.createEntity('basket', EntityType.CONTAINER))
|
|
107
|
-
* .add(new IdentityTrait({ name: 'rusty iron basket' }))
|
|
108
|
-
* .add(new ContainerTrait({ capacity: { maxItems: 10 } }))
|
|
109
|
-
* .add(new BasketElevatorTrait({ ... }))
|
|
110
|
-
* .build();
|
|
111
|
-
* ```
|
|
112
|
-
*/
|
|
113
|
-
function buildEntity(entity) {
|
|
114
|
-
return new EntityBuilder(entity);
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=entity-builder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-builder.js","sourceRoot":"","sources":["../../src/capabilities/entity-builder.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAoHH,kCAEC;AAjHD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,aAAa;IAChB,MAAM,CAAW;IACjB,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;IAExC,YAAY,MAAgB;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;OASG;IACH,GAAG,CAAmB,KAAQ;QAC5B,MAAM,UAAU,GAAG,KAAK,CAAC,WAAgC,CAAC;QAC1D,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,IAAI,EAAE,CAAC;QAE9C,iCAAiC;QACjC,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YAC1B,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9B,sCAAsC;gBACtC,MAAM,aAAa,GAAG,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;gBACxD,MAAM,YAAY,GAAG,aAAa;oBAChC,CAAC,CAAE,aAAa,CAAC,WAAiC,CAAC,IAAI;oBACvD,CAAC,CAAC,SAAS,CAAC;gBAEd,MAAM,IAAI,KAAK,CACb,WAAW,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,+BAA+B,YAAY,KAAK;oBAC9F,cAAc,UAAU,CAAC,IAAI,yBAAyB,CACvD,CAAC;YACJ,CAAC;YACD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,KAAK;QACH,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,sBAAsB;QACpB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACK,uBAAuB,CAAC,UAAkB;QAChD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;YAChD,MAAM,UAAU,GAAG,KAAK,CAAC,WAAgC,CAAC;YAC1D,IAAI,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;gBAClD,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AArED,sCAqEC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,WAAW,CAAC,MAAgB;IAC1C,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Capability Dispatch System (ADR-090)
|
|
3
|
-
*
|
|
4
|
-
* Entity-centric action dispatch where traits declare capabilities
|
|
5
|
-
* (action IDs they respond to) and behaviors implement the logic.
|
|
6
|
-
*/
|
|
7
|
-
export { CapabilityValidationResult, CapabilityEffect, createEffect } from './types';
|
|
8
|
-
export { CapabilityBehavior, CapabilitySharedData } from './capability-behavior';
|
|
9
|
-
export { TraitBehaviorBinding, BehaviorRegistrationOptions, registerCapabilityBehavior, getBehaviorForCapability, getBehaviorBinding, hasCapabilityBehavior, unregisterCapabilityBehavior, clearCapabilityRegistry, getAllCapabilityBindings } from './capability-registry';
|
|
10
|
-
export { CapabilityResolution, CapabilityMode, CapabilityConfig, defineCapabilityDefaults, getCapabilityConfig, hasCapabilityDefaults, clearCapabilityDefaults, getAllCapabilityDefaults } from './capability-defaults';
|
|
11
|
-
export { findTraitWithCapability, hasCapability, getEntityCapabilities, traitHasCapability, getCapableTraits } from './capability-helpers';
|
|
12
|
-
export { EntityBuilder, buildEntity } from './entity-builder';
|
|
13
|
-
export { ActionInterceptor, InterceptorSharedData, InterceptorResult } from './action-interceptor';
|
|
14
|
-
export { TraitInterceptorBinding, InterceptorRegistrationOptions, InterceptorLookupResult, registerActionInterceptor, getInterceptorForAction, getInterceptorBinding, hasActionInterceptor, unregisterActionInterceptor, clearInterceptorRegistry, getAllInterceptorBindings } from './interceptor-registry';
|
|
15
|
-
export { findTraitWithInterceptor, hasInterceptor, getEntityInterceptors, traitHasInterceptor, getInterceptorTraits } from './interceptor-helpers';
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,YAAY,EACb,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAGjF,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,4BAA4B,EAC5B,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,aAAa,EACb,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAW1B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,uBAAuB,EACvB,8BAA8B,EAC9B,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Capability Dispatch System (ADR-090)
|
|
4
|
-
*
|
|
5
|
-
* Entity-centric action dispatch where traits declare capabilities
|
|
6
|
-
* (action IDs they respond to) and behaviors implement the logic.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.getInterceptorTraits = exports.traitHasInterceptor = exports.getEntityInterceptors = exports.hasInterceptor = exports.findTraitWithInterceptor = exports.getAllInterceptorBindings = exports.clearInterceptorRegistry = exports.unregisterActionInterceptor = exports.hasActionInterceptor = exports.getInterceptorBinding = exports.getInterceptorForAction = exports.registerActionInterceptor = exports.buildEntity = exports.EntityBuilder = exports.getCapableTraits = exports.traitHasCapability = exports.getEntityCapabilities = exports.hasCapability = exports.findTraitWithCapability = exports.getAllCapabilityDefaults = exports.clearCapabilityDefaults = exports.hasCapabilityDefaults = exports.getCapabilityConfig = exports.defineCapabilityDefaults = exports.getAllCapabilityBindings = exports.clearCapabilityRegistry = exports.unregisterCapabilityBehavior = exports.hasCapabilityBehavior = exports.getBehaviorBinding = exports.getBehaviorForCapability = exports.registerCapabilityBehavior = exports.createEffect = void 0;
|
|
10
|
-
// Types
|
|
11
|
-
var types_1 = require("./types");
|
|
12
|
-
Object.defineProperty(exports, "createEffect", { enumerable: true, get: function () { return types_1.createEffect; } });
|
|
13
|
-
// Registry
|
|
14
|
-
var capability_registry_1 = require("./capability-registry");
|
|
15
|
-
Object.defineProperty(exports, "registerCapabilityBehavior", { enumerable: true, get: function () { return capability_registry_1.registerCapabilityBehavior; } });
|
|
16
|
-
Object.defineProperty(exports, "getBehaviorForCapability", { enumerable: true, get: function () { return capability_registry_1.getBehaviorForCapability; } });
|
|
17
|
-
Object.defineProperty(exports, "getBehaviorBinding", { enumerable: true, get: function () { return capability_registry_1.getBehaviorBinding; } });
|
|
18
|
-
Object.defineProperty(exports, "hasCapabilityBehavior", { enumerable: true, get: function () { return capability_registry_1.hasCapabilityBehavior; } });
|
|
19
|
-
Object.defineProperty(exports, "unregisterCapabilityBehavior", { enumerable: true, get: function () { return capability_registry_1.unregisterCapabilityBehavior; } });
|
|
20
|
-
Object.defineProperty(exports, "clearCapabilityRegistry", { enumerable: true, get: function () { return capability_registry_1.clearCapabilityRegistry; } });
|
|
21
|
-
Object.defineProperty(exports, "getAllCapabilityBindings", { enumerable: true, get: function () { return capability_registry_1.getAllCapabilityBindings; } });
|
|
22
|
-
// Defaults and configuration
|
|
23
|
-
var capability_defaults_1 = require("./capability-defaults");
|
|
24
|
-
Object.defineProperty(exports, "defineCapabilityDefaults", { enumerable: true, get: function () { return capability_defaults_1.defineCapabilityDefaults; } });
|
|
25
|
-
Object.defineProperty(exports, "getCapabilityConfig", { enumerable: true, get: function () { return capability_defaults_1.getCapabilityConfig; } });
|
|
26
|
-
Object.defineProperty(exports, "hasCapabilityDefaults", { enumerable: true, get: function () { return capability_defaults_1.hasCapabilityDefaults; } });
|
|
27
|
-
Object.defineProperty(exports, "clearCapabilityDefaults", { enumerable: true, get: function () { return capability_defaults_1.clearCapabilityDefaults; } });
|
|
28
|
-
Object.defineProperty(exports, "getAllCapabilityDefaults", { enumerable: true, get: function () { return capability_defaults_1.getAllCapabilityDefaults; } });
|
|
29
|
-
// Helpers
|
|
30
|
-
var capability_helpers_1 = require("./capability-helpers");
|
|
31
|
-
Object.defineProperty(exports, "findTraitWithCapability", { enumerable: true, get: function () { return capability_helpers_1.findTraitWithCapability; } });
|
|
32
|
-
Object.defineProperty(exports, "hasCapability", { enumerable: true, get: function () { return capability_helpers_1.hasCapability; } });
|
|
33
|
-
Object.defineProperty(exports, "getEntityCapabilities", { enumerable: true, get: function () { return capability_helpers_1.getEntityCapabilities; } });
|
|
34
|
-
Object.defineProperty(exports, "traitHasCapability", { enumerable: true, get: function () { return capability_helpers_1.traitHasCapability; } });
|
|
35
|
-
Object.defineProperty(exports, "getCapableTraits", { enumerable: true, get: function () { return capability_helpers_1.getCapableTraits; } });
|
|
36
|
-
// Entity builder
|
|
37
|
-
var entity_builder_1 = require("./entity-builder");
|
|
38
|
-
Object.defineProperty(exports, "EntityBuilder", { enumerable: true, get: function () { return entity_builder_1.EntityBuilder; } });
|
|
39
|
-
Object.defineProperty(exports, "buildEntity", { enumerable: true, get: function () { return entity_builder_1.buildEntity; } });
|
|
40
|
-
// Interceptor registry
|
|
41
|
-
var interceptor_registry_1 = require("./interceptor-registry");
|
|
42
|
-
Object.defineProperty(exports, "registerActionInterceptor", { enumerable: true, get: function () { return interceptor_registry_1.registerActionInterceptor; } });
|
|
43
|
-
Object.defineProperty(exports, "getInterceptorForAction", { enumerable: true, get: function () { return interceptor_registry_1.getInterceptorForAction; } });
|
|
44
|
-
Object.defineProperty(exports, "getInterceptorBinding", { enumerable: true, get: function () { return interceptor_registry_1.getInterceptorBinding; } });
|
|
45
|
-
Object.defineProperty(exports, "hasActionInterceptor", { enumerable: true, get: function () { return interceptor_registry_1.hasActionInterceptor; } });
|
|
46
|
-
Object.defineProperty(exports, "unregisterActionInterceptor", { enumerable: true, get: function () { return interceptor_registry_1.unregisterActionInterceptor; } });
|
|
47
|
-
Object.defineProperty(exports, "clearInterceptorRegistry", { enumerable: true, get: function () { return interceptor_registry_1.clearInterceptorRegistry; } });
|
|
48
|
-
Object.defineProperty(exports, "getAllInterceptorBindings", { enumerable: true, get: function () { return interceptor_registry_1.getAllInterceptorBindings; } });
|
|
49
|
-
// Interceptor helpers
|
|
50
|
-
var interceptor_helpers_1 = require("./interceptor-helpers");
|
|
51
|
-
Object.defineProperty(exports, "findTraitWithInterceptor", { enumerable: true, get: function () { return interceptor_helpers_1.findTraitWithInterceptor; } });
|
|
52
|
-
Object.defineProperty(exports, "hasInterceptor", { enumerable: true, get: function () { return interceptor_helpers_1.hasInterceptor; } });
|
|
53
|
-
Object.defineProperty(exports, "getEntityInterceptors", { enumerable: true, get: function () { return interceptor_helpers_1.getEntityInterceptors; } });
|
|
54
|
-
Object.defineProperty(exports, "traitHasInterceptor", { enumerable: true, get: function () { return interceptor_helpers_1.traitHasInterceptor; } });
|
|
55
|
-
Object.defineProperty(exports, "getInterceptorTraits", { enumerable: true, get: function () { return interceptor_helpers_1.getInterceptorTraits; } });
|
|
56
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,QAAQ;AACR,iCAIiB;AADf,qGAAA,YAAY,OAAA;AAMd,WAAW;AACX,6DAU+B;AAP7B,iIAAA,0BAA0B,OAAA;AAC1B,+HAAA,wBAAwB,OAAA;AACxB,yHAAA,kBAAkB,OAAA;AAClB,4HAAA,qBAAqB,OAAA;AACrB,mIAAA,4BAA4B,OAAA;AAC5B,8HAAA,uBAAuB,OAAA;AACvB,+HAAA,wBAAwB,OAAA;AAG1B,6BAA6B;AAC7B,6DAS+B;AAL7B,+HAAA,wBAAwB,OAAA;AACxB,0HAAA,mBAAmB,OAAA;AACnB,4HAAA,qBAAqB,OAAA;AACrB,8HAAA,uBAAuB,OAAA;AACvB,+HAAA,wBAAwB,OAAA;AAG1B,UAAU;AACV,2DAM8B;AAL5B,6HAAA,uBAAuB,OAAA;AACvB,mHAAA,aAAa,OAAA;AACb,2HAAA,qBAAqB,OAAA;AACrB,wHAAA,kBAAkB,OAAA;AAClB,sHAAA,gBAAgB,OAAA;AAGlB,iBAAiB;AACjB,mDAG0B;AAFxB,+GAAA,aAAa,OAAA;AACb,6GAAA,WAAW,OAAA;AAkBb,uBAAuB;AACvB,+DAWgC;AAP9B,iIAAA,yBAAyB,OAAA;AACzB,+HAAA,uBAAuB,OAAA;AACvB,6HAAA,qBAAqB,OAAA;AACrB,4HAAA,oBAAoB,OAAA;AACpB,mIAAA,2BAA2B,OAAA;AAC3B,gIAAA,wBAAwB,OAAA;AACxB,iIAAA,yBAAyB,OAAA;AAG3B,sBAAsB;AACtB,6DAM+B;AAL7B,+HAAA,wBAAwB,OAAA;AACxB,qHAAA,cAAc,OAAA;AACd,4HAAA,qBAAqB,OAAA;AACrB,0HAAA,mBAAmB,OAAA;AACnB,2HAAA,oBAAoB,OAAA"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interceptor Helpers (ADR-118)
|
|
3
|
-
*
|
|
4
|
-
* Helper functions for working with trait interceptors.
|
|
5
|
-
* Mirrors capability-helpers.ts pattern but for interceptors.
|
|
6
|
-
*/
|
|
7
|
-
import { ITrait } from '../traits/trait';
|
|
8
|
-
import { IFEntity } from '../entities';
|
|
9
|
-
/**
|
|
10
|
-
* Find a trait on the entity that has an interceptor registered for the given action.
|
|
11
|
-
*
|
|
12
|
-
* Note: This checks both the static `interceptors` declaration on the trait class
|
|
13
|
-
* AND the registry. Use this when you need the trait instance.
|
|
14
|
-
*
|
|
15
|
-
* @param entity - The entity to search
|
|
16
|
-
* @param actionId - The action ID to find
|
|
17
|
-
* @returns The trait that has an interceptor registered, or undefined
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* const trait = findTraitWithInterceptor(boat, 'if.action.entering');
|
|
22
|
-
* if (trait) {
|
|
23
|
-
* // Entity has an interceptor for entering
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare function findTraitWithInterceptor(entity: IFEntity, actionId: string): ITrait | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Check if an entity has any trait declaring an interceptor for an action.
|
|
30
|
-
*
|
|
31
|
-
* @param entity - The entity to check
|
|
32
|
-
* @param actionId - The action ID to check for
|
|
33
|
-
* @returns True if entity has a trait with this interceptor
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* if (hasInterceptor(entity, 'if.action.entering')) {
|
|
38
|
-
* // Entity can intercept entering actions
|
|
39
|
-
* }
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
export declare function hasInterceptor(entity: IFEntity, actionId: string): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Get all interceptor action IDs declared by an entity's traits.
|
|
45
|
-
*
|
|
46
|
-
* @param entity - The entity to inspect
|
|
47
|
-
* @returns Array of action IDs the entity intercepts
|
|
48
|
-
*/
|
|
49
|
-
export declare function getEntityInterceptors(entity: IFEntity): string[];
|
|
50
|
-
/**
|
|
51
|
-
* Type guard to check if a trait declares a specific interceptor.
|
|
52
|
-
*
|
|
53
|
-
* @param trait - The trait to check
|
|
54
|
-
* @param actionId - The action ID to check for
|
|
55
|
-
* @param traitType - Optional: specific trait class to narrow to
|
|
56
|
-
* @returns True if trait has the interceptor (and is of specified type)
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```typescript
|
|
60
|
-
* if (traitHasInterceptor(trait, 'if.action.entering', InflatableTrait)) {
|
|
61
|
-
* // trait is narrowed to InflatableTrait
|
|
62
|
-
* console.log(trait.isInflated);
|
|
63
|
-
* }
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
export declare function traitHasInterceptor<T extends ITrait>(trait: ITrait, actionId: string, traitType?: new (...args: unknown[]) => T): trait is T;
|
|
67
|
-
/**
|
|
68
|
-
* Find all traits on an entity that have interceptors.
|
|
69
|
-
*
|
|
70
|
-
* @param entity - The entity to inspect
|
|
71
|
-
* @returns Array of traits that declare at least one interceptor
|
|
72
|
-
*/
|
|
73
|
-
export declare function getInterceptorTraits(entity: IFEntity): ITrait[];
|
|
74
|
-
//# sourceMappingURL=interceptor-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interceptor-helpers.d.ts","sourceRoot":"","sources":["../../src/capabilities/interceptor-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAqB,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,SAAS,CASpB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE1E;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,CAWhE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,EAClD,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,GACxC,KAAK,IAAI,CAAC,CAQZ;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,CAK/D"}
|