@sharpee/engine 0.9.113 → 1.0.8

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.
Files changed (183) hide show
  1. package/action-context-factory.d.ts +12 -4
  2. package/action-context-factory.d.ts.map +1 -1
  3. package/action-context-factory.js +32 -8
  4. package/action-context-factory.js.map +1 -1
  5. package/capability-dispatch-helper.d.ts +3 -3
  6. package/capability-dispatch-helper.d.ts.map +1 -1
  7. package/capability-dispatch-helper.js +1 -1
  8. package/command-executor.d.ts +7 -6
  9. package/command-executor.d.ts.map +1 -1
  10. package/command-executor.js +5 -5
  11. package/command-executor.js.map +1 -1
  12. package/events/event-emitter.d.ts +2 -2
  13. package/events/event-emitter.d.ts.map +1 -1
  14. package/game-engine.d.ts +93 -10
  15. package/game-engine.d.ts.map +1 -1
  16. package/game-engine.js +245 -14
  17. package/game-engine.js.map +1 -1
  18. package/index.d.ts +2 -1
  19. package/index.d.ts.map +1 -1
  20. package/index.js +3 -1
  21. package/index.js.map +1 -1
  22. package/language-provider-interface.d.ts +1 -1
  23. package/language-provider-interface.d.ts.map +1 -1
  24. package/narrative/index.d.ts.map +1 -1
  25. package/narrative/narrative-settings.d.ts +1 -1
  26. package/narrative/narrative-settings.d.ts.map +1 -1
  27. package/package.json +12 -12
  28. package/parser-interface.d.ts +2 -2
  29. package/parser-interface.d.ts.map +1 -1
  30. package/platform-operations.d.ts +2 -2
  31. package/platform-operations.d.ts.map +1 -1
  32. package/platform-operations.js +1 -1
  33. package/prose-pipeline/assemble.d.ts +77 -0
  34. package/prose-pipeline/assemble.d.ts.map +1 -0
  35. package/prose-pipeline/assemble.js +96 -0
  36. package/prose-pipeline/assemble.js.map +1 -0
  37. package/prose-pipeline/decorations/index.d.ts +18 -0
  38. package/prose-pipeline/decorations/index.d.ts.map +1 -0
  39. package/prose-pipeline/decorations/index.js +24 -0
  40. package/prose-pipeline/decorations/index.js.map +1 -0
  41. package/prose-pipeline/decorations/parser.d.ts +34 -0
  42. package/prose-pipeline/decorations/parser.d.ts.map +1 -0
  43. package/prose-pipeline/decorations/parser.js +195 -0
  44. package/prose-pipeline/decorations/parser.js.map +1 -0
  45. package/prose-pipeline/decorations/platform-vocabulary.d.ts +35 -0
  46. package/prose-pipeline/decorations/platform-vocabulary.d.ts.map +1 -0
  47. package/prose-pipeline/decorations/platform-vocabulary.js +81 -0
  48. package/prose-pipeline/decorations/platform-vocabulary.js.map +1 -0
  49. package/prose-pipeline/decorations/resolver.d.ts +28 -0
  50. package/prose-pipeline/decorations/resolver.d.ts.map +1 -0
  51. package/prose-pipeline/decorations/resolver.js +39 -0
  52. package/prose-pipeline/decorations/resolver.js.map +1 -0
  53. package/prose-pipeline/decorations/types.d.ts +16 -0
  54. package/prose-pipeline/decorations/types.d.ts.map +1 -0
  55. package/prose-pipeline/decorations/types.js +17 -0
  56. package/prose-pipeline/decorations/types.js.map +1 -0
  57. package/prose-pipeline/handlers/about.d.ts +31 -0
  58. package/prose-pipeline/handlers/about.d.ts.map +1 -0
  59. package/prose-pipeline/handlers/about.js +50 -0
  60. package/prose-pipeline/handlers/about.js.map +1 -0
  61. package/prose-pipeline/handlers/audibility.d.ts +46 -0
  62. package/prose-pipeline/handlers/audibility.d.ts.map +1 -0
  63. package/prose-pipeline/handlers/audibility.js +79 -0
  64. package/prose-pipeline/handlers/audibility.js.map +1 -0
  65. package/prose-pipeline/handlers/banner.d.ts +44 -0
  66. package/prose-pipeline/handlers/banner.d.ts.map +1 -0
  67. package/prose-pipeline/handlers/banner.js +88 -0
  68. package/prose-pipeline/handlers/banner.js.map +1 -0
  69. package/prose-pipeline/handlers/client-query.d.ts +22 -0
  70. package/prose-pipeline/handlers/client-query.d.ts.map +1 -0
  71. package/prose-pipeline/handlers/client-query.js +55 -0
  72. package/prose-pipeline/handlers/client-query.js.map +1 -0
  73. package/prose-pipeline/handlers/command-failed.d.ts +24 -0
  74. package/prose-pipeline/handlers/command-failed.d.ts.map +1 -0
  75. package/prose-pipeline/handlers/command-failed.js +46 -0
  76. package/prose-pipeline/handlers/command-failed.js.map +1 -0
  77. package/prose-pipeline/handlers/domain-message.d.ts +31 -0
  78. package/prose-pipeline/handlers/domain-message.d.ts.map +1 -0
  79. package/prose-pipeline/handlers/domain-message.js +66 -0
  80. package/prose-pipeline/handlers/domain-message.js.map +1 -0
  81. package/prose-pipeline/handlers/game.d.ts +31 -0
  82. package/prose-pipeline/handlers/game.d.ts.map +1 -0
  83. package/prose-pipeline/handlers/game.js +35 -0
  84. package/prose-pipeline/handlers/game.js.map +1 -0
  85. package/prose-pipeline/handlers/generic.d.ts +27 -0
  86. package/prose-pipeline/handlers/generic.d.ts.map +1 -0
  87. package/prose-pipeline/handlers/generic.js +67 -0
  88. package/prose-pipeline/handlers/generic.js.map +1 -0
  89. package/prose-pipeline/handlers/help.d.ts +21 -0
  90. package/prose-pipeline/handlers/help.d.ts.map +1 -0
  91. package/prose-pipeline/handlers/help.js +68 -0
  92. package/prose-pipeline/handlers/help.js.map +1 -0
  93. package/prose-pipeline/handlers/implicit-take.d.ts +20 -0
  94. package/prose-pipeline/handlers/implicit-take.d.ts.map +1 -0
  95. package/prose-pipeline/handlers/implicit-take.js +26 -0
  96. package/prose-pipeline/handlers/implicit-take.js.map +1 -0
  97. package/prose-pipeline/handlers/index.d.ts +24 -0
  98. package/prose-pipeline/handlers/index.d.ts.map +1 -0
  99. package/prose-pipeline/handlers/index.js +40 -0
  100. package/prose-pipeline/handlers/index.js.map +1 -0
  101. package/prose-pipeline/handlers/revealed.d.ts +24 -0
  102. package/prose-pipeline/handlers/revealed.d.ts.map +1 -0
  103. package/prose-pipeline/handlers/revealed.js +54 -0
  104. package/prose-pipeline/handlers/revealed.js.map +1 -0
  105. package/prose-pipeline/handlers/room.d.ts +25 -0
  106. package/prose-pipeline/handlers/room.d.ts.map +1 -0
  107. package/prose-pipeline/handlers/room.js +78 -0
  108. package/prose-pipeline/handlers/room.js.map +1 -0
  109. package/prose-pipeline/handlers/types.d.ts +47 -0
  110. package/prose-pipeline/handlers/types.d.ts.map +1 -0
  111. package/prose-pipeline/handlers/types.js +15 -0
  112. package/prose-pipeline/handlers/types.js.map +1 -0
  113. package/prose-pipeline/index.d.ts +20 -0
  114. package/prose-pipeline/index.d.ts.map +1 -0
  115. package/prose-pipeline/index.js +50 -0
  116. package/prose-pipeline/index.js.map +1 -0
  117. package/prose-pipeline/pipeline.d.ts +58 -0
  118. package/prose-pipeline/pipeline.d.ts.map +1 -0
  119. package/prose-pipeline/pipeline.js +120 -0
  120. package/prose-pipeline/pipeline.js.map +1 -0
  121. package/prose-pipeline/stages/filter.d.ts +26 -0
  122. package/prose-pipeline/stages/filter.d.ts.map +1 -0
  123. package/prose-pipeline/stages/filter.js +38 -0
  124. package/prose-pipeline/stages/filter.js.map +1 -0
  125. package/prose-pipeline/stages/index.d.ts +13 -0
  126. package/prose-pipeline/stages/index.d.ts.map +1 -0
  127. package/prose-pipeline/stages/index.js +19 -0
  128. package/prose-pipeline/stages/index.js.map +1 -0
  129. package/prose-pipeline/stages/sort.d.ts +38 -0
  130. package/prose-pipeline/stages/sort.d.ts.map +1 -0
  131. package/prose-pipeline/stages/sort.js +94 -0
  132. package/prose-pipeline/stages/sort.js.map +1 -0
  133. package/prose-pipeline/types.d.ts +45 -0
  134. package/prose-pipeline/types.d.ts.map +1 -0
  135. package/prose-pipeline/types.js +23 -0
  136. package/prose-pipeline/types.js.map +1 -0
  137. package/save-restore-service.d.ts +3 -3
  138. package/save-restore-service.d.ts.map +1 -1
  139. package/save-restore-service.js +1 -1
  140. package/scene-evaluation-plugin.d.ts +2 -2
  141. package/scene-evaluation-plugin.d.ts.map +1 -1
  142. package/scene-evaluation-plugin.js +1 -1
  143. package/shared-data-keys.d.ts +3 -3
  144. package/shared-data-keys.d.ts.map +1 -1
  145. package/sound/dispatcher.d.ts +75 -0
  146. package/sound/dispatcher.d.ts.map +1 -0
  147. package/sound/dispatcher.js +122 -0
  148. package/sound/dispatcher.js.map +1 -0
  149. package/sound/index.d.ts +26 -0
  150. package/sound/index.d.ts.map +1 -0
  151. package/sound/index.js +34 -0
  152. package/sound/index.js.map +1 -0
  153. package/sound/propagation.d.ts +69 -0
  154. package/sound/propagation.d.ts.map +1 -0
  155. package/sound/propagation.js +219 -0
  156. package/sound/propagation.js.map +1 -0
  157. package/story.d.ts +31 -4
  158. package/story.d.ts.map +1 -1
  159. package/story.js.map +1 -1
  160. package/test-helpers/mock-prose-pipeline.d.ts +22 -0
  161. package/test-helpers/mock-prose-pipeline.d.ts.map +1 -0
  162. package/test-helpers/mock-prose-pipeline.js +56 -0
  163. package/test-helpers/mock-prose-pipeline.js.map +1 -0
  164. package/turn-event-processor.d.ts +3 -3
  165. package/turn-event-processor.d.ts.map +1 -1
  166. package/turn-event-processor.js +1 -1
  167. package/types.d.ts +4 -4
  168. package/types.d.ts.map +1 -1
  169. package/vocabulary-manager.d.ts +1 -1
  170. package/vocabulary-manager.d.ts.map +1 -1
  171. package/vocabulary-manager.js +1 -1
  172. package/event-adapter.d.ts +0 -44
  173. package/event-adapter.d.ts.map +0 -1
  174. package/event-adapter.js +0 -127
  175. package/event-adapter.js.map +0 -1
  176. package/event-sequencer.d.ts +0 -73
  177. package/event-sequencer.d.ts.map +0 -1
  178. package/event-sequencer.js +0 -134
  179. package/event-sequencer.js.map +0 -1
  180. package/test-helpers/mock-text-service.d.ts +0 -11
  181. package/test-helpers/mock-text-service.d.ts.map +0 -1
  182. package/test-helpers/mock-text-service.js +0 -47
  183. package/test-helpers/mock-text-service.js.map +0 -1
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ /**
3
+ * Generic event handlers — game.message and the catch-all generic
4
+ * fallback for unknown event types.
5
+ *
6
+ * Public interface: `handleGameMessage`, `handleGenericEvent`. Used
7
+ * by the pipeline's event-type dispatch.
8
+ *
9
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
10
+ *
11
+ * @see ADR-174 §Engine-internal prose pipeline (port from text-service)
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.handleGameMessage = handleGameMessage;
15
+ exports.handleGenericEvent = handleGenericEvent;
16
+ const text_blocks_1 = require("@sharpee/text-blocks");
17
+ const assemble_1 = require("../assemble");
18
+ /**
19
+ * Handle `game.message` events.
20
+ */
21
+ function handleGameMessage(event, context) {
22
+ const data = event.data;
23
+ if (data.messageId && context.languageProvider) {
24
+ const message = context.languageProvider.getMessage(data.messageId, data.params);
25
+ if (message && message !== data.messageId) {
26
+ return (0, assemble_1.createBlocks)(text_blocks_1.BLOCK_KEYS.GAME_MESSAGE, message);
27
+ }
28
+ }
29
+ const text = data.text ?? data.message;
30
+ if (text) {
31
+ return (0, assemble_1.createBlocks)(text_blocks_1.BLOCK_KEYS.GAME_MESSAGE, text);
32
+ }
33
+ return [];
34
+ }
35
+ /**
36
+ * Handle generic / unknown events using `event.type` as the template key.
37
+ *
38
+ * Story-defined events follow the simple pattern:
39
+ * - event.type is the template key
40
+ * - event.data is the template params
41
+ */
42
+ function handleGenericEvent(event, context) {
43
+ const data = event.data;
44
+ if (!data) {
45
+ return [];
46
+ }
47
+ if (data.message || data.text) {
48
+ const text = data.message ?? data.text ?? '';
49
+ if (text) {
50
+ return (0, assemble_1.createBlocks)(text_blocks_1.BLOCK_KEYS.ACTION_RESULT, text);
51
+ }
52
+ }
53
+ if (context.languageProvider) {
54
+ const message = context.languageProvider.getMessage(event.type, data);
55
+ if (message && message !== event.type) {
56
+ return (0, assemble_1.createBlocks)(text_blocks_1.BLOCK_KEYS.ACTION_RESULT, message);
57
+ }
58
+ if (data.messageId) {
59
+ const msgFromId = context.languageProvider.getMessage(data.messageId, data);
60
+ if (msgFromId && msgFromId !== data.messageId) {
61
+ return (0, assemble_1.createBlocks)(text_blocks_1.BLOCK_KEYS.ACTION_RESULT, msgFromId);
62
+ }
63
+ }
64
+ }
65
+ return [];
66
+ }
67
+ //# sourceMappingURL=generic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generic.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/packages/engine/src/prose-pipeline/handlers/generic.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAkBH,8CAsBC;AASD,gDAoCC;AAlFD,sDAAkD;AAGlD,0CAA2C;AAS3C;;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,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,UAAU,CACjD,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,MAAM,CACZ,CAAC;QACF,IAAI,OAAO,IAAI,OAAO,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC;YAC1C,OAAO,IAAA,uBAAY,EAAC,wBAAU,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC;IACvC,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,IAAA,uBAAY,EAAC,wBAAU,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAChC,KAAqB,EACrB,OAAuB;IAEvB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAwB,CAAC;IAE5C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,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,IAAI,CAAC,CAAC;QAEtE,IAAI,OAAO,IAAI,OAAO,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;YACtC,OAAO,IAAA,uBAAY,EAAC,wBAAU,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACzD,CAAC;QAED,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC,UAAU,CACnD,IAAI,CAAC,SAAS,EACd,IAAI,CACL,CAAC;YACF,IAAI,SAAS,IAAI,SAAS,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC;gBAC9C,OAAO,IAAA,uBAAY,EAAC,wBAAU,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Help event handler — `if.event.help_displayed`.
3
+ *
4
+ * Produces the canonical "HOW TO PLAY INTERACTIVE FICTION" block.
5
+ * Content based on the PR-IF "How to Play" reference card.
6
+ *
7
+ * Public interface: `handleHelpDisplayed`. Used by the pipeline's
8
+ * event-type dispatch.
9
+ *
10
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
11
+ *
12
+ * @see ADR-174 §Engine-internal prose pipeline (port from text-service)
13
+ */
14
+ import type { ITextBlock } from '@sharpee/text-blocks';
15
+ import type { ISemanticEvent } from '@sharpee/core';
16
+ import type { HandlerContext } from './types';
17
+ /**
18
+ * Handle `if.event.help_displayed` to produce the help text block.
19
+ */
20
+ export declare function handleHelpDisplayed(_event: ISemanticEvent, _context: HandlerContext): ITextBlock[];
21
+ //# sourceMappingURL=help.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/packages/engine/src/prose-pipeline/handlers/help.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAgD9C;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,cAAc,GACvB,UAAU,EAAE,CAEd"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ /**
3
+ * Help event handler — `if.event.help_displayed`.
4
+ *
5
+ * Produces the canonical "HOW TO PLAY INTERACTIVE FICTION" block.
6
+ * Content based on the PR-IF "How to Play" reference card.
7
+ *
8
+ * Public interface: `handleHelpDisplayed`. Used by the pipeline's
9
+ * event-type dispatch.
10
+ *
11
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
12
+ *
13
+ * @see ADR-174 §Engine-internal prose pipeline (port from text-service)
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.handleHelpDisplayed = handleHelpDisplayed;
17
+ const assemble_1 = require("../assemble");
18
+ const HELP_TEXT = `HOW TO PLAY INTERACTIVE FICTION
19
+
20
+ Interactive fiction is a conversation between you and the game. You type commands; the game describes what happens.
21
+
22
+ MOVING AROUND
23
+ Type a direction to move: NORTH (N), SOUTH (S), EAST (E), WEST (W),
24
+ NORTHEAST (NE), NORTHWEST (NW), SOUTHEAST (SE), SOUTHWEST (SW),
25
+ UP (U), DOWN (D), IN, OUT, ENTER, EXIT.
26
+
27
+ LOOKING AND EXAMINING
28
+ LOOK (L) - Describe your surroundings.
29
+ EXAMINE (X) something - Look closely at an object.
30
+
31
+ INTERACTING WITH OBJECTS
32
+ TAKE (GET) something - Pick it up.
33
+ DROP something - Put it down.
34
+ OPEN / CLOSE something - Open or close a door, container, etc.
35
+ PUT something IN / ON something - Place an object in a container or on a surface.
36
+ LOCK / UNLOCK something WITH something - Lock or unlock with a key.
37
+ TURN ON / TURN OFF something - Operate a switch or device.
38
+ WEAR / TAKE OFF something - Put on or remove clothing.
39
+ EAT / DRINK something - Consume food or drink.
40
+ READ something - Read text on an object.
41
+ SEARCH something - Search a container or area.
42
+ LOOK UNDER / LOOK BEHIND something - Check hidden spots.
43
+
44
+ TALKING TO CHARACTERS
45
+ TALK TO someone - Start a conversation.
46
+ ASK someone ABOUT something - Ask about a topic.
47
+ TELL someone ABOUT something - Tell them something.
48
+ GIVE something TO someone - Hand over an item.
49
+ SHOW something TO someone - Display an item.
50
+
51
+ OTHER COMMANDS
52
+ INVENTORY (I) - List what you're carrying.
53
+ WAIT (Z) - Let time pass.
54
+ AGAIN (G) - Repeat your last command.
55
+ SCORE - Check your progress.
56
+ SAVE / RESTORE - Save or load your game.
57
+ UNDO - Take back your last move.
58
+ QUIT - End the game.
59
+ ABOUT - Information about this game.
60
+
61
+ When in doubt, EXAMINE everything.`;
62
+ /**
63
+ * Handle `if.event.help_displayed` to produce the help text block.
64
+ */
65
+ function handleHelpDisplayed(_event, _context) {
66
+ return (0, assemble_1.createBlocks)('help.text', HELP_TEXT);
67
+ }
68
+ //# sourceMappingURL=help.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/packages/engine/src/prose-pipeline/handlers/help.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAuDH,kDAKC;AAvDD,0CAA2C;AAE3C,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA2CiB,CAAC;AAEpC;;GAEG;AACH,SAAgB,mBAAmB,CACjC,MAAsB,EACtB,QAAwB;IAExB,OAAO,IAAA,uBAAY,EAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Implicit-take handler — `if.event.implicit_take`.
3
+ *
4
+ * Produces the "(first taking the X)" line that prefaces an action
5
+ * the parser auto-promoted (e.g. "READ BOOK" when the player isn't
6
+ * holding the book yet).
7
+ *
8
+ * Public interface: `handleImplicitTake`. Used by the pipeline's
9
+ * event-type dispatch.
10
+ *
11
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
12
+ *
13
+ * @see ADR-174 §Engine-internal prose pipeline (extracted from
14
+ * text-service.ts inline)
15
+ */
16
+ import type { ITextBlock } from '@sharpee/text-blocks';
17
+ import type { ISemanticEvent } from '@sharpee/core';
18
+ import type { HandlerContext } from './types';
19
+ export declare function handleImplicitTake(event: ISemanticEvent, _context: HandlerContext): ITextBlock[];
20
+ //# sourceMappingURL=implicit-take.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"implicit-take.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/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"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /**
3
+ * Implicit-take handler — `if.event.implicit_take`.
4
+ *
5
+ * Produces the "(first taking the X)" line that prefaces an action
6
+ * the parser auto-promoted (e.g. "READ BOOK" when the player isn't
7
+ * holding the book yet).
8
+ *
9
+ * Public interface: `handleImplicitTake`. Used by the pipeline's
10
+ * event-type dispatch.
11
+ *
12
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
13
+ *
14
+ * @see ADR-174 §Engine-internal prose pipeline (extracted from
15
+ * text-service.ts inline)
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.handleImplicitTake = handleImplicitTake;
19
+ const text_blocks_1 = require("@sharpee/text-blocks");
20
+ const assemble_1 = require("../assemble");
21
+ function handleImplicitTake(event, _context) {
22
+ const data = event.data;
23
+ const itemName = data?.itemName || 'something';
24
+ return [(0, assemble_1.createBlock)(text_blocks_1.BLOCK_KEYS.ACTION_RESULT, `(first taking the ${itemName})`)];
25
+ }
26
+ //# sourceMappingURL=implicit-take.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"implicit-take.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/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"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Prose pipeline handlers — internal barrel.
3
+ *
4
+ * Public interface: re-exports every handler family the pipeline
5
+ * dispatches to, plus the shared `HandlerContext` / `EventHandler`
6
+ * types. Used by the pipeline class (sub-phase 1.5).
7
+ *
8
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
9
+ *
10
+ * @see ADR-174 §Engine-internal prose pipeline
11
+ */
12
+ export type { EventHandler, HandlerContext, ChainableEventData, GenericEventData, } from './types';
13
+ export { handleRoomDescription } from './room';
14
+ export { handleRevealed } from './revealed';
15
+ export { handleGameMessage, handleGenericEvent } from './generic';
16
+ export { handleGameStarted } from './game';
17
+ export { handleHelpDisplayed } from './help';
18
+ export { handleAboutDisplayed } from './about';
19
+ export { handleAudibilityHeard } from './audibility';
20
+ export { tryProcessDomainEventMessage } from './domain-message';
21
+ export { handleImplicitTake } from './implicit-take';
22
+ export { handleCommandFailed } from './command-failed';
23
+ export { handleClientQuery } from './client-query';
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/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,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAGrD,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"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /**
3
+ * Prose pipeline handlers — internal barrel.
4
+ *
5
+ * Public interface: re-exports every handler family the pipeline
6
+ * dispatches to, plus the shared `HandlerContext` / `EventHandler`
7
+ * types. Used by the pipeline class (sub-phase 1.5).
8
+ *
9
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
10
+ *
11
+ * @see ADR-174 §Engine-internal prose pipeline
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.handleClientQuery = exports.handleCommandFailed = exports.handleImplicitTake = exports.tryProcessDomainEventMessage = exports.handleAudibilityHeard = exports.handleAboutDisplayed = exports.handleHelpDisplayed = exports.handleGameStarted = exports.handleGenericEvent = exports.handleGameMessage = exports.handleRevealed = exports.handleRoomDescription = void 0;
15
+ // Type-keyed handlers (former text-service handlers/*.ts).
16
+ var room_1 = require("./room");
17
+ Object.defineProperty(exports, "handleRoomDescription", { enumerable: true, get: function () { return room_1.handleRoomDescription; } });
18
+ var revealed_1 = require("./revealed");
19
+ Object.defineProperty(exports, "handleRevealed", { enumerable: true, get: function () { return revealed_1.handleRevealed; } });
20
+ var generic_1 = require("./generic");
21
+ Object.defineProperty(exports, "handleGameMessage", { enumerable: true, get: function () { return generic_1.handleGameMessage; } });
22
+ Object.defineProperty(exports, "handleGenericEvent", { enumerable: true, get: function () { return generic_1.handleGenericEvent; } });
23
+ var game_1 = require("./game");
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
+ var audibility_1 = require("./audibility");
30
+ Object.defineProperty(exports, "handleAudibilityHeard", { enumerable: true, get: function () { return audibility_1.handleAudibilityHeard; } });
31
+ // Inline handlers extracted from text-service.ts in this sub-phase.
32
+ var domain_message_1 = require("./domain-message");
33
+ Object.defineProperty(exports, "tryProcessDomainEventMessage", { enumerable: true, get: function () { return domain_message_1.tryProcessDomainEventMessage; } });
34
+ var implicit_take_1 = require("./implicit-take");
35
+ Object.defineProperty(exports, "handleImplicitTake", { enumerable: true, get: function () { return implicit_take_1.handleImplicitTake; } });
36
+ var command_failed_1 = require("./command-failed");
37
+ Object.defineProperty(exports, "handleCommandFailed", { enumerable: true, get: function () { return command_failed_1.handleCommandFailed; } });
38
+ var client_query_1 = require("./client-query");
39
+ Object.defineProperty(exports, "handleClientQuery", { enumerable: true, get: function () { return client_query_1.handleClientQuery; } });
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/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,+BAA6C;AAApC,2GAAA,mBAAmB,OAAA;AAC5B,iCAA+C;AAAtC,6GAAA,oBAAoB,OAAA;AAC7B,2CAAqD;AAA5C,mHAAA,qBAAqB,OAAA;AAE9B,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,24 @@
1
+ /**
2
+ * Revealed event handler.
3
+ *
4
+ * Handles `if.event.revealed` — fired when items become visible inside
5
+ * a container. Pulls a direct message/text payload first, then tries
6
+ * the language provider keyed on event type, then falls back to a
7
+ * built-in "Inside the {container} you see {items}." formatter.
8
+ *
9
+ * Public interface: `handleRevealed`. Used by the pipeline's
10
+ * event-type dispatch.
11
+ *
12
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
13
+ *
14
+ * @see ADR-094 Event Chaining
15
+ * @see ADR-174 §Engine-internal prose pipeline (port from text-service)
16
+ */
17
+ import type { ITextBlock } from '@sharpee/text-blocks';
18
+ import type { ISemanticEvent } from '@sharpee/core';
19
+ import type { HandlerContext } from './types';
20
+ /**
21
+ * Handle `if.event.revealed` events.
22
+ */
23
+ export declare function handleRevealed(event: ISemanticEvent, context: HandlerContext): ITextBlock[];
24
+ //# sourceMappingURL=revealed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revealed.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/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"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /**
3
+ * Revealed event handler.
4
+ *
5
+ * Handles `if.event.revealed` — fired when items become visible inside
6
+ * a container. Pulls a direct message/text payload first, then tries
7
+ * the language provider keyed on event type, then falls back to a
8
+ * built-in "Inside the {container} you see {items}." formatter.
9
+ *
10
+ * Public interface: `handleRevealed`. Used by the pipeline's
11
+ * event-type dispatch.
12
+ *
13
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
14
+ *
15
+ * @see ADR-094 Event Chaining
16
+ * @see ADR-174 §Engine-internal prose pipeline (port from text-service)
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.handleRevealed = handleRevealed;
20
+ const text_blocks_1 = require("@sharpee/text-blocks");
21
+ const assemble_1 = require("../assemble");
22
+ /**
23
+ * Handle `if.event.revealed` events.
24
+ */
25
+ function handleRevealed(event, context) {
26
+ const data = event.data;
27
+ if (data.message || data.text) {
28
+ const text = data.message ?? data.text ?? '';
29
+ if (text) {
30
+ return (0, assemble_1.createBlocks)(text_blocks_1.BLOCK_KEYS.ACTION_RESULT, text);
31
+ }
32
+ }
33
+ if (context.languageProvider) {
34
+ const message = context.languageProvider.getMessage(event.type, {
35
+ containerId: data.containerId,
36
+ containerName: data.containerName,
37
+ container: data.containerName,
38
+ items: data.items,
39
+ });
40
+ if (message && message !== event.type) {
41
+ return (0, assemble_1.createBlocks)(text_blocks_1.BLOCK_KEYS.ACTION_RESULT, message);
42
+ }
43
+ }
44
+ if (data.items && data.items.length > 0) {
45
+ const itemNames = data.items
46
+ .map((item) => item.name ?? item.messageId ?? item.entityId)
47
+ .join(', ');
48
+ const container = data.containerName ?? 'it';
49
+ const text = `Inside the ${container} you see ${itemNames}.`;
50
+ return (0, assemble_1.createBlocks)(text_blocks_1.BLOCK_KEYS.ACTION_RESULT, text);
51
+ }
52
+ return [];
53
+ }
54
+ //# sourceMappingURL=revealed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revealed.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/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"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Room description event handler.
3
+ *
4
+ * Handles `if.event.room.description` (canonical form) and
5
+ * `if.event.room_description` (legacy alternate). Resolves the
6
+ * room name and description through the language provider when a
7
+ * message id is present (ADR-107 dual-mode), falling back to literal
8
+ * text otherwise.
9
+ *
10
+ * Public interface: `handleRoomDescription`. Used by the pipeline's
11
+ * event-type dispatch.
12
+ *
13
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
14
+ *
15
+ * @see ADR-107 — Dual-mode literal/messageId handling
16
+ * @see ADR-174 §Engine-internal prose pipeline (port from text-service)
17
+ */
18
+ import type { ITextBlock } from '@sharpee/text-blocks';
19
+ import type { ISemanticEvent } from '@sharpee/core';
20
+ import type { HandlerContext } from './types';
21
+ /**
22
+ * Handle room description events.
23
+ */
24
+ export declare function handleRoomDescription(event: ISemanticEvent, context: HandlerContext): ITextBlock[];
25
+ //# sourceMappingURL=room.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"room.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/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;AA0B9C;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,cAAc,GACtB,UAAU,EAAE,CA8Dd"}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ /**
3
+ * Room description event handler.
4
+ *
5
+ * Handles `if.event.room.description` (canonical form) and
6
+ * `if.event.room_description` (legacy alternate). Resolves the
7
+ * room name and description through the language provider when a
8
+ * message id is present (ADR-107 dual-mode), falling back to literal
9
+ * text otherwise.
10
+ *
11
+ * Public interface: `handleRoomDescription`. Used by the pipeline's
12
+ * event-type dispatch.
13
+ *
14
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
15
+ *
16
+ * @see ADR-107 — Dual-mode literal/messageId handling
17
+ * @see ADR-174 §Engine-internal prose pipeline (port from text-service)
18
+ */
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.handleRoomDescription = handleRoomDescription;
21
+ const text_blocks_1 = require("@sharpee/text-blocks");
22
+ const assemble_1 = require("../assemble");
23
+ /**
24
+ * Handle room description events.
25
+ */
26
+ function handleRoomDescription(event, context) {
27
+ const data = event.data;
28
+ const blocks = [];
29
+ // Room name (if verbose).
30
+ if (data.verbose) {
31
+ let name;
32
+ // ADR-107: message ID takes precedence.
33
+ const nameId = data.roomNameId ?? data.room?.nameId;
34
+ if (nameId && context.languageProvider) {
35
+ const resolved = context.languageProvider.getMessage(nameId, {});
36
+ if (resolved && resolved !== nameId) {
37
+ name = resolved;
38
+ }
39
+ }
40
+ if (!name) {
41
+ name = data.room?.name ?? data.roomName;
42
+ }
43
+ if (name) {
44
+ const resolvedName = (0, assemble_1.extractValue)(name);
45
+ if (resolvedName) {
46
+ blocks.push((0, assemble_1.createBlock)(text_blocks_1.BLOCK_KEYS.ROOM_NAME, `[room:${resolvedName}]`));
47
+ }
48
+ }
49
+ }
50
+ // Room description.
51
+ let description;
52
+ const descriptionId = data.roomDescriptionId ?? data.room?.descriptionId;
53
+ if (descriptionId && context.languageProvider) {
54
+ const resolved = context.languageProvider.getMessage(descriptionId, {});
55
+ if (resolved && resolved !== descriptionId) {
56
+ description = resolved;
57
+ }
58
+ }
59
+ if (!description) {
60
+ description = data.room?.description ?? data.roomDescription;
61
+ }
62
+ if (description) {
63
+ const resolvedDesc = (0, assemble_1.extractValue)(description);
64
+ if (resolvedDesc) {
65
+ const descBlocks = (0, assemble_1.createBlocks)(text_blocks_1.BLOCK_KEYS.ROOM_DESCRIPTION, resolvedDesc);
66
+ // When the room name was emitted in this packet, the description's
67
+ // first block continues the room "heading" visually — mark it tight
68
+ // so the renderer collapses the inter-paragraph margin and the
69
+ // description sits flush under the bold room name.
70
+ if (descBlocks.length > 0 && blocks.length > 0) {
71
+ descBlocks[0] = { ...descBlocks[0], tight: true };
72
+ }
73
+ blocks.push(...descBlocks);
74
+ }
75
+ }
76
+ return blocks;
77
+ }
78
+ //# sourceMappingURL=room.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"room.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/packages/engine/src/prose-pipeline/handlers/room.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;AAkCH,sDAiEC;AAhGD,sDAAkD;AAGlD,0CAAsE;AAyBtE;;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,IAAI,IAAI,EAAE,CAAC;YACT,MAAM,YAAY,GAAG,IAAA,uBAAY,EAAC,IAAI,CAAC,CAAC;YACxC,IAAI,YAAY,EAAE,CAAC;gBACjB,MAAM,CAAC,IAAI,CACT,IAAA,sBAAW,EAAC,wBAAU,CAAC,SAAS,EAAE,SAAS,YAAY,GAAG,CAAC,CAC5D,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,oBAAoB;IACpB,IAAI,WAA+B,CAAC;IAEpC,MAAM,aAAa,GAAG,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC;IACzE,IAAI,aAAa,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC9C,MAAM,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;QACxE,IAAI,QAAQ,IAAI,QAAQ,KAAK,aAAa,EAAE,CAAC;YAC3C,WAAW,GAAG,QAAQ,CAAC;QACzB,CAAC;IACH,CAAC;IAED,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,WAAW,IAAI,IAAI,CAAC,eAAe,CAAC;IAC/D,CAAC;IAED,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,YAAY,GAAG,IAAA,uBAAY,EAAC,WAAW,CAAC,CAAC;QAC/C,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,UAAU,GAAG,IAAA,uBAAY,EAAC,wBAAU,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;YAC3E,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"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Handler types for the engine prose pipeline.
3
+ *
4
+ * Public interface: `HandlerContext`, `EventHandler`,
5
+ * `ChainableEventData`, `GenericEventData`. Used by handler families
6
+ * and the pipeline class.
7
+ *
8
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
9
+ *
10
+ * @see ADR-174 §Engine-internal prose pipeline
11
+ * @see ADR-094 (chain metadata semantics, preserved)
12
+ */
13
+ import type { ITextBlock } from '@sharpee/text-blocks';
14
+ import type { LanguageProvider } from '@sharpee/if-domain';
15
+ import type { ISemanticEvent } from '@sharpee/core';
16
+ /**
17
+ * Context passed to event handlers.
18
+ */
19
+ export interface HandlerContext {
20
+ /** Language provider for template resolution. */
21
+ languageProvider?: LanguageProvider;
22
+ }
23
+ /**
24
+ * Event handler function signature.
25
+ *
26
+ * Handlers receive an event and context, return zero or more TextBlocks.
27
+ */
28
+ export type EventHandler = (event: ISemanticEvent, context: HandlerContext) => ITextBlock[];
29
+ /**
30
+ * Common event data with chain metadata (ADR-094).
31
+ */
32
+ export interface ChainableEventData {
33
+ _transactionId?: string;
34
+ _chainDepth?: number;
35
+ _chainedFrom?: string;
36
+ _chainSourceId?: string;
37
+ }
38
+ /**
39
+ * Generic event data with message fields.
40
+ */
41
+ export interface GenericEventData extends ChainableEventData {
42
+ message?: string;
43
+ messageId?: string;
44
+ text?: string;
45
+ [key: string]: unknown;
46
+ }
47
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/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;AAEpD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC;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"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * Handler types for the engine prose pipeline.
4
+ *
5
+ * Public interface: `HandlerContext`, `EventHandler`,
6
+ * `ChainableEventData`, `GenericEventData`. Used by handler families
7
+ * and the pipeline class.
8
+ *
9
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
10
+ *
11
+ * @see ADR-174 §Engine-internal prose pipeline
12
+ * @see ADR-094 (chain metadata semantics, preserved)
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/packages/engine/src/prose-pipeline/handlers/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Prose pipeline — internal barrel for the engine package.
3
+ *
4
+ * Public interface: `ProsePipeline`, `createProsePipeline`,
5
+ * `ITextService`. Plus the decoration primitives and stage utilities
6
+ * the pipeline class composes.
7
+ *
8
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
9
+ *
10
+ * @see ADR-174 §Engine-internal prose pipeline
11
+ */
12
+ export { ProsePipeline, createProsePipeline } from './pipeline';
13
+ export type { ITextService } from './types';
14
+ export { parseDecorations, resolveClassName, PLATFORM_VOCABULARY, PLATFORM_VOCABULARY_NAMES, type PlatformVocabularyName, type IDecoration, type TextContent, } from './decorations';
15
+ export { filterEvents } from './stages/filter';
16
+ export { sortEventsForProse, getChainMetadata, } from './stages/sort';
17
+ export { createBlock, createBlocks, extractValue } from './assemble';
18
+ export type { EventHandler, HandlerContext, ChainableEventData, GenericEventData, } from './handlers/types';
19
+ export { handleRoomDescription, handleRevealed, handleGameMessage, handleGenericEvent, handleGameStarted, handleHelpDisplayed, handleAboutDisplayed, handleAudibilityHeard, tryProcessDomainEventMessage, handleImplicitTake, handleCommandFailed, handleClientQuery, } from './handlers';
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/engine/src/prose-pipeline/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGhE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAK5C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGrE,YAAY,EACV,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,EAC5B,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,YAAY,CAAC"}