@sharpee/engine 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/action-context-factory.d.ts +10 -2
- package/action-context-factory.d.ts.map +1 -1
- package/action-context-factory.js +29 -5
- package/action-context-factory.js.map +1 -1
- package/command-executor.d.ts +2 -1
- package/command-executor.d.ts.map +1 -1
- package/command-executor.js +3 -3
- package/command-executor.js.map +1 -1
- package/game-engine.d.ts +87 -4
- package/game-engine.d.ts.map +1 -1
- package/game-engine.js +250 -9
- package/game-engine.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +13 -12
- package/prose-pipeline/assemble.d.ts +77 -0
- package/prose-pipeline/assemble.d.ts.map +1 -0
- package/prose-pipeline/assemble.js +96 -0
- package/prose-pipeline/assemble.js.map +1 -0
- package/prose-pipeline/decorations/index.d.ts +18 -0
- package/prose-pipeline/decorations/index.d.ts.map +1 -0
- package/prose-pipeline/decorations/index.js +24 -0
- package/prose-pipeline/decorations/index.js.map +1 -0
- package/prose-pipeline/decorations/parser.d.ts +34 -0
- package/prose-pipeline/decorations/parser.d.ts.map +1 -0
- package/prose-pipeline/decorations/parser.js +177 -0
- package/prose-pipeline/decorations/parser.js.map +1 -0
- package/prose-pipeline/decorations/platform-vocabulary.d.ts +27 -0
- package/prose-pipeline/decorations/platform-vocabulary.d.ts.map +1 -0
- package/prose-pipeline/decorations/platform-vocabulary.js +65 -0
- package/prose-pipeline/decorations/platform-vocabulary.js.map +1 -0
- package/prose-pipeline/decorations/resolver.d.ts +28 -0
- package/prose-pipeline/decorations/resolver.d.ts.map +1 -0
- package/prose-pipeline/decorations/resolver.js +39 -0
- package/prose-pipeline/decorations/resolver.js.map +1 -0
- package/prose-pipeline/decorations/types.d.ts +16 -0
- package/prose-pipeline/decorations/types.d.ts.map +1 -0
- package/prose-pipeline/decorations/types.js +17 -0
- package/prose-pipeline/decorations/types.js.map +1 -0
- package/prose-pipeline/handlers/about.d.ts +31 -0
- package/prose-pipeline/handlers/about.d.ts.map +1 -0
- package/prose-pipeline/handlers/about.js +50 -0
- package/prose-pipeline/handlers/about.js.map +1 -0
- package/prose-pipeline/handlers/audibility.d.ts +46 -0
- package/prose-pipeline/handlers/audibility.d.ts.map +1 -0
- package/prose-pipeline/handlers/audibility.js +79 -0
- package/prose-pipeline/handlers/audibility.js.map +1 -0
- package/prose-pipeline/handlers/banner.d.ts +44 -0
- package/prose-pipeline/handlers/banner.d.ts.map +1 -0
- package/prose-pipeline/handlers/banner.js +88 -0
- package/prose-pipeline/handlers/banner.js.map +1 -0
- package/prose-pipeline/handlers/client-query.d.ts +22 -0
- package/prose-pipeline/handlers/client-query.d.ts.map +1 -0
- package/prose-pipeline/handlers/client-query.js +55 -0
- package/prose-pipeline/handlers/client-query.js.map +1 -0
- package/prose-pipeline/handlers/command-failed.d.ts +24 -0
- package/prose-pipeline/handlers/command-failed.d.ts.map +1 -0
- package/prose-pipeline/handlers/command-failed.js +46 -0
- package/prose-pipeline/handlers/command-failed.js.map +1 -0
- package/prose-pipeline/handlers/domain-message.d.ts +31 -0
- package/prose-pipeline/handlers/domain-message.d.ts.map +1 -0
- package/prose-pipeline/handlers/domain-message.js +66 -0
- package/prose-pipeline/handlers/domain-message.js.map +1 -0
- package/prose-pipeline/handlers/game.d.ts +31 -0
- package/prose-pipeline/handlers/game.d.ts.map +1 -0
- package/prose-pipeline/handlers/game.js +35 -0
- package/prose-pipeline/handlers/game.js.map +1 -0
- package/prose-pipeline/handlers/generic.d.ts +27 -0
- package/prose-pipeline/handlers/generic.d.ts.map +1 -0
- package/prose-pipeline/handlers/generic.js +67 -0
- package/prose-pipeline/handlers/generic.js.map +1 -0
- package/prose-pipeline/handlers/help.d.ts +21 -0
- package/prose-pipeline/handlers/help.d.ts.map +1 -0
- package/prose-pipeline/handlers/help.js +68 -0
- package/prose-pipeline/handlers/help.js.map +1 -0
- package/prose-pipeline/handlers/implicit-take.d.ts +20 -0
- package/prose-pipeline/handlers/implicit-take.d.ts.map +1 -0
- package/prose-pipeline/handlers/implicit-take.js +26 -0
- package/prose-pipeline/handlers/implicit-take.js.map +1 -0
- package/prose-pipeline/handlers/index.d.ts +24 -0
- package/prose-pipeline/handlers/index.d.ts.map +1 -0
- package/prose-pipeline/handlers/index.js +40 -0
- package/prose-pipeline/handlers/index.js.map +1 -0
- package/prose-pipeline/handlers/revealed.d.ts +24 -0
- package/prose-pipeline/handlers/revealed.d.ts.map +1 -0
- package/prose-pipeline/handlers/revealed.js +54 -0
- package/prose-pipeline/handlers/revealed.js.map +1 -0
- package/prose-pipeline/handlers/room.d.ts +25 -0
- package/prose-pipeline/handlers/room.d.ts.map +1 -0
- package/prose-pipeline/handlers/room.js +78 -0
- package/prose-pipeline/handlers/room.js.map +1 -0
- package/prose-pipeline/handlers/types.d.ts +47 -0
- package/prose-pipeline/handlers/types.d.ts.map +1 -0
- package/prose-pipeline/handlers/types.js +15 -0
- package/prose-pipeline/handlers/types.js.map +1 -0
- package/prose-pipeline/index.d.ts +20 -0
- package/prose-pipeline/index.d.ts.map +1 -0
- package/prose-pipeline/index.js +50 -0
- package/prose-pipeline/index.js.map +1 -0
- package/prose-pipeline/pipeline.d.ts +58 -0
- package/prose-pipeline/pipeline.d.ts.map +1 -0
- package/prose-pipeline/pipeline.js +120 -0
- package/prose-pipeline/pipeline.js.map +1 -0
- package/prose-pipeline/stages/filter.d.ts +26 -0
- package/prose-pipeline/stages/filter.d.ts.map +1 -0
- package/prose-pipeline/stages/filter.js +38 -0
- package/prose-pipeline/stages/filter.js.map +1 -0
- package/prose-pipeline/stages/index.d.ts +13 -0
- package/prose-pipeline/stages/index.d.ts.map +1 -0
- package/prose-pipeline/stages/index.js +19 -0
- package/prose-pipeline/stages/index.js.map +1 -0
- package/prose-pipeline/stages/sort.d.ts +38 -0
- package/prose-pipeline/stages/sort.d.ts.map +1 -0
- package/prose-pipeline/stages/sort.js +94 -0
- package/prose-pipeline/stages/sort.js.map +1 -0
- package/prose-pipeline/types.d.ts +45 -0
- package/prose-pipeline/types.d.ts.map +1 -0
- package/prose-pipeline/types.js +23 -0
- package/prose-pipeline/types.js.map +1 -0
- package/save-restore-service.d.ts +17 -23
- package/save-restore-service.d.ts.map +1 -1
- package/save-restore-service.js +79 -138
- package/save-restore-service.js.map +1 -1
- package/sound/dispatcher.d.ts +75 -0
- package/sound/dispatcher.d.ts.map +1 -0
- package/sound/dispatcher.js +122 -0
- package/sound/dispatcher.js.map +1 -0
- package/sound/index.d.ts +26 -0
- package/sound/index.d.ts.map +1 -0
- package/sound/index.js +34 -0
- package/sound/index.js.map +1 -0
- package/sound/propagation.d.ts +69 -0
- package/sound/propagation.d.ts.map +1 -0
- package/sound/propagation.js +219 -0
- package/sound/propagation.js.map +1 -0
- package/story.d.ts +28 -1
- package/story.d.ts.map +1 -1
- package/story.js.map +1 -1
- package/test-helpers/mock-prose-pipeline.d.ts +22 -0
- package/test-helpers/mock-prose-pipeline.d.ts.map +1 -0
- package/test-helpers/mock-prose-pipeline.js +56 -0
- package/test-helpers/mock-prose-pipeline.js.map +1 -0
- package/types.d.ts +14 -0
- package/types.d.ts.map +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-turn audibility dispatcher (ADR-172 Phase 6).
|
|
3
|
+
*
|
|
4
|
+
* Closes the loop between `emitSound` (authoring API; Step 6.1) and the
|
|
5
|
+
* `audibility` channel (Phase 5). For each `ISound` buffered during a
|
|
6
|
+
* turn, the dispatcher walks every entity carrying `ListenerTrait`,
|
|
7
|
+
* calls `propagate(sound, listenerId, world, timestamp)`, and emits one
|
|
8
|
+
* `sound.audibility.heard` `ISemanticEvent` per (sound × listener) pair
|
|
9
|
+
* that produced a non-null `IAudibilityEvent`.
|
|
10
|
+
*
|
|
11
|
+
* The dispatcher is pure: same buffer + same world state + same
|
|
12
|
+
* timestamp → same event array. Listeners are processed in entity-id
|
|
13
|
+
* sort order for deterministic event ordering across turns and runs.
|
|
14
|
+
*
|
|
15
|
+
* Owner context: `@sharpee/engine` — runtime / sound subsystem.
|
|
16
|
+
*
|
|
17
|
+
* Public interface:
|
|
18
|
+
* - `class SoundDispatcher` — the dispatcher itself.
|
|
19
|
+
* - `SoundDispatcher.dispatch(buffer, world, timestamp)` — produces
|
|
20
|
+
* the `sound.audibility.heard` events for the turn.
|
|
21
|
+
*
|
|
22
|
+
* @see ADR-172 — Spatial Sound Propagation
|
|
23
|
+
* @see ADR-163 — Channel-Service Platform (audibility channel)
|
|
24
|
+
*/
|
|
25
|
+
import { type ISemanticEvent } from "../../core/index";
|
|
26
|
+
import type { IAudibilityEvent, ISound } from "../../if-domain/index";
|
|
27
|
+
import { type WorldModel } from "../../world-model/index";
|
|
28
|
+
/**
|
|
29
|
+
* Semantic-event type fired by the dispatcher when a listener perceives
|
|
30
|
+
* a propagated sound. Mirrors `SOUND_EVENT_TYPES.AUDIBILITY_HEARD` in
|
|
31
|
+
* `@sharpee/stdlib/channels/sound-events`. The constant is duplicated
|
|
32
|
+
* here as a string literal so the engine package does not depend on
|
|
33
|
+
* stdlib at compile time (engine → stdlib is the existing dependency
|
|
34
|
+
* direction; the inverse would be a cycle). The string value is the
|
|
35
|
+
* contract — both sides must agree.
|
|
36
|
+
*/
|
|
37
|
+
export declare const AUDIBILITY_HEARD_EVENT_TYPE = "sound.audibility.heard";
|
|
38
|
+
/**
|
|
39
|
+
* Per-turn audibility dispatcher.
|
|
40
|
+
*
|
|
41
|
+
* The class shape (rather than a free function) leaves room for a
|
|
42
|
+
* future propagate-injection point in tests and for caching listener
|
|
43
|
+
* lookups across multi-action turns. For Phase 6 the dispatcher is a
|
|
44
|
+
* thin wrapper around `propagate()`; the class structure is the
|
|
45
|
+
* extension seam for L2's "NPC voice profile" layer.
|
|
46
|
+
*/
|
|
47
|
+
export declare class SoundDispatcher {
|
|
48
|
+
/**
|
|
49
|
+
* The propagation function the dispatcher uses. Defaulted to the
|
|
50
|
+
* production `propagate` from `./propagation`; tests may inject a
|
|
51
|
+
* fake to isolate dispatcher behavior from edge-graph + Dijkstra
|
|
52
|
+
* complexity.
|
|
53
|
+
*/
|
|
54
|
+
private readonly propagate;
|
|
55
|
+
constructor(propagateFn?: (sound: ISound, listenerId: string, world: WorldModel, timestamp: number) => IAudibilityEvent | null);
|
|
56
|
+
/**
|
|
57
|
+
* Dispatch every buffered sound to every listener.
|
|
58
|
+
*
|
|
59
|
+
* @param buffer The per-turn sound buffer; iterated in insertion
|
|
60
|
+
* order. May be empty (quiet turn).
|
|
61
|
+
* @param world The world model the propagation function reads
|
|
62
|
+
* from. Must be the same instance the actions
|
|
63
|
+
* mutated during the turn.
|
|
64
|
+
* @param timestamp The turn-sequence integer the engine assigns to
|
|
65
|
+
* this turn. Used as the `IAudibilityEvent.timestamp`
|
|
66
|
+
* for ordering across multi-emission turns.
|
|
67
|
+
* @returns Array of `sound.audibility.heard` events, one per
|
|
68
|
+
* (sound × listener) where `propagate()` returned
|
|
69
|
+
* non-null. Order: outer iteration over the buffer in
|
|
70
|
+
* emission order, inner iteration over listeners
|
|
71
|
+
* sorted by entity id ascending.
|
|
72
|
+
*/
|
|
73
|
+
dispatch(buffer: readonly ISound[], world: WorldModel, timestamp: number): ISemanticEvent[];
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=dispatcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/sound/dispatcher.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAA4B,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGjF;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,2BAA2B,CAAC;AAEpE;;;;;;;;GAQG;AACH,qBAAa,eAAe;IAC1B;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAKG;gBAG3B,WAAW,GAAE,CACX,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,MAAM,KACd,gBAAgB,GAAG,IAAuB;IAKjD;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CACN,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,MAAM,GAChB,cAAc,EAAE;CAsBpB"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/engine/src/sound/dispatcher.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SoundDispatcher = exports.AUDIBILITY_HEARD_EVENT_TYPE = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Per-turn audibility dispatcher (ADR-172 Phase 6).
|
|
7
|
+
*
|
|
8
|
+
* Closes the loop between `emitSound` (authoring API; Step 6.1) and the
|
|
9
|
+
* `audibility` channel (Phase 5). For each `ISound` buffered during a
|
|
10
|
+
* turn, the dispatcher walks every entity carrying `ListenerTrait`,
|
|
11
|
+
* calls `propagate(sound, listenerId, world, timestamp)`, and emits one
|
|
12
|
+
* `sound.audibility.heard` `ISemanticEvent` per (sound × listener) pair
|
|
13
|
+
* that produced a non-null `IAudibilityEvent`.
|
|
14
|
+
*
|
|
15
|
+
* The dispatcher is pure: same buffer + same world state + same
|
|
16
|
+
* timestamp → same event array. Listeners are processed in entity-id
|
|
17
|
+
* sort order for deterministic event ordering across turns and runs.
|
|
18
|
+
*
|
|
19
|
+
* Owner context: `@sharpee/engine` — runtime / sound subsystem.
|
|
20
|
+
*
|
|
21
|
+
* Public interface:
|
|
22
|
+
* - `class SoundDispatcher` — the dispatcher itself.
|
|
23
|
+
* - `SoundDispatcher.dispatch(buffer, world, timestamp)` — produces
|
|
24
|
+
* the `sound.audibility.heard` events for the turn.
|
|
25
|
+
*
|
|
26
|
+
* @see ADR-172 — Spatial Sound Propagation
|
|
27
|
+
* @see ADR-163 — Channel-Service Platform (audibility channel)
|
|
28
|
+
*/
|
|
29
|
+
const core_1 = require("../../core/index.js");
|
|
30
|
+
const world_model_1 = require("../../world-model/index.js");
|
|
31
|
+
const propagation_1 = require("./propagation");
|
|
32
|
+
/**
|
|
33
|
+
* Semantic-event type fired by the dispatcher when a listener perceives
|
|
34
|
+
* a propagated sound. Mirrors `SOUND_EVENT_TYPES.AUDIBILITY_HEARD` in
|
|
35
|
+
* `@sharpee/stdlib/channels/sound-events`. The constant is duplicated
|
|
36
|
+
* here as a string literal so the engine package does not depend on
|
|
37
|
+
* stdlib at compile time (engine → stdlib is the existing dependency
|
|
38
|
+
* direction; the inverse would be a cycle). The string value is the
|
|
39
|
+
* contract — both sides must agree.
|
|
40
|
+
*/
|
|
41
|
+
exports.AUDIBILITY_HEARD_EVENT_TYPE = 'sound.audibility.heard';
|
|
42
|
+
/**
|
|
43
|
+
* Per-turn audibility dispatcher.
|
|
44
|
+
*
|
|
45
|
+
* The class shape (rather than a free function) leaves room for a
|
|
46
|
+
* future propagate-injection point in tests and for caching listener
|
|
47
|
+
* lookups across multi-action turns. For Phase 6 the dispatcher is a
|
|
48
|
+
* thin wrapper around `propagate()`; the class structure is the
|
|
49
|
+
* extension seam for L2's "NPC voice profile" layer.
|
|
50
|
+
*/
|
|
51
|
+
class SoundDispatcher {
|
|
52
|
+
/**
|
|
53
|
+
* The propagation function the dispatcher uses. Defaulted to the
|
|
54
|
+
* production `propagate` from `./propagation`; tests may inject a
|
|
55
|
+
* fake to isolate dispatcher behavior from edge-graph + Dijkstra
|
|
56
|
+
* complexity.
|
|
57
|
+
*/
|
|
58
|
+
propagate;
|
|
59
|
+
constructor(propagateFn = propagation_1.propagate) {
|
|
60
|
+
this.propagate = propagateFn;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Dispatch every buffered sound to every listener.
|
|
64
|
+
*
|
|
65
|
+
* @param buffer The per-turn sound buffer; iterated in insertion
|
|
66
|
+
* order. May be empty (quiet turn).
|
|
67
|
+
* @param world The world model the propagation function reads
|
|
68
|
+
* from. Must be the same instance the actions
|
|
69
|
+
* mutated during the turn.
|
|
70
|
+
* @param timestamp The turn-sequence integer the engine assigns to
|
|
71
|
+
* this turn. Used as the `IAudibilityEvent.timestamp`
|
|
72
|
+
* for ordering across multi-emission turns.
|
|
73
|
+
* @returns Array of `sound.audibility.heard` events, one per
|
|
74
|
+
* (sound × listener) where `propagate()` returned
|
|
75
|
+
* non-null. Order: outer iteration over the buffer in
|
|
76
|
+
* emission order, inner iteration over listeners
|
|
77
|
+
* sorted by entity id ascending.
|
|
78
|
+
*/
|
|
79
|
+
dispatch(buffer, world, timestamp) {
|
|
80
|
+
if (buffer.length === 0)
|
|
81
|
+
return [];
|
|
82
|
+
const listeners = world
|
|
83
|
+
.findByTrait(world_model_1.TraitType.LISTENER)
|
|
84
|
+
.slice()
|
|
85
|
+
.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
|
|
86
|
+
if (listeners.length === 0)
|
|
87
|
+
return [];
|
|
88
|
+
const events = [];
|
|
89
|
+
for (const sound of buffer) {
|
|
90
|
+
for (const listener of listeners) {
|
|
91
|
+
const audibility = this.propagate(sound, listener.id, world, timestamp);
|
|
92
|
+
if (!audibility)
|
|
93
|
+
continue;
|
|
94
|
+
events.push(buildAudibilityEvent(audibility, listener.id));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return events;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.SoundDispatcher = SoundDispatcher;
|
|
101
|
+
/**
|
|
102
|
+
* Build the `sound.audibility.heard` semantic event from a propagation
|
|
103
|
+
* result and the listener that perceived it.
|
|
104
|
+
*
|
|
105
|
+
* `entities` mapping:
|
|
106
|
+
* - `actor` → `sourceEntityId` (who emitted the sound)
|
|
107
|
+
* - `location` → `sourceRoomId` (where the sound came from)
|
|
108
|
+
* - `target` → listenerId (who heard it)
|
|
109
|
+
*
|
|
110
|
+
* The `audibility` channel projection (ADR-163, ADR-172 Phase 5) reads
|
|
111
|
+
* the `IAudibilityEvent` from `event.data`; `entities` is provided for
|
|
112
|
+
* downstream filters and handlers that want a fast "who heard / from
|
|
113
|
+
* where" lookup without re-reading `data`.
|
|
114
|
+
*/
|
|
115
|
+
function buildAudibilityEvent(audibility, listenerId) {
|
|
116
|
+
return (0, core_1.createEvent)(exports.AUDIBILITY_HEARD_EVENT_TYPE, audibility, {
|
|
117
|
+
actor: audibility.sourceEntityId,
|
|
118
|
+
location: audibility.sourceRoomId,
|
|
119
|
+
target: listenerId,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=dispatcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/engine/src/sound/dispatcher.ts"],"names":[],"mappings":";AAAA,0CAA0C;;;AAE1C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,wCAAiE;AAEjE,sDAAiF;AACjF,+CAA8D;AAE9D;;;;;;;;GAQG;AACU,QAAA,2BAA2B,GAAG,wBAAwB,CAAC;AAEpE;;;;;;;;GAQG;AACH,MAAa,eAAe;IAC1B;;;;;OAKG;IACc,SAAS,CAKG;IAE7B,YACE,cAK+B,uBAAgB;QAE/C,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC;IAC/B,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CACN,MAAyB,EACzB,KAAiB,EACjB,SAAiB;QAEjB,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAEnC,MAAM,SAAS,GAAG,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(ADR-172).
|
|
3
|
+
*
|
|
4
|
+
* Owner context: engine layer. The propagation function lives here
|
|
5
|
+
* because it consumes world-model state, doesn't fit in a pure
|
|
6
|
+
* domain-types layer, and is invoked from the action pipeline (Phase
|
|
7
|
+
* 6) which is engine-adjacent.
|
|
8
|
+
*
|
|
9
|
+
* Public interface:
|
|
10
|
+
* - `propagate(sound, listenerId, world, timestamp)` — produce an
|
|
11
|
+
* `AudibilityEvent` (or null) for a single listener.
|
|
12
|
+
* - `clarityToTier(clarity)` — exposed for testability and for
|
|
13
|
+
* composition layers that need to query "what tier does this
|
|
14
|
+
* clarity value map to?".
|
|
15
|
+
* - `SoundDispatcher` — per-turn fan-out: for each buffered sound,
|
|
16
|
+
* propagate to every `ListenerTrait` entity and emit one
|
|
17
|
+
* `sound.audibility.heard` semantic event per non-silent result
|
|
18
|
+
* (Phase 6 Step 6.2).
|
|
19
|
+
* - `AUDIBILITY_HEARD_EVENT_TYPE` — the semantic-event type string
|
|
20
|
+
* fired by the dispatcher.
|
|
21
|
+
*
|
|
22
|
+
* @see ADR-172 — Spatial Sound Propagation
|
|
23
|
+
*/
|
|
24
|
+
export { propagate, clarityToTier } from './propagation';
|
|
25
|
+
export { SoundDispatcher, AUDIBILITY_HEARD_EVENT_TYPE } from './dispatcher';
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/sound/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC"}
|
package/sound/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/engine/src/sound/index.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AUDIBILITY_HEARD_EVENT_TYPE = exports.SoundDispatcher = exports.clarityToTier = exports.propagate = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* @sharpee/engine/sound — spatial sound propagation runtime (ADR-172).
|
|
7
|
+
*
|
|
8
|
+
* Owner context: engine layer. The propagation function lives here
|
|
9
|
+
* because it consumes world-model state, doesn't fit in a pure
|
|
10
|
+
* domain-types layer, and is invoked from the action pipeline (Phase
|
|
11
|
+
* 6) which is engine-adjacent.
|
|
12
|
+
*
|
|
13
|
+
* Public interface:
|
|
14
|
+
* - `propagate(sound, listenerId, world, timestamp)` — produce an
|
|
15
|
+
* `AudibilityEvent` (or null) for a single listener.
|
|
16
|
+
* - `clarityToTier(clarity)` — exposed for testability and for
|
|
17
|
+
* composition layers that need to query "what tier does this
|
|
18
|
+
* clarity value map to?".
|
|
19
|
+
* - `SoundDispatcher` — per-turn fan-out: for each buffered sound,
|
|
20
|
+
* propagate to every `ListenerTrait` entity and emit one
|
|
21
|
+
* `sound.audibility.heard` semantic event per non-silent result
|
|
22
|
+
* (Phase 6 Step 6.2).
|
|
23
|
+
* - `AUDIBILITY_HEARD_EVENT_TYPE` — the semantic-event type string
|
|
24
|
+
* fired by the dispatcher.
|
|
25
|
+
*
|
|
26
|
+
* @see ADR-172 — Spatial Sound Propagation
|
|
27
|
+
*/
|
|
28
|
+
var propagation_1 = require("./propagation");
|
|
29
|
+
Object.defineProperty(exports, "propagate", { enumerable: true, get: function () { return propagation_1.propagate; } });
|
|
30
|
+
Object.defineProperty(exports, "clarityToTier", { enumerable: true, get: function () { return propagation_1.clarityToTier; } });
|
|
31
|
+
var dispatcher_1 = require("./dispatcher");
|
|
32
|
+
Object.defineProperty(exports, "SoundDispatcher", { enumerable: true, get: function () { return dispatcher_1.SoundDispatcher; } });
|
|
33
|
+
Object.defineProperty(exports, "AUDIBILITY_HEARD_EVENT_TYPE", { enumerable: true, get: function () { return dispatcher_1.AUDIBILITY_HEARD_EVENT_TYPE; } });
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/engine/src/sound/index.ts"],"names":[],"mappings":";AAAA,qCAAqC;;;AAErC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,6CAAyD;AAAhD,wGAAA,SAAS,OAAA;AAAE,4GAAA,aAAa,OAAA;AACjC,2CAA4E;AAAnE,6GAAA,eAAe,OAAA;AAAE,yHAAA,2BAA2B,OAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spatial sound propagation function (ADR-172 Phase 3).
|
|
3
|
+
*
|
|
4
|
+
* Pure logic: given a `Sound` emission, a listener entity-id, and the
|
|
5
|
+
* world-model, returns the `AudibilityEvent` the listener perceives —
|
|
6
|
+
* or `null` if the sound is silent at the listener's location.
|
|
7
|
+
*
|
|
8
|
+
* The function is structured around three pieces:
|
|
9
|
+
*
|
|
10
|
+
* 1. **Edge-graph construction** (`getAcousticEdges`) — for any room,
|
|
11
|
+
* enumerate the rooms it's acoustically connected to, with each
|
|
12
|
+
* edge's cost. Today's edge sources are exits-with-doors and walls
|
|
13
|
+
* (per ADR-173). Future acoustic conduits ride on the same shape
|
|
14
|
+
* without changes here.
|
|
15
|
+
*
|
|
16
|
+
* 2. **Path search** (`findShortestAcousticPath`) — Dijkstra from
|
|
17
|
+
* source room to listener's room. Path cost = sum of edge costs +
|
|
18
|
+
* 1 unit per intermediate room. Wall edges traversed are recorded
|
|
19
|
+
* so the resulting `AudibilityEvent` can name a wall when the path
|
|
20
|
+
* crosses exactly one.
|
|
21
|
+
*
|
|
22
|
+
* 3. **Clarity → tier mapping** (`clarityToTier`) — the ADR-172
|
|
23
|
+
* audibility-tier table.
|
|
24
|
+
*
|
|
25
|
+
* The propagation function does *not* enumerate listeners — that is
|
|
26
|
+
* Phase 5/6's dispatcher. This file is `propagate(sound, listenerId,
|
|
27
|
+
* world, timestamp) → event | null`, intended to be called per
|
|
28
|
+
* listener.
|
|
29
|
+
*
|
|
30
|
+
* Owner context: `@sharpee/engine` — runtime / sound subsystem.
|
|
31
|
+
*
|
|
32
|
+
* @see ADR-172 — Spatial Sound Propagation
|
|
33
|
+
* @see ADR-173 — Wall Adjacency Primitive (substrate)
|
|
34
|
+
*/
|
|
35
|
+
import type { EntityId } from "../../core/index";
|
|
36
|
+
import { type AudibilityTier, type IAudibilityEvent, type ISound } from "../../if-domain/index";
|
|
37
|
+
import { WorldModel } from "../../world-model/index";
|
|
38
|
+
/**
|
|
39
|
+
* Propagate a sound emission to a single listener.
|
|
40
|
+
*
|
|
41
|
+
* Returns an `AudibilityEvent` for the listener if the sound reaches
|
|
42
|
+
* them at any tier above `silent`; returns `null` if the sound is
|
|
43
|
+
* silent at the listener's location (no reachable path, cost too high
|
|
44
|
+
* for the volume budget, or the listener has no resolvable room).
|
|
45
|
+
*
|
|
46
|
+
* Same-room emissions short-circuit to `full` audibility regardless of
|
|
47
|
+
* intervening boundaries (degenerate case from ADR-172 §Propagation
|
|
48
|
+
* function step 5).
|
|
49
|
+
*
|
|
50
|
+
* @param sound The emission shape.
|
|
51
|
+
* @param listenerId The entity id of the listener.
|
|
52
|
+
* @param world The world-model carrying rooms, walls, doors,
|
|
53
|
+
* and obstructors.
|
|
54
|
+
* @param timestamp Engine-provided turn-sequence integer for event
|
|
55
|
+
* ordering. Phase 6's dispatcher threads this from
|
|
56
|
+
* the turn manager.
|
|
57
|
+
*/
|
|
58
|
+
export declare function propagate(sound: ISound, listenerId: EntityId, world: WorldModel, timestamp: number): IAudibilityEvent | null;
|
|
59
|
+
/**
|
|
60
|
+
* Map a clarity value (volume budget − accumulated path cost) to the
|
|
61
|
+
* ADR-172 audibility tier table.
|
|
62
|
+
*
|
|
63
|
+
* Exposed for testability and so that future composition layers can
|
|
64
|
+
* reuse the mapping (e.g., a conversation-choreography layer that
|
|
65
|
+
* wants to show a "what would the audibility be at this volume from
|
|
66
|
+
* here?" debug overlay).
|
|
67
|
+
*/
|
|
68
|
+
export declare function clarityToTier(clarity: number): AudibilityTier;
|
|
69
|
+
//# sourceMappingURL=propagation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propagation.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/sound/propagation.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAUL,UAAU,EACX,MAAM,sBAAsB,CAAC;AAM9B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,QAAQ,EACpB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,MAAM,GAChB,gBAAgB,GAAG,IAAI,CAuBzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAM7D"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// packages/engine/src/sound/propagation.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.propagate = propagate;
|
|
5
|
+
exports.clarityToTier = clarityToTier;
|
|
6
|
+
const if_domain_1 = require("../../if-domain/index.js");
|
|
7
|
+
const world_model_1 = require("../../world-model/index.js");
|
|
8
|
+
// =============================================================================
|
|
9
|
+
// Public API
|
|
10
|
+
// =============================================================================
|
|
11
|
+
/**
|
|
12
|
+
* Propagate a sound emission to a single listener.
|
|
13
|
+
*
|
|
14
|
+
* Returns an `AudibilityEvent` for the listener if the sound reaches
|
|
15
|
+
* them at any tier above `silent`; returns `null` if the sound is
|
|
16
|
+
* silent at the listener's location (no reachable path, cost too high
|
|
17
|
+
* for the volume budget, or the listener has no resolvable room).
|
|
18
|
+
*
|
|
19
|
+
* Same-room emissions short-circuit to `full` audibility regardless of
|
|
20
|
+
* intervening boundaries (degenerate case from ADR-172 §Propagation
|
|
21
|
+
* function step 5).
|
|
22
|
+
*
|
|
23
|
+
* @param sound The emission shape.
|
|
24
|
+
* @param listenerId The entity id of the listener.
|
|
25
|
+
* @param world The world-model carrying rooms, walls, doors,
|
|
26
|
+
* and obstructors.
|
|
27
|
+
* @param timestamp Engine-provided turn-sequence integer for event
|
|
28
|
+
* ordering. Phase 6's dispatcher threads this from
|
|
29
|
+
* the turn manager.
|
|
30
|
+
*/
|
|
31
|
+
function propagate(sound, listenerId, world, timestamp) {
|
|
32
|
+
const listenerRoom = locateRoom(world, listenerId);
|
|
33
|
+
if (!listenerRoom)
|
|
34
|
+
return null;
|
|
35
|
+
// Same-room: full audibility, no wall, no path search.
|
|
36
|
+
if (sound.sourceLocation === listenerRoom) {
|
|
37
|
+
return buildAudibilityEvent(sound, listenerRoom, undefined, 'full', timestamp);
|
|
38
|
+
}
|
|
39
|
+
const path = findShortestAcousticPath(sound.sourceLocation, listenerRoom, world);
|
|
40
|
+
if (!path)
|
|
41
|
+
return null;
|
|
42
|
+
const budget = if_domain_1.VOLUME_TIER_BUDGETS[sound.volumeTier];
|
|
43
|
+
const clarity = budget - path.cost;
|
|
44
|
+
const tier = clarityToTier(clarity);
|
|
45
|
+
if (tier === 'silent')
|
|
46
|
+
return null;
|
|
47
|
+
// Per ADR-172 AudibilityEvent shape: `wallId` is set when the path
|
|
48
|
+
// crosses exactly one wall. Multi-wall and zero-wall (door-only)
|
|
49
|
+
// paths leave it undefined.
|
|
50
|
+
const wallId = path.wallEdges.length === 1 ? path.wallEdges[0] : undefined;
|
|
51
|
+
return buildAudibilityEvent(sound, listenerRoom, wallId, tier, timestamp);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Map a clarity value (volume budget − accumulated path cost) to the
|
|
55
|
+
* ADR-172 audibility tier table.
|
|
56
|
+
*
|
|
57
|
+
* Exposed for testability and so that future composition layers can
|
|
58
|
+
* reuse the mapping (e.g., a conversation-choreography layer that
|
|
59
|
+
* wants to show a "what would the audibility be at this volume from
|
|
60
|
+
* here?" debug overlay).
|
|
61
|
+
*/
|
|
62
|
+
function clarityToTier(clarity) {
|
|
63
|
+
if (clarity >= 4)
|
|
64
|
+
return 'full';
|
|
65
|
+
if (clarity === 3)
|
|
66
|
+
return 'muffled';
|
|
67
|
+
if (clarity === 2)
|
|
68
|
+
return 'fragments';
|
|
69
|
+
if (clarity === 1)
|
|
70
|
+
return 'presence-only';
|
|
71
|
+
return 'silent';
|
|
72
|
+
}
|
|
73
|
+
// =============================================================================
|
|
74
|
+
// Internal: room resolution
|
|
75
|
+
// =============================================================================
|
|
76
|
+
function locateRoom(world, entityId) {
|
|
77
|
+
const entity = world.getEntity(entityId);
|
|
78
|
+
if (!entity)
|
|
79
|
+
return undefined;
|
|
80
|
+
if (entity.has(world_model_1.TraitType.ROOM))
|
|
81
|
+
return entityId;
|
|
82
|
+
return world.getContainingRoom(entityId)?.id;
|
|
83
|
+
}
|
|
84
|
+
function getAcousticEdges(roomId, world) {
|
|
85
|
+
const room = world.getEntity(roomId);
|
|
86
|
+
if (!room)
|
|
87
|
+
return [];
|
|
88
|
+
const roomTrait = room.get(world_model_1.TraitType.ROOM);
|
|
89
|
+
if (!roomTrait)
|
|
90
|
+
return [];
|
|
91
|
+
const edges = [];
|
|
92
|
+
// Exits — each direction may carry a door whose state determines cost.
|
|
93
|
+
if (roomTrait.exits) {
|
|
94
|
+
for (const exit of Object.values(roomTrait.exits)) {
|
|
95
|
+
if (!exit)
|
|
96
|
+
continue;
|
|
97
|
+
const cost = exitAcousticCost(exit, world);
|
|
98
|
+
edges.push({ to: exit.destination, cost });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// Walls — effective cost combines AcousticTrait base + obstructor
|
|
102
|
+
// dampener contributions per ADR-173's generalized obstructor protocol.
|
|
103
|
+
if (roomTrait.walls) {
|
|
104
|
+
for (const wallId of roomTrait.walls) {
|
|
105
|
+
const wall = world.getEntity(wallId);
|
|
106
|
+
if (!(wall instanceof world_model_1.WallEntity))
|
|
107
|
+
continue;
|
|
108
|
+
const otherRoom = wall.otherRoom(roomId);
|
|
109
|
+
if (!otherRoom)
|
|
110
|
+
continue;
|
|
111
|
+
const cost = wallEffectiveAcousticCost(wall, world);
|
|
112
|
+
// Soundproof walls (cost = ∞) contribute no usable edge — drop
|
|
113
|
+
// them rather than feeding Infinity into Dijkstra.
|
|
114
|
+
if (!Number.isFinite(cost))
|
|
115
|
+
continue;
|
|
116
|
+
edges.push({ to: otherRoom, cost, wallId });
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Future: acoustic conduits (separate ADR) plug in here.
|
|
120
|
+
return edges;
|
|
121
|
+
}
|
|
122
|
+
function exitAcousticCost(exit, world) {
|
|
123
|
+
if (!exit.via)
|
|
124
|
+
return 1; // open passage, no door
|
|
125
|
+
const door = world.getEntity(exit.via);
|
|
126
|
+
if (!door)
|
|
127
|
+
return 1;
|
|
128
|
+
if (!door.has(world_model_1.TraitType.OPENABLE))
|
|
129
|
+
return 1; // door without state = always open
|
|
130
|
+
const openable = door.get(world_model_1.TraitType.OPENABLE);
|
|
131
|
+
return openable?.isOpen ? 1 : 4;
|
|
132
|
+
}
|
|
133
|
+
function wallEffectiveAcousticCost(wall, world) {
|
|
134
|
+
const acoustic = wall.get(world_model_1.TraitType.ACOUSTIC);
|
|
135
|
+
const baseTier = acoustic?.tier ?? 'default';
|
|
136
|
+
const baseCost = world_model_1.ACOUSTIC_TIER_COSTS[baseTier];
|
|
137
|
+
if (!Number.isFinite(baseCost))
|
|
138
|
+
return Number.POSITIVE_INFINITY;
|
|
139
|
+
// Cross-side aggregation per ADR-172 effective_cost formula:
|
|
140
|
+
// base + Σ AcousticDampenerTrait.contribution for each side's
|
|
141
|
+
// currently-located obstructor.
|
|
142
|
+
const dampeners = (0, world_model_1.findTraitsOnObstructors)(wall, world_model_1.TraitType.ACOUSTIC_DAMPENER, world);
|
|
143
|
+
const contribution = dampeners.reduce((sum, m) => sum + m.trait.contribution, 0);
|
|
144
|
+
// Negative effective cost (a hole / amplifier / extreme conduit)
|
|
145
|
+
// clamps to 0 — sound passes the wall as if it weren't there, but
|
|
146
|
+
// we don't amplify beyond the volume budget.
|
|
147
|
+
return Math.max(0, baseCost + contribution);
|
|
148
|
+
}
|
|
149
|
+
function findShortestAcousticPath(source, target, world) {
|
|
150
|
+
if (source === target)
|
|
151
|
+
return { cost: 0, wallEdges: [] };
|
|
152
|
+
const dist = new Map();
|
|
153
|
+
const prev = new Map();
|
|
154
|
+
const visited = new Set();
|
|
155
|
+
dist.set(source, 0);
|
|
156
|
+
while (true) {
|
|
157
|
+
// Pick unvisited node with minimum tentative distance.
|
|
158
|
+
let current;
|
|
159
|
+
let currentDist = Number.POSITIVE_INFINITY;
|
|
160
|
+
for (const [node, d] of dist) {
|
|
161
|
+
if (!visited.has(node) && d < currentDist) {
|
|
162
|
+
current = node;
|
|
163
|
+
currentDist = d;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (!current || !Number.isFinite(currentDist))
|
|
167
|
+
break;
|
|
168
|
+
if (current === target)
|
|
169
|
+
break;
|
|
170
|
+
visited.add(current);
|
|
171
|
+
const edges = getAcousticEdges(current, world);
|
|
172
|
+
for (const edge of edges) {
|
|
173
|
+
if (visited.has(edge.to))
|
|
174
|
+
continue;
|
|
175
|
+
// Room-traversal cost: 1 per *intermediate* room. The source
|
|
176
|
+
// room contributes 0; every subsequent leg adds 1 to account
|
|
177
|
+
// for traversing the room we're leaving from.
|
|
178
|
+
const traversalCost = current === source ? 0 : 1;
|
|
179
|
+
const tentative = currentDist + traversalCost + edge.cost;
|
|
180
|
+
const known = dist.get(edge.to) ?? Number.POSITIVE_INFINITY;
|
|
181
|
+
if (tentative < known) {
|
|
182
|
+
dist.set(edge.to, tentative);
|
|
183
|
+
prev.set(edge.to, { from: current, wallId: edge.wallId });
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
const finalCost = dist.get(target);
|
|
188
|
+
if (finalCost === undefined || !Number.isFinite(finalCost))
|
|
189
|
+
return null;
|
|
190
|
+
// Reconstruct wall edges along the chosen path.
|
|
191
|
+
const wallEdges = [];
|
|
192
|
+
let cur = target;
|
|
193
|
+
while (cur && cur !== source) {
|
|
194
|
+
const p = prev.get(cur);
|
|
195
|
+
if (!p)
|
|
196
|
+
return null;
|
|
197
|
+
if (p.wallId)
|
|
198
|
+
wallEdges.push(p.wallId);
|
|
199
|
+
cur = p.from;
|
|
200
|
+
}
|
|
201
|
+
return { cost: finalCost, wallEdges };
|
|
202
|
+
}
|
|
203
|
+
// =============================================================================
|
|
204
|
+
// Internal: AudibilityEvent construction
|
|
205
|
+
// =============================================================================
|
|
206
|
+
function buildAudibilityEvent(sound, listenerRoom, wallId, tier, timestamp) {
|
|
207
|
+
return {
|
|
208
|
+
sourceRoomId: sound.sourceLocation,
|
|
209
|
+
targetRoomId: listenerRoom,
|
|
210
|
+
wallId,
|
|
211
|
+
sourceEntityId: sound.sourceEntity,
|
|
212
|
+
kind: sound.kind,
|
|
213
|
+
volumeTier: sound.volumeTier,
|
|
214
|
+
audibilityTier: tier,
|
|
215
|
+
content: sound.content,
|
|
216
|
+
timestamp,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=propagation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propagation.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/engine/src/sound/propagation.ts"],"names":[],"mappings":";AAAA,2CAA2C;;AAiF3C,8BA4BC;AAWD,sCAMC;AAxFD,kDAK4B;AAC5B,sDAW8B;AAE9B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|
*/
|
|
4
4
|
import { WorldModel, IFEntity, IGameEvent, SimpleEventHandler } from "../world-model/index";
|
|
5
|
-
import { LanguageProvider } from "../if-domain/index";
|
|
5
|
+
import { LanguageProvider, IChannelRegistry } from "../if-domain/index";
|
|
6
6
|
import { Parser } from "../stdlib/index";
|
|
7
7
|
import { ISemanticEvent } from "../core/index";
|
|
8
8
|
import type { GameEngine } from './game-engine';
|
|
@@ -23,6 +23,16 @@ export interface StoryConfig {
|
|
|
23
23
|
* Story author(s)
|
|
24
24
|
*/
|
|
25
25
|
author: string | string[];
|
|
26
|
+
/**
|
|
27
|
+
* Credit lines for the opening banner's `author-list` section. Each
|
|
28
|
+
* string becomes one `author-list`-classed paragraph. Use this when
|
|
29
|
+
* the banner needs distinct credit lines (e.g., a primary author
|
|
30
|
+
* line plus a "Ported by …" line, or multiple separate roles).
|
|
31
|
+
*
|
|
32
|
+
* When omitted, the engine falls back to a single `author-list`
|
|
33
|
+
* entry built from `author` (joined with ", " if it's an array).
|
|
34
|
+
*/
|
|
35
|
+
credits?: string[];
|
|
26
36
|
/**
|
|
27
37
|
* Story version (semantic version, e.g., "1.0.0" or "1.0.0-beta")
|
|
28
38
|
*/
|
|
@@ -185,6 +195,23 @@ export interface Story {
|
|
|
185
195
|
* @param engine - The fully initialized game engine
|
|
186
196
|
*/
|
|
187
197
|
onEngineReady?(engine: GameEngine): void;
|
|
198
|
+
/**
|
|
199
|
+
* Register or override channels on the platform's channel registry
|
|
200
|
+
* (ADR-163 §6, §7, §14). Invoked by `engine.start()` before the
|
|
201
|
+
* `ChannelService` is constructed.
|
|
202
|
+
*
|
|
203
|
+
* Stories use this hook to:
|
|
204
|
+
* - Add story-specific channels (e.g., a `debug-stats` JSON channel
|
|
205
|
+
* for renderer overlays).
|
|
206
|
+
* - Override a standard channel by re-registering an `IOChannel`
|
|
207
|
+
* with the same id (last-write-wins per ADR-163 §6).
|
|
208
|
+
* - Register dynamic image / ambient channels via stdlib's
|
|
209
|
+
* `createImageChannel` / `createAmbientChannel` builders.
|
|
210
|
+
*
|
|
211
|
+
* The registry passed in is the same instance for the lifetime of
|
|
212
|
+
* the engine. Re-registrations persist across the session.
|
|
213
|
+
*/
|
|
214
|
+
registerChannels?(registry: IChannelRegistry): void;
|
|
188
215
|
}
|
|
189
216
|
/**
|
|
190
217
|
* Extended story class with event handling capabilities
|
package/story.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"story.d.ts","sourceRoot":"","sources":["../../../../../repos/sharpee/packages/engine/src/story.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"story.d.ts","sourceRoot":"","sources":["../../../../../repos/sharpee/packages/engine/src/story.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE1B;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IA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E,UAAU,GAAG,IAAI;IAIxC,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,QAAQ;CAG1C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAU7D"}
|
package/story.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"story.js","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/story.ts"],"names":[],"mappings":";AAAA;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"story.js","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/story.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAsSH,kDAUC;AA3SD,0DAAsD;AAkPtD;;GAEG;AACH,MAAa,eAAe;IAC1B,MAAM,CAAc;IACZ,YAAY,CAAe;IAEnC,YAAY,MAAmB;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,IAAI,4BAAY,EAAE,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,EAAE,CAAC,SAAiB,EAAE,OAA2B;QAC/C,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,SAAiB,EAAE,OAA2B;QAChD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,KAAiB;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED,0DAA0D;IAC1D,eAAe,CAAC,KAAiB;QAC/B,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IAED,YAAY,CAAC,KAAiB;QAC5B,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;CACF;AAvCD,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