@sharpee/engine 1.5.0 → 2.1.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.map +1 -1
- package/action-context-factory.js.map +1 -1
- package/capability-dispatch-helper.d.ts +5 -3
- package/capability-dispatch-helper.d.ts.map +1 -1
- package/capability-dispatch-helper.js +6 -4
- package/capability-dispatch-helper.js.map +1 -1
- package/command-executor.d.ts.map +1 -1
- package/command-executor.js +2 -2
- package/command-executor.js.map +1 -1
- package/events/event-emitter.d.ts.map +1 -1
- package/events/event-emitter.js.map +1 -1
- package/game-engine.d.ts +14 -3
- package/game-engine.d.ts.map +1 -1
- package/game-engine.js +45 -5
- package/game-engine.js.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/language-provider-interface.d.ts.map +1 -1
- package/language-provider-interface.js.map +1 -1
- package/narrative/index.d.ts.map +1 -1
- package/narrative/index.js.map +1 -1
- package/narrative/narrative-settings.d.ts.map +1 -1
- package/narrative/narrative-settings.js.map +1 -1
- package/package.json +12 -12
- package/parser-interface.d.ts.map +1 -1
- package/parser-interface.js.map +1 -1
- package/platform-operations.d.ts.map +1 -1
- package/platform-operations.js.map +1 -1
- package/prose-pipeline/assemble.d.ts.map +1 -1
- package/prose-pipeline/assemble.js.map +1 -1
- package/prose-pipeline/decorations/index.d.ts.map +1 -1
- package/prose-pipeline/decorations/index.js.map +1 -1
- package/prose-pipeline/decorations/parser.d.ts.map +1 -1
- package/prose-pipeline/decorations/parser.js.map +1 -1
- package/prose-pipeline/decorations/platform-vocabulary.d.ts.map +1 -1
- package/prose-pipeline/decorations/platform-vocabulary.js.map +1 -1
- package/prose-pipeline/decorations/resolver.d.ts.map +1 -1
- package/prose-pipeline/decorations/resolver.js.map +1 -1
- package/prose-pipeline/decorations/types.d.ts.map +1 -1
- package/prose-pipeline/decorations/types.js.map +1 -1
- package/prose-pipeline/handlers/audibility.d.ts.map +1 -1
- package/prose-pipeline/handlers/audibility.js +16 -2
- package/prose-pipeline/handlers/audibility.js.map +1 -1
- package/prose-pipeline/handlers/banner.d.ts +5 -6
- package/prose-pipeline/handlers/banner.d.ts.map +1 -1
- package/prose-pipeline/handlers/banner.js +4 -4
- package/prose-pipeline/handlers/banner.js.map +1 -1
- package/prose-pipeline/handlers/client-query.d.ts.map +1 -1
- package/prose-pipeline/handlers/client-query.js.map +1 -1
- package/prose-pipeline/handlers/command-failed.d.ts.map +1 -1
- package/prose-pipeline/handlers/command-failed.js.map +1 -1
- package/prose-pipeline/handlers/domain-message.d.ts +5 -0
- package/prose-pipeline/handlers/domain-message.d.ts.map +1 -1
- package/prose-pipeline/handlers/domain-message.js +33 -14
- package/prose-pipeline/handlers/domain-message.js.map +1 -1
- package/prose-pipeline/handlers/game.d.ts.map +1 -1
- package/prose-pipeline/handlers/game.js.map +1 -1
- package/prose-pipeline/handlers/generic.d.ts.map +1 -1
- package/prose-pipeline/handlers/generic.js +28 -3
- package/prose-pipeline/handlers/generic.js.map +1 -1
- package/prose-pipeline/handlers/implicit-take.d.ts.map +1 -1
- package/prose-pipeline/handlers/implicit-take.js.map +1 -1
- package/prose-pipeline/handlers/index.d.ts +1 -2
- package/prose-pipeline/handlers/index.d.ts.map +1 -1
- package/prose-pipeline/handlers/index.js +3 -5
- package/prose-pipeline/handlers/index.js.map +1 -1
- package/prose-pipeline/handlers/platform.d.ts +25 -0
- package/prose-pipeline/handlers/platform.d.ts.map +1 -0
- package/prose-pipeline/handlers/platform.js +48 -0
- package/prose-pipeline/handlers/platform.js.map +1 -0
- package/prose-pipeline/handlers/revealed.d.ts.map +1 -1
- package/prose-pipeline/handlers/revealed.js.map +1 -1
- package/prose-pipeline/handlers/room.d.ts.map +1 -1
- package/prose-pipeline/handlers/room.js +15 -1
- package/prose-pipeline/handlers/room.js.map +1 -1
- package/prose-pipeline/handlers/types.d.ts +11 -0
- package/prose-pipeline/handlers/types.d.ts.map +1 -1
- package/prose-pipeline/handlers/types.js.map +1 -1
- package/prose-pipeline/index.d.ts +4 -3
- package/prose-pipeline/index.d.ts.map +1 -1
- package/prose-pipeline/index.js +6 -4
- package/prose-pipeline/index.js.map +1 -1
- package/prose-pipeline/phrase-render.d.ts +54 -0
- package/prose-pipeline/phrase-render.d.ts.map +1 -0
- package/prose-pipeline/phrase-render.js +103 -0
- package/prose-pipeline/phrase-render.js.map +1 -0
- package/prose-pipeline/pipeline.d.ts +23 -5
- package/prose-pipeline/pipeline.d.ts.map +1 -1
- package/prose-pipeline/pipeline.js +57 -10
- package/prose-pipeline/pipeline.js.map +1 -1
- package/prose-pipeline/render-context.d.ts +108 -0
- package/prose-pipeline/render-context.d.ts.map +1 -0
- package/prose-pipeline/render-context.js +192 -0
- package/prose-pipeline/render-context.js.map +1 -0
- package/prose-pipeline/stages/filter.d.ts +9 -2
- package/prose-pipeline/stages/filter.d.ts.map +1 -1
- package/prose-pipeline/stages/filter.js +10 -3
- package/prose-pipeline/stages/filter.js.map +1 -1
- package/prose-pipeline/stages/index.d.ts.map +1 -1
- package/prose-pipeline/stages/index.js.map +1 -1
- package/prose-pipeline/stages/sort.d.ts.map +1 -1
- package/prose-pipeline/stages/sort.js.map +1 -1
- package/prose-pipeline/types.d.ts +33 -10
- package/prose-pipeline/types.d.ts.map +1 -1
- package/prose-pipeline/types.js +9 -9
- package/prose-pipeline/types.js.map +1 -1
- package/save-restore-service.d.ts.map +1 -1
- package/save-restore-service.js.map +1 -1
- package/scene-evaluation-plugin.d.ts.map +1 -1
- package/scene-evaluation-plugin.js.map +1 -1
- package/shared-data-keys.d.ts.map +1 -1
- package/shared-data-keys.js.map +1 -1
- package/sound/dispatcher.d.ts.map +1 -1
- package/sound/dispatcher.js.map +1 -1
- package/sound/index.d.ts.map +1 -1
- package/sound/index.js.map +1 -1
- package/sound/propagation.d.ts.map +1 -1
- package/sound/propagation.js.map +1 -1
- package/story.d.ts.map +1 -1
- package/story.js.map +1 -1
- package/test-helpers/mock-prose-pipeline.d.ts +6 -4
- package/test-helpers/mock-prose-pipeline.d.ts.map +1 -1
- package/test-helpers/mock-prose-pipeline.js +5 -1
- package/test-helpers/mock-prose-pipeline.js.map +1 -1
- package/turn-event-processor.d.ts.map +1 -1
- package/turn-event-processor.js.map +1 -1
- package/types.d.ts.map +1 -1
- package/types.js.map +1 -1
- package/vocabulary-manager.d.ts.map +1 -1
- package/vocabulary-manager.js.map +1 -1
- package/prose-pipeline/handlers/about.d.ts +0 -31
- package/prose-pipeline/handlers/about.d.ts.map +0 -1
- package/prose-pipeline/handlers/about.js +0 -50
- package/prose-pipeline/handlers/about.js.map +0 -1
- package/prose-pipeline/handlers/help.d.ts +0 -21
- package/prose-pipeline/handlers/help.d.ts.map +0 -1
- package/prose-pipeline/handlers/help.js +0 -68
- package/prose-pipeline/handlers/help.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audibility.js","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"audibility.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/audibility.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;AAqBH,sDAoDC;AAtED,sDAAkD;AAIlD,0CAA2C;AAC3C,oDAAmF;AAEnF,MAAM,0BAA0B,GAAG,aAAa,CAAC;AAEjD;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CACnC,KAAqB,EACrB,OAAuB;IAEvB,MAAM,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAC1C,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IAEzB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAoC,CAAC;IACxD,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IACjD,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc;QAA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UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC5E,CAAC;IACD,IAAI,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClD,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACnC,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAClD,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,UAAU,EAAE,CAAC;YACvC,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAED,OAAO,IAAA,uBAAY,EAAC,wBAAU,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Shared banner-block builder.
|
|
3
3
|
*
|
|
4
4
|
* Emits the opening banner as a sequence of semantically-classed
|
|
5
|
-
* blocks. Used by
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* blocks. Used by `handleGameStarted` for the game-start banner.
|
|
6
|
+
* (ABOUT renders via the lang-en-us `if.action.about.success` template
|
|
7
|
+
* since 2026-07-02; its dedicated handler was removed.)
|
|
8
8
|
*
|
|
9
9
|
* Pieces (in order):
|
|
10
10
|
*
|
|
@@ -25,8 +25,7 @@ import type { ITextBlock } from '@sharpee/text-blocks';
|
|
|
25
25
|
import type { HandlerContext } from './types';
|
|
26
26
|
/**
|
|
27
27
|
* Subset of story metadata used by the banner builder.
|
|
28
|
-
*
|
|
29
|
-
* `handleAboutDisplayed` (`event.data.params`) project into this shape.
|
|
28
|
+
* `handleGameStarted` projects `event.data.story` into this shape.
|
|
30
29
|
*/
|
|
31
30
|
export interface BannerStoryInfo {
|
|
32
31
|
title?: string;
|
|
@@ -38,7 +37,7 @@ export interface BannerStoryInfo {
|
|
|
38
37
|
}
|
|
39
38
|
/**
|
|
40
39
|
* Build the structured banner blocks for a `key` (typically
|
|
41
|
-
* `'game.banner'` from `game.started`
|
|
40
|
+
* `'game.banner'` from `game.started`).
|
|
42
41
|
*/
|
|
43
42
|
export declare function buildBannerBlocks(key: string, story: BannerStoryInfo | undefined, engineVersion: string | undefined, context: HandlerContext): ITextBlock[];
|
|
44
43
|
//# sourceMappingURL=banner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/banner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,eAAe,GAAG,SAAS,EAClC,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,OAAO,EAAE,cAAc,GACtB,UAAU,EAAE,CAmDd"}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Shared banner-block builder.
|
|
4
4
|
*
|
|
5
5
|
* Emits the opening banner as a sequence of semantically-classed
|
|
6
|
-
* blocks. Used by
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* blocks. Used by `handleGameStarted` for the game-start banner.
|
|
7
|
+
* (ABOUT renders via the lang-en-us `if.action.about.success` template
|
|
8
|
+
* since 2026-07-02; its dedicated handler was removed.)
|
|
9
9
|
*
|
|
10
10
|
* Pieces (in order):
|
|
11
11
|
*
|
|
@@ -28,7 +28,7 @@ const assemble_1 = require("../assemble");
|
|
|
28
28
|
const STORY_TAIL_MESSAGE_ID = 'game.banner.story-tail';
|
|
29
29
|
/**
|
|
30
30
|
* Build the structured banner blocks for a `key` (typically
|
|
31
|
-
* `'game.banner'` from `game.started`
|
|
31
|
+
* `'game.banner'` from `game.started`).
|
|
32
32
|
*/
|
|
33
33
|
function buildBannerBlocks(key, story, engineVersion, context) {
|
|
34
34
|
if (!story)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/banner.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAyBH,8CAwDC;AA9ED,0CAAwD;AAGxD,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAevD;;;GAGG;AACH,SAAgB,iBAAiB,CAC/B,GAAW,EACX,KAAkC,EAClC,aAAiC,EACjC,OAAuB;IAEvB,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IAEtB,MAAM,MAAM,GAAiB,EAAE,CAAC;IAEhC,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,MAAM,CAAC,IAAI,CAAC,IAAA,sBAAW,EAAC,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACnD,MAAM,WAAW,GAAG,SAAS;YAC3B,C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,IAAI,GAAG,OAAO,CAAC,gBAAgB,EAAE,UAAU,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;IAC7E,IAAI,IAAI,IAAI,IAAI,KAAK,qBAAqB,EAAE,CAAC;QAC3C,MAAM,CAAC,IAAI,CAAC,GAAG,IAAA,uBAAY,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CAAC,SAA6B;IACpD,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAC1B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9C,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-query.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"client-query.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/client-query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAU9C,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,cAAc,GACtB,UAAU,EAAE,CAgBd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-query.js","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"client-query.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/client-query.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;AAeH,8CAmBC;AA/BD,sDAAkD;AAGlD,0CAA2C;AAS3C,SAAgB,iBAAiB,CAC/B,KAAqB,EACrB,OAAuB;IAEvB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAuB,CAAC;IAE3C,IAAI,IAAI,EAAE,MAAM,KAAK,gBAAgB,EAAE,CAAC;QACtC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,cAAc,GAAG,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,mBAAmB,CAAC,cAAc,CAAC,CAAC;IAEpD,MAAM,OAAO,GACX,OAAO,CAAC,gBAAgB,EAAE,UAAU,CAAC,4BAA4B,EAAE;QACjE,OAAO;KACR,CAAC,IAAI,sBAAsB,OAAO,GAAG,CAAC;IAEzC,OAAO,IAAA,uBAAY,EAAC,wBAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,SAAS,mBAAmB,CAAC,KAAe;IAC1C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAClC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAEjD,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAElD,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IACpD,CAAC;IAED,+CAA+C;IAC/C,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,EAAE,CAAC;IAChC,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-failed.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"command-failed.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/command-failed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAQ9C,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,cAAc,GACtB,UAAU,EAAE,CA6Bd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-failed.js","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"command-failed.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/command-failed.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;AAaH,kDAgCC;AA1CD,sDAAkD;AAGlD,0CAA2C;AAO3C,SAAgB,mBAAmB,CACjC,KAAqB,EACrB,OAAuB;IAEvB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAyB,CAAC;IAC7C,MAAM,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAE1C,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC;QACjB,IACE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAC7C,CAAC;YACD,MAAM,OAAO,GACX,QAAQ,EAAE,UAAU,CAAC,uBAAuB,CAAC;gBAC7C,wBAAwB,CAAC;YAC3B,OAAO,IAAA,uBAAY,EAAC,wBAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;QAED,oEAAoE;QAEpE,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACtE,MAAM,OAAO,GACX,QAAQ,EAAE,UAAU,CAAC,6BAA6B,CAAC;gBACnD,0BAA0B,CAAC;YAC7B,OAAO,IAAA,uBAAY,EAAC,wBAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GACX,QAAQ,EAAE,UAAU,CAAC,qBAAqB,CAAC;QAC3C,0BAA0B,CAAC;IAC7B,OAAO,IAAA,uBAAY,EAAC,wBAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
* story actions emitting `action.success` / `action.blocked` events
|
|
7
7
|
* also flow through here.
|
|
8
8
|
*
|
|
9
|
+
* Params bind nested-preferred with flat fallback (`data.params ?? data`,
|
|
10
|
+
* ADR-206 unified rule) — emitters may nest template params under
|
|
11
|
+
* `params` or carry them flat on the event data; nested wins when both
|
|
12
|
+
* exist.
|
|
13
|
+
*
|
|
9
14
|
* Public interface: `tryProcessDomainEventMessage`. The pipeline
|
|
10
15
|
* consults this first; on null, it falls through to the type-keyed
|
|
11
16
|
* handlers (room, revealed, generic, etc.).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-message.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"domain-message.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/domain-message.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAW9C;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,cAAc,GACtB,UAAU,EAAE,GAAG,IAAI,CAuDrB"}
|
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
* story actions emitting `action.success` / `action.blocked` events
|
|
8
8
|
* also flow through here.
|
|
9
9
|
*
|
|
10
|
+
* Params bind nested-preferred with flat fallback (`data.params ?? data`,
|
|
11
|
+
* ADR-206 unified rule) — emitters may nest template params under
|
|
12
|
+
* `params` or carry them flat on the event data; nested wins when both
|
|
13
|
+
* exist.
|
|
14
|
+
*
|
|
10
15
|
* Public interface: `tryProcessDomainEventMessage`. The pipeline
|
|
11
16
|
* consults this first; on null, it falls through to the type-keyed
|
|
12
17
|
* handlers (room, revealed, generic, etc.).
|
|
@@ -21,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
26
|
exports.tryProcessDomainEventMessage = tryProcessDomainEventMessage;
|
|
22
27
|
const text_blocks_1 = require("@sharpee/text-blocks");
|
|
23
28
|
const assemble_1 = require("../assemble");
|
|
29
|
+
const phrase_render_1 = require("../phrase-render");
|
|
24
30
|
/**
|
|
25
31
|
* Process domain events that carry messageId directly (ADR-097).
|
|
26
32
|
*
|
|
@@ -42,25 +48,38 @@ function tryProcessDomainEventMessage(event, context) {
|
|
|
42
48
|
if (!context.languageProvider) {
|
|
43
49
|
return null;
|
|
44
50
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
// Block key chosen by event-type semantics.
|
|
52
|
+
const blockKey = event.type.includes('blocked') || event.type.includes('failure')
|
|
53
|
+
? text_blocks_1.BLOCK_KEYS.ACTION_BLOCKED
|
|
54
|
+
: text_blocks_1.BLOCK_KEYS.ACTION_RESULT;
|
|
55
|
+
const inlineFallback = () => {
|
|
56
|
+
// Many events carry both a messageId and pre-rendered text (melee combat,
|
|
57
|
+
// GDT, …). When the id is unregistered, render that inline text.
|
|
50
58
|
const fallback = data.message ?? data.text;
|
|
51
59
|
if (typeof fallback === 'string' && fallback) {
|
|
52
|
-
return (0, assemble_1.createBlocks)(
|
|
60
|
+
return (0, assemble_1.createBlocks)(blockKey, fallback);
|
|
53
61
|
}
|
|
54
|
-
// No inline text — skip silently
|
|
55
|
-
//
|
|
56
|
-
// association, not for text rendering. Actual prose comes from
|
|
57
|
-
// game.message events.
|
|
62
|
+
// No inline text — skip silently. Domain events (if.event.*) carry a
|
|
63
|
+
// messageId for semantic association, not for text rendering.
|
|
58
64
|
return null;
|
|
65
|
+
};
|
|
66
|
+
// Params binding (ADR-206 unified rule, 2026-07-02): prefer the nested
|
|
67
|
+
// `data.params` object; fall back to the flat event data — the same
|
|
68
|
+
// nested-preferred/flat-fallback rule handleGameMessage uses. Before
|
|
69
|
+
// this, the domain path was nested-only while the generic fallback bound
|
|
70
|
+
// flat, so a messageId + flat-params event failed here (stderr "param not
|
|
71
|
+
// bound" noise) and only rendered by accident via the generic handler.
|
|
72
|
+
const params = (data.params ?? data);
|
|
73
|
+
// Phrase path (ADR-192): render the template to a phrase tree and realize it.
|
|
74
|
+
if ((0, phrase_render_1.phraseAvailable)(context)) {
|
|
75
|
+
const blocks = (0, phrase_render_1.renderViaPhrase)(context, data.messageId, params, blockKey);
|
|
76
|
+
return blocks ?? inlineFallback();
|
|
77
|
+
}
|
|
78
|
+
// Legacy string path — only when the pipeline has no world (some unit tests).
|
|
79
|
+
const message = context.languageProvider.getMessage(data.messageId, params);
|
|
80
|
+
if (message === data.messageId || !message) {
|
|
81
|
+
return inlineFallback();
|
|
59
82
|
}
|
|
60
|
-
// Block key chosen by event-type semantics.
|
|
61
|
-
const blockKey = event.type.includes('blocked') || event.type.includes('failure')
|
|
62
|
-
? text_blocks_1.BLOCK_KEYS.ACTION_BLOCKED
|
|
63
|
-
: text_blocks_1.BLOCK_KEYS.ACTION_RESULT;
|
|
64
83
|
return (0, assemble_1.createBlocks)(blockKey, message);
|
|
65
84
|
}
|
|
66
85
|
//# sourceMappingURL=domain-message.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-message.js","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"domain-message.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/domain-message.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAwBH,oEA0DC;AA/ED,sDAAkD;AAGlD,0CAA2C;AAC3C,oDAAoE;AASpE;;;;;;;GAOG;AACH,SAAgB,4BAA4B,CAC1C,KAAqB,EACrB,OAAuB;IAEvB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAqC,CAAC;IAEzD,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oEAAoE;IACpE,mCAAmC;IACnC,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,4CAA4C;IAC5C,MAAM,QAAQ,GACZ,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;QA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/
|
|
1
|
+
{"version":3,"file":"game.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/game.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAA4B,MAAM,eAAe,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,cAAc,GACtB,UAAU,EAAE,CAQd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game.js","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"game.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/game.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;AAgBH,8CAWC;AAtBD,qCAA6C;AAE7C;;;;;;;;GAQG;AACH,SAAgB,iBAAiB,CAC/B,KAAqB,EACrB,OAAuB;IAEvB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAgC,CAAC;IACpD,OAAO,IAAA,0BAAiB,EACtB,aAAa,EACb,IAAI,EAAE,KAAK,EACX,IAAI,EAAE,aAAa,EACnB,OAAO,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"generic.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/generic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAoB,MAAM,SAAS,CAAC;AAWhE;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,cAAc,GACtB,UAAU,EAAE,CAyBd;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,cAAc,GACtB,UAAU,EAAE,CA0Cd"}
|
|
@@ -15,15 +15,27 @@ exports.handleGameMessage = handleGameMessage;
|
|
|
15
15
|
exports.handleGenericEvent = handleGenericEvent;
|
|
16
16
|
const text_blocks_1 = require("@sharpee/text-blocks");
|
|
17
17
|
const assemble_1 = require("../assemble");
|
|
18
|
+
const phrase_render_1 = require("../phrase-render");
|
|
18
19
|
/**
|
|
19
20
|
* Handle `game.message` events.
|
|
20
21
|
*/
|
|
21
22
|
function handleGameMessage(event, context) {
|
|
22
23
|
const data = event.data;
|
|
23
24
|
if (data.messageId && context.languageProvider) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
// Story `game.message` events often carry the template's bindings at the
|
|
26
|
+
// event-data top level rather than under `params` (the same shape
|
|
27
|
+
// handleGenericEvent accepts). Fall back to `data` so those bind.
|
|
28
|
+
const params = (data.params ?? data);
|
|
29
|
+
if ((0, phrase_render_1.phraseAvailable)(context)) {
|
|
30
|
+
const blocks = (0, phrase_render_1.renderViaPhrase)(context, data.messageId, params, text_blocks_1.BLOCK_KEYS.GAME_MESSAGE);
|
|
31
|
+
if (blocks)
|
|
32
|
+
return blocks;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
const message = context.languageProvider.getMessage(data.messageId, params);
|
|
36
|
+
if (message && message !== data.messageId) {
|
|
37
|
+
return (0, assemble_1.createBlocks)(text_blocks_1.BLOCK_KEYS.GAME_MESSAGE, message);
|
|
38
|
+
}
|
|
27
39
|
}
|
|
28
40
|
}
|
|
29
41
|
const text = data.text ?? data.message;
|
|
@@ -51,6 +63,19 @@ function handleGenericEvent(event, context) {
|
|
|
51
63
|
}
|
|
52
64
|
}
|
|
53
65
|
if (context.languageProvider) {
|
|
66
|
+
const params = data;
|
|
67
|
+
// Phrase path: try the event type as a template key, then the messageId.
|
|
68
|
+
if ((0, phrase_render_1.phraseAvailable)(context)) {
|
|
69
|
+
const byType = (0, phrase_render_1.renderViaPhrase)(context, event.type, params, text_blocks_1.BLOCK_KEYS.ACTION_RESULT);
|
|
70
|
+
if (byType)
|
|
71
|
+
return byType;
|
|
72
|
+
if (data.messageId) {
|
|
73
|
+
const byId = (0, phrase_render_1.renderViaPhrase)(context, data.messageId, params, text_blocks_1.BLOCK_KEYS.ACTION_RESULT);
|
|
74
|
+
if (byId)
|
|
75
|
+
return byId;
|
|
76
|
+
}
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
54
79
|
const message = context.languageProvider.getMessage(event.type, data);
|
|
55
80
|
if (message && message !== event.type) {
|
|
56
81
|
return (0, assemble_1.createBlocks)(text_blocks_1.BLOCK_KEYS.ACTION_RESULT, message);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic.js","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"generic.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/generic.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAmBH,8CA4BC;AASD,gDA6CC;AAlGD,sDAAkD;AAGlD,0CAA2C;AAC3C,oDAAoE;AASpE;;GAEG;AACH,SAAgB,iBAAiB,CAC/B,KAAqB,EACrB,OAAuB;IAEvB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAuB,CAAC;IAE3C,IAAI,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC/C,yEAAyE;QACzE,kEAAkE;QAClE,kEAAkE;QAClE,MAAM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,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implicit-take.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"implicit-take.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/implicit-take.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAO9C,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,cAAc,GACvB,UAAU,EAAE,CAId"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implicit-take.js","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"implicit-take.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/implicit-take.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAYH,gDAOC;AAhBD,sDAAkD;AAGlD,0CAA0C;AAM1C,SAAgB,kBAAkB,CAChC,KAAqB,EACrB,QAAwB;IAExB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAwB,CAAC;IAC5C,MAAM,QAAQ,GAAG,IAAI,EAAE,QAAQ,IAAI,WAAW,CAAC;IAC/C,OAAO,CAAC,IAAA,sBAAW,EAAC,wBAAU,CAAC,aAAa,EAAE,qBAAqB,QAAQ,GAAG,CAAC,CAAC,CAAC;AACnF,CAAC"}
|
|
@@ -14,9 +14,8 @@ export { handleRoomDescription } from './room';
|
|
|
14
14
|
export { handleRevealed } from './revealed';
|
|
15
15
|
export { handleGameMessage, handleGenericEvent } from './generic';
|
|
16
16
|
export { handleGameStarted } from './game';
|
|
17
|
-
export { handleHelpDisplayed } from './help';
|
|
18
|
-
export { handleAboutDisplayed } from './about';
|
|
19
17
|
export { handleAudibilityHeard } from './audibility';
|
|
18
|
+
export { handlePlatformEvent } from './platform';
|
|
20
19
|
export { tryProcessDomainEventMessage } from './domain-message';
|
|
21
20
|
export { handleImplicitTake } from './implicit-take';
|
|
22
21
|
export { handleCommandFailed } from './command-failed';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,EACV,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGjD,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @see ADR-174 §Engine-internal prose pipeline
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.handleClientQuery = exports.handleCommandFailed = exports.handleImplicitTake = exports.tryProcessDomainEventMessage = exports.
|
|
14
|
+
exports.handleClientQuery = exports.handleCommandFailed = exports.handleImplicitTake = exports.tryProcessDomainEventMessage = exports.handlePlatformEvent = exports.handleAudibilityHeard = exports.handleGameStarted = exports.handleGenericEvent = exports.handleGameMessage = exports.handleRevealed = exports.handleRoomDescription = void 0;
|
|
15
15
|
// Type-keyed handlers (former text-service handlers/*.ts).
|
|
16
16
|
var room_1 = require("./room");
|
|
17
17
|
Object.defineProperty(exports, "handleRoomDescription", { enumerable: true, get: function () { return room_1.handleRoomDescription; } });
|
|
@@ -22,12 +22,10 @@ Object.defineProperty(exports, "handleGameMessage", { enumerable: true, get: fun
|
|
|
22
22
|
Object.defineProperty(exports, "handleGenericEvent", { enumerable: true, get: function () { return generic_1.handleGenericEvent; } });
|
|
23
23
|
var game_1 = require("./game");
|
|
24
24
|
Object.defineProperty(exports, "handleGameStarted", { enumerable: true, get: function () { return game_1.handleGameStarted; } });
|
|
25
|
-
var help_1 = require("./help");
|
|
26
|
-
Object.defineProperty(exports, "handleHelpDisplayed", { enumerable: true, get: function () { return help_1.handleHelpDisplayed; } });
|
|
27
|
-
var about_1 = require("./about");
|
|
28
|
-
Object.defineProperty(exports, "handleAboutDisplayed", { enumerable: true, get: function () { return about_1.handleAboutDisplayed; } });
|
|
29
25
|
var audibility_1 = require("./audibility");
|
|
30
26
|
Object.defineProperty(exports, "handleAudibilityHeard", { enumerable: true, get: function () { return audibility_1.handleAudibilityHeard; } });
|
|
27
|
+
var platform_1 = require("./platform");
|
|
28
|
+
Object.defineProperty(exports, "handlePlatformEvent", { enumerable: true, get: function () { return platform_1.handlePlatformEvent; } });
|
|
31
29
|
// Inline handlers extracted from text-service.ts in this sub-phase.
|
|
32
30
|
var domain_message_1 = require("./domain-message");
|
|
33
31
|
Object.defineProperty(exports, "tryProcessDomainEventMessage", { enumerable: true, get: function () { return domain_message_1.tryProcessDomainEventMessage; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AASH,2DAA2D;AAC3D,+BAA+C;AAAtC,6GAAA,qBAAqB,OAAA;AAC9B,uCAA4C;AAAnC,0GAAA,cAAc,OAAA;AACvB,qCAAkE;AAAzD,4GAAA,iBAAiB,OAAA;AAAE,6GAAA,kBAAkB,OAAA;AAC9C,+BAA2C;AAAlC,yGAAA,iBAAiB,OAAA;AAC1B,2CAAqD;AAA5C,mHAAA,qBAAqB,OAAA;AAC9B,uCAAiD;AAAxC,+GAAA,mBAAmB,OAAA;AAE5B,oEAAoE;AACpE,mDAAgE;AAAvD,8HAAA,4BAA4B,OAAA;AACrC,iDAAqD;AAA5C,mHAAA,kBAAkB,OAAA;AAC3B,mDAAuD;AAA9C,qHAAA,mBAAmB,OAAA;AAC5B,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-event handler — renders `platform.*` lifecycle events.
|
|
3
|
+
*
|
|
4
|
+
* Platform events (core `createPlatformEvent`) carry their information in
|
|
5
|
+
* `payload`, not `data`, so the ADR-097 domain-message path never sees them.
|
|
6
|
+
* This handler renders them in the same prose-pipeline manner: the event
|
|
7
|
+
* type itself is the messageId (`platform.save_completed`,
|
|
8
|
+
* `platform.undo_failed`, ...) and params bind from the payload. lang-en-us
|
|
9
|
+
* registers the standard texts; stories override by registering the same id.
|
|
10
|
+
*
|
|
11
|
+
* Events with no registered message render nothing — request-phase events
|
|
12
|
+
* (`platform.save_requested`, ...) are intentionally silent by default.
|
|
13
|
+
*
|
|
14
|
+
* Public interface: `handlePlatformEvent`.
|
|
15
|
+
* Owner context: `@sharpee/engine` — internal prose pipeline.
|
|
16
|
+
*/
|
|
17
|
+
import type { ITextBlock } from '@sharpee/text-blocks';
|
|
18
|
+
import type { ISemanticEvent } from '@sharpee/core';
|
|
19
|
+
import type { HandlerContext } from './types';
|
|
20
|
+
/**
|
|
21
|
+
* Render a `platform.*` event via the message registered under its event
|
|
22
|
+
* type. Returns [] when no message is registered (silent by design).
|
|
23
|
+
*/
|
|
24
|
+
export declare function handlePlatformEvent(event: ISemanticEvent, context: HandlerContext): ITextBlock[];
|
|
25
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,cAAc,GACtB,UAAU,EAAE,CA0Bd"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Platform-event handler — renders `platform.*` lifecycle events.
|
|
4
|
+
*
|
|
5
|
+
* Platform events (core `createPlatformEvent`) carry their information in
|
|
6
|
+
* `payload`, not `data`, so the ADR-097 domain-message path never sees them.
|
|
7
|
+
* This handler renders them in the same prose-pipeline manner: the event
|
|
8
|
+
* type itself is the messageId (`platform.save_completed`,
|
|
9
|
+
* `platform.undo_failed`, ...) and params bind from the payload. lang-en-us
|
|
10
|
+
* registers the standard texts; stories override by registering the same id.
|
|
11
|
+
*
|
|
12
|
+
* Events with no registered message render nothing — request-phase events
|
|
13
|
+
* (`platform.save_requested`, ...) are intentionally silent by default.
|
|
14
|
+
*
|
|
15
|
+
* Public interface: `handlePlatformEvent`.
|
|
16
|
+
* Owner context: `@sharpee/engine` — internal prose pipeline.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.handlePlatformEvent = handlePlatformEvent;
|
|
20
|
+
const text_blocks_1 = require("@sharpee/text-blocks");
|
|
21
|
+
const assemble_1 = require("../assemble");
|
|
22
|
+
const phrase_render_1 = require("../phrase-render");
|
|
23
|
+
/**
|
|
24
|
+
* Render a `platform.*` event via the message registered under its event
|
|
25
|
+
* type. Returns [] when no message is registered (silent by design).
|
|
26
|
+
*/
|
|
27
|
+
function handlePlatformEvent(event, context) {
|
|
28
|
+
if (!context.languageProvider) {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
const payload = event.payload ?? {};
|
|
32
|
+
// Failure/cancellation outcomes block-key as blocked; successes as result
|
|
33
|
+
// (mirrors the domain-message handler's event-type semantics).
|
|
34
|
+
const blockKey = event.type.includes('failed') || event.type.includes('cancelled')
|
|
35
|
+
? text_blocks_1.BLOCK_KEYS.ACTION_BLOCKED
|
|
36
|
+
: text_blocks_1.BLOCK_KEYS.ACTION_RESULT;
|
|
37
|
+
// Phrase path (ADR-192).
|
|
38
|
+
if ((0, phrase_render_1.phraseAvailable)(context)) {
|
|
39
|
+
return (0, phrase_render_1.renderViaPhrase)(context, event.type, payload, blockKey) ?? [];
|
|
40
|
+
}
|
|
41
|
+
// Legacy string path — only when the pipeline has no world (unit tests).
|
|
42
|
+
const message = context.languageProvider.getMessage(event.type, payload);
|
|
43
|
+
if (!message || message === event.type) {
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
return (0, assemble_1.createBlocks)(blockKey, message);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/platform.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAaH,kDA6BC;AAvCD,sDAAkD;AAGlD,0CAA2C;AAC3C,oDAAoE;AAEpE;;;GAGG;AACH,SAAgB,mBAAmB,CACjC,KAAqB,EACrB,OAAuB;IAEvB,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC9B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GACV,KAA+C,CAAC,OAAO,IAAI,EAAE,CAAC;IAEjE,0EAA0E;IAC1E,+DAA+D;IAC/D,MAAM,QAAQ,GACZ,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;QAC/D,CAAC,CAAC,wBAAU,CAAC,cAAc;QAC3B,CAAC,CAAC,wBAAU,CAAC,aAAa,CAAC;IAE/B,yBAAyB;IACzB,IAAI,IAAA,+BAAe,EAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,OAAO,IAAA,+BAAe,EAAC,OAAO,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC;IACvE,CAAC;IAED,yEAAyE;IACzE,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACzE,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;QACvC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,IAAA,uBAAY,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revealed.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"revealed.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/revealed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAsB,MAAM,SAAS,CAAC;AAelE;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,cAAc,GACtB,UAAU,EAAE,CAkCd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revealed.js","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"revealed.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/revealed.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAuBH,wCAqCC;AAzDD,sDAAkD;AAGlD,0CAA2C;AAc3C;;GAEG;AACH,SAAgB,cAAc,CAC5B,KAAqB,EACrB,OAAuB;IAEvB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAyB,CAAC;IAE7C,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QAC7C,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,IAAA,uBAAY,EAAC,wBAAU,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE;YAC9D,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,SAAS,EAAE,IAAI,CAAC,aAAa;YAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;QAEH,IAAI,OAAO,IAAI,OAAO,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;YACtC,OAAO,IAAA,uBAAY,EAAC,wBAAU,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IAED,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK;aACzB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC;aAC3D,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC;QAC7C,MAAM,IAAI,GAAG,cAAc,SAAS,YAAY,SAAS,GAAG,CAAC;QAC7D,OAAO,IAAA,uBAAY,EAAC,wBAAU,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"room.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"room.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/room.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAkC9C;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,cAAc,GACtB,UAAU,EAAE,CA0Ed"}
|
|
@@ -20,6 +20,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
20
20
|
exports.handleRoomDescription = handleRoomDescription;
|
|
21
21
|
const text_blocks_1 = require("@sharpee/text-blocks");
|
|
22
22
|
const assemble_1 = require("../assemble");
|
|
23
|
+
const phrase_render_1 = require("../phrase-render");
|
|
24
|
+
/**
|
|
25
|
+
* Core template id for the room description body (ADR-195). Realized through the
|
|
26
|
+
* phrase pipeline so its `{slot:here}` room-occupant channel fills with the
|
|
27
|
+
* presence clauses staged this turn. Registered in `@sharpee/lang-en-us`.
|
|
28
|
+
*/
|
|
29
|
+
const ROOM_DESCRIPTION_BODY_ID = 'if.room.description_body';
|
|
23
30
|
/**
|
|
24
31
|
* Handle room description events.
|
|
25
32
|
*/
|
|
@@ -62,7 +69,14 @@ function handleRoomDescription(event, context) {
|
|
|
62
69
|
if (description) {
|
|
63
70
|
const resolvedDesc = (0, assemble_1.extractValue)(description);
|
|
64
71
|
if (resolvedDesc) {
|
|
65
|
-
|
|
72
|
+
// ADR-192/195: realize the description body through the phrase pipeline so
|
|
73
|
+
// its `{slot:here}` occupant channel fills with the presence clauses staged
|
|
74
|
+
// this turn. The room's prose is bound as a `{verbatim:description}` param;
|
|
75
|
+
// the slot owns the connective grammar. Degrade to literal blocks only when
|
|
76
|
+
// the pipeline has no world (the legacy string path, e.g. some unit tests).
|
|
77
|
+
const descBlocks = (0, phrase_render_1.phraseAvailable)(context)
|
|
78
|
+
? (0, phrase_render_1.renderViaPhrase)(context, ROOM_DESCRIPTION_BODY_ID, { description: resolvedDesc }, text_blocks_1.BLOCK_KEYS.ROOM_DESCRIPTION) ?? (0, assemble_1.createBlocks)(text_blocks_1.BLOCK_KEYS.ROOM_DESCRIPTION, resolvedDesc)
|
|
79
|
+
: (0, assemble_1.createBlocks)(text_blocks_1.BLOCK_KEYS.ROOM_DESCRIPTION, resolvedDesc);
|
|
66
80
|
// When the room name was emitted in this packet, the description's
|
|
67
81
|
// first block continues the room "heading" visually — mark it tight
|
|
68
82
|
// so the renderer collapses the inter-paragraph margin and the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"room.js","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"room.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/room.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;AA0CH,sDA6EC;AApHD,sDAAkD;AAGlD,0CAAsE;AACtE,oDAAoE;AAEpE;;;;GAIG;AACH,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AAyB5D;;GAEG;AACH,SAAgB,qBAAqB,CACnC,KAAqB,EACrB,OAAuB;IAEvB,MAAM,IAAI,GAAG,KAAK,CAAC,IAA2B,CAAC;IAC/C,MAAM,MAAM,GAAiB,EAAE,CAAC;IAEhC,0BAA0B;IAC1B,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,IAAI,IAAwB,CAAC;QAE7B,wCAAwC;QACxC,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;QACpD,IAAI,MAAM,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;YACvC,MAAM,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACjE,IAAI,QAAQ,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;gBACpC,IAAI,GAAG,QAAQ,CAAC;YAClB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,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,CAAC,CAAC,IAAA,uBAAY,EAAC,wBAAU,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;YAC5D,mEAAmE;YACnE,oEAAoE;YACpE,+DAA+D;YAC/D,mDAAmD;YACnD,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC/C,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YACpD,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -13,12 +13,23 @@
|
|
|
13
13
|
import type { ITextBlock } from '@sharpee/text-blocks';
|
|
14
14
|
import type { LanguageProvider } from '@sharpee/if-domain';
|
|
15
15
|
import type { ISemanticEvent } from '@sharpee/core';
|
|
16
|
+
import type { RenderContextFactory } from '../render-context';
|
|
16
17
|
/**
|
|
17
18
|
* Context passed to event handlers.
|
|
18
19
|
*/
|
|
19
20
|
export interface HandlerContext {
|
|
20
21
|
/** Language provider for template resolution. */
|
|
21
22
|
languageProvider?: LanguageProvider;
|
|
23
|
+
/**
|
|
24
|
+
* Per-turn render-context factory for the phrase pipeline (ADR-192, W2).
|
|
25
|
+
*
|
|
26
|
+
* Present when the pipeline was constructed with a world model; a handler on
|
|
27
|
+
* the phrase path builds its per-message `RenderContext` by calling this with
|
|
28
|
+
* the message's params, then passes it to `languageProvider.renderMessage`.
|
|
29
|
+
* Absent in legacy/world-less construction (the old string path needs no
|
|
30
|
+
* render context).
|
|
31
|
+
*/
|
|
32
|
+
makeRenderContext?: RenderContextFactory;
|
|
22
33
|
}
|
|
23
34
|
/**
|
|
24
35
|
* Event handler function signature.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAEpC;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,oBAAoB,CAAC;CAC1C;AAED;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,cAAc,KACpB,UAAU,EAAE,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../../repos/
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee_v2/packages/engine/src/prose-pipeline/handlers/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Prose pipeline — internal barrel for the engine package.
|
|
3
3
|
*
|
|
4
4
|
* Public interface: `ProsePipeline`, `createProsePipeline`,
|
|
5
|
-
* `
|
|
5
|
+
* `IProsePipeline`. Plus the decoration primitives and stage utilities
|
|
6
6
|
* the pipeline class composes.
|
|
7
7
|
*
|
|
8
8
|
* Owner context: `@sharpee/engine` — internal prose pipeline.
|
|
@@ -10,11 +10,12 @@
|
|
|
10
10
|
* @see ADR-174 §Engine-internal prose pipeline
|
|
11
11
|
*/
|
|
12
12
|
export { ProsePipeline, createProsePipeline } from './pipeline';
|
|
13
|
-
export type {
|
|
13
|
+
export type { IProsePipeline, SlotContributor } from './types';
|
|
14
|
+
export { createRenderWorld, createRenderContextFactory, type RenderContextFactory, type WorldModelLike, } from './render-context';
|
|
14
15
|
export { parseDecorations, resolveClassName, PLATFORM_VOCABULARY, PLATFORM_VOCABULARY_NAMES, type PlatformVocabularyName, type IDecoration, type TextContent, } from './decorations';
|
|
15
16
|
export { filterEvents } from './stages/filter';
|
|
16
17
|
export { sortEventsForProse, getChainMetadata, } from './stages/sort';
|
|
17
18
|
export { createBlock, createBlocks, extractValue } from './assemble';
|
|
18
19
|
export type { EventHandler, HandlerContext, ChainableEventData, GenericEventData, } from './handlers/types';
|
|
19
|
-
export { handleRoomDescription, handleRevealed, handleGameMessage, handleGenericEvent, handleGameStarted,
|
|
20
|
+
export { handleRoomDescription, handleRevealed, handleGameMessage, handleGenericEvent, handleGameStarted, handleAudibilityHeard, tryProcessDomainEventMessage, handleImplicitTake, handleCommandFailed, handleClientQuery, } from './handlers';
|
|
20
21
|
//# sourceMappingURL=index.d.ts.map
|