@sharpee/stdlib 0.9.60-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/LICENSE +21 -0
- package/README.md +236 -0
- package/dist/actions/author/index.d.ts +5 -0
- package/dist/actions/author/index.d.ts.map +1 -0
- package/dist/actions/author/index.js +9 -0
- package/dist/actions/author/index.js.map +1 -0
- package/dist/actions/author/trace.d.ts +26 -0
- package/dist/actions/author/trace.d.ts.map +1 -0
- package/dist/actions/author/trace.js +125 -0
- package/dist/actions/author/trace.js.map +1 -0
- package/dist/actions/base/index.d.ts +9 -0
- package/dist/actions/base/index.d.ts.map +1 -0
- package/dist/actions/base/index.js +25 -0
- package/dist/actions/base/index.js.map +1 -0
- package/dist/actions/base/migration-shim.d.ts +105 -0
- package/dist/actions/base/migration-shim.d.ts.map +1 -0
- package/dist/actions/base/migration-shim.js +146 -0
- package/dist/actions/base/migration-shim.js.map +1 -0
- package/dist/actions/base/report-helpers.d.ts +90 -0
- package/dist/actions/base/report-helpers.d.ts.map +1 -0
- package/dist/actions/base/report-helpers.js +123 -0
- package/dist/actions/base/report-helpers.js.map +1 -0
- package/dist/actions/base/snapshot-utils.d.ts +99 -0
- package/dist/actions/base/snapshot-utils.d.ts.map +1 -0
- package/dist/actions/base/snapshot-utils.js +202 -0
- package/dist/actions/base/snapshot-utils.js.map +1 -0
- package/dist/actions/capability-dispatch.d.ts +48 -0
- package/dist/actions/capability-dispatch.d.ts.map +1 -0
- package/dist/actions/capability-dispatch.js +144 -0
- package/dist/actions/capability-dispatch.js.map +1 -0
- package/dist/actions/constants.d.ts +82 -0
- package/dist/actions/constants.d.ts.map +1 -0
- package/dist/actions/constants.js +104 -0
- package/dist/actions/constants.js.map +1 -0
- package/dist/actions/context-adapter.d.ts +45 -0
- package/dist/actions/context-adapter.d.ts.map +1 -0
- package/dist/actions/context-adapter.js +152 -0
- package/dist/actions/context-adapter.js.map +1 -0
- package/dist/actions/context.d.ts +95 -0
- package/dist/actions/context.d.ts.map +1 -0
- package/dist/actions/context.js +271 -0
- package/dist/actions/context.js.map +1 -0
- package/dist/actions/data-builder-types.d.ts +85 -0
- package/dist/actions/data-builder-types.d.ts.map +1 -0
- package/dist/actions/data-builder-types.js +99 -0
- package/dist/actions/data-builder-types.js.map +1 -0
- package/dist/actions/enhanced-context.d.ts +21 -0
- package/dist/actions/enhanced-context.d.ts.map +1 -0
- package/dist/actions/enhanced-context.js +363 -0
- package/dist/actions/enhanced-context.js.map +1 -0
- package/dist/actions/enhanced-types.d.ts +697 -0
- package/dist/actions/enhanced-types.d.ts.map +1 -0
- package/dist/actions/enhanced-types.js +49 -0
- package/dist/actions/enhanced-types.js.map +1 -0
- package/dist/actions/index.d.ts +14 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +40 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/meta-action.d.ts +112 -0
- package/dist/actions/meta-action.d.ts.map +1 -0
- package/dist/actions/meta-action.js +107 -0
- package/dist/actions/meta-action.js.map +1 -0
- package/dist/actions/meta-registry.d.ts +110 -0
- package/dist/actions/meta-registry.d.ts.map +1 -0
- package/dist/actions/meta-registry.js +209 -0
- package/dist/actions/meta-registry.js.map +1 -0
- package/dist/actions/registry.d.ts +67 -0
- package/dist/actions/registry.d.ts.map +1 -0
- package/dist/actions/registry.js +141 -0
- package/dist/actions/registry.js.map +1 -0
- package/dist/actions/standard/about/about-events.d.ts +29 -0
- package/dist/actions/standard/about/about-events.d.ts.map +1 -0
- package/dist/actions/standard/about/about-events.js +6 -0
- package/dist/actions/standard/about/about-events.js.map +1 -0
- package/dist/actions/standard/about/about.d.ts +19 -0
- package/dist/actions/standard/about/about.d.ts.map +1 -0
- package/dist/actions/standard/about/about.js +62 -0
- package/dist/actions/standard/about/about.js.map +1 -0
- package/dist/actions/standard/about/index.d.ts +6 -0
- package/dist/actions/standard/about/index.d.ts.map +1 -0
- package/dist/actions/standard/about/index.js +9 -0
- package/dist/actions/standard/about/index.js.map +1 -0
- package/dist/actions/standard/again/again-events.d.ts +18 -0
- package/dist/actions/standard/again/again-events.d.ts.map +1 -0
- package/dist/actions/standard/again/again-events.js +6 -0
- package/dist/actions/standard/again/again-events.js.map +1 -0
- package/dist/actions/standard/again/again.d.ts +19 -0
- package/dist/actions/standard/again/again.d.ts.map +1 -0
- package/dist/actions/standard/again/again.js +69 -0
- package/dist/actions/standard/again/again.js.map +1 -0
- package/dist/actions/standard/again/index.d.ts +6 -0
- package/dist/actions/standard/again/index.d.ts.map +1 -0
- package/dist/actions/standard/again/index.js +9 -0
- package/dist/actions/standard/again/index.js.map +1 -0
- package/dist/actions/standard/attacking/attacking-data.d.ts +10 -0
- package/dist/actions/standard/attacking/attacking-data.d.ts.map +1 -0
- package/dist/actions/standard/attacking/attacking-data.js +33 -0
- package/dist/actions/standard/attacking/attacking-data.js.map +1 -0
- package/dist/actions/standard/attacking/attacking-events.d.ts +62 -0
- package/dist/actions/standard/attacking/attacking-events.d.ts.map +1 -0
- package/dist/actions/standard/attacking/attacking-events.js +6 -0
- package/dist/actions/standard/attacking/attacking-events.js.map +1 -0
- package/dist/actions/standard/attacking/attacking-types.d.ts +61 -0
- package/dist/actions/standard/attacking/attacking-types.d.ts.map +1 -0
- package/dist/actions/standard/attacking/attacking-types.js +20 -0
- package/dist/actions/standard/attacking/attacking-types.js.map +1 -0
- package/dist/actions/standard/attacking/attacking.d.ts +19 -0
- package/dist/actions/standard/attacking/attacking.d.ts.map +1 -0
- package/dist/actions/standard/attacking/attacking.js +378 -0
- package/dist/actions/standard/attacking/attacking.js.map +1 -0
- package/dist/actions/standard/attacking/index.d.ts +6 -0
- package/dist/actions/standard/attacking/index.d.ts.map +1 -0
- package/dist/actions/standard/attacking/index.js +24 -0
- package/dist/actions/standard/attacking/index.js.map +1 -0
- package/dist/actions/standard/climbing/climbing-events.d.ts +54 -0
- package/dist/actions/standard/climbing/climbing-events.d.ts.map +1 -0
- package/dist/actions/standard/climbing/climbing-events.js +6 -0
- package/dist/actions/standard/climbing/climbing-events.js.map +1 -0
- package/dist/actions/standard/climbing/climbing.d.ts +18 -0
- package/dist/actions/standard/climbing/climbing.d.ts.map +1 -0
- package/dist/actions/standard/climbing/climbing.js +208 -0
- package/dist/actions/standard/climbing/climbing.js.map +1 -0
- package/dist/actions/standard/climbing/index.d.ts +6 -0
- package/dist/actions/standard/climbing/index.d.ts.map +1 -0
- package/dist/actions/standard/climbing/index.js +9 -0
- package/dist/actions/standard/climbing/index.js.map +1 -0
- package/dist/actions/standard/closing/closing-data.d.ts +7 -0
- package/dist/actions/standard/closing/closing-data.d.ts.map +1 -0
- package/dist/actions/standard/closing/closing-data.js +27 -0
- package/dist/actions/standard/closing/closing-data.js.map +1 -0
- package/dist/actions/standard/closing/closing-error-prevents-closing.d.ts +19 -0
- package/dist/actions/standard/closing/closing-error-prevents-closing.d.ts.map +1 -0
- package/dist/actions/standard/closing/closing-error-prevents-closing.js +8 -0
- package/dist/actions/standard/closing/closing-error-prevents-closing.js.map +1 -0
- package/dist/actions/standard/closing/closing-event-data.d.ts +24 -0
- package/dist/actions/standard/closing/closing-event-data.d.ts.map +1 -0
- package/dist/actions/standard/closing/closing-event-data.js +8 -0
- package/dist/actions/standard/closing/closing-event-data.js.map +1 -0
- package/dist/actions/standard/closing/closing-messages.d.ts +14 -0
- package/dist/actions/standard/closing/closing-messages.d.ts.map +1 -0
- package/dist/actions/standard/closing/closing-messages.js +17 -0
- package/dist/actions/standard/closing/closing-messages.js.map +1 -0
- package/dist/actions/standard/closing/closing.d.ts +18 -0
- package/dist/actions/standard/closing/closing.d.ts.map +1 -0
- package/dist/actions/standard/closing/closing.js +202 -0
- package/dist/actions/standard/closing/closing.js.map +1 -0
- package/dist/actions/standard/closing/index.d.ts +7 -0
- package/dist/actions/standard/closing/index.d.ts.map +1 -0
- package/dist/actions/standard/closing/index.js +9 -0
- package/dist/actions/standard/closing/index.js.map +1 -0
- package/dist/actions/standard/drinking/drinking-events.d.ts +67 -0
- package/dist/actions/standard/drinking/drinking-events.d.ts.map +1 -0
- package/dist/actions/standard/drinking/drinking-events.js +6 -0
- package/dist/actions/standard/drinking/drinking-events.js.map +1 -0
- package/dist/actions/standard/drinking/drinking.d.ts +18 -0
- package/dist/actions/standard/drinking/drinking.d.ts.map +1 -0
- package/dist/actions/standard/drinking/drinking.js +292 -0
- package/dist/actions/standard/drinking/drinking.js.map +1 -0
- package/dist/actions/standard/drinking/index.d.ts +6 -0
- package/dist/actions/standard/drinking/index.d.ts.map +1 -0
- package/dist/actions/standard/drinking/index.js +24 -0
- package/dist/actions/standard/drinking/index.js.map +1 -0
- package/dist/actions/standard/dropping/dropping-data.d.ts +29 -0
- package/dist/actions/standard/dropping/dropping-data.d.ts.map +1 -0
- package/dist/actions/standard/dropping/dropping-data.js +118 -0
- package/dist/actions/standard/dropping/dropping-data.js.map +1 -0
- package/dist/actions/standard/dropping/dropping-events.d.ts +50 -0
- package/dist/actions/standard/dropping/dropping-events.d.ts.map +1 -0
- package/dist/actions/standard/dropping/dropping-events.js +8 -0
- package/dist/actions/standard/dropping/dropping-events.js.map +1 -0
- package/dist/actions/standard/dropping/dropping-messages.d.ts +21 -0
- package/dist/actions/standard/dropping/dropping-messages.d.ts.map +1 -0
- package/dist/actions/standard/dropping/dropping-messages.js +25 -0
- package/dist/actions/standard/dropping/dropping-messages.js.map +1 -0
- package/dist/actions/standard/dropping/dropping-types.d.ts +48 -0
- package/dist/actions/standard/dropping/dropping-types.d.ts.map +1 -0
- package/dist/actions/standard/dropping/dropping-types.js +25 -0
- package/dist/actions/standard/dropping/dropping-types.js.map +1 -0
- package/dist/actions/standard/dropping/dropping.d.ts +20 -0
- package/dist/actions/standard/dropping/dropping.d.ts.map +1 -0
- package/dist/actions/standard/dropping/dropping.js +328 -0
- package/dist/actions/standard/dropping/dropping.js.map +1 -0
- package/dist/actions/standard/dropping/index.d.ts +8 -0
- package/dist/actions/standard/dropping/index.d.ts.map +1 -0
- package/dist/actions/standard/dropping/index.js +11 -0
- package/dist/actions/standard/dropping/index.js.map +1 -0
- package/dist/actions/standard/eating/eating-events.d.ts +59 -0
- package/dist/actions/standard/eating/eating-events.d.ts.map +1 -0
- package/dist/actions/standard/eating/eating-events.js +6 -0
- package/dist/actions/standard/eating/eating-events.js.map +1 -0
- package/dist/actions/standard/eating/eating.d.ts +21 -0
- package/dist/actions/standard/eating/eating.d.ts.map +1 -0
- package/dist/actions/standard/eating/eating.js +228 -0
- package/dist/actions/standard/eating/eating.js.map +1 -0
- package/dist/actions/standard/eating/index.d.ts +6 -0
- package/dist/actions/standard/eating/index.d.ts.map +1 -0
- package/dist/actions/standard/eating/index.js +24 -0
- package/dist/actions/standard/eating/index.js.map +1 -0
- package/dist/actions/standard/entering/entering-events.d.ts +42 -0
- package/dist/actions/standard/entering/entering-events.d.ts.map +1 -0
- package/dist/actions/standard/entering/entering-events.js +6 -0
- package/dist/actions/standard/entering/entering-events.js.map +1 -0
- package/dist/actions/standard/entering/entering-messages.d.ts +16 -0
- package/dist/actions/standard/entering/entering-messages.d.ts.map +1 -0
- package/dist/actions/standard/entering/entering-messages.js +19 -0
- package/dist/actions/standard/entering/entering-messages.js.map +1 -0
- package/dist/actions/standard/entering/entering.d.ts +18 -0
- package/dist/actions/standard/entering/entering.d.ts.map +1 -0
- package/dist/actions/standard/entering/entering.js +156 -0
- package/dist/actions/standard/entering/entering.js.map +1 -0
- package/dist/actions/standard/entering/index.d.ts +6 -0
- package/dist/actions/standard/entering/index.d.ts.map +1 -0
- package/dist/actions/standard/entering/index.js +9 -0
- package/dist/actions/standard/entering/index.js.map +1 -0
- package/dist/actions/standard/examining/examining-data.d.ts +42 -0
- package/dist/actions/standard/examining/examining-data.d.ts.map +1 -0
- package/dist/actions/standard/examining/examining-data.js +213 -0
- package/dist/actions/standard/examining/examining-data.js.map +1 -0
- package/dist/actions/standard/examining/examining-events.d.ts +66 -0
- package/dist/actions/standard/examining/examining-events.d.ts.map +1 -0
- package/dist/actions/standard/examining/examining-events.js +8 -0
- package/dist/actions/standard/examining/examining-events.js.map +1 -0
- package/dist/actions/standard/examining/examining-messages.d.ts +23 -0
- package/dist/actions/standard/examining/examining-messages.d.ts.map +1 -0
- package/dist/actions/standard/examining/examining-messages.js +27 -0
- package/dist/actions/standard/examining/examining-messages.js.map +1 -0
- package/dist/actions/standard/examining/examining.d.ts +18 -0
- package/dist/actions/standard/examining/examining.d.ts.map +1 -0
- package/dist/actions/standard/examining/examining.js +110 -0
- package/dist/actions/standard/examining/examining.js.map +1 -0
- package/dist/actions/standard/examining/index.d.ts +8 -0
- package/dist/actions/standard/examining/index.d.ts.map +1 -0
- package/dist/actions/standard/examining/index.js +11 -0
- package/dist/actions/standard/examining/index.js.map +1 -0
- package/dist/actions/standard/exiting/exiting-events.d.ts +40 -0
- package/dist/actions/standard/exiting/exiting-events.d.ts.map +1 -0
- package/dist/actions/standard/exiting/exiting-events.js +6 -0
- package/dist/actions/standard/exiting/exiting-events.js.map +1 -0
- package/dist/actions/standard/exiting/exiting-messages.d.ts +13 -0
- package/dist/actions/standard/exiting/exiting-messages.d.ts.map +1 -0
- package/dist/actions/standard/exiting/exiting-messages.js +18 -0
- package/dist/actions/standard/exiting/exiting-messages.js.map +1 -0
- package/dist/actions/standard/exiting/exiting.d.ts +11 -0
- package/dist/actions/standard/exiting/exiting.d.ts.map +1 -0
- package/dist/actions/standard/exiting/exiting.js +146 -0
- package/dist/actions/standard/exiting/exiting.js.map +1 -0
- package/dist/actions/standard/exiting/index.d.ts +6 -0
- package/dist/actions/standard/exiting/index.d.ts.map +1 -0
- package/dist/actions/standard/exiting/index.js +9 -0
- package/dist/actions/standard/exiting/index.js.map +1 -0
- package/dist/actions/standard/giving/giving-events.d.ts +22 -0
- package/dist/actions/standard/giving/giving-events.d.ts.map +1 -0
- package/dist/actions/standard/giving/giving-events.js +7 -0
- package/dist/actions/standard/giving/giving-events.js.map +1 -0
- package/dist/actions/standard/giving/giving.d.ts +18 -0
- package/dist/actions/standard/giving/giving.d.ts.map +1 -0
- package/dist/actions/standard/giving/giving.js +231 -0
- package/dist/actions/standard/giving/giving.js.map +1 -0
- package/dist/actions/standard/giving/index.d.ts +7 -0
- package/dist/actions/standard/giving/index.d.ts.map +1 -0
- package/dist/actions/standard/giving/index.js +25 -0
- package/dist/actions/standard/giving/index.js.map +1 -0
- package/dist/actions/standard/going/going-data.d.ts +33 -0
- package/dist/actions/standard/going/going-data.d.ts.map +1 -0
- package/dist/actions/standard/going/going-data.js +162 -0
- package/dist/actions/standard/going/going-data.js.map +1 -0
- package/dist/actions/standard/going/going-events.d.ts +72 -0
- package/dist/actions/standard/going/going-events.d.ts.map +1 -0
- package/dist/actions/standard/going/going-events.js +8 -0
- package/dist/actions/standard/going/going-events.js.map +1 -0
- package/dist/actions/standard/going/going-messages.d.ts +20 -0
- package/dist/actions/standard/going/going-messages.d.ts.map +1 -0
- package/dist/actions/standard/going/going-messages.js +25 -0
- package/dist/actions/standard/going/going-messages.js.map +1 -0
- package/dist/actions/standard/going/going.d.ts +29 -0
- package/dist/actions/standard/going/going.d.ts.map +1 -0
- package/dist/actions/standard/going/going.js +302 -0
- package/dist/actions/standard/going/going.js.map +1 -0
- package/dist/actions/standard/going/index.d.ts +8 -0
- package/dist/actions/standard/going/index.d.ts.map +1 -0
- package/dist/actions/standard/going/index.js +11 -0
- package/dist/actions/standard/going/index.js.map +1 -0
- package/dist/actions/standard/help/help-events.d.ts +42 -0
- package/dist/actions/standard/help/help-events.d.ts.map +1 -0
- package/dist/actions/standard/help/help-events.js +6 -0
- package/dist/actions/standard/help/help-events.js.map +1 -0
- package/dist/actions/standard/help/help.d.ts +22 -0
- package/dist/actions/standard/help/help.d.ts.map +1 -0
- package/dist/actions/standard/help/help.js +131 -0
- package/dist/actions/standard/help/help.js.map +1 -0
- package/dist/actions/standard/help/index.d.ts +6 -0
- package/dist/actions/standard/help/index.d.ts.map +1 -0
- package/dist/actions/standard/help/index.js +9 -0
- package/dist/actions/standard/help/index.js.map +1 -0
- package/dist/actions/standard/index.d.ts +62 -0
- package/dist/actions/standard/index.d.ts.map +1 -0
- package/dist/actions/standard/index.js +203 -0
- package/dist/actions/standard/index.js.map +1 -0
- package/dist/actions/standard/inserting/index.d.ts +7 -0
- package/dist/actions/standard/inserting/index.d.ts.map +1 -0
- package/dist/actions/standard/inserting/index.js +25 -0
- package/dist/actions/standard/inserting/index.js.map +1 -0
- package/dist/actions/standard/inserting/inserting-data.d.ts +7 -0
- package/dist/actions/standard/inserting/inserting-data.d.ts.map +1 -0
- package/dist/actions/standard/inserting/inserting-data.js +28 -0
- package/dist/actions/standard/inserting/inserting-data.js.map +1 -0
- package/dist/actions/standard/inserting/inserting-events.d.ts +9 -0
- package/dist/actions/standard/inserting/inserting-events.d.ts.map +1 -0
- package/dist/actions/standard/inserting/inserting-events.js +7 -0
- package/dist/actions/standard/inserting/inserting-events.js.map +1 -0
- package/dist/actions/standard/inserting/inserting-messages.d.ts +18 -0
- package/dist/actions/standard/inserting/inserting-messages.d.ts.map +1 -0
- package/dist/actions/standard/inserting/inserting-messages.js +21 -0
- package/dist/actions/standard/inserting/inserting-messages.js.map +1 -0
- package/dist/actions/standard/inserting/inserting-semantic.d.ts +42 -0
- package/dist/actions/standard/inserting/inserting-semantic.d.ts.map +1 -0
- package/dist/actions/standard/inserting/inserting-semantic.js +209 -0
- package/dist/actions/standard/inserting/inserting-semantic.js.map +1 -0
- package/dist/actions/standard/inserting/inserting.d.ts +24 -0
- package/dist/actions/standard/inserting/inserting.d.ts.map +1 -0
- package/dist/actions/standard/inserting/inserting.js +177 -0
- package/dist/actions/standard/inserting/inserting.js.map +1 -0
- package/dist/actions/standard/inventory/index.d.ts +7 -0
- package/dist/actions/standard/inventory/index.d.ts.map +1 -0
- package/dist/actions/standard/inventory/index.js +25 -0
- package/dist/actions/standard/inventory/index.js.map +1 -0
- package/dist/actions/standard/inventory/inventory-events.d.ts +48 -0
- package/dist/actions/standard/inventory/inventory-events.d.ts.map +1 -0
- package/dist/actions/standard/inventory/inventory-events.js +7 -0
- package/dist/actions/standard/inventory/inventory-events.js.map +1 -0
- package/dist/actions/standard/inventory/inventory-messages.d.ts +27 -0
- package/dist/actions/standard/inventory/inventory-messages.d.ts.map +1 -0
- package/dist/actions/standard/inventory/inventory-messages.js +30 -0
- package/dist/actions/standard/inventory/inventory-messages.js.map +1 -0
- package/dist/actions/standard/inventory/inventory.d.ts +21 -0
- package/dist/actions/standard/inventory/inventory.d.ts.map +1 -0
- package/dist/actions/standard/inventory/inventory.js +239 -0
- package/dist/actions/standard/inventory/inventory.js.map +1 -0
- package/dist/actions/standard/listening/index.d.ts +6 -0
- package/dist/actions/standard/listening/index.d.ts.map +1 -0
- package/dist/actions/standard/listening/index.js +24 -0
- package/dist/actions/standard/listening/index.js.map +1 -0
- package/dist/actions/standard/listening/listening-events.d.ts +49 -0
- package/dist/actions/standard/listening/listening-events.d.ts.map +1 -0
- package/dist/actions/standard/listening/listening-events.js +6 -0
- package/dist/actions/standard/listening/listening-events.js.map +1 -0
- package/dist/actions/standard/listening/listening.d.ts +18 -0
- package/dist/actions/standard/listening/listening.d.ts.map +1 -0
- package/dist/actions/standard/listening/listening.js +166 -0
- package/dist/actions/standard/listening/listening.js.map +1 -0
- package/dist/actions/standard/lock-shared.d.ts +41 -0
- package/dist/actions/standard/lock-shared.d.ts.map +1 -0
- package/dist/actions/standard/lock-shared.js +153 -0
- package/dist/actions/standard/lock-shared.js.map +1 -0
- package/dist/actions/standard/locking/index.d.ts +8 -0
- package/dist/actions/standard/locking/index.d.ts.map +1 -0
- package/dist/actions/standard/locking/index.js +11 -0
- package/dist/actions/standard/locking/index.js.map +1 -0
- package/dist/actions/standard/locking/locking-events.d.ts +41 -0
- package/dist/actions/standard/locking/locking-events.d.ts.map +1 -0
- package/dist/actions/standard/locking/locking-events.js +8 -0
- package/dist/actions/standard/locking/locking-events.js.map +1 -0
- package/dist/actions/standard/locking/locking-messages.d.ts +20 -0
- package/dist/actions/standard/locking/locking-messages.d.ts.map +1 -0
- package/dist/actions/standard/locking/locking-messages.js +24 -0
- package/dist/actions/standard/locking/locking-messages.js.map +1 -0
- package/dist/actions/standard/locking/locking.d.ts +17 -0
- package/dist/actions/standard/locking/locking.d.ts.map +1 -0
- package/dist/actions/standard/locking/locking.js +223 -0
- package/dist/actions/standard/locking/locking.js.map +1 -0
- package/dist/actions/standard/looking/index.d.ts +7 -0
- package/dist/actions/standard/looking/index.d.ts.map +1 -0
- package/dist/actions/standard/looking/index.js +25 -0
- package/dist/actions/standard/looking/index.js.map +1 -0
- package/dist/actions/standard/looking/looking-data.d.ts +44 -0
- package/dist/actions/standard/looking/looking-data.d.ts.map +1 -0
- package/dist/actions/standard/looking/looking-data.js +275 -0
- package/dist/actions/standard/looking/looking-data.js.map +1 -0
- package/dist/actions/standard/looking/looking-events.d.ts +50 -0
- package/dist/actions/standard/looking/looking-events.d.ts.map +1 -0
- package/dist/actions/standard/looking/looking-events.js +7 -0
- package/dist/actions/standard/looking/looking-events.js.map +1 -0
- package/dist/actions/standard/looking/looking-messages.d.ts +20 -0
- package/dist/actions/standard/looking/looking-messages.d.ts.map +1 -0
- package/dist/actions/standard/looking/looking-messages.js +23 -0
- package/dist/actions/standard/looking/looking-messages.js.map +1 -0
- package/dist/actions/standard/looking/looking.d.ts +15 -0
- package/dist/actions/standard/looking/looking.d.ts.map +1 -0
- package/dist/actions/standard/looking/looking.js +120 -0
- package/dist/actions/standard/looking/looking.js.map +1 -0
- package/dist/actions/standard/lowering/index.d.ts +2 -0
- package/dist/actions/standard/lowering/index.d.ts.map +1 -0
- package/dist/actions/standard/lowering/index.js +6 -0
- package/dist/actions/standard/lowering/index.js.map +1 -0
- package/dist/actions/standard/lowering/lowering.d.ts +46 -0
- package/dist/actions/standard/lowering/lowering.d.ts.map +1 -0
- package/dist/actions/standard/lowering/lowering.js +54 -0
- package/dist/actions/standard/lowering/lowering.js.map +1 -0
- package/dist/actions/standard/opening/index.d.ts +8 -0
- package/dist/actions/standard/opening/index.d.ts.map +1 -0
- package/dist/actions/standard/opening/index.js +11 -0
- package/dist/actions/standard/opening/index.js.map +1 -0
- package/dist/actions/standard/opening/opening-data.d.ts +10 -0
- package/dist/actions/standard/opening/opening-data.d.ts.map +1 -0
- package/dist/actions/standard/opening/opening-data.js +27 -0
- package/dist/actions/standard/opening/opening-data.js.map +1 -0
- package/dist/actions/standard/opening/opening-events.d.ts +63 -0
- package/dist/actions/standard/opening/opening-events.d.ts.map +1 -0
- package/dist/actions/standard/opening/opening-events.js +9 -0
- package/dist/actions/standard/opening/opening-events.js.map +1 -0
- package/dist/actions/standard/opening/opening-messages.d.ts +19 -0
- package/dist/actions/standard/opening/opening-messages.d.ts.map +1 -0
- package/dist/actions/standard/opening/opening-messages.js +23 -0
- package/dist/actions/standard/opening/opening-messages.js.map +1 -0
- package/dist/actions/standard/opening/opening-types.d.ts +35 -0
- package/dist/actions/standard/opening/opening-types.d.ts.map +1 -0
- package/dist/actions/standard/opening/opening-types.js +20 -0
- package/dist/actions/standard/opening/opening-types.js.map +1 -0
- package/dist/actions/standard/opening/opening.d.ts +18 -0
- package/dist/actions/standard/opening/opening.d.ts.map +1 -0
- package/dist/actions/standard/opening/opening.js +164 -0
- package/dist/actions/standard/opening/opening.js.map +1 -0
- package/dist/actions/standard/pulling/index.d.ts +6 -0
- package/dist/actions/standard/pulling/index.d.ts.map +1 -0
- package/dist/actions/standard/pulling/index.js +24 -0
- package/dist/actions/standard/pulling/index.js.map +1 -0
- package/dist/actions/standard/pulling/pulling-events.d.ts +109 -0
- package/dist/actions/standard/pulling/pulling-events.d.ts.map +1 -0
- package/dist/actions/standard/pulling/pulling-events.js +6 -0
- package/dist/actions/standard/pulling/pulling-events.js.map +1 -0
- package/dist/actions/standard/pulling/pulling.d.ts +18 -0
- package/dist/actions/standard/pulling/pulling.d.ts.map +1 -0
- package/dist/actions/standard/pulling/pulling.js +122 -0
- package/dist/actions/standard/pulling/pulling.js.map +1 -0
- package/dist/actions/standard/pushing/index.d.ts +6 -0
- package/dist/actions/standard/pushing/index.d.ts.map +1 -0
- package/dist/actions/standard/pushing/index.js +24 -0
- package/dist/actions/standard/pushing/index.js.map +1 -0
- package/dist/actions/standard/pushing/pushing-events.d.ts +62 -0
- package/dist/actions/standard/pushing/pushing-events.d.ts.map +1 -0
- package/dist/actions/standard/pushing/pushing-events.js +6 -0
- package/dist/actions/standard/pushing/pushing-events.js.map +1 -0
- package/dist/actions/standard/pushing/pushing-original.d.ts +15 -0
- package/dist/actions/standard/pushing/pushing-original.d.ts.map +1 -0
- package/dist/actions/standard/pushing/pushing-original.js +352 -0
- package/dist/actions/standard/pushing/pushing-original.js.map +1 -0
- package/dist/actions/standard/pushing/pushing.d.ts +21 -0
- package/dist/actions/standard/pushing/pushing.d.ts.map +1 -0
- package/dist/actions/standard/pushing/pushing.js +238 -0
- package/dist/actions/standard/pushing/pushing.js.map +1 -0
- package/dist/actions/standard/putting/index.d.ts +7 -0
- package/dist/actions/standard/putting/index.d.ts.map +1 -0
- package/dist/actions/standard/putting/index.js +25 -0
- package/dist/actions/standard/putting/index.js.map +1 -0
- package/dist/actions/standard/putting/putting-data.d.ts +7 -0
- package/dist/actions/standard/putting/putting-data.d.ts.map +1 -0
- package/dist/actions/standard/putting/putting-data.js +29 -0
- package/dist/actions/standard/putting/putting-data.js.map +1 -0
- package/dist/actions/standard/putting/putting-events.d.ts +25 -0
- package/dist/actions/standard/putting/putting-events.d.ts.map +1 -0
- package/dist/actions/standard/putting/putting-events.js +7 -0
- package/dist/actions/standard/putting/putting-events.js.map +1 -0
- package/dist/actions/standard/putting/putting-messages.d.ts +22 -0
- package/dist/actions/standard/putting/putting-messages.d.ts.map +1 -0
- package/dist/actions/standard/putting/putting-messages.js +25 -0
- package/dist/actions/standard/putting/putting-messages.js.map +1 -0
- package/dist/actions/standard/putting/putting-types.d.ts +36 -0
- package/dist/actions/standard/putting/putting-types.d.ts.map +1 -0
- package/dist/actions/standard/putting/putting-types.js +18 -0
- package/dist/actions/standard/putting/putting-types.js.map +1 -0
- package/dist/actions/standard/putting/putting.d.ts +23 -0
- package/dist/actions/standard/putting/putting.d.ts.map +1 -0
- package/dist/actions/standard/putting/putting.js +440 -0
- package/dist/actions/standard/putting/putting.js.map +1 -0
- package/dist/actions/standard/quitting/index.d.ts +6 -0
- package/dist/actions/standard/quitting/index.d.ts.map +1 -0
- package/dist/actions/standard/quitting/index.js +24 -0
- package/dist/actions/standard/quitting/index.js.map +1 -0
- package/dist/actions/standard/quitting/quitting-events.d.ts +31 -0
- package/dist/actions/standard/quitting/quitting-events.d.ts.map +1 -0
- package/dist/actions/standard/quitting/quitting-events.js +6 -0
- package/dist/actions/standard/quitting/quitting-events.js.map +1 -0
- package/dist/actions/standard/quitting/quitting.d.ts +18 -0
- package/dist/actions/standard/quitting/quitting.d.ts.map +1 -0
- package/dist/actions/standard/quitting/quitting.js +120 -0
- package/dist/actions/standard/quitting/quitting.js.map +1 -0
- package/dist/actions/standard/raising/index.d.ts +2 -0
- package/dist/actions/standard/raising/index.d.ts.map +1 -0
- package/dist/actions/standard/raising/index.js +6 -0
- package/dist/actions/standard/raising/index.js.map +1 -0
- package/dist/actions/standard/raising/raising.d.ts +22 -0
- package/dist/actions/standard/raising/raising.d.ts.map +1 -0
- package/dist/actions/standard/raising/raising.js +30 -0
- package/dist/actions/standard/raising/raising.js.map +1 -0
- package/dist/actions/standard/reading/index.d.ts +7 -0
- package/dist/actions/standard/reading/index.d.ts.map +1 -0
- package/dist/actions/standard/reading/index.js +10 -0
- package/dist/actions/standard/reading/index.js.map +1 -0
- package/dist/actions/standard/reading/reading-events.d.ts +35 -0
- package/dist/actions/standard/reading/reading-events.d.ts.map +1 -0
- package/dist/actions/standard/reading/reading-events.js +22 -0
- package/dist/actions/standard/reading/reading-events.js.map +1 -0
- package/dist/actions/standard/reading/reading.d.ts +17 -0
- package/dist/actions/standard/reading/reading.d.ts.map +1 -0
- package/dist/actions/standard/reading/reading.js +176 -0
- package/dist/actions/standard/reading/reading.js.map +1 -0
- package/dist/actions/standard/removing/index.d.ts +6 -0
- package/dist/actions/standard/removing/index.d.ts.map +1 -0
- package/dist/actions/standard/removing/index.js +10 -0
- package/dist/actions/standard/removing/index.js.map +1 -0
- package/dist/actions/standard/removing/removing-data.d.ts +7 -0
- package/dist/actions/standard/removing/removing-data.d.ts.map +1 -0
- package/dist/actions/standard/removing/removing-data.js +29 -0
- package/dist/actions/standard/removing/removing-data.js.map +1 -0
- package/dist/actions/standard/removing/removing-events.d.ts +9 -0
- package/dist/actions/standard/removing/removing-events.d.ts.map +1 -0
- package/dist/actions/standard/removing/removing-events.js +7 -0
- package/dist/actions/standard/removing/removing-events.js.map +1 -0
- package/dist/actions/standard/removing/removing-messages.d.ts +22 -0
- package/dist/actions/standard/removing/removing-messages.d.ts.map +1 -0
- package/dist/actions/standard/removing/removing-messages.js +25 -0
- package/dist/actions/standard/removing/removing-messages.js.map +1 -0
- package/dist/actions/standard/removing/removing-types.d.ts +36 -0
- package/dist/actions/standard/removing/removing-types.d.ts.map +1 -0
- package/dist/actions/standard/removing/removing-types.js +18 -0
- package/dist/actions/standard/removing/removing-types.js.map +1 -0
- package/dist/actions/standard/removing/removing.d.ts +23 -0
- package/dist/actions/standard/removing/removing.d.ts.map +1 -0
- package/dist/actions/standard/removing/removing.js +436 -0
- package/dist/actions/standard/removing/removing.js.map +1 -0
- package/dist/actions/standard/restarting/index.d.ts +6 -0
- package/dist/actions/standard/restarting/index.d.ts.map +1 -0
- package/dist/actions/standard/restarting/index.js +24 -0
- package/dist/actions/standard/restarting/index.js.map +1 -0
- package/dist/actions/standard/restarting/restarting-events.d.ts +33 -0
- package/dist/actions/standard/restarting/restarting-events.d.ts.map +1 -0
- package/dist/actions/standard/restarting/restarting-events.js +6 -0
- package/dist/actions/standard/restarting/restarting-events.js.map +1 -0
- package/dist/actions/standard/restarting/restarting.d.ts +18 -0
- package/dist/actions/standard/restarting/restarting.d.ts.map +1 -0
- package/dist/actions/standard/restarting/restarting.js +116 -0
- package/dist/actions/standard/restarting/restarting.js.map +1 -0
- package/dist/actions/standard/restoring/index.d.ts +6 -0
- package/dist/actions/standard/restoring/index.d.ts.map +1 -0
- package/dist/actions/standard/restoring/index.js +24 -0
- package/dist/actions/standard/restoring/index.js.map +1 -0
- package/dist/actions/standard/restoring/restoring-events.d.ts +39 -0
- package/dist/actions/standard/restoring/restoring-events.d.ts.map +1 -0
- package/dist/actions/standard/restoring/restoring-events.js +6 -0
- package/dist/actions/standard/restoring/restoring-events.js.map +1 -0
- package/dist/actions/standard/restoring/restoring.d.ts +18 -0
- package/dist/actions/standard/restoring/restoring.d.ts.map +1 -0
- package/dist/actions/standard/restoring/restoring.js +156 -0
- package/dist/actions/standard/restoring/restoring.js.map +1 -0
- package/dist/actions/standard/saving/index.d.ts +6 -0
- package/dist/actions/standard/saving/index.d.ts.map +1 -0
- package/dist/actions/standard/saving/index.js +24 -0
- package/dist/actions/standard/saving/index.js.map +1 -0
- package/dist/actions/standard/saving/saving-events.d.ts +44 -0
- package/dist/actions/standard/saving/saving-events.d.ts.map +1 -0
- package/dist/actions/standard/saving/saving-events.js +6 -0
- package/dist/actions/standard/saving/saving-events.js.map +1 -0
- package/dist/actions/standard/saving/saving.d.ts +18 -0
- package/dist/actions/standard/saving/saving.d.ts.map +1 -0
- package/dist/actions/standard/saving/saving.js +152 -0
- package/dist/actions/standard/saving/saving.js.map +1 -0
- package/dist/actions/standard/scoring/index.d.ts +6 -0
- package/dist/actions/standard/scoring/index.d.ts.map +1 -0
- package/dist/actions/standard/scoring/index.js +9 -0
- package/dist/actions/standard/scoring/index.js.map +1 -0
- package/dist/actions/standard/scoring/scoring-events.d.ts +44 -0
- package/dist/actions/standard/scoring/scoring-events.d.ts.map +1 -0
- package/dist/actions/standard/scoring/scoring-events.js +6 -0
- package/dist/actions/standard/scoring/scoring-events.js.map +1 -0
- package/dist/actions/standard/scoring/scoring.d.ts +23 -0
- package/dist/actions/standard/scoring/scoring.d.ts.map +1 -0
- package/dist/actions/standard/scoring/scoring.js +159 -0
- package/dist/actions/standard/scoring/scoring.js.map +1 -0
- package/dist/actions/standard/searching/index.d.ts +6 -0
- package/dist/actions/standard/searching/index.d.ts.map +1 -0
- package/dist/actions/standard/searching/index.js +9 -0
- package/dist/actions/standard/searching/index.js.map +1 -0
- package/dist/actions/standard/searching/searching-events.d.ts +43 -0
- package/dist/actions/standard/searching/searching-events.d.ts.map +1 -0
- package/dist/actions/standard/searching/searching-events.js +6 -0
- package/dist/actions/standard/searching/searching-events.js.map +1 -0
- package/dist/actions/standard/searching/searching.d.ts +18 -0
- package/dist/actions/standard/searching/searching.d.ts.map +1 -0
- package/dist/actions/standard/searching/searching.js +106 -0
- package/dist/actions/standard/searching/searching.js.map +1 -0
- package/dist/actions/standard/searching-helpers.d.ts +38 -0
- package/dist/actions/standard/searching-helpers.d.ts.map +1 -0
- package/dist/actions/standard/searching-helpers.js +133 -0
- package/dist/actions/standard/searching-helpers.js.map +1 -0
- package/dist/actions/standard/showing/index.d.ts +7 -0
- package/dist/actions/standard/showing/index.d.ts.map +1 -0
- package/dist/actions/standard/showing/index.js +25 -0
- package/dist/actions/standard/showing/index.js.map +1 -0
- package/dist/actions/standard/showing/showing-events.d.ts +26 -0
- package/dist/actions/standard/showing/showing-events.d.ts.map +1 -0
- package/dist/actions/standard/showing/showing-events.js +7 -0
- package/dist/actions/standard/showing/showing-events.js.map +1 -0
- package/dist/actions/standard/showing/showing.d.ts +18 -0
- package/dist/actions/standard/showing/showing.d.ts.map +1 -0
- package/dist/actions/standard/showing/showing.js +217 -0
- package/dist/actions/standard/showing/showing.js.map +1 -0
- package/dist/actions/standard/sleeping/index.d.ts +6 -0
- package/dist/actions/standard/sleeping/index.d.ts.map +1 -0
- package/dist/actions/standard/sleeping/index.js +9 -0
- package/dist/actions/standard/sleeping/index.js.map +1 -0
- package/dist/actions/standard/sleeping/sleeping-events.d.ts +49 -0
- package/dist/actions/standard/sleeping/sleeping-events.d.ts.map +1 -0
- package/dist/actions/standard/sleeping/sleeping-events.js +6 -0
- package/dist/actions/standard/sleeping/sleeping-events.js.map +1 -0
- package/dist/actions/standard/sleeping/sleeping.d.ts +19 -0
- package/dist/actions/standard/sleeping/sleeping.d.ts.map +1 -0
- package/dist/actions/standard/sleeping/sleeping.js +124 -0
- package/dist/actions/standard/sleeping/sleeping.js.map +1 -0
- package/dist/actions/standard/smelling/index.d.ts +6 -0
- package/dist/actions/standard/smelling/index.d.ts.map +1 -0
- package/dist/actions/standard/smelling/index.js +24 -0
- package/dist/actions/standard/smelling/index.js.map +1 -0
- package/dist/actions/standard/smelling/smelling-events.d.ts +45 -0
- package/dist/actions/standard/smelling/smelling-events.d.ts.map +1 -0
- package/dist/actions/standard/smelling/smelling-events.js +6 -0
- package/dist/actions/standard/smelling/smelling-events.js.map +1 -0
- package/dist/actions/standard/smelling/smelling.d.ts +18 -0
- package/dist/actions/standard/smelling/smelling.d.ts.map +1 -0
- package/dist/actions/standard/smelling/smelling.js +191 -0
- package/dist/actions/standard/smelling/smelling.js.map +1 -0
- package/dist/actions/standard/switching-shared.d.ts +23 -0
- package/dist/actions/standard/switching-shared.d.ts.map +1 -0
- package/dist/actions/standard/switching-shared.js +84 -0
- package/dist/actions/standard/switching-shared.js.map +1 -0
- package/dist/actions/standard/switching_off/index.d.ts +6 -0
- package/dist/actions/standard/switching_off/index.d.ts.map +1 -0
- package/dist/actions/standard/switching_off/index.js +9 -0
- package/dist/actions/standard/switching_off/index.js.map +1 -0
- package/dist/actions/standard/switching_off/switching_off-events.d.ts +53 -0
- package/dist/actions/standard/switching_off/switching_off-events.d.ts.map +1 -0
- package/dist/actions/standard/switching_off/switching_off-events.js +6 -0
- package/dist/actions/standard/switching_off/switching_off-events.js.map +1 -0
- package/dist/actions/standard/switching_off/switching_off-messages.d.ts +21 -0
- package/dist/actions/standard/switching_off/switching_off-messages.d.ts.map +1 -0
- package/dist/actions/standard/switching_off/switching_off-messages.js +25 -0
- package/dist/actions/standard/switching_off/switching_off-messages.js.map +1 -0
- package/dist/actions/standard/switching_off/switching_off.d.ts +17 -0
- package/dist/actions/standard/switching_off/switching_off.d.ts.map +1 -0
- package/dist/actions/standard/switching_off/switching_off.js +197 -0
- package/dist/actions/standard/switching_off/switching_off.js.map +1 -0
- package/dist/actions/standard/switching_on/index.d.ts +6 -0
- package/dist/actions/standard/switching_on/index.d.ts.map +1 -0
- package/dist/actions/standard/switching_on/index.js +9 -0
- package/dist/actions/standard/switching_on/index.js.map +1 -0
- package/dist/actions/standard/switching_on/switching_on-events.d.ts +57 -0
- package/dist/actions/standard/switching_on/switching_on-events.d.ts.map +1 -0
- package/dist/actions/standard/switching_on/switching_on-events.js +6 -0
- package/dist/actions/standard/switching_on/switching_on-events.js.map +1 -0
- package/dist/actions/standard/switching_on/switching_on-messages.d.ts +21 -0
- package/dist/actions/standard/switching_on/switching_on-messages.d.ts.map +1 -0
- package/dist/actions/standard/switching_on/switching_on-messages.js +25 -0
- package/dist/actions/standard/switching_on/switching_on-messages.js.map +1 -0
- package/dist/actions/standard/switching_on/switching_on.d.ts +17 -0
- package/dist/actions/standard/switching_on/switching_on.d.ts.map +1 -0
- package/dist/actions/standard/switching_on/switching_on.js +261 -0
- package/dist/actions/standard/switching_on/switching_on.js.map +1 -0
- package/dist/actions/standard/taking/index.d.ts +7 -0
- package/dist/actions/standard/taking/index.d.ts.map +1 -0
- package/dist/actions/standard/taking/index.js +11 -0
- package/dist/actions/standard/taking/index.js.map +1 -0
- package/dist/actions/standard/taking/taking-data.d.ts +21 -0
- package/dist/actions/standard/taking/taking-data.d.ts.map +1 -0
- package/dist/actions/standard/taking/taking-data.js +72 -0
- package/dist/actions/standard/taking/taking-data.js.map +1 -0
- package/dist/actions/standard/taking/taking-events.d.ts +52 -0
- package/dist/actions/standard/taking/taking-events.d.ts.map +1 -0
- package/dist/actions/standard/taking/taking-events.js +8 -0
- package/dist/actions/standard/taking/taking-events.js.map +1 -0
- package/dist/actions/standard/taking/taking-messages.d.ts +23 -0
- package/dist/actions/standard/taking/taking-messages.d.ts.map +1 -0
- package/dist/actions/standard/taking/taking-messages.js +27 -0
- package/dist/actions/standard/taking/taking-messages.js.map +1 -0
- package/dist/actions/standard/taking/taking-types.d.ts +97 -0
- package/dist/actions/standard/taking/taking-types.d.ts.map +1 -0
- package/dist/actions/standard/taking/taking-types.js +61 -0
- package/dist/actions/standard/taking/taking-types.js.map +1 -0
- package/dist/actions/standard/taking/taking.d.ts +20 -0
- package/dist/actions/standard/taking/taking.d.ts.map +1 -0
- package/dist/actions/standard/taking/taking.js +333 -0
- package/dist/actions/standard/taking/taking.js.map +1 -0
- package/dist/actions/standard/taking_off/index.d.ts +5 -0
- package/dist/actions/standard/taking_off/index.d.ts.map +1 -0
- package/dist/actions/standard/taking_off/index.js +9 -0
- package/dist/actions/standard/taking_off/index.js.map +1 -0
- package/dist/actions/standard/taking_off/taking-off-events.d.ts +40 -0
- package/dist/actions/standard/taking_off/taking-off-events.d.ts.map +1 -0
- package/dist/actions/standard/taking_off/taking-off-events.js +6 -0
- package/dist/actions/standard/taking_off/taking-off-events.js.map +1 -0
- package/dist/actions/standard/taking_off/taking-off.d.ts +18 -0
- package/dist/actions/standard/taking_off/taking-off.d.ts.map +1 -0
- package/dist/actions/standard/taking_off/taking-off.js +170 -0
- package/dist/actions/standard/taking_off/taking-off.js.map +1 -0
- package/dist/actions/standard/talking/index.d.ts +6 -0
- package/dist/actions/standard/talking/index.d.ts.map +1 -0
- package/dist/actions/standard/talking/index.js +24 -0
- package/dist/actions/standard/talking/index.js.map +1 -0
- package/dist/actions/standard/talking/talking-events.d.ts +43 -0
- package/dist/actions/standard/talking/talking-events.d.ts.map +1 -0
- package/dist/actions/standard/talking/talking-events.js +6 -0
- package/dist/actions/standard/talking/talking-events.js.map +1 -0
- package/dist/actions/standard/talking/talking.d.ts +18 -0
- package/dist/actions/standard/talking/talking.d.ts.map +1 -0
- package/dist/actions/standard/talking/talking.js +199 -0
- package/dist/actions/standard/talking/talking.js.map +1 -0
- package/dist/actions/standard/throwing/index.d.ts +6 -0
- package/dist/actions/standard/throwing/index.d.ts.map +1 -0
- package/dist/actions/standard/throwing/index.js +10 -0
- package/dist/actions/standard/throwing/index.js.map +1 -0
- package/dist/actions/standard/throwing/throwing-events.d.ts +41 -0
- package/dist/actions/standard/throwing/throwing-events.d.ts.map +1 -0
- package/dist/actions/standard/throwing/throwing-events.js +7 -0
- package/dist/actions/standard/throwing/throwing-events.js.map +1 -0
- package/dist/actions/standard/throwing/throwing.d.ts +20 -0
- package/dist/actions/standard/throwing/throwing.d.ts.map +1 -0
- package/dist/actions/standard/throwing/throwing.js +369 -0
- package/dist/actions/standard/throwing/throwing.js.map +1 -0
- package/dist/actions/standard/touching/index.d.ts +6 -0
- package/dist/actions/standard/touching/index.d.ts.map +1 -0
- package/dist/actions/standard/touching/index.js +24 -0
- package/dist/actions/standard/touching/index.js.map +1 -0
- package/dist/actions/standard/touching/touching-events.d.ts +51 -0
- package/dist/actions/standard/touching/touching-events.d.ts.map +1 -0
- package/dist/actions/standard/touching/touching-events.js +6 -0
- package/dist/actions/standard/touching/touching-events.js.map +1 -0
- package/dist/actions/standard/touching/touching.d.ts +18 -0
- package/dist/actions/standard/touching/touching.d.ts.map +1 -0
- package/dist/actions/standard/touching/touching.js +221 -0
- package/dist/actions/standard/touching/touching.js.map +1 -0
- package/dist/actions/standard/undoing/index.d.ts +6 -0
- package/dist/actions/standard/undoing/index.d.ts.map +1 -0
- package/dist/actions/standard/undoing/index.js +24 -0
- package/dist/actions/standard/undoing/index.js.map +1 -0
- package/dist/actions/standard/undoing/undoing-events.d.ts +12 -0
- package/dist/actions/standard/undoing/undoing-events.d.ts.map +1 -0
- package/dist/actions/standard/undoing/undoing-events.js +6 -0
- package/dist/actions/standard/undoing/undoing-events.js.map +1 -0
- package/dist/actions/standard/undoing/undoing.d.ts +13 -0
- package/dist/actions/standard/undoing/undoing.d.ts.map +1 -0
- package/dist/actions/standard/undoing/undoing.js +43 -0
- package/dist/actions/standard/undoing/undoing.js.map +1 -0
- package/dist/actions/standard/unlocking/index.d.ts +8 -0
- package/dist/actions/standard/unlocking/index.d.ts.map +1 -0
- package/dist/actions/standard/unlocking/index.js +11 -0
- package/dist/actions/standard/unlocking/index.js.map +1 -0
- package/dist/actions/standard/unlocking/unlocking-events.d.ts +50 -0
- package/dist/actions/standard/unlocking/unlocking-events.d.ts.map +1 -0
- package/dist/actions/standard/unlocking/unlocking-events.js +8 -0
- package/dist/actions/standard/unlocking/unlocking-events.js.map +1 -0
- package/dist/actions/standard/unlocking/unlocking-messages.d.ts +19 -0
- package/dist/actions/standard/unlocking/unlocking-messages.d.ts.map +1 -0
- package/dist/actions/standard/unlocking/unlocking-messages.js +23 -0
- package/dist/actions/standard/unlocking/unlocking-messages.js.map +1 -0
- package/dist/actions/standard/unlocking/unlocking.d.ts +17 -0
- package/dist/actions/standard/unlocking/unlocking.d.ts.map +1 -0
- package/dist/actions/standard/unlocking/unlocking.js +235 -0
- package/dist/actions/standard/unlocking/unlocking.js.map +1 -0
- package/dist/actions/standard/version/index.d.ts +6 -0
- package/dist/actions/standard/version/index.d.ts.map +1 -0
- package/dist/actions/standard/version/index.js +10 -0
- package/dist/actions/standard/version/index.js.map +1 -0
- package/dist/actions/standard/version/version-events.d.ts +46 -0
- package/dist/actions/standard/version/version-events.d.ts.map +1 -0
- package/dist/actions/standard/version/version-events.js +6 -0
- package/dist/actions/standard/version/version-events.js.map +1 -0
- package/dist/actions/standard/version/version.d.ts +21 -0
- package/dist/actions/standard/version/version.d.ts.map +1 -0
- package/dist/actions/standard/version/version.js +86 -0
- package/dist/actions/standard/version/version.js.map +1 -0
- package/dist/actions/standard/waiting/index.d.ts +6 -0
- package/dist/actions/standard/waiting/index.d.ts.map +1 -0
- package/dist/actions/standard/waiting/index.js +9 -0
- package/dist/actions/standard/waiting/index.js.map +1 -0
- package/dist/actions/standard/waiting/waiting-events.d.ts +31 -0
- package/dist/actions/standard/waiting/waiting-events.d.ts.map +1 -0
- package/dist/actions/standard/waiting/waiting-events.js +6 -0
- package/dist/actions/standard/waiting/waiting-events.js.map +1 -0
- package/dist/actions/standard/waiting/waiting.d.ts +18 -0
- package/dist/actions/standard/waiting/waiting.d.ts.map +1 -0
- package/dist/actions/standard/waiting/waiting.js +65 -0
- package/dist/actions/standard/waiting/waiting.js.map +1 -0
- package/dist/actions/standard/wearable-shared.d.ts +55 -0
- package/dist/actions/standard/wearable-shared.d.ts.map +1 -0
- package/dist/actions/standard/wearable-shared.js +148 -0
- package/dist/actions/standard/wearable-shared.js.map +1 -0
- package/dist/actions/standard/wearing/index.d.ts +5 -0
- package/dist/actions/standard/wearing/index.d.ts.map +1 -0
- package/dist/actions/standard/wearing/index.js +9 -0
- package/dist/actions/standard/wearing/index.js.map +1 -0
- package/dist/actions/standard/wearing/wearing-events.d.ts +49 -0
- package/dist/actions/standard/wearing/wearing-events.d.ts.map +1 -0
- package/dist/actions/standard/wearing/wearing-events.js +6 -0
- package/dist/actions/standard/wearing/wearing-events.js.map +1 -0
- package/dist/actions/standard/wearing/wearing-messages.d.ts +17 -0
- package/dist/actions/standard/wearing/wearing-messages.d.ts.map +1 -0
- package/dist/actions/standard/wearing/wearing-messages.js +21 -0
- package/dist/actions/standard/wearing/wearing-messages.js.map +1 -0
- package/dist/actions/standard/wearing/wearing.d.ts +17 -0
- package/dist/actions/standard/wearing/wearing.d.ts.map +1 -0
- package/dist/actions/standard/wearing/wearing.js +170 -0
- package/dist/actions/standard/wearing/wearing.js.map +1 -0
- package/dist/actions/types.d.ts +36 -0
- package/dist/actions/types.d.ts.map +1 -0
- package/dist/actions/types.js +9 -0
- package/dist/actions/types.js.map +1 -0
- package/dist/capabilities/command-history.d.ts +33 -0
- package/dist/capabilities/command-history.d.ts.map +1 -0
- package/dist/capabilities/command-history.js +24 -0
- package/dist/capabilities/command-history.js.map +1 -0
- package/dist/capabilities/conversation.d.ts +33 -0
- package/dist/capabilities/conversation.d.ts.map +1 -0
- package/dist/capabilities/conversation.js +28 -0
- package/dist/capabilities/conversation.js.map +1 -0
- package/dist/capabilities/debug.d.ts +35 -0
- package/dist/capabilities/debug.d.ts.map +1 -0
- package/dist/capabilities/debug.js +71 -0
- package/dist/capabilities/debug.js.map +1 -0
- package/dist/capabilities/game-meta.d.ts +24 -0
- package/dist/capabilities/game-meta.d.ts.map +1 -0
- package/dist/capabilities/game-meta.js +37 -0
- package/dist/capabilities/game-meta.js.map +1 -0
- package/dist/capabilities/index.d.ts +33 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +52 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/save-restore.d.ts +28 -0
- package/dist/capabilities/save-restore.d.ts.map +1 -0
- package/dist/capabilities/save-restore.js +33 -0
- package/dist/capabilities/save-restore.js.map +1 -0
- package/dist/capabilities/scoring.d.ts +25 -0
- package/dist/capabilities/scoring.d.ts.map +1 -0
- package/dist/capabilities/scoring.js +43 -0
- package/dist/capabilities/scoring.js.map +1 -0
- package/dist/chains/index.d.ts +43 -0
- package/dist/chains/index.d.ts.map +1 -0
- package/dist/chains/index.js +63 -0
- package/dist/chains/index.js.map +1 -0
- package/dist/chains/opened-revealed.d.ts +27 -0
- package/dist/chains/opened-revealed.d.ts.map +1 -0
- package/dist/chains/opened-revealed.js +77 -0
- package/dist/chains/opened-revealed.js.map +1 -0
- package/dist/combat/combat-messages.d.ts +52 -0
- package/dist/combat/combat-messages.d.ts.map +1 -0
- package/dist/combat/combat-messages.js +69 -0
- package/dist/combat/combat-messages.js.map +1 -0
- package/dist/combat/combat-service.d.ts +109 -0
- package/dist/combat/combat-service.d.ts.map +1 -0
- package/dist/combat/combat-service.js +244 -0
- package/dist/combat/combat-service.js.map +1 -0
- package/dist/combat/index.d.ts +8 -0
- package/dist/combat/index.d.ts.map +1 -0
- package/dist/combat/index.js +31 -0
- package/dist/combat/index.js.map +1 -0
- package/dist/events/action-events.d.ts +33 -0
- package/dist/events/action-events.d.ts.map +1 -0
- package/dist/events/action-events.js +10 -0
- package/dist/events/action-events.js.map +1 -0
- package/dist/events/base-event.d.ts +63 -0
- package/dist/events/base-event.d.ts.map +1 -0
- package/dist/events/base-event.js +9 -0
- package/dist/events/base-event.js.map +1 -0
- package/dist/events/common-patterns.d.ts +60 -0
- package/dist/events/common-patterns.d.ts.map +1 -0
- package/dist/events/common-patterns.js +22 -0
- package/dist/events/common-patterns.js.map +1 -0
- package/dist/events/event-registry.d.ts +111 -0
- package/dist/events/event-registry.d.ts.map +1 -0
- package/dist/events/event-registry.js +11 -0
- package/dist/events/event-registry.js.map +1 -0
- package/dist/events/event-utils.d.ts +56 -0
- package/dist/events/event-utils.d.ts.map +1 -0
- package/dist/events/event-utils.js +77 -0
- package/dist/events/event-utils.js.map +1 -0
- package/dist/events/helpers.d.ts +44 -0
- package/dist/events/helpers.d.ts.map +1 -0
- package/dist/events/helpers.js +141 -0
- package/dist/events/helpers.js.map +1 -0
- package/dist/events/index.d.ts +25 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +41 -0
- package/dist/events/index.js.map +1 -0
- package/dist/helpers/index.d.ts +5 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +21 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/multi-object-handler.d.ts +54 -0
- package/dist/helpers/multi-object-handler.d.ts.map +1 -0
- package/dist/helpers/multi-object-handler.js +189 -0
- package/dist/helpers/multi-object-handler.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/inference/implicit-inference.d.ts +75 -0
- package/dist/inference/implicit-inference.d.ts.map +1 -0
- package/dist/inference/implicit-inference.js +132 -0
- package/dist/inference/implicit-inference.js.map +1 -0
- package/dist/inference/index.d.ts +10 -0
- package/dist/inference/index.d.ts.map +1 -0
- package/dist/inference/index.js +16 -0
- package/dist/inference/index.js.map +1 -0
- package/dist/npc/behaviors.d.ts +64 -0
- package/dist/npc/behaviors.d.ts.map +1 -0
- package/dist/npc/behaviors.js +244 -0
- package/dist/npc/behaviors.js.map +1 -0
- package/dist/npc/index.d.ts +10 -0
- package/dist/npc/index.d.ts.map +1 -0
- package/dist/npc/index.js +38 -0
- package/dist/npc/index.js.map +1 -0
- package/dist/npc/npc-messages.d.ts +45 -0
- package/dist/npc/npc-messages.d.ts.map +1 -0
- package/dist/npc/npc-messages.js +52 -0
- package/dist/npc/npc-messages.js.map +1 -0
- package/dist/npc/npc-service.d.ts +84 -0
- package/dist/npc/npc-service.d.ts.map +1 -0
- package/dist/npc/npc-service.js +394 -0
- package/dist/npc/npc-service.js.map +1 -0
- package/dist/npc/types.d.ts +167 -0
- package/dist/npc/types.d.ts.map +1 -0
- package/dist/npc/types.js +8 -0
- package/dist/npc/types.js.map +1 -0
- package/dist/parser/index.d.ts +8 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +22 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/query-handlers/index.d.ts +9 -0
- package/dist/query-handlers/index.d.ts.map +1 -0
- package/dist/query-handlers/index.js +29 -0
- package/dist/query-handlers/index.js.map +1 -0
- package/dist/query-handlers/quit-handler.d.ts +42 -0
- package/dist/query-handlers/quit-handler.d.ts.map +1 -0
- package/dist/query-handlers/quit-handler.js +201 -0
- package/dist/query-handlers/quit-handler.js.map +1 -0
- package/dist/query-handlers/restart-handler.d.ts +42 -0
- package/dist/query-handlers/restart-handler.d.ts.map +1 -0
- package/dist/query-handlers/restart-handler.js +202 -0
- package/dist/query-handlers/restart-handler.js.map +1 -0
- package/dist/scope/index.d.ts +10 -0
- package/dist/scope/index.d.ts.map +1 -0
- package/dist/scope/index.js +26 -0
- package/dist/scope/index.js.map +1 -0
- package/dist/scope/scope-resolver.d.ts +107 -0
- package/dist/scope/scope-resolver.d.ts.map +1 -0
- package/dist/scope/scope-resolver.js +509 -0
- package/dist/scope/scope-resolver.js.map +1 -0
- package/dist/scope/types.d.ts +242 -0
- package/dist/scope/types.d.ts.map +1 -0
- package/dist/scope/types.js +71 -0
- package/dist/scope/types.js.map +1 -0
- package/dist/scope/witness-system.d.ts +83 -0
- package/dist/scope/witness-system.d.ts.map +1 -0
- package/dist/scope/witness-system.js +346 -0
- package/dist/scope/witness-system.js.map +1 -0
- package/dist/services/PerceptionService.d.ts +80 -0
- package/dist/services/PerceptionService.d.ts.map +1 -0
- package/dist/services/PerceptionService.js +189 -0
- package/dist/services/PerceptionService.js.map +1 -0
- package/dist/services/index.d.ts +6 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +13 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/scoring/index.d.ts +6 -0
- package/dist/services/scoring/index.d.ts.map +1 -0
- package/dist/services/scoring/index.js +12 -0
- package/dist/services/scoring/index.js.map +1 -0
- package/dist/services/scoring/scoring-event-processor.d.ts +337 -0
- package/dist/services/scoring/scoring-event-processor.d.ts.map +1 -0
- package/dist/services/scoring/scoring-event-processor.js +613 -0
- package/dist/services/scoring/scoring-event-processor.js.map +1 -0
- package/dist/services/scoring/scoring-service.d.ts +185 -0
- package/dist/services/scoring/scoring-service.d.ts.map +1 -0
- package/dist/services/scoring/scoring-service.js +279 -0
- package/dist/services/scoring/scoring-service.js.map +1 -0
- package/dist/validation/command-validator.d.ts +162 -0
- package/dist/validation/command-validator.d.ts.map +1 -0
- package/dist/validation/command-validator.js +1171 -0
- package/dist/validation/command-validator.js.map +1 -0
- package/dist/validation/index.d.ts +7 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +9 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/types.d.ts +35 -0
- package/dist/validation/types.d.ts.map +1 -0
- package/dist/validation/types.js +8 -0
- package/dist/validation/types.js.map +1 -0
- package/dist/vocabulary/index.d.ts +5 -0
- package/dist/vocabulary/index.d.ts.map +1 -0
- package/dist/vocabulary/index.js +21 -0
- package/dist/vocabulary/index.js.map +1 -0
- package/dist/vocabulary/standard-english.d.ts +27 -0
- package/dist/vocabulary/standard-english.d.ts.map +1 -0
- package/dist/vocabulary/standard-english.js +234 -0
- package/dist/vocabulary/standard-english.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,1171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Command Validator
|
|
4
|
+
*
|
|
5
|
+
* Validates parsed commands against the world model
|
|
6
|
+
* Resolves entities and checks preconditions
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.CommandValidator = void 0;
|
|
10
|
+
const types_1 = require("../scope/types");
|
|
11
|
+
const scope_resolver_1 = require("../scope/scope-resolver");
|
|
12
|
+
/**
|
|
13
|
+
* Enhanced command validator with full entity resolution
|
|
14
|
+
*/
|
|
15
|
+
class CommandValidator {
|
|
16
|
+
world;
|
|
17
|
+
actionRegistry;
|
|
18
|
+
scopeResolver;
|
|
19
|
+
systemEvents;
|
|
20
|
+
/** Current action ID being validated (for disambiguation scoring) */
|
|
21
|
+
currentActionId;
|
|
22
|
+
constructor(world, actionRegistry, scopeResolver) {
|
|
23
|
+
this.world = world;
|
|
24
|
+
this.actionRegistry = actionRegistry;
|
|
25
|
+
this.scopeResolver = scopeResolver || new scope_resolver_1.StandardScopeResolver(world);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Set system event source for debug events
|
|
29
|
+
*/
|
|
30
|
+
setSystemEventSource(eventSource) {
|
|
31
|
+
this.systemEvents = eventSource;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Validate parsed command against world state
|
|
35
|
+
*/
|
|
36
|
+
validate(command) {
|
|
37
|
+
const startTime = Date.now();
|
|
38
|
+
const warnings = [];
|
|
39
|
+
// 1. Validate action exists
|
|
40
|
+
// First try direct lookup by action ID
|
|
41
|
+
let actionHandler = this.actionRegistry.get(command.action);
|
|
42
|
+
// If not found, try to find by pattern (verb)
|
|
43
|
+
if (!actionHandler) {
|
|
44
|
+
const verb = command.structure?.verb?.text || command.action;
|
|
45
|
+
const matches = this.actionRegistry.findByPattern(verb);
|
|
46
|
+
if (matches.length > 0) {
|
|
47
|
+
actionHandler = matches[0]; // Take the highest priority match
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (!actionHandler) {
|
|
51
|
+
return {
|
|
52
|
+
success: false,
|
|
53
|
+
error: {
|
|
54
|
+
type: 'VALIDATION_ERROR',
|
|
55
|
+
code: 'ACTION_NOT_AVAILABLE',
|
|
56
|
+
parsed: command,
|
|
57
|
+
details: { action: command.action }
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
// Store current action ID for disambiguation scoring
|
|
62
|
+
this.currentActionId = actionHandler.id;
|
|
63
|
+
// 2. Resolve direct object if present in parsed command
|
|
64
|
+
let directObject;
|
|
65
|
+
if (command.structure?.directObject) {
|
|
66
|
+
// ADR-080: Multi-object commands ("get all", "drop all but sword")
|
|
67
|
+
// Skip single-entity resolution - let the action handle expansion via expandMultiObject()
|
|
68
|
+
const nounPhrase = command.structure.directObject;
|
|
69
|
+
if (nounPhrase.isAll || nounPhrase.isList) {
|
|
70
|
+
// Leave directObject undefined - action will use isMultiObjectCommand()
|
|
71
|
+
// and expandMultiObject() to handle multiple entities
|
|
72
|
+
directObject = undefined;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
// Normal single-entity resolution
|
|
76
|
+
const metadata = this.getActionMetadata(actionHandler);
|
|
77
|
+
const scope = metadata.directObjectScope || types_1.ScopeLevel.VISIBLE;
|
|
78
|
+
const resolved = this.resolveEntity(nounPhrase, 'direct', scope, command);
|
|
79
|
+
if (!resolved.success) {
|
|
80
|
+
return resolved;
|
|
81
|
+
}
|
|
82
|
+
directObject = resolved.value;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// If no direct object in parsed command, that's fine - let the action decide if it needs one
|
|
86
|
+
// 3. Resolve indirect object if present in parsed command
|
|
87
|
+
let indirectObject;
|
|
88
|
+
if (command.structure?.indirectObject) {
|
|
89
|
+
const metadata = this.getActionMetadata(actionHandler);
|
|
90
|
+
const scope = metadata.indirectObjectScope || types_1.ScopeLevel.VISIBLE;
|
|
91
|
+
const resolved = this.resolveEntity(command.structure.indirectObject, 'indirect', scope, command);
|
|
92
|
+
if (!resolved.success) {
|
|
93
|
+
return resolved;
|
|
94
|
+
}
|
|
95
|
+
indirectObject = resolved.value;
|
|
96
|
+
}
|
|
97
|
+
// 3b. Resolve instrument if present in parsed command (ADR-080)
|
|
98
|
+
// Instruments are tools/weapons marked with .instrument() in grammar patterns
|
|
99
|
+
let instrument;
|
|
100
|
+
if (command.instrument) {
|
|
101
|
+
// Instruments are typically carried or reachable
|
|
102
|
+
const resolved = this.resolveEntity(command.instrument, 'instrument', types_1.ScopeLevel.REACHABLE, command);
|
|
103
|
+
if (!resolved.success) {
|
|
104
|
+
return resolved;
|
|
105
|
+
}
|
|
106
|
+
instrument = resolved.value;
|
|
107
|
+
}
|
|
108
|
+
// 4. Check scope constraints based on action metadata
|
|
109
|
+
const metadata = this.getActionMetadata(actionHandler);
|
|
110
|
+
// Check direct object scope
|
|
111
|
+
if (directObject && metadata.directObjectScope) {
|
|
112
|
+
const scopeCheck = this.checkEntityScope(directObject.entity, metadata.directObjectScope, directObject.parsed.text);
|
|
113
|
+
if (!scopeCheck.success) {
|
|
114
|
+
return {
|
|
115
|
+
success: false,
|
|
116
|
+
error: {
|
|
117
|
+
type: 'VALIDATION_ERROR',
|
|
118
|
+
code: 'ENTITY_NOT_VISIBLE',
|
|
119
|
+
parsed: command,
|
|
120
|
+
details: {
|
|
121
|
+
entity: directObject.entity.id,
|
|
122
|
+
entityName: directObject.parsed.text,
|
|
123
|
+
scopeCode: scopeCheck.code
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// Check indirect object scope
|
|
130
|
+
if (indirectObject && metadata.indirectObjectScope) {
|
|
131
|
+
const scopeCheck = this.checkEntityScope(indirectObject.entity, metadata.indirectObjectScope, indirectObject.parsed.text);
|
|
132
|
+
if (!scopeCheck.success) {
|
|
133
|
+
return {
|
|
134
|
+
success: false,
|
|
135
|
+
error: {
|
|
136
|
+
type: 'VALIDATION_ERROR',
|
|
137
|
+
code: 'ENTITY_NOT_VISIBLE',
|
|
138
|
+
parsed: command,
|
|
139
|
+
details: {
|
|
140
|
+
entity: indirectObject.entity.id,
|
|
141
|
+
entityName: indirectObject.parsed.text,
|
|
142
|
+
scopeCode: scopeCheck.code
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// 5. Check action-specific preconditions
|
|
149
|
+
const preconditionCheck = this.checkActionPreconditions(actionHandler, directObject?.entity, indirectObject?.entity);
|
|
150
|
+
if (!preconditionCheck.success) {
|
|
151
|
+
return {
|
|
152
|
+
success: false,
|
|
153
|
+
error: {
|
|
154
|
+
type: 'VALIDATION_ERROR',
|
|
155
|
+
code: 'PRECONDITION_FAILED',
|
|
156
|
+
parsed: command,
|
|
157
|
+
details: preconditionCheck.details
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
// Success - build validated command with scope info
|
|
162
|
+
const validationTime = Date.now() - startTime;
|
|
163
|
+
// Build scope info for resolved entities
|
|
164
|
+
const scopeInfo = {};
|
|
165
|
+
if (directObject) {
|
|
166
|
+
const player = this.world.getPlayer();
|
|
167
|
+
const entityScope = this.scopeResolver.getScope(player, directObject.entity);
|
|
168
|
+
const perceivedBy = this.getPerceivedSenses(player, directObject.entity);
|
|
169
|
+
scopeInfo.directObject = {
|
|
170
|
+
level: entityScope,
|
|
171
|
+
perceivedBy
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
if (indirectObject) {
|
|
175
|
+
const player = this.world.getPlayer();
|
|
176
|
+
const entityScope = this.scopeResolver.getScope(player, indirectObject.entity);
|
|
177
|
+
const perceivedBy = this.getPerceivedSenses(player, indirectObject.entity);
|
|
178
|
+
scopeInfo.indirectObject = {
|
|
179
|
+
level: entityScope,
|
|
180
|
+
perceivedBy
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
if (instrument) {
|
|
184
|
+
const player = this.world.getPlayer();
|
|
185
|
+
const entityScope = this.scopeResolver.getScope(player, instrument.entity);
|
|
186
|
+
const perceivedBy = this.getPerceivedSenses(player, instrument.entity);
|
|
187
|
+
scopeInfo.instrument = {
|
|
188
|
+
level: entityScope,
|
|
189
|
+
perceivedBy
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
const validatedCommand = {
|
|
193
|
+
parsed: command,
|
|
194
|
+
actionId: actionHandler.id,
|
|
195
|
+
directObject,
|
|
196
|
+
indirectObject,
|
|
197
|
+
instrument,
|
|
198
|
+
metadata: {
|
|
199
|
+
validationTime,
|
|
200
|
+
warnings: warnings.length > 0 ? warnings : undefined
|
|
201
|
+
},
|
|
202
|
+
...(Object.keys(scopeInfo).length > 0 && { scopeInfo })
|
|
203
|
+
};
|
|
204
|
+
return {
|
|
205
|
+
success: true,
|
|
206
|
+
value: validatedCommand
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Re-validate a command with explicit entity selections
|
|
211
|
+
* Used after AMBIGUOUS_ENTITY error when user selects from disambiguation choices
|
|
212
|
+
*/
|
|
213
|
+
resolveWithSelection(command, selections) {
|
|
214
|
+
const startTime = Date.now();
|
|
215
|
+
const warnings = [];
|
|
216
|
+
// 1. Validate action exists
|
|
217
|
+
let actionHandler = this.actionRegistry.get(command.action);
|
|
218
|
+
if (!actionHandler) {
|
|
219
|
+
const verb = command.structure?.verb?.text || command.action;
|
|
220
|
+
const matches = this.actionRegistry.findByPattern(verb);
|
|
221
|
+
if (matches.length > 0) {
|
|
222
|
+
actionHandler = matches[0];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (!actionHandler) {
|
|
226
|
+
return {
|
|
227
|
+
success: false,
|
|
228
|
+
error: {
|
|
229
|
+
type: 'VALIDATION_ERROR',
|
|
230
|
+
code: 'ACTION_NOT_AVAILABLE',
|
|
231
|
+
parsed: command,
|
|
232
|
+
details: { action: command.action }
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
this.currentActionId = actionHandler.id;
|
|
237
|
+
// 2. Resolve direct object - use selection if provided
|
|
238
|
+
let directObject;
|
|
239
|
+
if (command.structure?.directObject) {
|
|
240
|
+
const nounPhrase = command.structure.directObject;
|
|
241
|
+
// ADR-080: Multi-object commands bypass resolution
|
|
242
|
+
if (nounPhrase.isAll || nounPhrase.isList) {
|
|
243
|
+
directObject = undefined;
|
|
244
|
+
}
|
|
245
|
+
else if (selections.directObject) {
|
|
246
|
+
// Use explicit selection
|
|
247
|
+
const entity = this.world.getEntity(selections.directObject);
|
|
248
|
+
if (!entity) {
|
|
249
|
+
return {
|
|
250
|
+
success: false,
|
|
251
|
+
error: {
|
|
252
|
+
type: 'VALIDATION_ERROR',
|
|
253
|
+
code: 'ENTITY_NOT_FOUND',
|
|
254
|
+
parsed: command,
|
|
255
|
+
details: {
|
|
256
|
+
slot: 'directObject',
|
|
257
|
+
selectedId: selections.directObject,
|
|
258
|
+
reason: 'Selected entity no longer exists'
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
directObject = {
|
|
264
|
+
entity,
|
|
265
|
+
parsed: nounPhrase
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
// Normal resolution
|
|
270
|
+
const metadata = this.getActionMetadata(actionHandler);
|
|
271
|
+
const scope = metadata.directObjectScope || types_1.ScopeLevel.VISIBLE;
|
|
272
|
+
const resolved = this.resolveEntity(nounPhrase, 'direct', scope, command);
|
|
273
|
+
if (!resolved.success) {
|
|
274
|
+
return resolved;
|
|
275
|
+
}
|
|
276
|
+
directObject = resolved.value;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
// 3. Resolve indirect object - use selection if provided
|
|
280
|
+
let indirectObject;
|
|
281
|
+
if (command.structure?.indirectObject) {
|
|
282
|
+
if (selections.indirectObject) {
|
|
283
|
+
const entity = this.world.getEntity(selections.indirectObject);
|
|
284
|
+
if (!entity) {
|
|
285
|
+
return {
|
|
286
|
+
success: false,
|
|
287
|
+
error: {
|
|
288
|
+
type: 'VALIDATION_ERROR',
|
|
289
|
+
code: 'ENTITY_NOT_FOUND',
|
|
290
|
+
parsed: command,
|
|
291
|
+
details: {
|
|
292
|
+
slot: 'indirectObject',
|
|
293
|
+
selectedId: selections.indirectObject,
|
|
294
|
+
reason: 'Selected entity no longer exists'
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
indirectObject = {
|
|
300
|
+
entity,
|
|
301
|
+
parsed: command.structure.indirectObject
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
const metadata = this.getActionMetadata(actionHandler);
|
|
306
|
+
const scope = metadata.indirectObjectScope || types_1.ScopeLevel.VISIBLE;
|
|
307
|
+
const resolved = this.resolveEntity(command.structure.indirectObject, 'indirect', scope, command);
|
|
308
|
+
if (!resolved.success) {
|
|
309
|
+
return resolved;
|
|
310
|
+
}
|
|
311
|
+
indirectObject = resolved.value;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
// 3b. Resolve instrument - use selection if provided
|
|
315
|
+
let instrument;
|
|
316
|
+
if (command.instrument) {
|
|
317
|
+
if (selections.instrument) {
|
|
318
|
+
const entity = this.world.getEntity(selections.instrument);
|
|
319
|
+
if (!entity) {
|
|
320
|
+
return {
|
|
321
|
+
success: false,
|
|
322
|
+
error: {
|
|
323
|
+
type: 'VALIDATION_ERROR',
|
|
324
|
+
code: 'ENTITY_NOT_FOUND',
|
|
325
|
+
parsed: command,
|
|
326
|
+
details: {
|
|
327
|
+
slot: 'instrument',
|
|
328
|
+
selectedId: selections.instrument,
|
|
329
|
+
reason: 'Selected entity no longer exists'
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
instrument = {
|
|
335
|
+
entity,
|
|
336
|
+
parsed: command.instrument
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
const resolved = this.resolveEntity(command.instrument, 'instrument', types_1.ScopeLevel.REACHABLE, command);
|
|
341
|
+
if (!resolved.success) {
|
|
342
|
+
return resolved;
|
|
343
|
+
}
|
|
344
|
+
instrument = resolved.value;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
// 4. Check scope constraints based on action metadata
|
|
348
|
+
const metadata = this.getActionMetadata(actionHandler);
|
|
349
|
+
if (directObject && metadata.directObjectScope) {
|
|
350
|
+
const scopeCheck = this.checkEntityScope(directObject.entity, metadata.directObjectScope, directObject.parsed.text);
|
|
351
|
+
if (!scopeCheck.success) {
|
|
352
|
+
return {
|
|
353
|
+
success: false,
|
|
354
|
+
error: {
|
|
355
|
+
type: 'VALIDATION_ERROR',
|
|
356
|
+
code: 'ENTITY_NOT_VISIBLE',
|
|
357
|
+
parsed: command,
|
|
358
|
+
details: {
|
|
359
|
+
entity: directObject.entity.id,
|
|
360
|
+
entityName: directObject.parsed.text,
|
|
361
|
+
scopeCode: scopeCheck.code
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
if (indirectObject && metadata.indirectObjectScope) {
|
|
368
|
+
const scopeCheck = this.checkEntityScope(indirectObject.entity, metadata.indirectObjectScope, indirectObject.parsed.text);
|
|
369
|
+
if (!scopeCheck.success) {
|
|
370
|
+
return {
|
|
371
|
+
success: false,
|
|
372
|
+
error: {
|
|
373
|
+
type: 'VALIDATION_ERROR',
|
|
374
|
+
code: 'ENTITY_NOT_VISIBLE',
|
|
375
|
+
parsed: command,
|
|
376
|
+
details: {
|
|
377
|
+
entity: indirectObject.entity.id,
|
|
378
|
+
entityName: indirectObject.parsed.text,
|
|
379
|
+
scopeCode: scopeCheck.code
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
// 5. Check action-specific preconditions
|
|
386
|
+
const preconditionCheck = this.checkActionPreconditions(actionHandler, directObject?.entity, indirectObject?.entity);
|
|
387
|
+
if (!preconditionCheck.success) {
|
|
388
|
+
return {
|
|
389
|
+
success: false,
|
|
390
|
+
error: {
|
|
391
|
+
type: 'VALIDATION_ERROR',
|
|
392
|
+
code: 'PRECONDITION_FAILED',
|
|
393
|
+
parsed: command,
|
|
394
|
+
details: preconditionCheck.details
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
// Success - build validated command with scope info
|
|
399
|
+
const validationTime = Date.now() - startTime;
|
|
400
|
+
const scopeInfo = {};
|
|
401
|
+
if (directObject) {
|
|
402
|
+
const player = this.world.getPlayer();
|
|
403
|
+
const entityScope = this.scopeResolver.getScope(player, directObject.entity);
|
|
404
|
+
const perceivedBy = this.getPerceivedSenses(player, directObject.entity);
|
|
405
|
+
scopeInfo.directObject = {
|
|
406
|
+
level: entityScope,
|
|
407
|
+
perceivedBy
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
if (indirectObject) {
|
|
411
|
+
const player = this.world.getPlayer();
|
|
412
|
+
const entityScope = this.scopeResolver.getScope(player, indirectObject.entity);
|
|
413
|
+
const perceivedBy = this.getPerceivedSenses(player, indirectObject.entity);
|
|
414
|
+
scopeInfo.indirectObject = {
|
|
415
|
+
level: entityScope,
|
|
416
|
+
perceivedBy
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
if (instrument) {
|
|
420
|
+
const player = this.world.getPlayer();
|
|
421
|
+
const entityScope = this.scopeResolver.getScope(player, instrument.entity);
|
|
422
|
+
const perceivedBy = this.getPerceivedSenses(player, instrument.entity);
|
|
423
|
+
scopeInfo.instrument = {
|
|
424
|
+
level: entityScope,
|
|
425
|
+
perceivedBy
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
const validatedCommand = {
|
|
429
|
+
parsed: command,
|
|
430
|
+
actionId: actionHandler.id,
|
|
431
|
+
directObject,
|
|
432
|
+
indirectObject,
|
|
433
|
+
instrument,
|
|
434
|
+
metadata: {
|
|
435
|
+
validationTime,
|
|
436
|
+
warnings: warnings.length > 0 ? warnings : undefined
|
|
437
|
+
},
|
|
438
|
+
...(Object.keys(scopeInfo).length > 0 && { scopeInfo })
|
|
439
|
+
};
|
|
440
|
+
this.emitDebugEvent('entity_resolution', command, {
|
|
441
|
+
method: 'resolveWithSelection',
|
|
442
|
+
selections,
|
|
443
|
+
success: true
|
|
444
|
+
});
|
|
445
|
+
return {
|
|
446
|
+
success: true,
|
|
447
|
+
value: validatedCommand
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Resolve an entity reference with full matching logic
|
|
452
|
+
*/
|
|
453
|
+
resolveEntity(ref, objectType, requiredScope, command) {
|
|
454
|
+
if (!ref) {
|
|
455
|
+
throw new Error('Cannot resolve undefined reference');
|
|
456
|
+
}
|
|
457
|
+
this.emitDebugEvent('entity_resolution', command, {
|
|
458
|
+
objectType,
|
|
459
|
+
reference: ref,
|
|
460
|
+
requiredScope,
|
|
461
|
+
startTime: Date.now()
|
|
462
|
+
});
|
|
463
|
+
// ADR-089: Handle pre-resolved entity ID (from pronoun resolution in parser)
|
|
464
|
+
if (ref.entityId) {
|
|
465
|
+
const resolved = this.resolveEntityById(ref.entityId, ref);
|
|
466
|
+
if (resolved) {
|
|
467
|
+
this.emitDebugEvent('entity_resolution', command, {
|
|
468
|
+
objectType,
|
|
469
|
+
preResolvedEntityId: ref.entityId,
|
|
470
|
+
entity: resolved.entity.id
|
|
471
|
+
});
|
|
472
|
+
return { success: true, value: resolved };
|
|
473
|
+
}
|
|
474
|
+
// Entity ID was set but entity not found - fall through to error
|
|
475
|
+
}
|
|
476
|
+
// Find candidate entities by head noun (e.g., "box" from "wooden box")
|
|
477
|
+
// The head noun is the main identifier, modifiers are used for disambiguation
|
|
478
|
+
const searchTerm = ref.head || ref.text;
|
|
479
|
+
let candidates = [];
|
|
480
|
+
// For AWARE scope (hearing/smelling), we need to search more broadly
|
|
481
|
+
// because entities might be in other rooms
|
|
482
|
+
const needsBroadSearch = requiredScope === types_1.ScopeLevel.AWARE;
|
|
483
|
+
if (needsBroadSearch) {
|
|
484
|
+
// For audible/detectable, search all entities (except rooms/player)
|
|
485
|
+
// and let scope filtering handle visibility
|
|
486
|
+
candidates = this.world.getAllEntities().filter(e => e.type !== 'room' && e.id !== this.world.getPlayer()?.id);
|
|
487
|
+
// Filter candidates by name/type/synonym match with head noun
|
|
488
|
+
candidates = candidates.filter(entity => {
|
|
489
|
+
const name = this.getEntityName(entity).toLowerCase();
|
|
490
|
+
const type = entity.type?.toLowerCase() || '';
|
|
491
|
+
const synonyms = this.getEntitySynonyms(entity).map(s => s.toLowerCase());
|
|
492
|
+
const searchLower = searchTerm.toLowerCase();
|
|
493
|
+
return name === searchLower || type === searchLower || synonyms.includes(searchLower);
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
else {
|
|
497
|
+
// For other scopes, use targeted search by head noun
|
|
498
|
+
// Look for entities by name, type, or synonym
|
|
499
|
+
const byName = this.getEntitiesByName(searchTerm);
|
|
500
|
+
candidates = byName;
|
|
501
|
+
// Also check type matches
|
|
502
|
+
const byType = this.getEntitiesByType(searchTerm);
|
|
503
|
+
candidates.push(...byType);
|
|
504
|
+
// And synonym matches
|
|
505
|
+
const bySynonym = this.getEntitiesBySynonym(searchTerm);
|
|
506
|
+
candidates.push(...bySynonym);
|
|
507
|
+
this.emitDebugEvent('entity_search', command, {
|
|
508
|
+
searchTerm,
|
|
509
|
+
byName: byName.length,
|
|
510
|
+
byType: byType.length,
|
|
511
|
+
bySynonym: bySynonym.length,
|
|
512
|
+
totalBeforeDedupe: candidates.length
|
|
513
|
+
});
|
|
514
|
+
// Remove duplicates
|
|
515
|
+
candidates = candidates.filter((e, i, arr) => arr.findIndex(x => x.id === e.id) === i);
|
|
516
|
+
// Fallback: If no candidates found by name/type/synonym, try adjective search
|
|
517
|
+
// This handles "press yellow" when yellow is an adjective on "yellow button"
|
|
518
|
+
if (candidates.length === 0) {
|
|
519
|
+
const byAdjective = this.getEntitiesByAdjective(searchTerm);
|
|
520
|
+
if (byAdjective.length > 0) {
|
|
521
|
+
candidates = byAdjective;
|
|
522
|
+
this.emitDebugEvent('entity_search', command, {
|
|
523
|
+
searchTerm,
|
|
524
|
+
byAdjective: byAdjective.length,
|
|
525
|
+
fallback: true
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
// Now filter by scope
|
|
531
|
+
let entitiesInScope = this.filterByScope(candidates, requiredScope);
|
|
532
|
+
// Second adjective fallback: if scope filtering eliminated all candidates,
|
|
533
|
+
// try adjective search and filter those by scope
|
|
534
|
+
if (entitiesInScope.length === 0 && candidates.length > 0) {
|
|
535
|
+
const byAdjective = this.getEntitiesByAdjective(searchTerm);
|
|
536
|
+
if (byAdjective.length > 0) {
|
|
537
|
+
const adjectiveInScope = this.filterByScope(byAdjective, requiredScope);
|
|
538
|
+
if (adjectiveInScope.length > 0) {
|
|
539
|
+
candidates = byAdjective;
|
|
540
|
+
entitiesInScope = adjectiveInScope;
|
|
541
|
+
this.emitDebugEvent('entity_search', command, {
|
|
542
|
+
searchTerm,
|
|
543
|
+
byAdjective: byAdjective.length,
|
|
544
|
+
adjectiveInScope: adjectiveInScope.length,
|
|
545
|
+
fallbackAfterScope: true
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
// Get detailed scope information for all candidates
|
|
551
|
+
const candidateScopes = [];
|
|
552
|
+
const player = this.world.getPlayer();
|
|
553
|
+
if (player) {
|
|
554
|
+
for (const entity of candidates) {
|
|
555
|
+
const entityScope = this.scopeResolver.getScope(player, entity);
|
|
556
|
+
candidateScopes.push({
|
|
557
|
+
id: entity.id,
|
|
558
|
+
name: this.getEntityName(entity),
|
|
559
|
+
type: entity.type,
|
|
560
|
+
location: this.world.getLocation(entity.id),
|
|
561
|
+
scope: entityScope,
|
|
562
|
+
meetsRequired: this.filterByScope([entity], requiredScope).length > 0,
|
|
563
|
+
visible: this.isEntityVisible(entity),
|
|
564
|
+
reachable: this.isEntityReachable(entity),
|
|
565
|
+
touchable: this.isEntityTouchable(entity)
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
this.emitDebugEvent('scope_check', command, {
|
|
570
|
+
objectType,
|
|
571
|
+
requiredScope,
|
|
572
|
+
totalCandidates: candidates.length,
|
|
573
|
+
entitiesInScope: entitiesInScope.length,
|
|
574
|
+
candidateScopes,
|
|
575
|
+
scopeDetails: entitiesInScope.map(e => ({
|
|
576
|
+
id: e.id,
|
|
577
|
+
name: this.getEntityName(e),
|
|
578
|
+
visible: this.isEntityVisible(e),
|
|
579
|
+
reachable: this.isEntityReachable(e),
|
|
580
|
+
touchable: this.isEntityTouchable(e)
|
|
581
|
+
}))
|
|
582
|
+
});
|
|
583
|
+
// Score only the entities that are in scope
|
|
584
|
+
const scoredMatches = this.scoreEntities(entitiesInScope, ref);
|
|
585
|
+
// Filter out zero-score matches
|
|
586
|
+
const viableMatches = scoredMatches.filter(m => m.score > 0);
|
|
587
|
+
if (viableMatches.length === 0) {
|
|
588
|
+
this.emitDebugEvent('validation_error', command, {
|
|
589
|
+
errorType: 'NO_MATCHES',
|
|
590
|
+
reference: ref,
|
|
591
|
+
scope: requiredScope,
|
|
592
|
+
checkedEntities: entitiesInScope.length
|
|
593
|
+
});
|
|
594
|
+
return {
|
|
595
|
+
success: false,
|
|
596
|
+
error: {
|
|
597
|
+
type: 'VALIDATION_ERROR',
|
|
598
|
+
code: 'ENTITY_NOT_FOUND',
|
|
599
|
+
parsed: command,
|
|
600
|
+
details: {
|
|
601
|
+
searchText: ref.text,
|
|
602
|
+
candidates: ref.candidates,
|
|
603
|
+
scope: requiredScope
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
// Handle ambiguity
|
|
609
|
+
if (viableMatches.length > 1) {
|
|
610
|
+
const resolved = this.resolveAmbiguity(viableMatches, ref, command);
|
|
611
|
+
if (resolved) {
|
|
612
|
+
return {
|
|
613
|
+
success: true,
|
|
614
|
+
value: {
|
|
615
|
+
entity: resolved.entity,
|
|
616
|
+
parsed: ref
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
// Phase 5: If user specified modifiers (adjectives) but NO candidate matches them,
|
|
621
|
+
// this is ENTITY_NOT_FOUND (the specific entity doesn't exist), not AMBIGUOUS_ENTITY.
|
|
622
|
+
// Example: "green ball" when only red and blue balls exist -> ENTITY_NOT_FOUND
|
|
623
|
+
//
|
|
624
|
+
// Note: The parser may not always populate modifiers, so we also extract them
|
|
625
|
+
// by comparing text to head (e.g., "green ball" vs "ball" -> modifier "green")
|
|
626
|
+
let modifiers = ref.modifiers || [];
|
|
627
|
+
if (modifiers.length === 0 && ref.text && ref.head) {
|
|
628
|
+
const head = ref.head.toLowerCase();
|
|
629
|
+
const words = ref.text.toLowerCase().split(/\s+/).filter(w => w !== head);
|
|
630
|
+
// Filter out common articles/determiners that aren't adjectives
|
|
631
|
+
const nonModifiers = ['the', 'a', 'an', 'all', 'some', 'every', 'any', 'my'];
|
|
632
|
+
modifiers = words.filter(w => !nonModifiers.includes(w));
|
|
633
|
+
}
|
|
634
|
+
if (modifiers.length > 0) {
|
|
635
|
+
const anyModifierMatch = viableMatches.some(m => m.matchReasons.some(r => r.startsWith('modifier_match_')));
|
|
636
|
+
if (!anyModifierMatch) {
|
|
637
|
+
// User asked for specific adjective(s) that no entity has
|
|
638
|
+
this.emitDebugEvent('entity_resolution', command, {
|
|
639
|
+
objectType,
|
|
640
|
+
resolved: false,
|
|
641
|
+
reason: 'modifiers_not_matched',
|
|
642
|
+
searchText: ref.text,
|
|
643
|
+
specifiedModifiers: modifiers
|
|
644
|
+
});
|
|
645
|
+
return {
|
|
646
|
+
success: false,
|
|
647
|
+
error: {
|
|
648
|
+
type: 'VALIDATION_ERROR',
|
|
649
|
+
code: 'ENTITY_NOT_FOUND',
|
|
650
|
+
parsed: command,
|
|
651
|
+
details: {
|
|
652
|
+
searchText: ref.text,
|
|
653
|
+
modifiers,
|
|
654
|
+
nearMatches: viableMatches.slice(0, 3).map(m => this.getEntityName(m.entity))
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
// Still ambiguous - return error with choices for disambiguation prompt
|
|
661
|
+
// Phase 5: Include entity IDs so caller can re-resolve after user selection
|
|
662
|
+
const choices = viableMatches.slice(0, 5).map(m => ({
|
|
663
|
+
id: m.entity.id,
|
|
664
|
+
name: this.getEntityName(m.entity),
|
|
665
|
+
description: this.getEntityDescription(m.entity),
|
|
666
|
+
score: m.score,
|
|
667
|
+
matchReasons: m.matchReasons
|
|
668
|
+
}));
|
|
669
|
+
this.emitDebugEvent('disambiguation_required', command, {
|
|
670
|
+
objectType,
|
|
671
|
+
searchText: ref.text,
|
|
672
|
+
candidateCount: viableMatches.length,
|
|
673
|
+
topCandidates: choices
|
|
674
|
+
});
|
|
675
|
+
return {
|
|
676
|
+
success: false,
|
|
677
|
+
error: {
|
|
678
|
+
type: 'VALIDATION_ERROR',
|
|
679
|
+
code: 'AMBIGUOUS_ENTITY', // Distinct from ENTITY_NOT_FOUND
|
|
680
|
+
parsed: command,
|
|
681
|
+
details: {
|
|
682
|
+
ambiguousEntities: choices,
|
|
683
|
+
searchText: ref.text,
|
|
684
|
+
matchCount: viableMatches.length,
|
|
685
|
+
objectType // 'direct', 'indirect', or 'instrument'
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
// Single match
|
|
691
|
+
const match = viableMatches[0];
|
|
692
|
+
this.emitDebugEvent('entity_resolution', command, {
|
|
693
|
+
objectType,
|
|
694
|
+
resolved: true,
|
|
695
|
+
entity: match.entity.id,
|
|
696
|
+
score: match.score,
|
|
697
|
+
matchReasons: match.matchReasons
|
|
698
|
+
});
|
|
699
|
+
return {
|
|
700
|
+
success: true,
|
|
701
|
+
value: {
|
|
702
|
+
entity: match.entity,
|
|
703
|
+
parsed: ref
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Get entities by exact name match
|
|
709
|
+
*/
|
|
710
|
+
getEntitiesByName(name) {
|
|
711
|
+
// For now, use findWhere until WorldModel has a name index
|
|
712
|
+
const normalizedName = name.toLowerCase();
|
|
713
|
+
return this.world.findWhere(entity => {
|
|
714
|
+
// Skip rooms and player
|
|
715
|
+
if (entity.type === 'room' || entity.id === this.world.getPlayer()?.id) {
|
|
716
|
+
return false;
|
|
717
|
+
}
|
|
718
|
+
// Check exact name match
|
|
719
|
+
const entityName = this.getEntityName(entity).toLowerCase();
|
|
720
|
+
return entityName === normalizedName;
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Get entities by type
|
|
725
|
+
*/
|
|
726
|
+
getEntitiesByType(type) {
|
|
727
|
+
const normalizedType = type.toLowerCase();
|
|
728
|
+
return this.world.findByType(normalizedType);
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* Get entities by synonym
|
|
732
|
+
*/
|
|
733
|
+
getEntitiesBySynonym(synonym) {
|
|
734
|
+
const normalizedSynonym = synonym.toLowerCase();
|
|
735
|
+
return this.world.findWhere(entity => {
|
|
736
|
+
// Skip rooms and player
|
|
737
|
+
if (entity.type === 'room' || entity.id === this.world.getPlayer()?.id) {
|
|
738
|
+
return false;
|
|
739
|
+
}
|
|
740
|
+
const synonyms = this.getEntitySynonyms(entity).map(s => s.toLowerCase());
|
|
741
|
+
return synonyms.includes(normalizedSynonym);
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Get entities by adjective (fallback for "press yellow" style commands)
|
|
746
|
+
* When no name/alias match exists, find entities where the search term is an adjective
|
|
747
|
+
*/
|
|
748
|
+
getEntitiesByAdjective(adjective) {
|
|
749
|
+
const normalizedAdjective = adjective.toLowerCase();
|
|
750
|
+
return this.world.findWhere(entity => {
|
|
751
|
+
// Skip rooms and player
|
|
752
|
+
if (entity.type === 'room' || entity.id === this.world.getPlayer()?.id) {
|
|
753
|
+
return false;
|
|
754
|
+
}
|
|
755
|
+
const adjectives = this.getEntityAdjectives(entity).map(a => a.toLowerCase());
|
|
756
|
+
return adjectives.includes(normalizedAdjective);
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Filter entities by scope level
|
|
761
|
+
*/
|
|
762
|
+
filterByScope(entities, scope) {
|
|
763
|
+
const player = this.world.getPlayer();
|
|
764
|
+
if (!player)
|
|
765
|
+
return [];
|
|
766
|
+
return entities.filter(entity => {
|
|
767
|
+
const entityScope = this.scopeResolver.getScope(player, entity);
|
|
768
|
+
// Check if entity meets the required scope level
|
|
769
|
+
switch (scope) {
|
|
770
|
+
case types_1.ScopeLevel.CARRIED:
|
|
771
|
+
return entityScope === types_1.ScopeLevel.CARRIED;
|
|
772
|
+
case types_1.ScopeLevel.REACHABLE:
|
|
773
|
+
return entityScope === types_1.ScopeLevel.CARRIED || entityScope === types_1.ScopeLevel.REACHABLE;
|
|
774
|
+
case types_1.ScopeLevel.VISIBLE:
|
|
775
|
+
return entityScope === types_1.ScopeLevel.CARRIED ||
|
|
776
|
+
entityScope === types_1.ScopeLevel.REACHABLE ||
|
|
777
|
+
entityScope === types_1.ScopeLevel.VISIBLE;
|
|
778
|
+
case types_1.ScopeLevel.AWARE:
|
|
779
|
+
// For aware, check if we can hear or smell it
|
|
780
|
+
const canHear = this.scopeResolver.canHear && this.scopeResolver.canHear(player, entity);
|
|
781
|
+
const canSmell = this.scopeResolver.canSmell && this.scopeResolver.canSmell(player, entity);
|
|
782
|
+
return canHear || canSmell || entityScope >= types_1.ScopeLevel.AWARE;
|
|
783
|
+
default:
|
|
784
|
+
// Use numeric comparison for other scope levels
|
|
785
|
+
return entityScope >= scope;
|
|
786
|
+
}
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Score entities against a reference
|
|
791
|
+
*/
|
|
792
|
+
scoreEntities(entities, ref) {
|
|
793
|
+
if (!ref)
|
|
794
|
+
return [];
|
|
795
|
+
const scored = [];
|
|
796
|
+
const searchTerm = (ref.head || ref.text).toLowerCase();
|
|
797
|
+
// Extract modifiers from ref, or infer from text vs head if not set
|
|
798
|
+
// (The parser may not always populate the modifiers field)
|
|
799
|
+
let modifiers = ref.modifiers || [];
|
|
800
|
+
if (modifiers.length === 0 && ref.text && ref.head) {
|
|
801
|
+
const head = ref.head.toLowerCase();
|
|
802
|
+
const words = ref.text.toLowerCase().split(/\s+/).filter(w => w !== head);
|
|
803
|
+
const nonModifiers = ['the', 'a', 'an', 'all', 'some', 'every', 'any', 'my'];
|
|
804
|
+
modifiers = words.filter(w => !nonModifiers.includes(w));
|
|
805
|
+
}
|
|
806
|
+
for (const entity of entities) {
|
|
807
|
+
let score = 0;
|
|
808
|
+
const matchReasons = [];
|
|
809
|
+
// Get entity properties
|
|
810
|
+
const name = this.getEntityName(entity).toLowerCase();
|
|
811
|
+
const type = entity.type?.toLowerCase() || '';
|
|
812
|
+
const adjectives = this.getEntityAdjectives(entity).map(a => a.toLowerCase());
|
|
813
|
+
const synonyms = this.getEntitySynonyms(entity).map(s => s.toLowerCase());
|
|
814
|
+
// Base score for matching the search term (head noun)
|
|
815
|
+
if (name === searchTerm) {
|
|
816
|
+
score += 10;
|
|
817
|
+
matchReasons.push('exact_name_match');
|
|
818
|
+
}
|
|
819
|
+
else if (type === searchTerm) {
|
|
820
|
+
score += 8;
|
|
821
|
+
matchReasons.push('type_match');
|
|
822
|
+
}
|
|
823
|
+
else if (synonyms.includes(searchTerm)) {
|
|
824
|
+
score += 6;
|
|
825
|
+
matchReasons.push('synonym_match');
|
|
826
|
+
}
|
|
827
|
+
else if (adjectives.includes(searchTerm)) {
|
|
828
|
+
// Adjective fallback: "press yellow" finds "yellow button"
|
|
829
|
+
score += 4;
|
|
830
|
+
matchReasons.push('adjective_match');
|
|
831
|
+
}
|
|
832
|
+
// Modifier matching - this is key for disambiguation
|
|
833
|
+
// If the user specified modifiers, entities that match them score higher
|
|
834
|
+
for (const modifier of modifiers) {
|
|
835
|
+
if (adjectives.includes(modifier.toLowerCase())) {
|
|
836
|
+
score += 5;
|
|
837
|
+
matchReasons.push(`modifier_match_${modifier}`);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
// Penalty if entity has adjectives that weren't specified
|
|
841
|
+
// This helps "red ball" not match when user just says "ball" if there's also a plain ball
|
|
842
|
+
if (modifiers.length === 0 && adjectives.length > 0) {
|
|
843
|
+
score -= 1;
|
|
844
|
+
matchReasons.push('unspecified_adjectives');
|
|
845
|
+
}
|
|
846
|
+
// Visibility bonus
|
|
847
|
+
if (this.isEntityVisible(entity)) {
|
|
848
|
+
score += 1;
|
|
849
|
+
matchReasons.push('visible');
|
|
850
|
+
}
|
|
851
|
+
// Reachability bonus
|
|
852
|
+
if (this.isEntityReachable(entity)) {
|
|
853
|
+
score += 1;
|
|
854
|
+
matchReasons.push('reachable');
|
|
855
|
+
}
|
|
856
|
+
// In inventory bonus
|
|
857
|
+
if (this.isInPlayerInventory(entity)) {
|
|
858
|
+
score += 2;
|
|
859
|
+
matchReasons.push('in_inventory');
|
|
860
|
+
}
|
|
861
|
+
// Author-controlled scope priority (Phase 5 disambiguation)
|
|
862
|
+
// entity.scope(actionId) returns priority (default 100)
|
|
863
|
+
// We scale it to add reasonable bonus/penalty (100 = neutral, 150 = +5, 50 = -5)
|
|
864
|
+
const actionId = this.currentActionId;
|
|
865
|
+
if (actionId && typeof entity.scope === 'function') {
|
|
866
|
+
const priority = entity.scope(actionId);
|
|
867
|
+
const priorityBonus = Math.round((priority - 100) / 10); // 150 -> +5, 50 -> -5
|
|
868
|
+
if (priorityBonus !== 0) {
|
|
869
|
+
score += priorityBonus;
|
|
870
|
+
matchReasons.push(`scope_priority_${priority}`);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
if (score > 0) {
|
|
874
|
+
scored.push({ entity, score, matchReasons });
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
// Sort by score descending
|
|
878
|
+
scored.sort((a, b) => b.score - a.score);
|
|
879
|
+
return scored;
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Resolve ambiguity between multiple matches
|
|
883
|
+
*/
|
|
884
|
+
resolveAmbiguity(matches, ref, command) {
|
|
885
|
+
this.emitDebugEvent('ambiguity_resolution', command, {
|
|
886
|
+
reference: ref,
|
|
887
|
+
matchCount: matches.length,
|
|
888
|
+
topMatches: matches.slice(0, 5).map(m => ({
|
|
889
|
+
entity: m.entity.id,
|
|
890
|
+
name: this.getEntityName(m.entity),
|
|
891
|
+
score: m.score,
|
|
892
|
+
reasons: m.matchReasons
|
|
893
|
+
}))
|
|
894
|
+
});
|
|
895
|
+
// If there's a clear winner (score significantly higher), use it
|
|
896
|
+
if (matches.length >= 2) {
|
|
897
|
+
const topScore = matches[0].score;
|
|
898
|
+
const secondScore = matches[1].score;
|
|
899
|
+
if (topScore >= secondScore * 1.5) {
|
|
900
|
+
this.emitDebugEvent('ambiguity_resolution', command, {
|
|
901
|
+
resolved: true,
|
|
902
|
+
method: 'score_threshold',
|
|
903
|
+
chosen: matches[0].entity.id,
|
|
904
|
+
scoreGap: topScore - secondScore
|
|
905
|
+
});
|
|
906
|
+
return matches[0];
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
// If all adjectives match for only one entity, use it
|
|
910
|
+
if (ref && ref.modifiers && ref.modifiers.length > 0) {
|
|
911
|
+
const perfectMatches = matches.filter(m => {
|
|
912
|
+
const adjectives = this.getEntityAdjectives(m.entity).map(a => a.toLowerCase());
|
|
913
|
+
return ref.modifiers.every((mod) => adjectives.includes(mod.toLowerCase()));
|
|
914
|
+
});
|
|
915
|
+
if (perfectMatches.length === 1) {
|
|
916
|
+
this.emitDebugEvent('ambiguity_resolution', command, {
|
|
917
|
+
resolved: true,
|
|
918
|
+
method: 'all_modifiers_match',
|
|
919
|
+
chosen: perfectMatches[0].entity.id
|
|
920
|
+
});
|
|
921
|
+
return perfectMatches[0];
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
// If only one is visible and reachable, use it
|
|
925
|
+
const reachableMatches = matches.filter(m => this.isEntityVisible(m.entity) && this.isEntityReachable(m.entity));
|
|
926
|
+
if (reachableMatches.length === 1) {
|
|
927
|
+
this.emitDebugEvent('ambiguity_resolution', command, {
|
|
928
|
+
resolved: true,
|
|
929
|
+
method: 'only_reachable',
|
|
930
|
+
chosen: reachableMatches[0].entity.id
|
|
931
|
+
});
|
|
932
|
+
return reachableMatches[0];
|
|
933
|
+
}
|
|
934
|
+
// Unable to resolve automatically
|
|
935
|
+
this.emitDebugEvent('ambiguity_resolution', command, {
|
|
936
|
+
resolved: false,
|
|
937
|
+
method: 'none',
|
|
938
|
+
remainingCount: matches.length
|
|
939
|
+
});
|
|
940
|
+
return null;
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* Resolve an entity directly by ID
|
|
944
|
+
* Used after disambiguation when user selects a specific entity
|
|
945
|
+
*/
|
|
946
|
+
resolveEntityById(entityId, parsed) {
|
|
947
|
+
const entity = this.world.getEntity(entityId);
|
|
948
|
+
if (!entity) {
|
|
949
|
+
return null;
|
|
950
|
+
}
|
|
951
|
+
return {
|
|
952
|
+
entity: entity,
|
|
953
|
+
parsed
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Check if entity is visible to player
|
|
958
|
+
*/
|
|
959
|
+
isEntityVisible(entity) {
|
|
960
|
+
const player = this.world.getPlayer();
|
|
961
|
+
if (!player)
|
|
962
|
+
return false;
|
|
963
|
+
return this.scopeResolver.canSee(player, entity);
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* Check if entity is reachable by player
|
|
967
|
+
*/
|
|
968
|
+
isEntityReachable(entity) {
|
|
969
|
+
const player = this.world.getPlayer();
|
|
970
|
+
if (!player)
|
|
971
|
+
return false;
|
|
972
|
+
return this.scopeResolver.canReach(player, entity);
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Check if entity is touchable by player
|
|
976
|
+
*/
|
|
977
|
+
isEntityTouchable(entity) {
|
|
978
|
+
// Touchable = reachable and not intangible
|
|
979
|
+
if (!this.isEntityReachable(entity))
|
|
980
|
+
return false;
|
|
981
|
+
// Check for intangible trait
|
|
982
|
+
if (entity.has && entity.has('intangible'))
|
|
983
|
+
return false;
|
|
984
|
+
return true;
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* Check if entity is in player's inventory
|
|
988
|
+
*/
|
|
989
|
+
isInPlayerInventory(entity) {
|
|
990
|
+
const player = this.world.getPlayer();
|
|
991
|
+
if (!player)
|
|
992
|
+
return false;
|
|
993
|
+
const inventory = this.world.getContents(player.id);
|
|
994
|
+
return inventory.some(e => e.id === entity.id);
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
997
|
+
* Check if entity meets required scope level
|
|
998
|
+
*/
|
|
999
|
+
checkEntityScope(entity, requiredScope, entityName) {
|
|
1000
|
+
const player = this.world.getPlayer();
|
|
1001
|
+
if (!player) {
|
|
1002
|
+
return {
|
|
1003
|
+
success: false,
|
|
1004
|
+
code: 'NO_PLAYER'
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
const entityScope = this.scopeResolver.getScope(player, entity);
|
|
1008
|
+
// Check if entity meets the required scope level
|
|
1009
|
+
switch (requiredScope) {
|
|
1010
|
+
case types_1.ScopeLevel.CARRIED:
|
|
1011
|
+
if (entityScope !== types_1.ScopeLevel.CARRIED) {
|
|
1012
|
+
return {
|
|
1013
|
+
success: false,
|
|
1014
|
+
code: 'NOT_CARRIED'
|
|
1015
|
+
};
|
|
1016
|
+
}
|
|
1017
|
+
break;
|
|
1018
|
+
case types_1.ScopeLevel.REACHABLE:
|
|
1019
|
+
if (entityScope !== types_1.ScopeLevel.CARRIED && entityScope !== types_1.ScopeLevel.REACHABLE) {
|
|
1020
|
+
return {
|
|
1021
|
+
success: false,
|
|
1022
|
+
code: 'NOT_REACHABLE'
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
break;
|
|
1026
|
+
case types_1.ScopeLevel.VISIBLE:
|
|
1027
|
+
if (entityScope < types_1.ScopeLevel.VISIBLE) {
|
|
1028
|
+
return {
|
|
1029
|
+
success: false,
|
|
1030
|
+
code: 'NOT_VISIBLE'
|
|
1031
|
+
};
|
|
1032
|
+
}
|
|
1033
|
+
break;
|
|
1034
|
+
case types_1.ScopeLevel.AWARE:
|
|
1035
|
+
if (entityScope === types_1.ScopeLevel.UNAWARE) {
|
|
1036
|
+
return {
|
|
1037
|
+
success: false,
|
|
1038
|
+
code: 'NOT_AWARE'
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
break;
|
|
1042
|
+
}
|
|
1043
|
+
return { success: true };
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* Get which senses can perceive an entity
|
|
1047
|
+
*/
|
|
1048
|
+
getPerceivedSenses(perceiver, entity) {
|
|
1049
|
+
const senses = [];
|
|
1050
|
+
if (this.scopeResolver.canSee(perceiver, entity)) {
|
|
1051
|
+
senses.push('sight');
|
|
1052
|
+
}
|
|
1053
|
+
if (this.scopeResolver.canHear) {
|
|
1054
|
+
if (this.scopeResolver.canHear(perceiver, entity)) {
|
|
1055
|
+
senses.push('hearing');
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
if (this.scopeResolver.canSmell) {
|
|
1059
|
+
if (this.scopeResolver.canSmell(perceiver, entity)) {
|
|
1060
|
+
senses.push('smell');
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
// Touch is available if entity is reachable
|
|
1064
|
+
if (this.scopeResolver.canReach(perceiver, entity)) {
|
|
1065
|
+
senses.push('touch');
|
|
1066
|
+
}
|
|
1067
|
+
return senses;
|
|
1068
|
+
}
|
|
1069
|
+
/**
|
|
1070
|
+
* Get entity display name
|
|
1071
|
+
*/
|
|
1072
|
+
getEntityName(entity) {
|
|
1073
|
+
// IFEntity has a name getter that uses identity trait
|
|
1074
|
+
const name = entity.name;
|
|
1075
|
+
// Handle case where name might be an object (from world model creation)
|
|
1076
|
+
if (typeof name === 'string') {
|
|
1077
|
+
return name;
|
|
1078
|
+
}
|
|
1079
|
+
return entity.type || entity.id;
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Get entity description
|
|
1083
|
+
*/
|
|
1084
|
+
getEntityDescription(entity) {
|
|
1085
|
+
// IFEntity has a description getter that uses identity trait
|
|
1086
|
+
return entity.description || this.getEntityName(entity);
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
1089
|
+
* Get entity adjectives
|
|
1090
|
+
*/
|
|
1091
|
+
getEntityAdjectives(entity) {
|
|
1092
|
+
const adjectives = [];
|
|
1093
|
+
// Get identity trait
|
|
1094
|
+
const identity = entity.get('identity');
|
|
1095
|
+
if (identity && typeof identity === 'object' && 'adjectives' in identity) {
|
|
1096
|
+
const adj = identity.adjectives;
|
|
1097
|
+
if (Array.isArray(adj)) {
|
|
1098
|
+
adjectives.push(...adj.map(String));
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
return adjectives;
|
|
1102
|
+
}
|
|
1103
|
+
/**
|
|
1104
|
+
* Get entity synonyms
|
|
1105
|
+
*/
|
|
1106
|
+
getEntitySynonyms(entity) {
|
|
1107
|
+
const synonyms = [];
|
|
1108
|
+
// Get identity trait
|
|
1109
|
+
// Note: Entities use 'aliases' not 'synonyms' (synonyms are for verbs)
|
|
1110
|
+
const identity = entity.get('identity');
|
|
1111
|
+
if (identity && typeof identity === 'object' && 'aliases' in identity) {
|
|
1112
|
+
const aliases = identity.aliases;
|
|
1113
|
+
if (Array.isArray(aliases)) {
|
|
1114
|
+
synonyms.push(...aliases.map(String));
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
// Add type as synonym
|
|
1118
|
+
if (entity.type) {
|
|
1119
|
+
synonyms.push(entity.type);
|
|
1120
|
+
}
|
|
1121
|
+
return synonyms;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* Get action metadata
|
|
1125
|
+
*/
|
|
1126
|
+
getActionMetadata(action) {
|
|
1127
|
+
// Check if action has metadata property with required fields
|
|
1128
|
+
if (action.metadata &&
|
|
1129
|
+
'requiresDirectObject' in action.metadata &&
|
|
1130
|
+
'requiresIndirectObject' in action.metadata) {
|
|
1131
|
+
return action.metadata;
|
|
1132
|
+
}
|
|
1133
|
+
// Default metadata - actions handle their own requirements
|
|
1134
|
+
return {
|
|
1135
|
+
requiresDirectObject: false,
|
|
1136
|
+
requiresIndirectObject: false,
|
|
1137
|
+
directObjectScope: types_1.ScopeLevel.VISIBLE,
|
|
1138
|
+
indirectObjectScope: types_1.ScopeLevel.VISIBLE
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* Check action-specific preconditions
|
|
1143
|
+
*/
|
|
1144
|
+
checkActionPreconditions(action, directObject, indirectObject) {
|
|
1145
|
+
// If action has a validate method in metadata, use it
|
|
1146
|
+
if (action.metadata && typeof action.metadata.validate === 'function') {
|
|
1147
|
+
return action.metadata.validate(directObject, indirectObject);
|
|
1148
|
+
}
|
|
1149
|
+
// Default - all preconditions pass
|
|
1150
|
+
return { success: true, message: 'OK' };
|
|
1151
|
+
}
|
|
1152
|
+
/**
|
|
1153
|
+
* Emit a debug event
|
|
1154
|
+
*/
|
|
1155
|
+
emitDebugEvent(debugType, command, data) {
|
|
1156
|
+
if (!this.systemEvents)
|
|
1157
|
+
return;
|
|
1158
|
+
this.systemEvents.emit({
|
|
1159
|
+
id: `validator_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
1160
|
+
timestamp: Date.now(),
|
|
1161
|
+
subsystem: 'validator',
|
|
1162
|
+
type: debugType,
|
|
1163
|
+
data: {
|
|
1164
|
+
command,
|
|
1165
|
+
...data
|
|
1166
|
+
}
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
exports.CommandValidator = CommandValidator;
|
|
1171
|
+
//# sourceMappingURL=command-validator.js.map
|