@sharpee/world-model 0.9.111 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/capabilities/action-interceptor.d.ts +122 -6
- package/capabilities/action-interceptor.d.ts.map +1 -1
- package/capabilities/action-interceptor.js +59 -0
- package/capabilities/action-interceptor.js.map +1 -1
- package/capabilities/index.d.ts +1 -1
- package/capabilities/index.d.ts.map +1 -1
- package/capabilities/index.js +11 -1
- package/capabilities/index.js.map +1 -1
- package/entities/entity-types.d.ts +2 -0
- package/entities/entity-types.d.ts.map +1 -1
- package/entities/entity-types.js +3 -0
- package/entities/entity-types.js.map +1 -1
- package/entities/index.d.ts +2 -0
- package/entities/index.d.ts.map +1 -1
- package/entities/index.js +3 -1
- package/entities/index.js.map +1 -1
- package/entities/wall-entity.d.ts +112 -0
- package/entities/wall-entity.d.ts.map +1 -0
- package/entities/wall-entity.js +50 -0
- package/entities/wall-entity.js.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -0
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/traits/acoustic/acousticDampenerTrait.d.ts +61 -0
- package/traits/acoustic/acousticDampenerTrait.d.ts.map +1 -0
- package/traits/acoustic/acousticDampenerTrait.js +38 -0
- package/traits/acoustic/acousticDampenerTrait.js.map +1 -0
- package/traits/acoustic/acousticTrait.d.ts +64 -0
- package/traits/acoustic/acousticTrait.d.ts.map +1 -0
- package/traits/acoustic/acousticTrait.js +47 -0
- package/traits/acoustic/acousticTrait.js.map +1 -0
- package/traits/acoustic/index.d.ts +3 -0
- package/traits/acoustic/index.d.ts.map +1 -0
- package/traits/acoustic/index.js +10 -0
- package/traits/acoustic/index.js.map +1 -0
- package/traits/implementations.d.ts.map +1 -1
- package/traits/implementations.js +8 -0
- package/traits/implementations.js.map +1 -1
- package/traits/index.d.ts +3 -0
- package/traits/index.d.ts.map +1 -1
- package/traits/index.js +5 -0
- package/traits/index.js.map +1 -1
- package/traits/listener/index.d.ts +2 -0
- package/traits/listener/index.d.ts.map +1 -0
- package/traits/listener/index.js +7 -0
- package/traits/listener/index.js.map +1 -0
- package/traits/listener/listenerTrait.d.ts +40 -0
- package/traits/listener/listenerTrait.d.ts.map +1 -0
- package/traits/listener/listenerTrait.js +23 -0
- package/traits/listener/listenerTrait.js.map +1 -0
- package/traits/obstructor-protocol.d.ts +96 -0
- package/traits/obstructor-protocol.d.ts.map +1 -0
- package/traits/obstructor-protocol.js +77 -0
- package/traits/obstructor-protocol.js.map +1 -0
- package/traits/room/roomTrait.d.ts +7 -0
- package/traits/room/roomTrait.d.ts.map +1 -1
- package/traits/room/roomTrait.js +2 -0
- package/traits/room/roomTrait.js.map +1 -1
- package/traits/story-info/storyInfoTrait.d.ts +6 -0
- package/traits/story-info/storyInfoTrait.d.ts.map +1 -1
- package/traits/story-info/storyInfoTrait.js +6 -0
- package/traits/story-info/storyInfoTrait.js.map +1 -1
- package/traits/trait-types.d.ts +3 -0
- package/traits/trait-types.d.ts.map +1 -1
- package/traits/trait-types.js +8 -0
- package/traits/trait-types.js.map +1 -1
- package/world/AuthorModel.d.ts +3 -0
- package/world/AuthorModel.d.ts.map +1 -1
- package/world/AuthorModel.js +7 -0
- package/world/AuthorModel.js.map +1 -1
- package/world/WorldModel.d.ts +23 -0
- package/world/WorldModel.d.ts.map +1 -1
- package/world/WorldModel.js +36 -0
- package/world/WorldModel.js.map +1 -1
- package/world/index.d.ts +4 -0
- package/world/index.d.ts.map +1 -1
- package/world/index.js +7 -1
- package/world/index.js.map +1 -1
- package/world/wall-creation.d.ts +38 -0
- package/world/wall-creation.d.ts.map +1 -0
- package/world/wall-creation.js +98 -0
- package/world/wall-creation.js.map +1 -0
- package/world/wall-validation.d.ts +45 -0
- package/world/wall-validation.d.ts.map +1 -0
- package/world/wall-validation.js +98 -0
- package/world/wall-validation.js.map +1 -0
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* - CapabilityBehavior: Full delegation, trait owns ALL logic (LOWER, RAISE)
|
|
11
11
|
* - ActionInterceptor: Hooks into phases, action owns core logic (ENTER, PUT)
|
|
12
12
|
*/
|
|
13
|
+
import { ISemanticEvent } from "../../core/index";
|
|
13
14
|
import { IFEntity } from '../entities';
|
|
14
15
|
import { WorldModel } from '../world';
|
|
15
16
|
import { CapabilityEffect } from './types';
|
|
@@ -34,6 +35,98 @@ export interface InterceptorResult {
|
|
|
34
35
|
/** Additional context for error messages */
|
|
35
36
|
params?: Record<string, unknown>;
|
|
36
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Result returned by `ActionInterceptor.postReport` (ISSUE-074).
|
|
40
|
+
*
|
|
41
|
+
* Distinguishes two semantically different intents that the old
|
|
42
|
+
* entity-`on` system collapsed onto a single `Effect[]` shape:
|
|
43
|
+
*
|
|
44
|
+
* 1. `override` — replace the primary domain event's `messageId`
|
|
45
|
+
* (and optional params). Use when the interceptor's narration
|
|
46
|
+
* *substitutes* for the action's standard message. Example: rug push
|
|
47
|
+
* reveals the trap door — the rug-reveal text replaces the generic
|
|
48
|
+
* "you give the rug a push" line.
|
|
49
|
+
*
|
|
50
|
+
* 2. `emit` — additional events to render alongside the action's
|
|
51
|
+
* standard ones. Use for side-channel narration (multi-line
|
|
52
|
+
* consequences) or events that are not message overrides.
|
|
53
|
+
*
|
|
54
|
+
* Both fields are optional and independent. Return `{}` (or simply
|
|
55
|
+
* an empty object literal) when the interceptor has nothing to do.
|
|
56
|
+
*
|
|
57
|
+
* Mirrors the override semantic that `event-processor.invokeEntityHandlers()`
|
|
58
|
+
* applies to single `game.message` reactions from story-level handlers
|
|
59
|
+
* (ADR-106), making the same intent explicit at the interceptor contract.
|
|
60
|
+
*
|
|
61
|
+
* @see applyInterceptorReportResult
|
|
62
|
+
*/
|
|
63
|
+
export interface InterceptorReportResult {
|
|
64
|
+
/** Override the primary domain event's messageId (and optional params/text).
|
|
65
|
+
*
|
|
66
|
+
* - `messageId`: replaces the primary event's `data.messageId`.
|
|
67
|
+
* - `params` (optional): replaces the primary event's `data.params`.
|
|
68
|
+
* - `text` (optional): replaces the primary event's `data.text`. Used
|
|
69
|
+
* when the interceptor has a pre-rendered string and wants the
|
|
70
|
+
* text-service to fall back to it if `messageId` doesn't resolve
|
|
71
|
+
* to a language template (mirrors the inline-text fallback in
|
|
72
|
+
* `event-processor.ts`'s entity-handler override path).
|
|
73
|
+
*
|
|
74
|
+
* Multiple interceptors returning `override` for the same action is a
|
|
75
|
+
* hard error mirroring ADR-106's "multiple game.message reactions" rule. */
|
|
76
|
+
override?: {
|
|
77
|
+
messageId: string;
|
|
78
|
+
params?: Record<string, unknown>;
|
|
79
|
+
text?: string;
|
|
80
|
+
};
|
|
81
|
+
/** Emit additional events alongside the action's standard events. */
|
|
82
|
+
emit?: CapabilityEffect[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Minimal context shape required by `applyInterceptorReportResult`.
|
|
86
|
+
*
|
|
87
|
+
* Real action contexts (both the engine's closure-based factory and the
|
|
88
|
+
* stdlib's class-based `EnhancedActionContext`) satisfy this structurally
|
|
89
|
+
* by exposing `event(type, data)`. Passing the *context object* — rather
|
|
90
|
+
* than an unbound `context.event` callback — preserves `this` for the
|
|
91
|
+
* class-based implementation, which would otherwise crash inside
|
|
92
|
+
* `createEventInternal`. Callers cannot forget to bind because there is
|
|
93
|
+
* nothing to bind.
|
|
94
|
+
*/
|
|
95
|
+
export interface InterceptorEventContext {
|
|
96
|
+
event(type: string, data: Record<string, any>): ISemanticEvent;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Apply an interceptor's `postReport` result to an action's emitted events.
|
|
100
|
+
*
|
|
101
|
+
* - If `result.override` is set, copies `messageId` (and optional `params`/`text`)
|
|
102
|
+
* onto the data of the event whose type matches `primaryEventType`.
|
|
103
|
+
* - If `result.emit` is set, converts each effect to an `ISemanticEvent`
|
|
104
|
+
* via `context.event(...)` and appends to `events`.
|
|
105
|
+
*
|
|
106
|
+
* The action's `report()` phase is responsible for calling this helper
|
|
107
|
+
* with the events array it has built so far, the event type that
|
|
108
|
+
* carries the standard message (e.g. `'if.event.pushed'`), and the
|
|
109
|
+
* action context whose `event(...)` method produces events with proper
|
|
110
|
+
* entity bindings.
|
|
111
|
+
*
|
|
112
|
+
* @param events - The action's events array; mutated in place.
|
|
113
|
+
* @param primaryEventType - The event type whose `messageId` an `override`
|
|
114
|
+
* should replace (e.g. `'if.event.pushed'`).
|
|
115
|
+
* @param result - The value returned from `interceptor.postReport`.
|
|
116
|
+
* @param context - The action context (any object exposing
|
|
117
|
+
* `event(type, data)`).
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```typescript
|
|
121
|
+
* // In the pushing action's report() phase, after pushing the standard
|
|
122
|
+
* // if.event.pushed onto events:
|
|
123
|
+
* if (interceptor?.postReport) {
|
|
124
|
+
* const result = interceptor.postReport(target, world, actorId, interceptorData);
|
|
125
|
+
* applyInterceptorReportResult(events, 'if.event.pushed', result, context);
|
|
126
|
+
* }
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
export declare function applyInterceptorReportResult(events: ISemanticEvent[], primaryEventType: string, result: InterceptorReportResult, context: InterceptorEventContext): void;
|
|
37
130
|
/**
|
|
38
131
|
* Action interceptor interface.
|
|
39
132
|
*
|
|
@@ -138,17 +231,40 @@ export interface ActionInterceptor {
|
|
|
138
231
|
/**
|
|
139
232
|
* Called AFTER standard report.
|
|
140
233
|
*
|
|
141
|
-
* Return
|
|
142
|
-
*
|
|
234
|
+
* Return an `InterceptorReportResult` that declares either:
|
|
235
|
+
* - `override`: replace the primary domain event's `messageId` (so the
|
|
236
|
+
* interceptor's narration *substitutes* for the standard message), or
|
|
237
|
+
* - `emit`: additional events to render alongside the standard ones, or
|
|
238
|
+
* - both, or neither (return `{}` for no-op).
|
|
239
|
+
*
|
|
240
|
+
* Use `override` when the interceptor's message should *replace* the
|
|
241
|
+
* action's default text. Use `emit` for side-channel narration or
|
|
242
|
+
* non-message events.
|
|
243
|
+
*
|
|
244
|
+
* The action's `report()` phase applies the result via
|
|
245
|
+
* `applyInterceptorReportResult` (see helper below).
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* // Override: rug push reveals trap door — the rug-reveal text
|
|
249
|
+
* // replaces the generic "you give the rug a push" message.
|
|
250
|
+
* postReport(entity, world, actorId, sharedData) {
|
|
251
|
+
* if (!sharedData.rugRevealed) return {};
|
|
252
|
+
* return { override: { messageId: 'dungeo.rug.moved.reveal_trapdoor' } };
|
|
253
|
+
* }
|
|
143
254
|
*
|
|
144
255
|
* @example
|
|
145
|
-
* //
|
|
256
|
+
* // Emit: ghost ritual narrates two consecutive lines.
|
|
146
257
|
* postReport(entity, world, actorId, sharedData) {
|
|
147
|
-
* if (!sharedData.
|
|
148
|
-
* return
|
|
258
|
+
* if (!sharedData.ritualCompleted) return {};
|
|
259
|
+
* return {
|
|
260
|
+
* emit: [
|
|
261
|
+
* createEffect('game.message', { messageId: 'dungeo.ghost.appears' }),
|
|
262
|
+
* createEffect('game.message', { messageId: 'dungeo.ghost.canvas_spawns' })
|
|
263
|
+
* ]
|
|
264
|
+
* };
|
|
149
265
|
* }
|
|
150
266
|
*/
|
|
151
|
-
postReport?(entity: IFEntity, world: WorldModel, actorId: string, sharedData: InterceptorSharedData):
|
|
267
|
+
postReport?(entity: IFEntity, world: WorldModel, actorId: string, sharedData: InterceptorSharedData): InterceptorReportResult;
|
|
152
268
|
/**
|
|
153
269
|
* Called when action is blocked (validation failed).
|
|
154
270
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-interceptor.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/world-model/src/capabilities/action-interceptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,CACV,MAAM,EAAE,QAAQ,EAChB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,qBAAqB,GAChC,iBAAiB,GAAG,IAAI,CAAC;IAE5B;;;;;;;;;;;;;;;;;;OAkBG;IACH,YAAY,CAAC,CACX,MAAM,EAAE,QAAQ,EAChB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,qBAAqB,GAChC,iBAAiB,GAAG,IAAI,CAAC;IAE5B;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,CACV,MAAM,EAAE,QAAQ,EAChB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,qBAAqB,GAChC,IAAI,CAAC;IAER
|
|
1
|
+
{"version":3,"file":"action-interceptor.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/world-model/src/capabilities/action-interceptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;;;;iFAW6E;IAC7E,QAAQ,CAAC,EAAE;QACT,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,qEAAqE;IACrE,IAAI,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,cAAc,CAAC;CAChE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,cAAc,EAAE,EACxB,gBAAgB,EAAE,MAAM,EACxB,MAAM,EAAE,uBAAuB,EAC/B,OAAO,EAAE,uBAAuB,GAC/B,IAAI,CA4BN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,CACV,MAAM,EAAE,QAAQ,EAChB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,qBAAqB,GAChC,iBAAiB,GAAG,IAAI,CAAC;IAE5B;;;;;;;;;;;;;;;;;;OAkBG;IACH,YAAY,CAAC,CACX,MAAM,EAAE,QAAQ,EAChB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,qBAAqB,GAChC,iBAAiB,GAAG,IAAI,CAAC;IAE5B;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,CACV,MAAM,EAAE,QAAQ,EAChB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,qBAAqB,GAChC,IAAI,CAAC;IAER;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,UAAU,CAAC,CACT,MAAM,EAAE,QAAQ,EAChB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,qBAAqB,GAChC,uBAAuB,CAAC;IAE3B;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,CACR,MAAM,EAAE,QAAQ,EAChB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,qBAAqB,GAChC,gBAAgB,EAAE,GAAG,IAAI,CAAC;CAC9B"}
|
|
@@ -12,4 +12,63 @@
|
|
|
12
12
|
* - ActionInterceptor: Hooks into phases, action owns core logic (ENTER, PUT)
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.applyInterceptorReportResult = applyInterceptorReportResult;
|
|
16
|
+
/**
|
|
17
|
+
* Apply an interceptor's `postReport` result to an action's emitted events.
|
|
18
|
+
*
|
|
19
|
+
* - If `result.override` is set, copies `messageId` (and optional `params`/`text`)
|
|
20
|
+
* onto the data of the event whose type matches `primaryEventType`.
|
|
21
|
+
* - If `result.emit` is set, converts each effect to an `ISemanticEvent`
|
|
22
|
+
* via `context.event(...)` and appends to `events`.
|
|
23
|
+
*
|
|
24
|
+
* The action's `report()` phase is responsible for calling this helper
|
|
25
|
+
* with the events array it has built so far, the event type that
|
|
26
|
+
* carries the standard message (e.g. `'if.event.pushed'`), and the
|
|
27
|
+
* action context whose `event(...)` method produces events with proper
|
|
28
|
+
* entity bindings.
|
|
29
|
+
*
|
|
30
|
+
* @param events - The action's events array; mutated in place.
|
|
31
|
+
* @param primaryEventType - The event type whose `messageId` an `override`
|
|
32
|
+
* should replace (e.g. `'if.event.pushed'`).
|
|
33
|
+
* @param result - The value returned from `interceptor.postReport`.
|
|
34
|
+
* @param context - The action context (any object exposing
|
|
35
|
+
* `event(type, data)`).
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* // In the pushing action's report() phase, after pushing the standard
|
|
40
|
+
* // if.event.pushed onto events:
|
|
41
|
+
* if (interceptor?.postReport) {
|
|
42
|
+
* const result = interceptor.postReport(target, world, actorId, interceptorData);
|
|
43
|
+
* applyInterceptorReportResult(events, 'if.event.pushed', result, context);
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
function applyInterceptorReportResult(events, primaryEventType, result, context) {
|
|
48
|
+
if (result.override) {
|
|
49
|
+
const primary = events.find((e) => e.type === primaryEventType);
|
|
50
|
+
if (primary) {
|
|
51
|
+
const data = primary.data;
|
|
52
|
+
data.messageId = result.override.messageId;
|
|
53
|
+
if (result.override.params) {
|
|
54
|
+
data.params = result.override.params;
|
|
55
|
+
}
|
|
56
|
+
if (result.override.text) {
|
|
57
|
+
data.text = result.override.text;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
// Defensive: an interceptor asked for an override but the action
|
|
62
|
+
// didn't emit a primary event of that type. Either the action's
|
|
63
|
+
// contract changed or the interceptor is misconfigured.
|
|
64
|
+
console.warn(`applyInterceptorReportResult: override requested for primary event type ` +
|
|
65
|
+
`"${primaryEventType}" but no event of that type was found in the events array.`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (result.emit) {
|
|
69
|
+
for (const effect of result.emit) {
|
|
70
|
+
events.push(context.event(effect.type, effect.payload));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
15
74
|
//# sourceMappingURL=action-interceptor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-interceptor.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/world-model/src/capabilities/action-interceptor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG"}
|
|
1
|
+
{"version":3,"file":"action-interceptor.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/world-model/src/capabilities/action-interceptor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AA4HH,oEAiCC;AAhED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,SAAgB,4BAA4B,CAC1C,MAAwB,EACxB,gBAAwB,EACxB,MAA+B,EAC/B,OAAgC;IAEhC,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC;QAChE,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,IAAI,GAAG,OAAO,CAAC,IAA+B,CAAC;YACrD,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;YAC3C,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;YACvC,CAAC;YACD,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;gBACzB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YACnC,CAAC;QACH,CAAC;aAAM,CAAC;YACN,iEAAiE;YACjE,gEAAgE;YAChE,wDAAwD;YACxD,OAAO,CAAC,IAAI,CACV,0EAA0E;gBAC1E,IAAI,gBAAgB,4DAA4D,CACjF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YACjC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/capabilities/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { TraitBehaviorBinding, BehaviorRegistrationOptions, registerCapabilityBe
|
|
|
10
10
|
export { CapabilityResolution, CapabilityMode, CapabilityConfig, defineCapabilityDefaults, getCapabilityConfig, hasCapabilityDefaults, clearCapabilityDefaults, getAllCapabilityDefaults } from './capability-defaults';
|
|
11
11
|
export { findTraitWithCapability, hasCapability, getEntityCapabilities, traitHasCapability, getCapableTraits } from './capability-helpers';
|
|
12
12
|
export { EntityBuilder, buildEntity } from './entity-builder';
|
|
13
|
-
export { ActionInterceptor, InterceptorSharedData, InterceptorResult } from './action-interceptor';
|
|
13
|
+
export { ActionInterceptor, InterceptorSharedData, InterceptorResult, InterceptorReportResult, InterceptorEventContext, applyInterceptorReportResult } from './action-interceptor';
|
|
14
14
|
export { TraitInterceptorBinding, InterceptorRegistrationOptions, InterceptorLookupResult, registerActionInterceptor, getInterceptorForAction, getInterceptorBinding, hasActionInterceptor, unregisterActionInterceptor, clearInterceptorRegistry, getAllInterceptorBindings } from './interceptor-registry';
|
|
15
15
|
export { findTraitWithInterceptor, hasInterceptor, getEntityInterceptors, traitHasInterceptor, getInterceptorTraits } from './interceptor-helpers';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/world-model/src/capabilities/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,YAAY,EACb,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAGjF,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,4BAA4B,EAC5B,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,aAAa,EACb,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAW1B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/world-model/src/capabilities/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,YAAY,EACb,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAGjF,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,4BAA4B,EAC5B,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,aAAa,EACb,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAW1B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,uBAAuB,EACvB,8BAA8B,EAC9B,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,uBAAuB,CAAC"}
|
package/capabilities/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* (action IDs they respond to) and behaviors implement the logic.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.getInterceptorTraits = exports.traitHasInterceptor = exports.getEntityInterceptors = exports.hasInterceptor = exports.findTraitWithInterceptor = exports.getAllInterceptorBindings = exports.clearInterceptorRegistry = exports.unregisterActionInterceptor = exports.hasActionInterceptor = exports.getInterceptorBinding = exports.getInterceptorForAction = exports.registerActionInterceptor = exports.buildEntity = exports.EntityBuilder = exports.getCapableTraits = exports.traitHasCapability = exports.getEntityCapabilities = exports.hasCapability = exports.findTraitWithCapability = exports.getAllCapabilityDefaults = exports.clearCapabilityDefaults = exports.hasCapabilityDefaults = exports.getCapabilityConfig = exports.defineCapabilityDefaults = exports.getAllCapabilityBindings = exports.clearCapabilityRegistry = exports.unregisterCapabilityBehavior = exports.hasCapabilityBehavior = exports.getBehaviorBinding = exports.getBehaviorForCapability = exports.registerCapabilityBehavior = exports.createEffect = void 0;
|
|
9
|
+
exports.getInterceptorTraits = exports.traitHasInterceptor = exports.getEntityInterceptors = exports.hasInterceptor = exports.findTraitWithInterceptor = exports.getAllInterceptorBindings = exports.clearInterceptorRegistry = exports.unregisterActionInterceptor = exports.hasActionInterceptor = exports.getInterceptorBinding = exports.getInterceptorForAction = exports.registerActionInterceptor = exports.applyInterceptorReportResult = exports.buildEntity = exports.EntityBuilder = exports.getCapableTraits = exports.traitHasCapability = exports.getEntityCapabilities = exports.hasCapability = exports.findTraitWithCapability = exports.getAllCapabilityDefaults = exports.clearCapabilityDefaults = exports.hasCapabilityDefaults = exports.getCapabilityConfig = exports.defineCapabilityDefaults = exports.getAllCapabilityBindings = exports.clearCapabilityRegistry = exports.unregisterCapabilityBehavior = exports.hasCapabilityBehavior = exports.getBehaviorBinding = exports.getBehaviorForCapability = exports.registerCapabilityBehavior = exports.createEffect = void 0;
|
|
10
10
|
// Types
|
|
11
11
|
var types_1 = require("./types");
|
|
12
12
|
Object.defineProperty(exports, "createEffect", { enumerable: true, get: function () { return types_1.createEffect; } });
|
|
@@ -37,6 +37,16 @@ Object.defineProperty(exports, "getCapableTraits", { enumerable: true, get: func
|
|
|
37
37
|
var entity_builder_1 = require("./entity-builder");
|
|
38
38
|
Object.defineProperty(exports, "EntityBuilder", { enumerable: true, get: function () { return entity_builder_1.EntityBuilder; } });
|
|
39
39
|
Object.defineProperty(exports, "buildEntity", { enumerable: true, get: function () { return entity_builder_1.buildEntity; } });
|
|
40
|
+
// ============================================================================
|
|
41
|
+
// Action Interceptors (ADR-118)
|
|
42
|
+
//
|
|
43
|
+
// Interceptors allow traits to hook into stdlib action phases without
|
|
44
|
+
// replacing standard logic. This complements capability behaviors which
|
|
45
|
+
// provide full delegation.
|
|
46
|
+
// ============================================================================
|
|
47
|
+
// Interceptor interface
|
|
48
|
+
var action_interceptor_1 = require("./action-interceptor");
|
|
49
|
+
Object.defineProperty(exports, "applyInterceptorReportResult", { enumerable: true, get: function () { return action_interceptor_1.applyInterceptorReportResult; } });
|
|
40
50
|
// Interceptor registry
|
|
41
51
|
var interceptor_registry_1 = require("./interceptor-registry");
|
|
42
52
|
Object.defineProperty(exports, "registerActionInterceptor", { enumerable: true, get: function () { return interceptor_registry_1.registerActionInterceptor; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/world-model/src/capabilities/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,QAAQ;AACR,iCAIiB;AADf,qGAAA,YAAY,OAAA;AAMd,WAAW;AACX,6DAU+B;AAP7B,iIAAA,0BAA0B,OAAA;AAC1B,+HAAA,wBAAwB,OAAA;AACxB,yHAAA,kBAAkB,OAAA;AAClB,4HAAA,qBAAqB,OAAA;AACrB,mIAAA,4BAA4B,OAAA;AAC5B,8HAAA,uBAAuB,OAAA;AACvB,+HAAA,wBAAwB,OAAA;AAG1B,6BAA6B;AAC7B,6DAS+B;AAL7B,+HAAA,wBAAwB,OAAA;AACxB,0HAAA,mBAAmB,OAAA;AACnB,4HAAA,qBAAqB,OAAA;AACrB,8HAAA,uBAAuB,OAAA;AACvB,+HAAA,wBAAwB,OAAA;AAG1B,UAAU;AACV,2DAM8B;AAL5B,6HAAA,uBAAuB,OAAA;AACvB,mHAAA,aAAa,OAAA;AACb,2HAAA,qBAAqB,OAAA;AACrB,wHAAA,kBAAkB,OAAA;AAClB,sHAAA,gBAAgB,OAAA;AAGlB,iBAAiB;AACjB,mDAG0B;AAFxB,+GAAA,aAAa,OAAA;AACb,6GAAA,WAAW,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/world-model/src/capabilities/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,QAAQ;AACR,iCAIiB;AADf,qGAAA,YAAY,OAAA;AAMd,WAAW;AACX,6DAU+B;AAP7B,iIAAA,0BAA0B,OAAA;AAC1B,+HAAA,wBAAwB,OAAA;AACxB,yHAAA,kBAAkB,OAAA;AAClB,4HAAA,qBAAqB,OAAA;AACrB,mIAAA,4BAA4B,OAAA;AAC5B,8HAAA,uBAAuB,OAAA;AACvB,+HAAA,wBAAwB,OAAA;AAG1B,6BAA6B;AAC7B,6DAS+B;AAL7B,+HAAA,wBAAwB,OAAA;AACxB,0HAAA,mBAAmB,OAAA;AACnB,4HAAA,qBAAqB,OAAA;AACrB,8HAAA,uBAAuB,OAAA;AACvB,+HAAA,wBAAwB,OAAA;AAG1B,UAAU;AACV,2DAM8B;AAL5B,6HAAA,uBAAuB,OAAA;AACvB,mHAAA,aAAa,OAAA;AACb,2HAAA,qBAAqB,OAAA;AACrB,wHAAA,kBAAkB,OAAA;AAClB,sHAAA,gBAAgB,OAAA;AAGlB,iBAAiB;AACjB,mDAG0B;AAFxB,+GAAA,aAAa,OAAA;AACb,6GAAA,WAAW,OAAA;AAGb,+EAA+E;AAC/E,gCAAgC;AAChC,EAAE;AACF,sEAAsE;AACtE,wEAAwE;AACxE,2BAA2B;AAC3B,+EAA+E;AAE/E,wBAAwB;AACxB,2DAO8B;AAD5B,kIAAA,4BAA4B,OAAA;AAG9B,uBAAuB;AACvB,+DAWgC;AAP9B,iIAAA,yBAAyB,OAAA;AACzB,+HAAA,uBAAuB,OAAA;AACvB,6HAAA,qBAAqB,OAAA;AACrB,4HAAA,oBAAoB,OAAA;AACpB,mIAAA,2BAA2B,OAAA;AAC3B,gIAAA,wBAAwB,OAAA;AACxB,iIAAA,yBAAyB,OAAA;AAG3B,sBAAsB;AACtB,6DAM+B;AAL7B,+HAAA,wBAAwB,OAAA;AACxB,qHAAA,cAAc,OAAA;AACd,4HAAA,qBAAqB,OAAA;AACrB,0HAAA,mBAAmB,OAAA;AACnB,2HAAA,oBAAoB,OAAA"}
|
|
@@ -21,6 +21,8 @@ export declare const EntityType: {
|
|
|
21
21
|
readonly SCENERY: "scenery";
|
|
22
22
|
/** A directional exit (rarely used as entity) */
|
|
23
23
|
readonly EXIT: "exit";
|
|
24
|
+
/** A physical adjacency between two rooms (ADR-173) */
|
|
25
|
+
readonly WALL: "wall";
|
|
24
26
|
/** A geographic grouping of rooms (ADR-149) */
|
|
25
27
|
readonly REGION: "region";
|
|
26
28
|
/** A temporal phase of the story (ADR-149) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-types.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/world-model/src/entities/entity-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,UAAU;IACrB,mCAAmC;;IAGnC,wCAAwC;;IAGxC,gCAAgC;;IAGhC,kCAAkC;;IAGlC,+CAA+C;;IAG/C,sDAAsD;;IAGtD,mDAAmD;;IAGnD,iDAAiD;;IAGjD,+CAA+C;;IAG/C,8CAA8C;;IAG9C,oCAAoC;;CAE5B,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEpE;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,UAAU,CAE7D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"entity-types.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/world-model/src/entities/entity-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,UAAU;IACrB,mCAAmC;;IAGnC,wCAAwC;;IAGxC,gCAAgC;;IAGhC,kCAAkC;;IAGlC,+CAA+C;;IAG/C,sDAAsD;;IAGtD,mDAAmD;;IAGnD,iDAAiD;;IAGjD,uDAAuD;;IAGvD,+CAA+C;;IAG/C,8CAA8C;;IAG9C,oCAAoC;;CAE5B,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEpE;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,UAAU,CAE7D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAiB5D"}
|
package/entities/entity-types.js
CHANGED
|
@@ -26,6 +26,8 @@ exports.EntityType = {
|
|
|
26
26
|
SCENERY: 'scenery',
|
|
27
27
|
/** A directional exit (rarely used as entity) */
|
|
28
28
|
EXIT: 'exit',
|
|
29
|
+
/** A physical adjacency between two rooms (ADR-173) */
|
|
30
|
+
WALL: 'wall',
|
|
29
31
|
/** A geographic grouping of rooms (ADR-149) */
|
|
30
32
|
REGION: 'region',
|
|
31
33
|
/** A temporal phase of the story (ADR-149) */
|
|
@@ -53,6 +55,7 @@ function getEntityTypePrefix(type) {
|
|
|
53
55
|
[exports.EntityType.SUPPORTER]: 's',
|
|
54
56
|
[exports.EntityType.SCENERY]: 'y',
|
|
55
57
|
[exports.EntityType.EXIT]: 'e',
|
|
58
|
+
[exports.EntityType.WALL]: 'w',
|
|
56
59
|
[exports.EntityType.REGION]: 'rg',
|
|
57
60
|
[exports.EntityType.SCENE]: 'sc',
|
|
58
61
|
[exports.EntityType.OBJECT]: 'o'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-types.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/world-model/src/entities/entity-types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"entity-types.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/world-model/src/entities/entity-types.ts"],"names":[],"mappings":";;;AAoDA,oCAEC;AAMD,kDAiBC;AA7ED;;;;;GAKG;AACU,QAAA,UAAU,GAAG;IACxB,mCAAmC;IACnC,IAAI,EAAE,MAAM;IAEZ,wCAAwC;IACxC,IAAI,EAAE,MAAM;IAEZ,gCAAgC;IAChC,IAAI,EAAE,MAAM;IAEZ,kCAAkC;IAClC,KAAK,EAAE,OAAO;IAEd,+CAA+C;IAC/C,SAAS,EAAE,WAAW;IAEtB,sDAAsD;IACtD,SAAS,EAAE,WAAW;IAEtB,mDAAmD;IACnD,OAAO,EAAE,SAAS;IAElB,iDAAiD;IACjD,IAAI,EAAE,MAAM;IAEZ,uDAAuD;IACvD,IAAI,EAAE,MAAM;IAEZ,+CAA+C;IAC/C,MAAM,EAAE,QAAQ;IAEhB,8CAA8C;IAC9C,KAAK,EAAE,OAAO;IAEd,oCAAoC;IACpC,MAAM,EAAE,QAAQ;CACR,CAAC;AAOX;;GAEG;AACH,SAAgB,YAAY,CAAC,IAAY;IACvC,OAAO,MAAM,CAAC,MAAM,CAAC,kBAAU,CAAC,CAAC,QAAQ,CAAC,IAAkB,CAAC,CAAC;AAChE,CAAC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,IAAgB;IAClD,MAAM,SAAS,GAA+B;QAC5C,CAAC,kBAAU,CAAC,IAAI,CAAC,EAAE,GAAG;QACtB,CAAC,kBAAU,CAAC,IAAI,CAAC,EAAE,GAAG;QACtB,CAAC,kBAAU,CAAC,IAAI,CAAC,EAAE,GAAG;QACtB,CAAC,kBAAU,CAAC,KAAK,CAAC,EAAE,GAAG;QACvB,CAAC,kBAAU,CAAC,SAAS,CAAC,EAAE,GAAG;QAC3B,CAAC,kBAAU,CAAC,SAAS,CAAC,EAAE,GAAG;QAC3B,CAAC,kBAAU,CAAC,OAAO,CAAC,EAAE,GAAG;QACzB,CAAC,kBAAU,CAAC,IAAI,CAAC,EAAE,GAAG;QACtB,CAAC,kBAAU,CAAC,IAAI,CAAC,EAAE,GAAG;QACtB,CAAC,kBAAU,CAAC,MAAM,CAAC,EAAE,IAAI;QACzB,CAAC,kBAAU,CAAC,KAAK,CAAC,EAAE,IAAI;QACxB,CAAC,kBAAU,CAAC,MAAM,CAAC,EAAE,GAAG;KACzB,CAAC;IAEF,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;AAChC,CAAC"}
|
package/entities/index.d.ts
CHANGED
|
@@ -2,4 +2,6 @@ export { IFEntity } from './if-entity';
|
|
|
2
2
|
export { EntityStore } from './entity-store';
|
|
3
3
|
export { EntityType, isEntityType, getEntityTypePrefix } from './entity-types';
|
|
4
4
|
export type { EntityType as EntityTypeValue } from './entity-types';
|
|
5
|
+
export { WallEntity } from './wall-entity';
|
|
6
|
+
export type { IWallEntity, IWallSideData, IWallSpec, IWallsSpec } from './wall-entity';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/entities/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/world-model/src/entities/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,YAAY,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/world-model/src/entities/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,YAAY,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
package/entities/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// packages/world-model/src/entities/index.ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getEntityTypePrefix = exports.isEntityType = exports.EntityType = exports.EntityStore = exports.IFEntity = void 0;
|
|
4
|
+
exports.WallEntity = exports.getEntityTypePrefix = exports.isEntityType = exports.EntityType = exports.EntityStore = exports.IFEntity = void 0;
|
|
5
5
|
var if_entity_1 = require("./if-entity");
|
|
6
6
|
Object.defineProperty(exports, "IFEntity", { enumerable: true, get: function () { return if_entity_1.IFEntity; } });
|
|
7
7
|
var entity_store_1 = require("./entity-store");
|
|
@@ -10,4 +10,6 @@ var entity_types_1 = require("./entity-types");
|
|
|
10
10
|
Object.defineProperty(exports, "EntityType", { enumerable: true, get: function () { return entity_types_1.EntityType; } });
|
|
11
11
|
Object.defineProperty(exports, "isEntityType", { enumerable: true, get: function () { return entity_types_1.isEntityType; } });
|
|
12
12
|
Object.defineProperty(exports, "getEntityTypePrefix", { enumerable: true, get: function () { return entity_types_1.getEntityTypePrefix; } });
|
|
13
|
+
var wall_entity_1 = require("./wall-entity");
|
|
14
|
+
Object.defineProperty(exports, "WallEntity", { enumerable: true, get: function () { return wall_entity_1.WallEntity; } });
|
|
13
15
|
//# sourceMappingURL=index.js.map
|
package/entities/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/world-model/src/entities/index.ts"],"names":[],"mappings":";AAAA,6CAA6C;;;AAE7C,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,+CAA+E;AAAtE,0GAAA,UAAU,OAAA;AAAE,4GAAA,YAAY,OAAA;AAAE,mHAAA,mBAAmB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/world-model/src/entities/index.ts"],"names":[],"mappings":";AAAA,6CAA6C;;;AAE7C,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,+CAA+E;AAAtE,0GAAA,UAAU,OAAA;AAAE,4GAAA,YAAY,OAAA;AAAE,mHAAA,mBAAmB,OAAA;AAEtD,6CAA2C;AAAlC,yGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wall entity primitive (ADR-173).
|
|
3
|
+
*
|
|
4
|
+
* A wall is an IFEntity-derived entity expressing a physical adjacency
|
|
5
|
+
* between exactly two distinct rooms. It carries whole-wall traits (the
|
|
6
|
+
* entity's regular trait map — symmetric properties of the wall as a
|
|
7
|
+
* physical object) and per-side data (asymmetric interface properties
|
|
8
|
+
* keyed by the room id you encounter the wall from).
|
|
9
|
+
*
|
|
10
|
+
* Public interface: `IWallSideData`, `IWallSpec`, `WallEntity`. Authors
|
|
11
|
+
* do not instantiate `WallEntity` directly — they use `WorldModel.createWall`,
|
|
12
|
+
* which constructs the entity, runs validation, and maintains reciprocal
|
|
13
|
+
* references on both rooms.
|
|
14
|
+
*
|
|
15
|
+
* Owner context: `@sharpee/world-model` — entities / spatial primitives.
|
|
16
|
+
*/
|
|
17
|
+
import { EntityId, IEntityCreationParams } from "../../core/index";
|
|
18
|
+
import { IFEntity } from './if-entity';
|
|
19
|
+
import { ITrait } from '../traits/trait';
|
|
20
|
+
/**
|
|
21
|
+
* Per-side data for a wall (ADR-173).
|
|
22
|
+
*
|
|
23
|
+
* Keyed by the room id the player is in when looking at the wall.
|
|
24
|
+
*/
|
|
25
|
+
export interface IWallSideData {
|
|
26
|
+
/**
|
|
27
|
+
* The adjective the parser uses to disambiguate this wall from other
|
|
28
|
+
* walls visible from the same room (e.g. 'oak', 'brick'). Required.
|
|
29
|
+
* Must be unique within any single room across all walls visible
|
|
30
|
+
* from that room.
|
|
31
|
+
*/
|
|
32
|
+
adjective: string;
|
|
33
|
+
/**
|
|
34
|
+
* Optional per-side description, rendered when the player examines
|
|
35
|
+
* the wall from this side.
|
|
36
|
+
*/
|
|
37
|
+
description?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Optional reference to an entity that obstructs capability access
|
|
40
|
+
* to this side of the wall (e.g. a bookcase against the parlor side).
|
|
41
|
+
* Per ADR-173, the obstructor's own traits declare which capabilities
|
|
42
|
+
* it modifies (the "generalized obstructor protocol"). Must reference
|
|
43
|
+
* an entity that exists and is located in the appropriate room at
|
|
44
|
+
* world-load time; runtime evaluation re-checks the obstructor's
|
|
45
|
+
* current location.
|
|
46
|
+
*/
|
|
47
|
+
obstructedBy?: EntityId;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Author-supplied specification for `WorldModel.createWall` (ADR-173).
|
|
51
|
+
*
|
|
52
|
+
* `between` is two distinct rooms (passed as either entities or ids).
|
|
53
|
+
* `whole` carries traits applied to the wall as a single object —
|
|
54
|
+
* symmetric properties (acoustic cost, structural material). `sides`
|
|
55
|
+
* carries the per-side data, keyed by each room's id.
|
|
56
|
+
*/
|
|
57
|
+
export interface IWallSpec {
|
|
58
|
+
between: [IFEntity | EntityId, IFEntity | EntityId];
|
|
59
|
+
whole?: ITrait[];
|
|
60
|
+
sides: Record<EntityId, IWallSideData>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Author-supplied specification for `WorldModel.createWalls` (ADR-173).
|
|
64
|
+
*
|
|
65
|
+
* Fans out into one wall entity per element of `to`. `sides` is a
|
|
66
|
+
* function called once per pair to produce that side's data; the
|
|
67
|
+
* caller is given the room id and may produce per-room-distinct
|
|
68
|
+
* adjectives or descriptions.
|
|
69
|
+
*/
|
|
70
|
+
export interface IWallsSpec {
|
|
71
|
+
from: IFEntity | EntityId;
|
|
72
|
+
to: ReadonlyArray<IFEntity | EntityId>;
|
|
73
|
+
whole?: ITrait[];
|
|
74
|
+
sides: (roomId: EntityId) => IWallSideData;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* IFEntity subclass for walls. Adds the `between` relation and the
|
|
78
|
+
* per-side data map. Whole-wall traits live on the entity's existing
|
|
79
|
+
* trait map (`entity.add(trait)`); per-side state is held here because
|
|
80
|
+
* it is keyed by room id rather than trait type.
|
|
81
|
+
*/
|
|
82
|
+
export declare class WallEntity extends IFEntity {
|
|
83
|
+
/**
|
|
84
|
+
* The two rooms this wall borders. Exactly two distinct room ids.
|
|
85
|
+
* Invariant established by `WorldModel.createWall` and held for the
|
|
86
|
+
* wall's lifetime — there is no API to mutate `between`.
|
|
87
|
+
*/
|
|
88
|
+
readonly between: [EntityId, EntityId];
|
|
89
|
+
/**
|
|
90
|
+
* Per-side data keyed by room id. Always has exactly the two keys in
|
|
91
|
+
* `between`; populated by `WorldModel.createWall`.
|
|
92
|
+
*/
|
|
93
|
+
readonly sides: Map<EntityId, IWallSideData>;
|
|
94
|
+
constructor(id: string, between: [EntityId, EntityId], params?: Partial<IEntityCreationParams>);
|
|
95
|
+
/**
|
|
96
|
+
* Returns the per-side data for the side facing `roomId`, or undefined
|
|
97
|
+
* if `roomId` is not one of the wall's two rooms.
|
|
98
|
+
*/
|
|
99
|
+
getSide(roomId: EntityId): IWallSideData | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Returns the id of the room on the other side of the wall from
|
|
102
|
+
* `roomId`, or undefined if `roomId` is not one of the wall's two
|
|
103
|
+
* rooms.
|
|
104
|
+
*/
|
|
105
|
+
otherRoom(roomId: EntityId): EntityId | undefined;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* `IWallEntity` is the structural shape consumers code against.
|
|
109
|
+
* `WallEntity` is the concrete class produced by `WorldModel.createWall`.
|
|
110
|
+
*/
|
|
111
|
+
export type IWallEntity = WallEntity;
|
|
112
|
+
//# sourceMappingURL=wall-entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wall-entity.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/world-model/src/entities/wall-entity.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,CAAC,QAAQ,GAAG,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,CAAC;IACpD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;CACxC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,EAAE,EAAE,aAAa,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAK,aAAa,CAAC;CAC5C;AAED;;;;;GAKG;AACH,qBAAa,UAAW,SAAQ,QAAQ;IACtC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAEvC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;gBAG3C,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAC7B,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC;IAOzC;;;OAGG;IACH,OAAO,CAAC,MAAM,EAAE,QAAQ,GAAG,aAAa,GAAG,SAAS;IAIpD;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS;CAKlD;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/world-model/src/entities/wall-entity.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.WallEntity = void 0;
|
|
5
|
+
const if_entity_1 = require("./if-entity");
|
|
6
|
+
/**
|
|
7
|
+
* IFEntity subclass for walls. Adds the `between` relation and the
|
|
8
|
+
* per-side data map. Whole-wall traits live on the entity's existing
|
|
9
|
+
* trait map (`entity.add(trait)`); per-side state is held here because
|
|
10
|
+
* it is keyed by room id rather than trait type.
|
|
11
|
+
*/
|
|
12
|
+
class WallEntity extends if_entity_1.IFEntity {
|
|
13
|
+
/**
|
|
14
|
+
* The two rooms this wall borders. Exactly two distinct room ids.
|
|
15
|
+
* Invariant established by `WorldModel.createWall` and held for the
|
|
16
|
+
* wall's lifetime — there is no API to mutate `between`.
|
|
17
|
+
*/
|
|
18
|
+
between;
|
|
19
|
+
/**
|
|
20
|
+
* Per-side data keyed by room id. Always has exactly the two keys in
|
|
21
|
+
* `between`; populated by `WorldModel.createWall`.
|
|
22
|
+
*/
|
|
23
|
+
sides;
|
|
24
|
+
constructor(id, between, params) {
|
|
25
|
+
super(id, 'wall', params);
|
|
26
|
+
this.between = between;
|
|
27
|
+
this.sides = new Map();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns the per-side data for the side facing `roomId`, or undefined
|
|
31
|
+
* if `roomId` is not one of the wall's two rooms.
|
|
32
|
+
*/
|
|
33
|
+
getSide(roomId) {
|
|
34
|
+
return this.sides.get(roomId);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Returns the id of the room on the other side of the wall from
|
|
38
|
+
* `roomId`, or undefined if `roomId` is not one of the wall's two
|
|
39
|
+
* rooms.
|
|
40
|
+
*/
|
|
41
|
+
otherRoom(roomId) {
|
|
42
|
+
if (roomId === this.between[0])
|
|
43
|
+
return this.between[1];
|
|
44
|
+
if (roomId === this.between[1])
|
|
45
|
+
return this.between[0];
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.WallEntity = WallEntity;
|
|
50
|
+
//# sourceMappingURL=wall-entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wall-entity.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/world-model/src/entities/wall-entity.ts"],"names":[],"mappings":";AAAA,mDAAmD;;;AAoBnD,2CAAuC;AAgEvC;;;;;GAKG;AACH,MAAa,UAAW,SAAQ,oBAAQ;IACtC;;;;OAIG;IACM,OAAO,CAAuB;IAEvC;;;OAGG;IACM,KAAK,CAA+B;IAE7C,YACE,EAAU,EACV,OAA6B,EAC7B,MAAuC;QAEvC,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,OAAO,CAAC,MAAgB;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,MAAgB;QACxB,IAAI,MAAM,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACvD,IAAI,MAAM,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACvD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA1CD,gCA0CC"}
|
package/index.d.ts
CHANGED
|
@@ -33,6 +33,9 @@ export * from './traits/vehicle';
|
|
|
33
33
|
export * from './traits/story-info';
|
|
34
34
|
export * from './traits/character-model';
|
|
35
35
|
export * from './traits/concealment';
|
|
36
|
+
export * from './traits/acoustic';
|
|
37
|
+
export * from './traits/listener';
|
|
38
|
+
export * from './traits/obstructor-protocol';
|
|
36
39
|
export * from './extensions';
|
|
37
40
|
export * from './world';
|
|
38
41
|
export * from './scope';
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../repos/sharpee/packages/world-model/src/index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAG3B,cAAc,aAAa,CAAC;AAG5B,cAAc,aAAa,CAAC;AAG5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAG7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../repos/sharpee/packages/world-model/src/index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAG3B,cAAc,aAAa,CAAC;AAG5B,cAAc,aAAa,CAAC;AAG5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAG7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAG7C,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,cAAc,gBAAgB,CAAC;AAG/B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,eAAe,CAAC"}
|
package/index.js
CHANGED
|
@@ -56,6 +56,9 @@ __exportStar(require("./traits/vehicle"), exports);
|
|
|
56
56
|
__exportStar(require("./traits/story-info"), exports);
|
|
57
57
|
__exportStar(require("./traits/character-model"), exports);
|
|
58
58
|
__exportStar(require("./traits/concealment"), exports);
|
|
59
|
+
__exportStar(require("./traits/acoustic"), exports);
|
|
60
|
+
__exportStar(require("./traits/listener"), exports);
|
|
61
|
+
__exportStar(require("./traits/obstructor-protocol"), exports);
|
|
59
62
|
// Extension system
|
|
60
63
|
__exportStar(require("./extensions"), exports);
|
|
61
64
|
// World model
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/world-model/src/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,gBAAgB;AAChB,6CAA2B;AAE3B,iBAAiB;AACjB,8CAA4B;AAE5B,YAAY;AACZ,8CAA4B;AAE5B,8CAA8C;AAC9C,6CAA2B;AAC3B,+CAA6B;AAE7B,SAAS;AACT,iDAA+B;AAC/B,uDAAqC;AACrC,2DAAyC;AAEzC,2BAA2B;AAC3B,oDAAkC;AAClC,qDAAmC;AACnC,gDAA8B;AAC9B,oDAAkC;AAClC,oDAAkC;AAClC,oDAAkC;AAClC,wDAAsC;AACtC,gDAA8B;AAC9B,qDAAmC;AACnC,mDAAiC;AACjC,qDAAmC;AACnC,sDAAoC;AACpC,oDAAkC;AAClC,kDAAgC;AAChC,gDAA8B;AAC9B,iDAA+B;AAC/B,oDAAkC;AAClC,kDAAgC;AAChC,oDAAkC;AAClC,4DAA0C;AAC1C,oDAAkC;AAClC,oDAAkC;AAClC,+CAA6B;AAC7B,mDAAiC;AACjC,sDAAoC;AACpC,2DAAyC;AACzC,uDAAqC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/world-model/src/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,gBAAgB;AAChB,6CAA2B;AAE3B,iBAAiB;AACjB,8CAA4B;AAE5B,YAAY;AACZ,8CAA4B;AAE5B,8CAA8C;AAC9C,6CAA2B;AAC3B,+CAA6B;AAE7B,SAAS;AACT,iDAA+B;AAC/B,uDAAqC;AACrC,2DAAyC;AAEzC,2BAA2B;AAC3B,oDAAkC;AAClC,qDAAmC;AACnC,gDAA8B;AAC9B,oDAAkC;AAClC,oDAAkC;AAClC,oDAAkC;AAClC,wDAAsC;AACtC,gDAA8B;AAC9B,qDAAmC;AACnC,mDAAiC;AACjC,qDAAmC;AACnC,sDAAoC;AACpC,oDAAkC;AAClC,kDAAgC;AAChC,gDAA8B;AAC9B,iDAA+B;AAC/B,oDAAkC;AAClC,kDAAgC;AAChC,oDAAkC;AAClC,4DAA0C;AAC1C,oDAAkC;AAClC,oDAAkC;AAClC,+CAA6B;AAC7B,mDAAiC;AACjC,sDAAoC;AACpC,2DAAyC;AACzC,uDAAqC;AACrC,oDAAkC;AAClC,oDAAkC;AAClC,+DAA6C;AAE7C,mBAAmB;AACnB,+CAA6B;AAE7B,cAAc;AACd,0CAAwB;AAExB,eAAe;AACf,0CAAwB;AAExB,mFAAmF;AACnF,iDAA+B;AAE/B,uCAAuC;AACvC,iDAA+B;AAE/B,wBAAwB;AACxB,gDAA8B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sharpee/world-model",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "World model for Sharpee IF platform - entities, traits, and behaviors",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@sharpee/core": "^0.
|
|
16
|
-
"@sharpee/if-domain": "^0.
|
|
15
|
+
"@sharpee/core": "^1.0.0",
|
|
16
|
+
"@sharpee/if-domain": "^1.0.0"
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
19
19
|
"interactive-fiction",
|