@sharpee/world-model 0.9.66-beta → 0.9.69-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/annotations/index.d.ts +2 -0
- package/annotations/index.d.ts.map +1 -0
- package/annotations/index.js +18 -0
- package/annotations/index.js.map +1 -0
- package/annotations/types.d.ts +35 -0
- package/annotations/types.d.ts.map +1 -0
- package/annotations/types.js +9 -0
- package/annotations/types.js.map +1 -0
- package/behaviors/attack.d.ts +52 -0
- package/behaviors/attack.d.ts.map +1 -0
- package/behaviors/attack.js +161 -0
- package/behaviors/attack.js.map +1 -0
- package/behaviors/behavior.d.ts +67 -0
- package/behaviors/behavior.d.ts.map +1 -0
- package/behaviors/behavior.js +80 -0
- package/behaviors/behavior.js.map +1 -0
- package/behaviors/index.d.ts +21 -0
- package/behaviors/index.d.ts.map +1 -0
- package/behaviors/index.js +39 -0
- package/behaviors/index.js.map +1 -0
- package/capabilities/action-interceptor.d.ts +169 -0
- package/capabilities/action-interceptor.d.ts.map +1 -0
- package/capabilities/action-interceptor.js +15 -0
- package/capabilities/action-interceptor.js.map +1 -0
- package/capabilities/capability-behavior.d.ts +112 -0
- package/capabilities/capability-behavior.d.ts.map +1 -0
- package/capabilities/capability-behavior.js +9 -0
- package/capabilities/capability-behavior.js.map +1 -0
- package/capabilities/capability-defaults.d.ts +67 -0
- package/capabilities/capability-defaults.d.ts.map +1 -0
- package/capabilities/capability-defaults.js +81 -0
- package/capabilities/capability-defaults.js.map +1 -0
- package/capabilities/capability-helpers.d.ts +76 -0
- package/capabilities/capability-helpers.d.ts.map +1 -0
- package/capabilities/capability-helpers.js +112 -0
- package/capabilities/capability-helpers.js.map +1 -0
- package/capabilities/capability-registry.d.ts +115 -0
- package/capabilities/capability-registry.d.ts.map +1 -0
- package/capabilities/capability-registry.js +136 -0
- package/capabilities/capability-registry.js.map +1 -0
- package/capabilities/entity-builder.d.ts +79 -0
- package/capabilities/entity-builder.d.ts.map +1 -0
- package/capabilities/entity-builder.js +116 -0
- package/capabilities/entity-builder.js.map +1 -0
- package/capabilities/index.d.ts +16 -0
- package/capabilities/index.d.ts.map +1 -0
- package/capabilities/index.js +56 -0
- package/capabilities/index.js.map +1 -0
- package/capabilities/interceptor-helpers.d.ts +74 -0
- package/capabilities/interceptor-helpers.d.ts.map +1 -0
- package/capabilities/interceptor-helpers.js +111 -0
- package/capabilities/interceptor-helpers.js.map +1 -0
- package/capabilities/interceptor-registry.d.ts +125 -0
- package/capabilities/interceptor-registry.d.ts.map +1 -0
- package/capabilities/interceptor-registry.js +176 -0
- package/capabilities/interceptor-registry.js.map +1 -0
- package/capabilities/types.d.ts +35 -0
- package/capabilities/types.d.ts.map +1 -0
- package/capabilities/types.js +16 -0
- package/capabilities/types.js.map +1 -0
- package/commands/command-types.d.ts +30 -0
- package/commands/command-types.d.ts.map +1 -0
- package/commands/command-types.js +6 -0
- package/commands/command-types.js.map +1 -0
- package/commands/index.d.ts +7 -0
- package/commands/index.d.ts.map +1 -0
- package/commands/index.js +23 -0
- package/commands/index.js.map +1 -0
- package/commands/parsed-command.d.ts +204 -0
- package/commands/parsed-command.d.ts.map +1 -0
- package/commands/parsed-command.js +25 -0
- package/commands/parsed-command.js.map +1 -0
- package/commands/validated-command.d.ts +52 -0
- package/commands/validated-command.d.ts.map +1 -0
- package/commands/validated-command.js +8 -0
- package/commands/validated-command.js.map +1 -0
- package/constants/action-failures.d.ts +54 -0
- package/constants/action-failures.d.ts.map +1 -0
- package/constants/action-failures.js +68 -0
- package/constants/action-failures.js.map +1 -0
- package/constants/directions.d.ts +32 -0
- package/constants/directions.d.ts.map +1 -0
- package/constants/directions.js +53 -0
- package/constants/directions.js.map +1 -0
- package/constants/if-events.d.ts +5 -0
- package/constants/if-events.d.ts.map +1 -0
- package/constants/if-events.js +10 -0
- package/constants/if-events.js.map +1 -0
- package/constants/index.d.ts +9 -0
- package/constants/index.d.ts.map +1 -0
- package/constants/index.js +25 -0
- package/constants/index.js.map +1 -0
- package/entities/entity-store.d.ts +66 -0
- package/entities/entity-store.d.ts.map +1 -0
- package/entities/entity-store.js +116 -0
- package/entities/entity-store.js.map +1 -0
- package/entities/entity-types.d.ts +40 -0
- package/entities/entity-types.d.ts.map +1 -0
- package/entities/entity-types.js +56 -0
- package/entities/entity-types.js.map +1 -0
- package/entities/if-entity.d.ts +314 -0
- package/entities/if-entity.d.ts.map +1 -0
- package/entities/if-entity.js +621 -0
- package/entities/if-entity.js.map +1 -0
- package/entities/index.d.ts +5 -0
- package/entities/index.d.ts.map +1 -0
- package/entities/index.js +13 -0
- package/entities/index.js.map +1 -0
- package/events/types.d.ts +45 -0
- package/events/types.d.ts.map +1 -0
- package/events/types.js +9 -0
- package/events/types.js.map +1 -0
- package/examples/event-handler-registration.d.ts +14 -0
- package/examples/event-handler-registration.d.ts.map +1 -0
- package/examples/event-handler-registration.js +158 -0
- package/examples/event-handler-registration.js.map +1 -0
- package/extensions/base-extension.d.ts +69 -0
- package/extensions/base-extension.d.ts.map +1 -0
- package/extensions/base-extension.js +83 -0
- package/extensions/base-extension.js.map +1 -0
- package/extensions/index.d.ts +11 -0
- package/extensions/index.d.ts.map +1 -0
- package/extensions/index.js +39 -0
- package/extensions/index.js.map +1 -0
- package/extensions/loader.d.ts +52 -0
- package/extensions/loader.d.ts.map +1 -0
- package/extensions/loader.js +177 -0
- package/extensions/loader.js.map +1 -0
- package/extensions/manager.d.ts +68 -0
- package/extensions/manager.d.ts.map +1 -0
- package/extensions/manager.js +164 -0
- package/extensions/manager.js.map +1 -0
- package/extensions/registry.d.ts +100 -0
- package/extensions/registry.d.ts.map +1 -0
- package/extensions/registry.js +193 -0
- package/extensions/registry.js.map +1 -0
- package/extensions/types.d.ts +226 -0
- package/extensions/types.d.ts.map +1 -0
- package/extensions/types.js +28 -0
- package/extensions/types.js.map +1 -0
- package/index.d.ts +41 -0
- package/index.d.ts.map +1 -0
- package/index.js +71 -0
- package/index.js.map +1 -0
- package/interfaces/command-executor.d.ts +17 -0
- package/interfaces/command-executor.d.ts.map +1 -0
- package/interfaces/command-executor.js +6 -0
- package/interfaces/command-executor.js.map +1 -0
- package/interfaces/command-processor.d.ts +17 -0
- package/interfaces/command-processor.d.ts.map +1 -0
- package/interfaces/command-processor.js +6 -0
- package/interfaces/command-processor.js.map +1 -0
- package/interfaces/command-validator.d.ts +17 -0
- package/interfaces/command-validator.d.ts.map +1 -0
- package/interfaces/command-validator.js +6 -0
- package/interfaces/command-validator.js.map +1 -0
- package/interfaces/index.d.ts +8 -0
- package/interfaces/index.d.ts.map +1 -0
- package/interfaces/index.js +24 -0
- package/interfaces/index.js.map +1 -0
- package/interfaces/language-provider.d.ts +86 -0
- package/interfaces/language-provider.d.ts.map +1 -0
- package/interfaces/language-provider.js +14 -0
- package/interfaces/language-provider.js.map +1 -0
- package/interfaces/parser.d.ts +16 -0
- package/interfaces/parser.d.ts.map +1 -0
- package/interfaces/parser.js +6 -0
- package/interfaces/parser.js.map +1 -0
- package/package.json +1 -16
- package/scope/index.d.ts +8 -0
- package/scope/index.d.ts.map +1 -0
- package/scope/index.js +24 -0
- package/scope/index.js.map +1 -0
- package/scope/scope-evaluator.d.ts +58 -0
- package/scope/scope-evaluator.d.ts.map +1 -0
- package/scope/scope-evaluator.js +207 -0
- package/scope/scope-evaluator.js.map +1 -0
- package/scope/scope-registry.d.ts +59 -0
- package/scope/scope-registry.d.ts.map +1 -0
- package/scope/scope-registry.js +182 -0
- package/scope/scope-registry.js.map +1 -0
- package/scope/scope-rule.d.ts +86 -0
- package/scope/scope-rule.d.ts.map +1 -0
- package/scope/scope-rule.js +7 -0
- package/scope/scope-rule.js.map +1 -0
- package/services/ScopeService.d.ts +8 -0
- package/services/ScopeService.d.ts.map +1 -0
- package/services/ScopeService.js +19 -0
- package/services/ScopeService.js.map +1 -0
- package/services/index.d.ts +2 -0
- package/services/index.d.ts.map +1 -0
- package/services/index.js +6 -0
- package/services/index.js.map +1 -0
- package/test-structure.d.ts +3 -0
- package/test-structure.d.ts.map +1 -0
- package/test-structure.js +26 -0
- package/test-structure.js.map +1 -0
- package/traits/actor/actorBehavior.d.ts +121 -0
- package/traits/actor/actorBehavior.d.ts.map +1 -0
- package/traits/actor/actorBehavior.js +288 -0
- package/traits/actor/actorBehavior.js.map +1 -0
- package/traits/actor/actorTrait.d.ts +158 -0
- package/traits/actor/actorTrait.d.ts.map +1 -0
- package/traits/actor/actorTrait.js +152 -0
- package/traits/actor/actorTrait.js.map +1 -0
- package/traits/actor/index.d.ts +3 -0
- package/traits/actor/index.d.ts.map +1 -0
- package/traits/actor/index.js +11 -0
- package/traits/actor/index.js.map +1 -0
- package/traits/all-traits.d.ts +95 -0
- package/traits/all-traits.d.ts.map +1 -0
- package/traits/all-traits.js +178 -0
- package/traits/all-traits.js.map +1 -0
- package/traits/attached/attachedTrait.d.ts +61 -0
- package/traits/attached/attachedTrait.d.ts.map +1 -0
- package/traits/attached/attachedTrait.js +36 -0
- package/traits/attached/attachedTrait.js.map +1 -0
- package/traits/attached/index.d.ts +2 -0
- package/traits/attached/index.d.ts.map +1 -0
- package/traits/attached/index.js +18 -0
- package/traits/attached/index.js.map +1 -0
- package/traits/breakable/breakableBehavior.d.ts +43 -0
- package/traits/breakable/breakableBehavior.d.ts.map +1 -0
- package/traits/breakable/breakableBehavior.js +70 -0
- package/traits/breakable/breakableBehavior.js.map +1 -0
- package/traits/breakable/breakableTrait.d.ts +22 -0
- package/traits/breakable/breakableTrait.d.ts.map +1 -0
- package/traits/breakable/breakableTrait.js +25 -0
- package/traits/breakable/breakableTrait.js.map +1 -0
- package/traits/breakable/index.d.ts +3 -0
- package/traits/breakable/index.d.ts.map +1 -0
- package/traits/breakable/index.js +8 -0
- package/traits/breakable/index.js.map +1 -0
- package/traits/button/buttonTrait.d.ts +53 -0
- package/traits/button/buttonTrait.d.ts.map +1 -0
- package/traits/button/buttonTrait.js +36 -0
- package/traits/button/buttonTrait.js.map +1 -0
- package/traits/button/index.d.ts +2 -0
- package/traits/button/index.d.ts.map +1 -0
- package/traits/button/index.js +18 -0
- package/traits/button/index.js.map +1 -0
- package/traits/climbable/climbableBehavior.d.ts +37 -0
- package/traits/climbable/climbableBehavior.d.ts.map +1 -0
- package/traits/climbable/climbableBehavior.js +70 -0
- package/traits/climbable/climbableBehavior.js.map +1 -0
- package/traits/climbable/climbableTrait.d.ts +31 -0
- package/traits/climbable/climbableTrait.d.ts.map +1 -0
- package/traits/climbable/climbableTrait.js +47 -0
- package/traits/climbable/climbableTrait.js.map +1 -0
- package/traits/climbable/index.d.ts +6 -0
- package/traits/climbable/index.d.ts.map +1 -0
- package/traits/climbable/index.js +22 -0
- package/traits/climbable/index.js.map +1 -0
- package/traits/clothing/clothingTrait.d.ts +58 -0
- package/traits/clothing/clothingTrait.d.ts.map +1 -0
- package/traits/clothing/clothingTrait.js +78 -0
- package/traits/clothing/clothingTrait.js.map +1 -0
- package/traits/clothing/index.d.ts +2 -0
- package/traits/clothing/index.d.ts.map +1 -0
- package/traits/clothing/index.js +19 -0
- package/traits/clothing/index.js.map +1 -0
- package/traits/combatant/combatantBehavior.d.ts +70 -0
- package/traits/combatant/combatantBehavior.d.ts.map +1 -0
- package/traits/combatant/combatantBehavior.js +155 -0
- package/traits/combatant/combatantBehavior.js.map +1 -0
- package/traits/combatant/combatantTrait.d.ts +98 -0
- package/traits/combatant/combatantTrait.d.ts.map +1 -0
- package/traits/combatant/combatantTrait.js +122 -0
- package/traits/combatant/combatantTrait.js.map +1 -0
- package/traits/combatant/index.d.ts +3 -0
- package/traits/combatant/index.d.ts.map +1 -0
- package/traits/combatant/index.js +8 -0
- package/traits/combatant/index.js.map +1 -0
- package/traits/container/container-utils.d.ts +39 -0
- package/traits/container/container-utils.d.ts.map +1 -0
- package/traits/container/container-utils.js +72 -0
- package/traits/container/container-utils.js.map +1 -0
- package/traits/container/containerBehavior.d.ts +94 -0
- package/traits/container/containerBehavior.d.ts.map +1 -0
- package/traits/container/containerBehavior.js +256 -0
- package/traits/container/containerBehavior.js.map +1 -0
- package/traits/container/containerTrait.d.ts +30 -0
- package/traits/container/containerTrait.d.ts.map +1 -0
- package/traits/container/containerTrait.js +45 -0
- package/traits/container/containerTrait.js.map +1 -0
- package/traits/container/index.d.ts +4 -0
- package/traits/container/index.d.ts.map +1 -0
- package/traits/container/index.js +14 -0
- package/traits/container/index.js.map +1 -0
- package/traits/destructible/destructibleBehavior.d.ts +57 -0
- package/traits/destructible/destructibleBehavior.d.ts.map +1 -0
- package/traits/destructible/destructibleBehavior.js +145 -0
- package/traits/destructible/destructibleBehavior.js.map +1 -0
- package/traits/destructible/destructibleTrait.d.ts +49 -0
- package/traits/destructible/destructibleTrait.d.ts.map +1 -0
- package/traits/destructible/destructibleTrait.js +43 -0
- package/traits/destructible/destructibleTrait.js.map +1 -0
- package/traits/destructible/index.d.ts +3 -0
- package/traits/destructible/index.d.ts.map +1 -0
- package/traits/destructible/index.js +8 -0
- package/traits/destructible/index.js.map +1 -0
- package/traits/door/doorBehavior.d.ts +42 -0
- package/traits/door/doorBehavior.d.ts.map +1 -0
- package/traits/door/doorBehavior.js +76 -0
- package/traits/door/doorBehavior.js.map +1 -0
- package/traits/door/doorTrait.d.ts +19 -0
- package/traits/door/doorTrait.d.ts.map +1 -0
- package/traits/door/doorTrait.js +33 -0
- package/traits/door/doorTrait.js.map +1 -0
- package/traits/door/index.d.ts +3 -0
- package/traits/door/index.d.ts.map +1 -0
- package/traits/door/index.js +9 -0
- package/traits/door/index.js.map +1 -0
- package/traits/edible/edibleBehavior.d.ts +63 -0
- package/traits/edible/edibleBehavior.d.ts.map +1 -0
- package/traits/edible/edibleBehavior.js +157 -0
- package/traits/edible/edibleBehavior.js.map +1 -0
- package/traits/edible/edibleTrait.d.ts +57 -0
- package/traits/edible/edibleTrait.d.ts.map +1 -0
- package/traits/edible/edibleTrait.js +51 -0
- package/traits/edible/edibleTrait.js.map +1 -0
- package/traits/edible/index.d.ts +3 -0
- package/traits/edible/index.d.ts.map +1 -0
- package/traits/edible/index.js +20 -0
- package/traits/edible/index.js.map +1 -0
- package/traits/enterable/enterableTrait.d.ts +33 -0
- package/traits/enterable/enterableTrait.d.ts.map +1 -0
- package/traits/enterable/enterableTrait.js +38 -0
- package/traits/enterable/enterableTrait.js.map +1 -0
- package/traits/enterable/index.d.ts +5 -0
- package/traits/enterable/index.d.ts.map +1 -0
- package/traits/enterable/index.js +21 -0
- package/traits/enterable/index.js.map +1 -0
- package/traits/equipped/equippedTrait.d.ts +46 -0
- package/traits/equipped/equippedTrait.d.ts.map +1 -0
- package/traits/equipped/equippedTrait.js +34 -0
- package/traits/equipped/equippedTrait.js.map +1 -0
- package/traits/equipped/index.d.ts +2 -0
- package/traits/equipped/index.d.ts.map +1 -0
- package/traits/equipped/index.js +6 -0
- package/traits/equipped/index.js.map +1 -0
- package/traits/exit/exitBehavior.d.ts +51 -0
- package/traits/exit/exitBehavior.d.ts.map +1 -0
- package/traits/exit/exitBehavior.js +231 -0
- package/traits/exit/exitBehavior.js.map +1 -0
- package/traits/exit/exitTrait.d.ts +41 -0
- package/traits/exit/exitTrait.d.ts.map +1 -0
- package/traits/exit/exitTrait.js +75 -0
- package/traits/exit/exitTrait.js.map +1 -0
- package/traits/exit/index.d.ts +3 -0
- package/traits/exit/index.d.ts.map +1 -0
- package/traits/exit/index.js +9 -0
- package/traits/exit/index.js.map +1 -0
- package/traits/identity/identityBehavior.d.ts +64 -0
- package/traits/identity/identityBehavior.d.ts.map +1 -0
- package/traits/identity/identityBehavior.js +154 -0
- package/traits/identity/identityBehavior.js.map +1 -0
- package/traits/identity/identityTrait.d.ts +70 -0
- package/traits/identity/identityTrait.d.ts.map +1 -0
- package/traits/identity/identityTrait.js +79 -0
- package/traits/identity/identityTrait.js.map +1 -0
- package/traits/identity/index.d.ts +3 -0
- package/traits/identity/index.d.ts.map +1 -0
- package/traits/identity/index.js +20 -0
- package/traits/identity/index.js.map +1 -0
- package/traits/implementations.d.ts +52 -0
- package/traits/implementations.d.ts.map +1 -0
- package/traits/implementations.js +150 -0
- package/traits/implementations.js.map +1 -0
- package/traits/index.d.ts +37 -0
- package/traits/index.d.ts.map +1 -0
- package/traits/index.js +64 -0
- package/traits/index.js.map +1 -0
- package/traits/light-source/index.d.ts +3 -0
- package/traits/light-source/index.d.ts.map +1 -0
- package/traits/light-source/index.js +9 -0
- package/traits/light-source/index.js.map +1 -0
- package/traits/light-source/lightSourceBehavior.d.ts +57 -0
- package/traits/light-source/lightSourceBehavior.d.ts.map +1 -0
- package/traits/light-source/lightSourceBehavior.js +135 -0
- package/traits/light-source/lightSourceBehavior.js.map +1 -0
- package/traits/light-source/lightSourceTrait.d.ts +28 -0
- package/traits/light-source/lightSourceTrait.d.ts.map +1 -0
- package/traits/light-source/lightSourceTrait.js +37 -0
- package/traits/light-source/lightSourceTrait.js.map +1 -0
- package/traits/lockable/index.d.ts +3 -0
- package/traits/lockable/index.d.ts.map +1 -0
- package/traits/lockable/index.js +20 -0
- package/traits/lockable/index.js.map +1 -0
- package/traits/lockable/lockableBehavior.d.ts +88 -0
- package/traits/lockable/lockableBehavior.d.ts.map +1 -0
- package/traits/lockable/lockableBehavior.js +196 -0
- package/traits/lockable/lockableBehavior.js.map +1 -0
- package/traits/lockable/lockableTrait.d.ts +59 -0
- package/traits/lockable/lockableTrait.d.ts.map +1 -0
- package/traits/lockable/lockableTrait.js +50 -0
- package/traits/lockable/lockableTrait.js.map +1 -0
- package/traits/moveable-scenery/index.d.ts +2 -0
- package/traits/moveable-scenery/index.d.ts.map +1 -0
- package/traits/moveable-scenery/index.js +18 -0
- package/traits/moveable-scenery/index.js.map +1 -0
- package/traits/moveable-scenery/moveableSceneryTrait.d.ts +69 -0
- package/traits/moveable-scenery/moveableSceneryTrait.d.ts.map +1 -0
- package/traits/moveable-scenery/moveableSceneryTrait.js +43 -0
- package/traits/moveable-scenery/moveableSceneryTrait.js.map +1 -0
- package/traits/npc/index.d.ts +5 -0
- package/traits/npc/index.d.ts.map +1 -0
- package/traits/npc/index.js +9 -0
- package/traits/npc/index.js.map +1 -0
- package/traits/npc/npcTrait.d.ts +128 -0
- package/traits/npc/npcTrait.d.ts.map +1 -0
- package/traits/npc/npcTrait.js +180 -0
- package/traits/npc/npcTrait.js.map +1 -0
- package/traits/openable/index.d.ts +3 -0
- package/traits/openable/index.d.ts.map +1 -0
- package/traits/openable/index.js +20 -0
- package/traits/openable/index.js.map +1 -0
- package/traits/openable/openableBehavior.d.ts +64 -0
- package/traits/openable/openableBehavior.d.ts.map +1 -0
- package/traits/openable/openableBehavior.js +109 -0
- package/traits/openable/openableBehavior.js.map +1 -0
- package/traits/openable/openableTrait.d.ts +46 -0
- package/traits/openable/openableTrait.d.ts.map +1 -0
- package/traits/openable/openableTrait.js +42 -0
- package/traits/openable/openableTrait.js.map +1 -0
- package/traits/pullable/index.d.ts +2 -0
- package/traits/pullable/index.d.ts.map +1 -0
- package/traits/pullable/index.js +18 -0
- package/traits/pullable/index.js.map +1 -0
- package/traits/pullable/pullableTrait.d.ts +81 -0
- package/traits/pullable/pullableTrait.d.ts.map +1 -0
- package/traits/pullable/pullableTrait.js +44 -0
- package/traits/pullable/pullableTrait.js.map +1 -0
- package/traits/pushable/index.d.ts +2 -0
- package/traits/pushable/index.d.ts.map +1 -0
- package/traits/pushable/index.js +18 -0
- package/traits/pushable/index.js.map +1 -0
- package/traits/pushable/pushableTrait.d.ts +81 -0
- package/traits/pushable/pushableTrait.d.ts.map +1 -0
- package/traits/pushable/pushableTrait.js +44 -0
- package/traits/pushable/pushableTrait.js.map +1 -0
- package/traits/readable/index.d.ts +3 -0
- package/traits/readable/index.d.ts.map +1 -0
- package/traits/readable/index.js +9 -0
- package/traits/readable/index.js.map +1 -0
- package/traits/readable/readableBehavior.d.ts +42 -0
- package/traits/readable/readableBehavior.d.ts.map +1 -0
- package/traits/readable/readableBehavior.js +174 -0
- package/traits/readable/readableBehavior.js.map +1 -0
- package/traits/readable/readableTrait.d.ts +37 -0
- package/traits/readable/readableTrait.d.ts.map +1 -0
- package/traits/readable/readableTrait.js +51 -0
- package/traits/readable/readableTrait.js.map +1 -0
- package/traits/register-all.d.ts +10 -0
- package/traits/register-all.d.ts.map +1 -0
- package/traits/register-all.js +19 -0
- package/traits/register-all.js.map +1 -0
- package/traits/room/index.d.ts +9 -0
- package/traits/room/index.d.ts.map +1 -0
- package/traits/room/index.js +14 -0
- package/traits/room/index.js.map +1 -0
- package/traits/room/roomBehavior.d.ts +87 -0
- package/traits/room/roomBehavior.d.ts.map +1 -0
- package/traits/room/roomBehavior.js +232 -0
- package/traits/room/roomBehavior.js.map +1 -0
- package/traits/room/roomTrait.d.ts +101 -0
- package/traits/room/roomTrait.d.ts.map +1 -0
- package/traits/room/roomTrait.js +59 -0
- package/traits/room/roomTrait.js.map +1 -0
- package/traits/scenery/index.d.ts +3 -0
- package/traits/scenery/index.d.ts.map +1 -0
- package/traits/scenery/index.js +9 -0
- package/traits/scenery/index.js.map +1 -0
- package/traits/scenery/sceneryBehavior.d.ts +21 -0
- package/traits/scenery/sceneryBehavior.d.ts.map +1 -0
- package/traits/scenery/sceneryBehavior.js +42 -0
- package/traits/scenery/sceneryBehavior.js.map +1 -0
- package/traits/scenery/sceneryTrait.d.ts +30 -0
- package/traits/scenery/sceneryTrait.d.ts.map +1 -0
- package/traits/scenery/sceneryTrait.js +39 -0
- package/traits/scenery/sceneryTrait.js.map +1 -0
- package/traits/story-info/index.d.ts +2 -0
- package/traits/story-info/index.d.ts.map +1 -0
- package/traits/story-info/index.js +6 -0
- package/traits/story-info/index.js.map +1 -0
- package/traits/story-info/storyInfoTrait.d.ts +22 -0
- package/traits/story-info/storyInfoTrait.d.ts.map +1 -0
- package/traits/story-info/storyInfoTrait.js +30 -0
- package/traits/story-info/storyInfoTrait.js.map +1 -0
- package/traits/supporter/index.d.ts +3 -0
- package/traits/supporter/index.d.ts.map +1 -0
- package/traits/supporter/index.js +9 -0
- package/traits/supporter/index.js.map +1 -0
- package/traits/supporter/supporterBehavior.d.ts +83 -0
- package/traits/supporter/supporterBehavior.d.ts.map +1 -0
- package/traits/supporter/supporterBehavior.js +210 -0
- package/traits/supporter/supporterBehavior.js.map +1 -0
- package/traits/supporter/supporterTrait.d.ts +26 -0
- package/traits/supporter/supporterTrait.d.ts.map +1 -0
- package/traits/supporter/supporterTrait.js +30 -0
- package/traits/supporter/supporterTrait.js.map +1 -0
- package/traits/switchable/index.d.ts +3 -0
- package/traits/switchable/index.d.ts.map +1 -0
- package/traits/switchable/index.js +20 -0
- package/traits/switchable/index.js.map +1 -0
- package/traits/switchable/switchableBehavior.d.ts +73 -0
- package/traits/switchable/switchableBehavior.d.ts.map +1 -0
- package/traits/switchable/switchableBehavior.js +191 -0
- package/traits/switchable/switchableBehavior.js.map +1 -0
- package/traits/switchable/switchableTrait.d.ts +61 -0
- package/traits/switchable/switchableTrait.d.ts.map +1 -0
- package/traits/switchable/switchableTrait.js +52 -0
- package/traits/switchable/switchableTrait.js.map +1 -0
- package/traits/trait-types.d.ts +82 -0
- package/traits/trait-types.d.ts.map +1 -0
- package/traits/trait-types.js +150 -0
- package/traits/trait-types.js.map +1 -0
- package/traits/trait.d.ts +44 -0
- package/traits/trait.d.ts.map +1 -0
- package/traits/trait.js +42 -0
- package/traits/trait.js.map +1 -0
- package/traits/vehicle/index.d.ts +6 -0
- package/traits/vehicle/index.d.ts.map +1 -0
- package/traits/vehicle/index.js +22 -0
- package/traits/vehicle/index.js.map +1 -0
- package/traits/vehicle/vehicleBehavior.d.ts +62 -0
- package/traits/vehicle/vehicleBehavior.d.ts.map +1 -0
- package/traits/vehicle/vehicleBehavior.js +145 -0
- package/traits/vehicle/vehicleBehavior.js.map +1 -0
- package/traits/vehicle/vehicleTrait.d.ts +77 -0
- package/traits/vehicle/vehicleTrait.d.ts.map +1 -0
- package/traits/vehicle/vehicleTrait.js +92 -0
- package/traits/vehicle/vehicleTrait.js.map +1 -0
- package/traits/weapon/index.d.ts +3 -0
- package/traits/weapon/index.d.ts.map +1 -0
- package/traits/weapon/index.js +8 -0
- package/traits/weapon/index.js.map +1 -0
- package/traits/weapon/weaponBehavior.d.ts +47 -0
- package/traits/weapon/weaponBehavior.d.ts.map +1 -0
- package/traits/weapon/weaponBehavior.js +106 -0
- package/traits/weapon/weaponBehavior.js.map +1 -0
- package/traits/weapon/weaponTrait.d.ts +67 -0
- package/traits/weapon/weaponTrait.d.ts.map +1 -0
- package/traits/weapon/weaponTrait.js +60 -0
- package/traits/weapon/weaponTrait.js.map +1 -0
- package/traits/wearable/index.d.ts +3 -0
- package/traits/wearable/index.d.ts.map +1 -0
- package/traits/wearable/index.js +20 -0
- package/traits/wearable/index.js.map +1 -0
- package/traits/wearable/wearableBehavior.d.ts +64 -0
- package/traits/wearable/wearableBehavior.d.ts.map +1 -0
- package/traits/wearable/wearableBehavior.js +142 -0
- package/traits/wearable/wearableBehavior.js.map +1 -0
- package/traits/wearable/wearableTrait.d.ts +54 -0
- package/traits/wearable/wearableTrait.d.ts.map +1 -0
- package/traits/wearable/wearableTrait.js +53 -0
- package/traits/wearable/wearableTrait.js.map +1 -0
- package/utils/event-utils.d.ts +30 -0
- package/utils/event-utils.d.ts.map +1 -0
- package/utils/event-utils.js +33 -0
- package/utils/event-utils.js.map +1 -0
- package/world/AuthorModel.d.ts +151 -0
- package/world/AuthorModel.d.ts.map +1 -0
- package/world/AuthorModel.js +416 -0
- package/world/AuthorModel.js.map +1 -0
- package/world/SharedDataStore.d.ts +24 -0
- package/world/SharedDataStore.d.ts.map +1 -0
- package/world/SharedDataStore.js +50 -0
- package/world/SharedDataStore.js.map +1 -0
- package/world/SpatialIndex.d.ts +16 -0
- package/world/SpatialIndex.d.ts.map +1 -0
- package/world/SpatialIndex.js +117 -0
- package/world/SpatialIndex.js.map +1 -0
- package/world/VisibilityBehavior.d.ts +83 -0
- package/world/VisibilityBehavior.d.ts.map +1 -0
- package/world/VisibilityBehavior.js +484 -0
- package/world/VisibilityBehavior.js.map +1 -0
- package/world/WorldModel.d.ts +301 -0
- package/world/WorldModel.d.ts.map +1 -0
- package/world/WorldModel.js +1085 -0
- package/world/WorldModel.js.map +1 -0
- package/world/capabilities.d.ts +36 -0
- package/world/capabilities.d.ts.map +1 -0
- package/world/capabilities.js +18 -0
- package/world/capabilities.js.map +1 -0
- package/world/index.d.ts +7 -0
- package/world/index.d.ts.map +1 -0
- package/world/index.js +21 -0
- package/world/index.js.map +1 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/world-model/src/traits/exit/exitTrait.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ExitTrait = void 0;
|
|
5
|
+
const trait_types_1 = require("../trait-types");
|
|
6
|
+
/**
|
|
7
|
+
* Exit trait for entities that represent passages between locations.
|
|
8
|
+
* Used for doors, passages, portals, and any custom exits like "xyzzy".
|
|
9
|
+
*
|
|
10
|
+
* This trait contains only data - all behavior is in ExitBehavior.
|
|
11
|
+
*/
|
|
12
|
+
class ExitTrait {
|
|
13
|
+
static type = trait_types_1.TraitType.EXIT;
|
|
14
|
+
type = trait_types_1.TraitType.EXIT;
|
|
15
|
+
/** Source location ID (must be an entity ID, not a name) */
|
|
16
|
+
from;
|
|
17
|
+
/** Destination location ID (must be an entity ID, not a name) */
|
|
18
|
+
to;
|
|
19
|
+
/** Standard direction (north, south, up, etc.) - optional */
|
|
20
|
+
direction;
|
|
21
|
+
/** Command to use this exit (e.g., "go north", "enter portal", "xyzzy") */
|
|
22
|
+
command;
|
|
23
|
+
/** Alternative commands that work for this exit */
|
|
24
|
+
aliases;
|
|
25
|
+
/** Whether this exit is visible to players */
|
|
26
|
+
visible = true;
|
|
27
|
+
/** Whether this exit appears in room descriptions */
|
|
28
|
+
listed = true;
|
|
29
|
+
/** Whether this exit works in reverse (bidirectional) */
|
|
30
|
+
bidirectional = false;
|
|
31
|
+
/** The reverse command if bidirectional */
|
|
32
|
+
reverseCommand;
|
|
33
|
+
/** The reverse direction if bidirectional */
|
|
34
|
+
reverseDirection;
|
|
35
|
+
/** Custom message when using this exit */
|
|
36
|
+
useMessage;
|
|
37
|
+
/** Custom message when this exit is blocked */
|
|
38
|
+
blockedMessage;
|
|
39
|
+
/** Whether this exit requires special conditions */
|
|
40
|
+
conditional = false;
|
|
41
|
+
/** Condition identifier (checked by behaviors) */
|
|
42
|
+
conditionId;
|
|
43
|
+
constructor(data) {
|
|
44
|
+
if (!data.from || !data.to || !data.command) {
|
|
45
|
+
throw new Error('ExitTrait requires from, to, and command');
|
|
46
|
+
}
|
|
47
|
+
this.from = data.from;
|
|
48
|
+
this.to = data.to;
|
|
49
|
+
this.command = data.command;
|
|
50
|
+
if (data.direction !== undefined)
|
|
51
|
+
this.direction = data.direction;
|
|
52
|
+
if (data.aliases !== undefined)
|
|
53
|
+
this.aliases = data.aliases;
|
|
54
|
+
if (data.visible !== undefined)
|
|
55
|
+
this.visible = data.visible;
|
|
56
|
+
if (data.listed !== undefined)
|
|
57
|
+
this.listed = data.listed;
|
|
58
|
+
if (data.bidirectional !== undefined)
|
|
59
|
+
this.bidirectional = data.bidirectional;
|
|
60
|
+
if (data.reverseCommand !== undefined)
|
|
61
|
+
this.reverseCommand = data.reverseCommand;
|
|
62
|
+
if (data.reverseDirection !== undefined)
|
|
63
|
+
this.reverseDirection = data.reverseDirection;
|
|
64
|
+
if (data.useMessage !== undefined)
|
|
65
|
+
this.useMessage = data.useMessage;
|
|
66
|
+
if (data.blockedMessage !== undefined)
|
|
67
|
+
this.blockedMessage = data.blockedMessage;
|
|
68
|
+
if (data.conditional !== undefined)
|
|
69
|
+
this.conditional = data.conditional;
|
|
70
|
+
if (data.conditionId !== undefined)
|
|
71
|
+
this.conditionId = data.conditionId;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.ExitTrait = ExitTrait;
|
|
75
|
+
//# sourceMappingURL=exitTrait.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exitTrait.js","sourceRoot":"","sources":["../../../../../../../../../../mnt/c/repot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@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/world-model/src/traits/exit/index.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ExitBehavior = exports.ExitTrait = void 0;
|
|
5
|
+
var exitTrait_1 = require("./exitTrait");
|
|
6
|
+
Object.defineProperty(exports, "ExitTrait", { enumerable: true, get: function () { return exitTrait_1.ExitTrait; } });
|
|
7
|
+
var exitBehavior_1 = require("./exitBehavior");
|
|
8
|
+
Object.defineProperty(exports, "ExitBehavior", { enumerable: true, get: function () { return exitBehavior_1.ExitBehavior; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../../mnt/c/repotemp/sharpee/packages/world-model/src/traits/exit/index.ts"],"names":[],"mappings":";AAAA,gDAAgD;;;AAEhD,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,+CAA8C;AAArC,4GAAA,YAAY,OAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Behavior } from '../../behaviors/behavior';
|
|
2
|
+
import { IFEntity } from '../../entities/if-entity';
|
|
3
|
+
/**
|
|
4
|
+
* Behavior for entities with identity.
|
|
5
|
+
*
|
|
6
|
+
* Handles name formatting, visibility, and validation of identity data.
|
|
7
|
+
*/
|
|
8
|
+
export declare class IdentityBehavior extends Behavior {
|
|
9
|
+
static requiredTraits: "identity"[];
|
|
10
|
+
/**
|
|
11
|
+
* Check if identity data is valid for game use
|
|
12
|
+
* @throws Error if identity data is invalid
|
|
13
|
+
*/
|
|
14
|
+
static validateIdentity(entity: IFEntity): void;
|
|
15
|
+
/**
|
|
16
|
+
* Format an entity's name for display with proper article
|
|
17
|
+
*/
|
|
18
|
+
static formatName(entity: IFEntity, options?: {
|
|
19
|
+
capitalize?: boolean;
|
|
20
|
+
definite?: boolean;
|
|
21
|
+
}): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get a possessive form of the entity's name
|
|
24
|
+
*/
|
|
25
|
+
static getPossessiveName(entity: IFEntity): string;
|
|
26
|
+
/**
|
|
27
|
+
* Check if a given name matches this entity
|
|
28
|
+
*/
|
|
29
|
+
static matchesName(entity: IFEntity, name: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Check if an entity should be visible in normal circumstances
|
|
32
|
+
*/
|
|
33
|
+
static isConcealed(entity: IFEntity): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Set whether an entity is concealed
|
|
36
|
+
*/
|
|
37
|
+
static setConcealed(entity: IFEntity, concealed: boolean): void;
|
|
38
|
+
/**
|
|
39
|
+
* Reveal a concealed entity (convenience method)
|
|
40
|
+
*/
|
|
41
|
+
static reveal(entity: IFEntity): void;
|
|
42
|
+
/**
|
|
43
|
+
* Conceal an entity (convenience method)
|
|
44
|
+
*/
|
|
45
|
+
static conceal(entity: IFEntity): void;
|
|
46
|
+
/**
|
|
47
|
+
* Get the weight of the entity (not including contents)
|
|
48
|
+
*/
|
|
49
|
+
static getWeight(entity: IFEntity): number;
|
|
50
|
+
/**
|
|
51
|
+
* Get the volume of the entity
|
|
52
|
+
*/
|
|
53
|
+
static getVolume(entity: IFEntity): number;
|
|
54
|
+
/**
|
|
55
|
+
* Get the size category of the entity
|
|
56
|
+
*/
|
|
57
|
+
static getSize(entity: IFEntity): 'tiny' | 'small' | 'medium' | 'large' | 'huge' | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Get total weight including contents (for containers/supporters)
|
|
60
|
+
* Note: This method needs a world context to access contents
|
|
61
|
+
*/
|
|
62
|
+
static getTotalWeight(entity: IFEntity, getContents?: (entityId: string) => IFEntity[]): number;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=identityBehavior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identityBehavior.d.ts","sourceRoot":"","sources":["../../../../../../../mnt/c/repotemp/sharpee/packages/world-model/src/traits/identity/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,GAAG,MAAM,GAAG,SAAS;IAK5F;;;OAGG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,QAAQ,EAAE,GAAG,MAAM;CAchG"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/world-model/src/traits/identity/identityBehavior.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.IdentityBehavior = void 0;
|
|
5
|
+
const behavior_1 = require("../../behaviors/behavior");
|
|
6
|
+
const trait_types_1 = require("../trait-types");
|
|
7
|
+
/**
|
|
8
|
+
* Behavior for entities with identity.
|
|
9
|
+
*
|
|
10
|
+
* Handles name formatting, visibility, and validation of identity data.
|
|
11
|
+
*/
|
|
12
|
+
class IdentityBehavior extends behavior_1.Behavior {
|
|
13
|
+
static requiredTraits = [trait_types_1.TraitType.IDENTITY];
|
|
14
|
+
/**
|
|
15
|
+
* Check if identity data is valid for game use
|
|
16
|
+
* @throws Error if identity data is invalid
|
|
17
|
+
*/
|
|
18
|
+
static validateIdentity(entity) {
|
|
19
|
+
const identity = IdentityBehavior.require(entity, trait_types_1.TraitType.IDENTITY);
|
|
20
|
+
if (!identity.name || !identity.name.trim()) {
|
|
21
|
+
throw new Error(`Entity ${entity.id} has no name`);
|
|
22
|
+
}
|
|
23
|
+
if (identity.properName && identity.article) {
|
|
24
|
+
// Proper names shouldn't have articles
|
|
25
|
+
identity.article = '';
|
|
26
|
+
}
|
|
27
|
+
if (identity.weight !== undefined && identity.weight < 0) {
|
|
28
|
+
throw new Error(`Entity ${entity.id} has negative weight`);
|
|
29
|
+
}
|
|
30
|
+
if (identity.volume !== undefined && identity.volume < 0) {
|
|
31
|
+
throw new Error(`Entity ${entity.id} has negative volume`);
|
|
32
|
+
}
|
|
33
|
+
const validSizes = ['tiny', 'small', 'medium', 'large', 'huge'];
|
|
34
|
+
if (identity.size !== undefined && !validSizes.includes(identity.size)) {
|
|
35
|
+
throw new Error(`Entity ${entity.id} has invalid size: ${identity.size}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Format an entity's name for display with proper article
|
|
40
|
+
*/
|
|
41
|
+
static formatName(entity, options) {
|
|
42
|
+
const identity = IdentityBehavior.require(entity, trait_types_1.TraitType.IDENTITY);
|
|
43
|
+
let name;
|
|
44
|
+
if (identity.properName || !identity.article) {
|
|
45
|
+
name = identity.name;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
name = `${identity.article} ${identity.name}`;
|
|
49
|
+
}
|
|
50
|
+
// Handle definite article request
|
|
51
|
+
if (options?.definite && !identity.properName && identity.article !== 'the') {
|
|
52
|
+
name = `the ${identity.name}`;
|
|
53
|
+
}
|
|
54
|
+
// Handle capitalization
|
|
55
|
+
if (options?.capitalize) {
|
|
56
|
+
name = name.charAt(0).toUpperCase() + name.slice(1);
|
|
57
|
+
}
|
|
58
|
+
return name;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get a possessive form of the entity's name
|
|
62
|
+
*/
|
|
63
|
+
static getPossessiveName(entity) {
|
|
64
|
+
const name = IdentityBehavior.formatName(entity);
|
|
65
|
+
// Handle names ending in 's'
|
|
66
|
+
if (name.endsWith('s')) {
|
|
67
|
+
return `${name}'`;
|
|
68
|
+
}
|
|
69
|
+
return `${name}'s`;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Check if a given name matches this entity
|
|
73
|
+
*/
|
|
74
|
+
static matchesName(entity, name) {
|
|
75
|
+
const identity = IdentityBehavior.require(entity, trait_types_1.TraitType.IDENTITY);
|
|
76
|
+
const lowerName = name.toLowerCase();
|
|
77
|
+
// Check main name
|
|
78
|
+
if (identity.name.toLowerCase() === lowerName)
|
|
79
|
+
return true;
|
|
80
|
+
// Check aliases
|
|
81
|
+
return identity.aliases.some((alias) => alias.toLowerCase() === lowerName);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Check if an entity should be visible in normal circumstances
|
|
85
|
+
*/
|
|
86
|
+
static isConcealed(entity) {
|
|
87
|
+
const identity = IdentityBehavior.require(entity, trait_types_1.TraitType.IDENTITY);
|
|
88
|
+
return identity.concealed;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Set whether an entity is concealed
|
|
92
|
+
*/
|
|
93
|
+
static setConcealed(entity, concealed) {
|
|
94
|
+
const identity = IdentityBehavior.require(entity, trait_types_1.TraitType.IDENTITY);
|
|
95
|
+
identity.concealed = concealed;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Reveal a concealed entity (convenience method)
|
|
99
|
+
*/
|
|
100
|
+
static reveal(entity) {
|
|
101
|
+
IdentityBehavior.setConcealed(entity, false);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Conceal an entity (convenience method)
|
|
105
|
+
*/
|
|
106
|
+
static conceal(entity) {
|
|
107
|
+
IdentityBehavior.setConcealed(entity, true);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Get the weight of the entity (not including contents)
|
|
111
|
+
*/
|
|
112
|
+
static getWeight(entity) {
|
|
113
|
+
if (!entity.has(trait_types_1.TraitType.IDENTITY)) {
|
|
114
|
+
return 0; // Default weight for items without identity trait
|
|
115
|
+
}
|
|
116
|
+
const identity = entity.get(trait_types_1.TraitType.IDENTITY);
|
|
117
|
+
return identity?.weight || 0;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Get the volume of the entity
|
|
121
|
+
*/
|
|
122
|
+
static getVolume(entity) {
|
|
123
|
+
if (!entity.has(trait_types_1.TraitType.IDENTITY)) {
|
|
124
|
+
return 0; // Default volume for items without identity trait
|
|
125
|
+
}
|
|
126
|
+
const identity = entity.get(trait_types_1.TraitType.IDENTITY);
|
|
127
|
+
return identity?.volume || 0;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Get the size category of the entity
|
|
131
|
+
*/
|
|
132
|
+
static getSize(entity) {
|
|
133
|
+
const identity = IdentityBehavior.require(entity, trait_types_1.TraitType.IDENTITY);
|
|
134
|
+
return identity.size;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get total weight including contents (for containers/supporters)
|
|
138
|
+
* Note: This method needs a world context to access contents
|
|
139
|
+
*/
|
|
140
|
+
static getTotalWeight(entity, getContents) {
|
|
141
|
+
const identity = IdentityBehavior.require(entity, trait_types_1.TraitType.IDENTITY);
|
|
142
|
+
let weight = identity.weight || 0;
|
|
143
|
+
// Add weight of contents if this is a container/supporter and we have a way to get contents
|
|
144
|
+
if (getContents && (entity.has(trait_types_1.TraitType.CONTAINER) || entity.has(trait_types_1.TraitType.SUPPORTER))) {
|
|
145
|
+
const contents = getContents(entity.id);
|
|
146
|
+
for (const item of contents) {
|
|
147
|
+
weight += IdentityBehavior.getTotalWeight(item, getContents);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return weight;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
exports.IdentityBehavior = IdentityBehavior;
|
|
154
|
+
//# sourceMappingURL=identityBehavior.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identityBehavior.js","sourceRoot":"","sources":["../../../../../../../../../../mnt/c/repotemp/sharpee/packages/world-model/src/traits/identity/identityBehavior.ts"],"names":[],"mappings":";AAAA,+DAA+D;;;AAE/D,uDAAoD;AAEpD,gDAA2C;AAG3C;;;;GAIG;AACH,MAAa,gBAAiB,SAAQ,mBAAQ;IAC5C,MAAM,CAAC,cAAc,GAAG,CAAC,uBAAS,CAAC,QAAQ,CAAC,CAAC;IAE7C;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAgB;QACtC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAgB,MAAM,EAAE,uBAAS,CAAC,QAAQ,CAAC,CAAC;QAErF,IAAI,CAA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AAC,EAAE,CAAC;YACpC,OAAO,CAAC,CAAC,CAAC,kDAAkD;QAC9D,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,uBAAS,CAAC,QAAQ,CAAkB,CAAC;QACjE,OAAO,QAAQ,EAAE,MAAM,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,MAAgB;QAC7B,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAgB,MAAM,EAAE,uBAAS,CAAC,QAAQ,CAAC,CAAC;QACrF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,cAAc,CAAC,MAAgB,EAAE,WAA8C;QACpF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAgB,MAAM,EAAE,uBAAS,CAAC,QAAQ,CAAC,CAAC;QACrF,IAAI,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAC;QAElC,4FAA4F;QAC5F,IAAI,WAAW,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,uBAAS,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,uBAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YACxF,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACxC,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;gBAC5B,MAAM,IAAI,gBAAgB,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;YAC/D,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;;AAxKH,4CAyKC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ITrait } from '../trait';
|
|
2
|
+
/**
|
|
3
|
+
* Identity trait provides basic naming and description for entities.
|
|
4
|
+
* This is one of the most fundamental traits in IF.
|
|
5
|
+
*
|
|
6
|
+
* This is a pure data structure - all validation and logic
|
|
7
|
+
* should be handled by IdentityBehavior.
|
|
8
|
+
*/
|
|
9
|
+
export declare class IdentityTrait implements ITrait {
|
|
10
|
+
static readonly type: "identity";
|
|
11
|
+
readonly type: "identity";
|
|
12
|
+
/** Primary name of the entity */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Full description shown when examining */
|
|
15
|
+
description: string;
|
|
16
|
+
/**
|
|
17
|
+
* Message ID for localized name (ADR-107).
|
|
18
|
+
* If set, the language layer resolves this ID to the actual name text.
|
|
19
|
+
* Takes precedence over literal `name` if both are set.
|
|
20
|
+
*/
|
|
21
|
+
nameId?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Message ID for localized description (ADR-107).
|
|
24
|
+
* If set, the language layer resolves this ID to the actual description text.
|
|
25
|
+
* Takes precedence over literal `description` if both are set.
|
|
26
|
+
*/
|
|
27
|
+
descriptionId?: string;
|
|
28
|
+
/** Alternative names/aliases the entity can be referred to by */
|
|
29
|
+
aliases: string[];
|
|
30
|
+
/** Brief description shown in room listings */
|
|
31
|
+
brief?: string;
|
|
32
|
+
/** Whether the entity has a proper name (like "John" vs "a man") */
|
|
33
|
+
properName: boolean;
|
|
34
|
+
/** Article to use with the name ("a", "an", "the", "some", or empty for proper names) */
|
|
35
|
+
article: string;
|
|
36
|
+
/** Whether this entity is concealed from normal view */
|
|
37
|
+
concealed: boolean;
|
|
38
|
+
/** Weight of the object (undefined = negligible/not tracked) */
|
|
39
|
+
weight?: number;
|
|
40
|
+
/** Volume of the object (undefined = negligible/not tracked) */
|
|
41
|
+
volume?: number;
|
|
42
|
+
/** Size category of the object */
|
|
43
|
+
size?: 'tiny' | 'small' | 'medium' | 'large' | 'huge';
|
|
44
|
+
/**
|
|
45
|
+
* Grammatical number for inanimate objects (ADR-089).
|
|
46
|
+
* - 'singular': "it" (default) - "take it", "the lamp"
|
|
47
|
+
* - 'plural': "them" - "take them", "the coins"
|
|
48
|
+
* Only used for entities WITHOUT ActorTrait.
|
|
49
|
+
*/
|
|
50
|
+
grammaticalNumber?: 'singular' | 'plural';
|
|
51
|
+
/**
|
|
52
|
+
* Adjectives that can be used to refer to this entity (ADR-093).
|
|
53
|
+
* Used for disambiguation when multiple entities share a noun.
|
|
54
|
+
* Example: ['yellow'] for "yellow button" vs ['red'] for "red button"
|
|
55
|
+
*/
|
|
56
|
+
adjectives: string[];
|
|
57
|
+
/**
|
|
58
|
+
* Noun type for article/formatter selection (ADR-095).
|
|
59
|
+
* - 'common': Regular countable noun (a sword, the sword)
|
|
60
|
+
* - 'proper': Proper name (John, not "a John")
|
|
61
|
+
* - 'mass': Uncountable noun (water, not "a water" - use "some water")
|
|
62
|
+
* - 'unique': One-of-a-kind (the sun, not "a sun")
|
|
63
|
+
* - 'plural': Inherently plural (scissors, pants)
|
|
64
|
+
*
|
|
65
|
+
* If not set, formatters use `properName` and `grammaticalNumber` as fallback.
|
|
66
|
+
*/
|
|
67
|
+
nounType?: 'common' | 'proper' | 'mass' | 'unique' | 'plural';
|
|
68
|
+
constructor(data?: Partial<IdentityTrait>);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=identityTrait.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identityTrait.d.ts","sourceRoot":"","sources":["../../../../../../../mnt/c/repotemp/sharpee/packages/world-model/src/traits/identity/identityTrait.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC;;;;;;GAMG;AACH,qBAAa,aAAc,YAAW,MAAM;IAC1C,MAAM,CAAC,QAAQ,CAAC,IAAI,aAAsB;IAC1C,QAAQ,CAAC,IAAI,aAAsB;IAEnC,iCAAiC;IACjC,IAAI,SAAM;IAEV,4CAA4C;IAC5C,WAAW,SAAM;IAEjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,iEAAiE;IACjE,OAAO,EAAE,MAAM,EAAE,CAAM;IAEvB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,oEAAoE;IACpE,UAAU,UAAS;IAEnB,yFAAyF;IACzF,OAAO,SAAO;IAEd,wDAAwD;IACxD,SAAS,UAAS;IAElB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAEtD;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IAE1C;;;;OAIG;IACH,UAAU,EAAE,MAAM,EAAE,CAAM;IAE1B;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;gBAElD,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC;CAK1C"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/world-model/src/traits/identity/identityTrait.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.IdentityTrait = void 0;
|
|
5
|
+
const trait_types_1 = require("../trait-types");
|
|
6
|
+
/**
|
|
7
|
+
* Identity trait provides basic naming and description for entities.
|
|
8
|
+
* This is one of the most fundamental traits in IF.
|
|
9
|
+
*
|
|
10
|
+
* This is a pure data structure - all validation and logic
|
|
11
|
+
* should be handled by IdentityBehavior.
|
|
12
|
+
*/
|
|
13
|
+
class IdentityTrait {
|
|
14
|
+
static type = trait_types_1.TraitType.IDENTITY;
|
|
15
|
+
type = trait_types_1.TraitType.IDENTITY;
|
|
16
|
+
/** Primary name of the entity */
|
|
17
|
+
name = '';
|
|
18
|
+
/** Full description shown when examining */
|
|
19
|
+
description = '';
|
|
20
|
+
/**
|
|
21
|
+
* Message ID for localized name (ADR-107).
|
|
22
|
+
* If set, the language layer resolves this ID to the actual name text.
|
|
23
|
+
* Takes precedence over literal `name` if both are set.
|
|
24
|
+
*/
|
|
25
|
+
nameId;
|
|
26
|
+
/**
|
|
27
|
+
* Message ID for localized description (ADR-107).
|
|
28
|
+
* If set, the language layer resolves this ID to the actual description text.
|
|
29
|
+
* Takes precedence over literal `description` if both are set.
|
|
30
|
+
*/
|
|
31
|
+
descriptionId;
|
|
32
|
+
/** Alternative names/aliases the entity can be referred to by */
|
|
33
|
+
aliases = [];
|
|
34
|
+
/** Brief description shown in room listings */
|
|
35
|
+
brief;
|
|
36
|
+
/** Whether the entity has a proper name (like "John" vs "a man") */
|
|
37
|
+
properName = false;
|
|
38
|
+
/** Article to use with the name ("a", "an", "the", "some", or empty for proper names) */
|
|
39
|
+
article = 'a';
|
|
40
|
+
/** Whether this entity is concealed from normal view */
|
|
41
|
+
concealed = false;
|
|
42
|
+
/** Weight of the object (undefined = negligible/not tracked) */
|
|
43
|
+
weight;
|
|
44
|
+
/** Volume of the object (undefined = negligible/not tracked) */
|
|
45
|
+
volume;
|
|
46
|
+
/** Size category of the object */
|
|
47
|
+
size;
|
|
48
|
+
/**
|
|
49
|
+
* Grammatical number for inanimate objects (ADR-089).
|
|
50
|
+
* - 'singular': "it" (default) - "take it", "the lamp"
|
|
51
|
+
* - 'plural': "them" - "take them", "the coins"
|
|
52
|
+
* Only used for entities WITHOUT ActorTrait.
|
|
53
|
+
*/
|
|
54
|
+
grammaticalNumber;
|
|
55
|
+
/**
|
|
56
|
+
* Adjectives that can be used to refer to this entity (ADR-093).
|
|
57
|
+
* Used for disambiguation when multiple entities share a noun.
|
|
58
|
+
* Example: ['yellow'] for "yellow button" vs ['red'] for "red button"
|
|
59
|
+
*/
|
|
60
|
+
adjectives = [];
|
|
61
|
+
/**
|
|
62
|
+
* Noun type for article/formatter selection (ADR-095).
|
|
63
|
+
* - 'common': Regular countable noun (a sword, the sword)
|
|
64
|
+
* - 'proper': Proper name (John, not "a John")
|
|
65
|
+
* - 'mass': Uncountable noun (water, not "a water" - use "some water")
|
|
66
|
+
* - 'unique': One-of-a-kind (the sun, not "a sun")
|
|
67
|
+
* - 'plural': Inherently plural (scissors, pants)
|
|
68
|
+
*
|
|
69
|
+
* If not set, formatters use `properName` and `grammaticalNumber` as fallback.
|
|
70
|
+
*/
|
|
71
|
+
nounType;
|
|
72
|
+
constructor(data) {
|
|
73
|
+
if (data) {
|
|
74
|
+
Object.assign(this, data);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.IdentityTrait = IdentityTrait;
|
|
79
|
+
//# sourceMappingURL=identityTrait.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identityTrait.js","sourceRoot":"","sources":["../../../../../../../../../../mnt/c/repotemp/sharpee/packages/world-model/src/traits/identity/identityTrait.ts"],"names":[],"mappings":";AAAA,4DAA4D;;;AAG5D,gDAA2C;AAE3C;;;;;;GAMG;AACH,MAAa,aAAa;IACxB,MAAM,CAAU,IAAI,GAAG,uBAAS,CAAC,QAAQ,CAAC;IACjC,IAAI,GAAG,uBAAS,CAAC,QAAQ,CAAC;IAEnC,iCAAiC;IACjC,IAAI,GAAG,EAAE,CAAC;IAEV,4CAA4C;IAC5C,WAAW,GAAG,EAAE,CAAC;IAEjB;;;;OAIG;IACH,MAAM,CAAU;IAEhB;;;;OAIG;IACH,aAAa,CAAU;IAEvB,iEAAiE;IACjE,OAAO,GAAa,EAAE,CAAC;IAEvB,+CAA+C;IAC/C,KAAK,CAAU;IAEf,oEAAoE;IACpE,UAAU,GAAG,KAAK,CAAC;IAEnB,yFAAyF;IACzF,OAAO,GAAG,GAAG,CAAC;IAEd,wDAAwD;IACxD,SAAS,GAAG,KAAK,CAAC;IAElB,gEAAgE;IAChE,MAAM,CAAU;IAEhB,gEAAgE;IAChE,MAAM,CAAU;IAEhB,kCAAkC;IAClC,IAAI,CAAkD;IAEtD;;;;;OAKG;IACH,iBAAiB,CAAyB;IAE1C;;;;OAIG;IACH,UAAU,GAAa,EAAE,CAAC;IAE1B;;;;;;;;;OASG;IACH,QAAQ,CAAsD;IAE9D,YAAY,IAA6B;QACvC,IAAI,IAAI,EAAE,CAAC;YACT,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;;AA/EH,sCAgFC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../mnt/c/repotemp/sharpee/packages/world-model/src/traits/identity/index.ts"],"names":[],"mappings":"AAEA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/world-model/src/traits/identity/index.ts
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__exportStar(require("./identityTrait"), exports);
|
|
19
|
+
__exportStar(require("./identityBehavior"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../../mnt/c/repotemp/sharpee/packages/world-model/src/traits/identity/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;;;;;;;;;;;;;;AAEpD,kDAAgC;AAChC,qDAAmC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trait implementations map
|
|
3
|
+
*
|
|
4
|
+
* Maps trait types to their implementation classes
|
|
5
|
+
*/
|
|
6
|
+
import { TraitType } from './trait-types';
|
|
7
|
+
import { ITraitConstructor } from './trait';
|
|
8
|
+
import { IdentityTrait } from './identity/identityTrait';
|
|
9
|
+
import { ContainerTrait } from './container/containerTrait';
|
|
10
|
+
import { SupporterTrait } from './supporter/supporterTrait';
|
|
11
|
+
import { RoomTrait } from './room/roomTrait';
|
|
12
|
+
import { WearableTrait } from './wearable/wearableTrait';
|
|
13
|
+
import { ClothingTrait } from './clothing/clothingTrait';
|
|
14
|
+
import { EdibleTrait } from './edible/edibleTrait';
|
|
15
|
+
import { SceneryTrait } from './scenery/sceneryTrait';
|
|
16
|
+
import { OpenableTrait } from './openable/openableTrait';
|
|
17
|
+
import { LockableTrait } from './lockable/lockableTrait';
|
|
18
|
+
import { SwitchableTrait } from './switchable/switchableTrait';
|
|
19
|
+
import { ReadableTrait } from './readable/readableTrait';
|
|
20
|
+
import { LightSourceTrait } from './light-source/lightSourceTrait';
|
|
21
|
+
import { DoorTrait } from './door/doorTrait';
|
|
22
|
+
import { ClimbableTrait } from './climbable/climbableTrait';
|
|
23
|
+
import { ActorTrait } from './actor/actorTrait';
|
|
24
|
+
import { ExitTrait } from './exit/exitTrait';
|
|
25
|
+
import { PullableTrait } from './pullable/pullableTrait';
|
|
26
|
+
import { AttachedTrait } from './attached/attachedTrait';
|
|
27
|
+
import { PushableTrait } from './pushable/pushableTrait';
|
|
28
|
+
import { ButtonTrait } from './button/buttonTrait';
|
|
29
|
+
import { MoveableSceneryTrait } from './moveable-scenery/moveableSceneryTrait';
|
|
30
|
+
import { WeaponTrait } from './weapon/weaponTrait';
|
|
31
|
+
import { BreakableTrait } from './breakable/breakableTrait';
|
|
32
|
+
import { DestructibleTrait } from './destructible/destructibleTrait';
|
|
33
|
+
import { CombatantTrait } from './combatant/combatantTrait';
|
|
34
|
+
import { EquippedTrait } from './equipped/equippedTrait';
|
|
35
|
+
import { NpcTrait } from './npc/npcTrait';
|
|
36
|
+
import { VehicleTrait } from './vehicle/vehicleTrait';
|
|
37
|
+
import { EnterableTrait } from './enterable/enterableTrait';
|
|
38
|
+
import { StoryInfoTrait } from './story-info/storyInfoTrait';
|
|
39
|
+
/**
|
|
40
|
+
* Map of trait types to their constructors
|
|
41
|
+
*/
|
|
42
|
+
export declare const TRAIT_IMPLEMENTATIONS: Record<TraitType, ITraitConstructor>;
|
|
43
|
+
/**
|
|
44
|
+
* Get trait implementation by type
|
|
45
|
+
*/
|
|
46
|
+
export declare function getTraitImplementation(type: TraitType): ITraitConstructor | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Create trait instance by type
|
|
49
|
+
*/
|
|
50
|
+
export declare function createTrait(type: TraitType, data?: any): InstanceType<ITraitConstructor>;
|
|
51
|
+
export { IdentityTrait, ContainerTrait, SupporterTrait, RoomTrait, WearableTrait, ClothingTrait, EdibleTrait, SceneryTrait, OpenableTrait, LockableTrait, SwitchableTrait, ReadableTrait, LightSourceTrait, DoorTrait, ActorTrait, ExitTrait, ClimbableTrait, PullableTrait, AttachedTrait, PushableTrait, ButtonTrait, MoveableSceneryTrait, WeaponTrait, BreakableTrait, DestructibleTrait, CombatantTrait, EquippedTrait, NpcTrait, VehicleTrait, EnterableTrait, StoryInfoTrait };
|
|
52
|
+
//# sourceMappingURL=implementations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implementations.d.ts","sourceRoot":"","sources":["../../../../../../mnt/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