@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
package/index.d.ts CHANGED
@@ -14,12 +14,13 @@ export * from './capability-dispatch-helper';
14
14
  export * from './parser-interface';
15
15
  export * from './shared-data-keys';
16
16
  export * from './game-engine';
17
- export { PluginRegistry, TurnPlugin, TurnPluginContext } from "../plugins/index";
17
+ export { PluginRegistry, TurnPlugin, TurnPluginContext } from '@sharpee/plugins';
18
18
  export { SceneEvaluationPlugin } from './scene-evaluation-plugin';
19
19
  export * from './vocabulary-manager';
20
20
  export * from './save-restore-service';
21
21
  export * from './turn-event-processor';
22
22
  export * from './platform-operations';
23
+ export * from './sound';
23
24
  export { GameEngine } from './game-engine';
24
25
  export { CommandExecutor, createCommandExecutor } from './command-executor';
25
26
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../repos/sharpee/packages/engine/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,aAAa,CAAC;AAG5B,cAAc,SAAS,CAAC;AAGxB,cAAc,oBAAoB,CAAC;AAGnC,cAAc,8BAA8B,CAAC;AAG7C,cAAc,oBAAoB,CAAC;AAGnC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,eAAe,CAAC;AAG9B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AAGtC,OAAO,EACL,UAAU,EACX,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,eAAe,EACf,qBAAqB,EACtB,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,aAAa,CAAC;AAG5B,cAAc,SAAS,CAAC;AAGxB,cAAc,oBAAoB,CAAC;AAGnC,cAAc,8BAA8B,CAAC;AAG7C,cAAc,oBAAoB,CAAC;AAGnC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,eAAe,CAAC;AAG9B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,SAAS,CAAC;AAGxB,OAAO,EACL,UAAU,EACX,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,eAAe,EACf,qBAAqB,EACtB,MAAM,oBAAoB,CAAC"}
package/index.js CHANGED
@@ -40,7 +40,7 @@ __exportStar(require("./shared-data-keys"), exports);
40
40
  // Main engine
41
41
  __exportStar(require("./game-engine"), exports);
42
42
  // Plugin system (ADR-120)
43
- var plugins_1 = require("../plugins/index.js");
43
+ var plugins_1 = require("@sharpee/plugins");
44
44
  Object.defineProperty(exports, "PluginRegistry", { enumerable: true, get: function () { return plugins_1.PluginRegistry; } });
45
45
  // Scene evaluation (ADR-149)
46
46
  var scene_evaluation_plugin_1 = require("./scene-evaluation-plugin");
@@ -50,6 +50,8 @@ __exportStar(require("./vocabulary-manager"), exports);
50
50
  __exportStar(require("./save-restore-service"), exports);
51
51
  __exportStar(require("./turn-event-processor"), exports);
52
52
  __exportStar(require("./platform-operations"), exports);
53
+ // Spatial sound propagation (ADR-172)
54
+ __exportStar(require("./sound"), exports);
53
55
  // Re-export commonly used items
54
56
  var game_engine_1 = require("./game-engine");
55
57
  Object.defineProperty(exports, "GameEngine", { enumerable: true, get: function () { return game_engine_1.GameEngine; } });
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;AAEH,QAAQ;AACR,0CAAwB;AAExB,+BAA+B;AAC/B,8CAA4B;AAE5B,kBAAkB;AAClB,0CAAwB;AAExB,oBAAoB;AACpB,qDAAmC;AAEnC,oDAAoD;AACpD,+DAA6C;AAE7C,0CAA0C;AAC1C,qDAAmC;AAEnC,kDAAkD;AAClD,qDAAmC;AAEnC,cAAc;AACd,gDAA8B;AAE9B,0BAA0B;AAC1B,4CAAiF;AAAxE,yGAAA,cAAc,OAAA;AAEvB,6BAA6B;AAC7B,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAE9B,qBAAqB;AACrB,uDAAqC;AACrC,yDAAuC;AACvC,yDAAuC;AACvC,wDAAsC;AAEtC,gCAAgC;AAChC,6CAEuB;AADrB,yGAAA,UAAU,OAAA;AAGZ,uDAG4B;AAF1B,mHAAA,eAAe,OAAA;AACf,yHAAA,qBAAqB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;AAEH,QAAQ;AACR,0CAAwB;AAExB,+BAA+B;AAC/B,8CAA4B;AAE5B,kBAAkB;AAClB,0CAAwB;AAExB,oBAAoB;AACpB,qDAAmC;AAEnC,oDAAoD;AACpD,+DAA6C;AAE7C,0CAA0C;AAC1C,qDAAmC;AAEnC,kDAAkD;AAClD,qDAAmC;AAEnC,cAAc;AACd,gDAA8B;AAE9B,0BAA0B;AAC1B,4CAAiF;AAAxE,yGAAA,cAAc,OAAA;AAEvB,6BAA6B;AAC7B,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAE9B,qBAAqB;AACrB,uDAAqC;AACrC,yDAAuC;AACvC,yDAAuC;AACvC,wDAAsC;AAEtC,sCAAsC;AACtC,0CAAwB;AAExB,gCAAgC;AAChC,6CAEuB;AADrB,yGAAA,UAAU,OAAA;AAGZ,uDAG4B;AAF1B,mHAAA,eAAe,OAAA;AACf,yHAAA,qBAAqB,OAAA"}
@@ -5,7 +5,7 @@
5
5
  * retrieval. This interface extends it with optional methods the engine can use
6
6
  * when available, following the same type-guard pattern as parser-interface.ts.
7
7
  */
8
- import type { LanguageProvider } from "../if-domain/index";
8
+ import type { LanguageProvider } from '@sharpee/if-domain';
9
9
  import type { NarrativeSettings } from './narrative';
10
10
  /**
11
11
  * Extended language provider interface for engine integration.
@@ -1 +1 @@
1
- {"version":3,"file":"language-provider-interface.d.ts","sourceRoot":"","sources":["../../../../../repos/sharpee/packages/engine/src/language-provider-interface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,4BAA6B,SAAQ,gBAAgB;IACpE;;;;;OAKG;IACH,oBAAoB,CAAC,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC1D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,GACzB,QAAQ,IAAI,4BAA4B,GAAG;IAC5C,oBAAoB,EAAE,WAAW,CAAC,4BAA4B,CAAC,sBAAsB,CAAC,CAAC,CAAC;CACzF,CAKA"}
1
+ {"version":3,"file":"language-provider-interface.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/language-provider-interface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,4BAA6B,SAAQ,gBAAgB;IACpE;;;;;OAKG;IACH,oBAAoB,CAAC,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC1D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,GACzB,QAAQ,IAAI,4BAA4B,GAAG;IAC5C,oBAAoB,EAAE,WAAW,CAAC,4BAA4B,CAAC,sBAAsB,CAAC,CAAC,CAAC;CACzF,CAKA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/narrative/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,WAAW,EACX,KAAK,EACL,iBAAiB,EACjB,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/engine/src/narrative/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,WAAW,EACX,KAAK,EACL,iBAAiB,EACjB,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * ADR-089 Phase C: Defines how the story narrates player actions.
5
5
  * Stories can be written in 1st, 2nd, or 3rd person perspective.
6
6
  */
7
- import { PronounSet } from "../../world-model/index";
7
+ import { PronounSet } from '@sharpee/world-model';
8
8
  /**
9
9
  * Narrative perspective for player actions
10
10
  * - '1st': "I take the lamp" (rare, Anchorhead-style)
@@ -1 +1 @@
1
- {"version":3,"file":"narrative-settings.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/narrative/narrative-settings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEhD;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,MAAM,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,WAAW,EAAE,WAAW,CAAC;IAEzB;;;;OAIG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,iBAGxC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,iBAAiB,CAMlF"}
1
+ {"version":3,"file":"narrative-settings.d.ts","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/engine/src/narrative/narrative-settings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEhD;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,MAAM,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,WAAW,EAAE,WAAW,CAAC;IAEzB;;;;OAIG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,iBAGxC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,iBAAiB,CAMlF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sharpee/engine",
3
- "version": "0.9.113",
3
+ "version": "1.0.8",
4
4
  "description": "Runtime engine for Sharpee IF Platform - game loop, command execution, and turn management",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -12,17 +12,17 @@
12
12
  }
13
13
  },
14
14
  "dependencies": {
15
- "@sharpee/core": "^0.9.113",
16
- "@sharpee/event-processor": "^0.9.113",
17
- "@sharpee/plugins": "^0.9.113",
18
- "@sharpee/if-domain": "^0.9.113",
19
- "@sharpee/if-services": "^0.9.113",
20
- "@sharpee/lang-en-us": "^0.9.113",
21
- "@sharpee/parser-en-us": "^0.9.113",
22
- "@sharpee/stdlib": "^0.9.113",
23
- "@sharpee/text-blocks": "^0.9.113",
24
- "@sharpee/text-service": "^0.9.113",
25
- "@sharpee/world-model": "^0.9.113",
15
+ "@sharpee/channel-service": "^1.0.8",
16
+ "@sharpee/core": "^1.0.8",
17
+ "@sharpee/event-processor": "^1.0.8",
18
+ "@sharpee/plugins": "^1.0.8",
19
+ "@sharpee/if-domain": "^1.0.8",
20
+ "@sharpee/if-services": "^1.0.8",
21
+ "@sharpee/lang-en-us": "^1.0.8",
22
+ "@sharpee/parser-en-us": "^1.0.8",
23
+ "@sharpee/stdlib": "^1.0.8",
24
+ "@sharpee/text-blocks": "^1.0.8",
25
+ "@sharpee/world-model": "^1.0.8",
26
26
  "fflate": "^0.8.2"
27
27
  },
28
28
  "keywords": [
@@ -5,8 +5,8 @@
5
5
  * This interface extends it with optional methods that the engine can use when
6
6
  * available, replacing duck-typing with proper type guards.
7
7
  */
8
- import type { IParser, IValidatedCommand, WorldModel } from "../world-model/index";
9
- import type { ISemanticEvent } from "../core/index";
8
+ import type { IParser, IValidatedCommand, WorldModel } from '@sharpee/world-model';
9
+ import type { ISemanticEvent } from '@sharpee/core';
10
10
  /**
11
11
  * Extended parser interface for engine integration.
12
12
  *
@@ -1 +1 @@
1
- {"version":3,"file":"parser-interface.d.ts","sourceRoot":"","sources":["../../../../../repos/sharpee/packages/engine/src/parser-interface.ts"],"names":[],"mappings":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M,IAAI,kBAAkB,GAAG;IACvF,uBAAuB,EAAE,WAAW,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,CAAC,CAAC;CACrF,CAKA"}
1
+ {"version":3,"file":"parser-interface.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/parser-interface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAmB,SAAQ,OAAO;IACjD;;;;;;;;OAQG;IACH,eAAe,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpF;;;;;OAKG;IACH,uBAAuB,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;IAEvF;;;;;;;OAOG;IACH,oBAAoB,CAAC,CAAC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5E;;;OAGG;IACH,mBAAmB,CAAC,IAAI,IAAI,CAAC;CAC9B;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,kBAAkB,CAOjF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,kBAAkB,GAAG;IAAE,eAAe,EAAE,WAAW,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC,CAAA;CAAE,CAEvJ;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,kBAAkB,GAAG;IACjF,oBAAoB,EAAE,WAAW,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAC9E,mBAAmB,EAAE,WAAW,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAC,CAAC;CAC7E,CAOA;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,kBAAkB,GAAG;IACvF,uBAAuB,EAAE,WAAW,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,CAAC,CAAC;CACrF,CAKA"}
@@ -4,8 +4,8 @@
4
4
  * Extracted from GameEngine as part of Phase 4 remediation.
5
5
  * Uses strategy pattern to handle different platform operation types.
6
6
  */
7
- import { IPlatformEvent, ISemanticEvent, ISemanticEventSource, ISaveRestoreHooks } from "../core/index";
8
- import type { IParser } from "../world-model/index";
7
+ import { IPlatformEvent, ISemanticEvent, ISemanticEventSource, ISaveRestoreHooks } from '@sharpee/core';
8
+ import type { IParser } from '@sharpee/world-model';
9
9
  import { SaveRestoreService, ISaveRestoreStateProvider } from './save-restore-service';
10
10
  import { VocabularyManager } from './vocabulary-manager';
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"platform-operations.d.ts","sourceRoot":"","sources":["../../../../../repos/sharpee/packages/engine/src/platform-operations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EAalB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,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BAAkB,EACtC,aAAa,EAAE,yBAAyB,EACxC,iBAAiB,EAAE,iBAAiB,GACnC,wBAAwB,CAO1B"}
1
+ {"version":3,"file":"platform-operations.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/engine/src/platform-operations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EAalB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,oBAAoB,CAAC;IAClC,SAAS,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CAC5C;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,KAAK,IAAI,CAAC;IACvE,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,aAAa,EAAE,CAAC,OAAO,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3D,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,OAAO,GAAG,SAAS,CAAC;CACtC;AAED;;GAEG;AACH,qBAAa,wBAAwB;IAEjC,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,iBAAiB;gBAHjB,gBAAgB,EAAE,iBAAiB,GAAG,SAAS,EAC/C,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,yBAAyB,EACxC,iBAAiB,EAAE,iBAAiB;IAG9C;;;;;;OAMG;IACG,UAAU,CACd,UAAU,EAAE,cAAc,EAAE,EAC5B,OAAO,EAAE,wBAAwB,EACjC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAAC,IAAI,CAAC;IAsChB;;OAEG;YACW,eAAe;IA0B7B;;OAEG;YACW,UAAU;IAoBxB;;OAEG;YACW,aAAa;IAkC3B;;OAEG;YACW,UAAU;IAqBxB;;OAEG;YACW,aAAa;IAmC3B;;OAEG;IACH,OAAO,CAAC,UAAU;IAkBlB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAmBzB;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,gBAAgB,EAAE,iBAAiB,GAAG,SAAS,EAC/C,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,yBAAyB,EACxC,iBAAiB,EAAE,iBAAiB,GACnC,wBAAwB,CAO1B"}
@@ -8,7 +8,7 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.PlatformOperationHandler = void 0;
10
10
  exports.createPlatformOperationHandler = createPlatformOperationHandler;
11
- const core_1 = require("../core/index.js");
11
+ const core_1 = require("@sharpee/core");
12
12
  const parser_interface_1 = require("./parser-interface");
13
13
  /**
14
14
  * Handler for platform operations
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Block assembly stage — wraps a resolved template string into an
3
+ * `ITextBlock`, parsing decorations along the way.
4
+ *
5
+ * Public interface: `createBlock`, `extractValue`. Used internally
6
+ * by handler families and the pipeline orchestration.
7
+ *
8
+ * Owner context: `@sharpee/engine` — internal prose pipeline. Lives
9
+ * at `prose-pipeline/assemble.ts` (not under `stages/`) per ADR-174
10
+ * §Engine-internal prose pipeline layout.
11
+ *
12
+ * @see ADR-174 §Markup syntax (decoration parsing)
13
+ * @see ADR-133 (preserved): blocks have keys and structured content.
14
+ */
15
+ import type { ITextBlock } from '@sharpee/text-blocks';
16
+ /**
17
+ * Options for `createBlock`.
18
+ */
19
+ export interface CreateBlockOptions {
20
+ /**
21
+ * Mark the block as a visual continuation of its predecessor — the
22
+ * renderer collapses the paragraph margin so the two lines stack
23
+ * flush. Used by handlers that split former multi-line content into
24
+ * multiple single-line blocks. See `ITextBlock.tight` for the
25
+ * invariant that a tight block must not appear first in a packet.
26
+ */
27
+ tight?: boolean;
28
+ /**
29
+ * Optional semantic CSS class the browser renderer applies to the
30
+ * rendered element in addition to `main-entry`. See
31
+ * `ITextBlock.className`.
32
+ */
33
+ className?: string;
34
+ }
35
+ /**
36
+ * Create an `ITextBlock` from a key and a resolved template string.
37
+ *
38
+ * The template is fed through the bracket-decoration parser; templates
39
+ * with no markers produce a single-string `content` array, matching
40
+ * the existing no-op-decoration shape.
41
+ *
42
+ * Pass `{ tight: true }` to mark this block as a continuation of the
43
+ * preceding block (renderer collapses inter-block margin).
44
+ *
45
+ * Callers that may receive text containing `\n` should use
46
+ * `createBlocks` instead, which lifts newlines to block boundaries.
47
+ */
48
+ export declare function createBlock(key: string, text: string, opts?: CreateBlockOptions): ITextBlock;
49
+ /**
50
+ * Create one or more `ITextBlock`s from a key and a (possibly
51
+ * multi-line) resolved template string.
52
+ *
53
+ * Newlines in the text are *lifted* to block boundaries — no block's
54
+ * `content` ever carries `\n` (the precondition for removing
55
+ * `white-space: pre-line` from the prose pane). Splitting policy:
56
+ *
57
+ * - `\n\n+` (one or more blank lines) → next block is a fresh
58
+ * paragraph (no `tight` flag); the renderer applies the prose
59
+ * pane's paragraph margin.
60
+ * - `\n` (single newline) → next block carries `tight: true`; the
61
+ * renderer collapses the inter-block margin so the lines stack
62
+ * flush, matching the legacy `pre-line` line-break behavior.
63
+ *
64
+ * Edge cases: leading/trailing whitespace is trimmed; empty
65
+ * paragraphs (between `\n\n\n` etc.) are dropped; empty input
66
+ * returns a single empty block.
67
+ */
68
+ export declare function createBlocks(key: string, text: string): ITextBlock[];
69
+ /**
70
+ * Extract a string value from a direct primitive or a function wrapper.
71
+ *
72
+ * Returns null for falsy values, function returns, or thrown errors.
73
+ * Used by handlers that pull data out of event payloads with mixed
74
+ * shapes (string, number, () => string, etc.).
75
+ */
76
+ export declare function extractValue(value: unknown): string | null;
77
+ //# sourceMappingURL=assemble.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assemble.d.ts","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/engine/src/prose-pipeline/assemble.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,sBAAsB,CAAC;AAGpE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,kBAAkB,GACxB,UAAU,CASZ;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAcpE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAW1D"}
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ /**
3
+ * Block assembly stage — wraps a resolved template string into an
4
+ * `ITextBlock`, parsing decorations along the way.
5
+ *
6
+ * Public interface: `createBlock`, `extractValue`. Used internally
7
+ * by handler families and the pipeline orchestration.
8
+ *
9
+ * Owner context: `@sharpee/engine` — internal prose pipeline. Lives
10
+ * at `prose-pipeline/assemble.ts` (not under `stages/`) per ADR-174
11
+ * §Engine-internal prose pipeline layout.
12
+ *
13
+ * @see ADR-174 §Markup syntax (decoration parsing)
14
+ * @see ADR-133 (preserved): blocks have keys and structured content.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.createBlock = createBlock;
18
+ exports.createBlocks = createBlocks;
19
+ exports.extractValue = extractValue;
20
+ const parser_1 = require("./decorations/parser");
21
+ /**
22
+ * Create an `ITextBlock` from a key and a resolved template string.
23
+ *
24
+ * The template is fed through the bracket-decoration parser; templates
25
+ * with no markers produce a single-string `content` array, matching
26
+ * the existing no-op-decoration shape.
27
+ *
28
+ * Pass `{ tight: true }` to mark this block as a continuation of the
29
+ * preceding block (renderer collapses inter-block margin).
30
+ *
31
+ * Callers that may receive text containing `\n` should use
32
+ * `createBlocks` instead, which lifts newlines to block boundaries.
33
+ */
34
+ function createBlock(key, text, opts) {
35
+ const content = (0, parser_1.parseDecorations)(text);
36
+ const block = {
37
+ key,
38
+ content: content.length === 0 ? [''] : content,
39
+ ...(opts?.tight ? { tight: true } : {}),
40
+ ...(opts?.className ? { className: opts.className } : {}),
41
+ };
42
+ return block;
43
+ }
44
+ /**
45
+ * Create one or more `ITextBlock`s from a key and a (possibly
46
+ * multi-line) resolved template string.
47
+ *
48
+ * Newlines in the text are *lifted* to block boundaries — no block's
49
+ * `content` ever carries `\n` (the precondition for removing
50
+ * `white-space: pre-line` from the prose pane). Splitting policy:
51
+ *
52
+ * - `\n\n+` (one or more blank lines) → next block is a fresh
53
+ * paragraph (no `tight` flag); the renderer applies the prose
54
+ * pane's paragraph margin.
55
+ * - `\n` (single newline) → next block carries `tight: true`; the
56
+ * renderer collapses the inter-block margin so the lines stack
57
+ * flush, matching the legacy `pre-line` line-break behavior.
58
+ *
59
+ * Edge cases: leading/trailing whitespace is trimmed; empty
60
+ * paragraphs (between `\n\n\n` etc.) are dropped; empty input
61
+ * returns a single empty block.
62
+ */
63
+ function createBlocks(key, text) {
64
+ const trimmed = text.trim();
65
+ if (!trimmed)
66
+ return [createBlock(key, '')];
67
+ const paragraphs = trimmed.split(/\n\n+/).filter((p) => p.length > 0);
68
+ const blocks = [];
69
+ for (const para of paragraphs) {
70
+ const lines = para.split('\n');
71
+ for (let i = 0; i < lines.length; i++) {
72
+ blocks.push(createBlock(key, lines[i], i > 0 ? { tight: true } : undefined));
73
+ }
74
+ }
75
+ return blocks;
76
+ }
77
+ /**
78
+ * Extract a string value from a direct primitive or a function wrapper.
79
+ *
80
+ * Returns null for falsy values, function returns, or thrown errors.
81
+ * Used by handlers that pull data out of event payloads with mixed
82
+ * shapes (string, number, () => string, etc.).
83
+ */
84
+ function extractValue(value) {
85
+ if (typeof value === 'function') {
86
+ try {
87
+ const result = value();
88
+ return result ? String(result) : null;
89
+ }
90
+ catch {
91
+ return null;
92
+ }
93
+ }
94
+ return value ? String(value) : null;
95
+ }
96
+ //# sourceMappingURL=assemble.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assemble.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/engine/src/prose-pipeline/assemble.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AAuCH,kCAaC;AAqBD,oCAcC;AASD,oCAWC;AAxGD,iDAAwD;AAuBxD;;;;;;;;;;;;GAYG;AACH,SAAgB,WAAW,CACzB,GAAW,EACX,IAAY,EACZ,IAAyB;IAEzB,MAAM,OAAO,GAAkB,IAAA,yBAAgB,EAAC,IAAI,CAAC,CAAC;IACtD,MAAM,KAAK,GAAe;QACxB,GAAG;QACH,OAAO,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO;QAC9C,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,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I,CAAC;QACxC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACtC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Decorations — internal barrel for the prose pipeline's bracket
3
+ * markup primitives.
4
+ *
5
+ * Public interface: re-exports from `parser`, `resolver`,
6
+ * `platform-vocabulary`, `types`. No external package imports this;
7
+ * the prose pipeline assembles its own consumers under
8
+ * `packages/engine/src/prose-pipeline/`.
9
+ *
10
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
11
+ *
12
+ * @see ADR-174 §Engine-internal prose pipeline
13
+ */
14
+ export { parseDecorations } from './parser';
15
+ export { resolveClassName } from './resolver';
16
+ export { PLATFORM_VOCABULARY, PLATFORM_VOCABULARY_NAMES, type PlatformVocabularyName, } from './platform-vocabulary';
17
+ export type { IDecoration, TextContent } from './types';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/packages/engine/src/prose-pipeline/decorations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,KAAK,sBAAsB,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * Decorations — internal barrel for the prose pipeline's bracket
4
+ * markup primitives.
5
+ *
6
+ * Public interface: re-exports from `parser`, `resolver`,
7
+ * `platform-vocabulary`, `types`. No external package imports this;
8
+ * the prose pipeline assembles its own consumers under
9
+ * `packages/engine/src/prose-pipeline/`.
10
+ *
11
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
12
+ *
13
+ * @see ADR-174 §Engine-internal prose pipeline
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.PLATFORM_VOCABULARY_NAMES = exports.PLATFORM_VOCABULARY = exports.resolveClassName = exports.parseDecorations = void 0;
17
+ var parser_1 = require("./parser");
18
+ Object.defineProperty(exports, "parseDecorations", { enumerable: true, get: function () { return parser_1.parseDecorations; } });
19
+ var resolver_1 = require("./resolver");
20
+ Object.defineProperty(exports, "resolveClassName", { enumerable: true, get: function () { return resolver_1.resolveClassName; } });
21
+ var platform_vocabulary_1 = require("./platform-vocabulary");
22
+ Object.defineProperty(exports, "PLATFORM_VOCABULARY", { enumerable: true, get: function () { return platform_vocabulary_1.PLATFORM_VOCABULARY; } });
23
+ Object.defineProperty(exports, "PLATFORM_VOCABULARY_NAMES", { enumerable: true, get: function () { return platform_vocabulary_1.PLATFORM_VOCABULARY_NAMES; } });
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/packages/engine/src/prose-pipeline/decorations/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,mCAA4C;AAAnC,0GAAA,gBAAgB,OAAA;AACzB,uCAA8C;AAArC,4GAAA,gBAAgB,OAAA;AACzB,6DAI+B;AAH7B,0HAAA,mBAAmB,OAAA;AACnB,gIAAA,yBAAyB,OAAA"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Bracket parser — markup string → structured `TextContent[]` tree.
3
+ *
4
+ * Public interface: `parseDecorations(template) → TextContent[]`.
5
+ * Pure function; same input always yields same output.
6
+ *
7
+ * Owner context: `@sharpee/engine` — internal prose pipeline.
8
+ *
9
+ * @see ADR-174 §Markup syntax
10
+ * @see ADR-174 §Internal interfaces
11
+ * @see ADR-174 acceptance criteria AC-1..AC-5, AC-10..AC-12
12
+ */
13
+ import type { TextContent } from './types';
14
+ /**
15
+ * Parse a template string into a `TextContent[]` tree.
16
+ *
17
+ * Bracket markup `[name:content]` becomes an `IDecoration` whose
18
+ * `className` is the result of `resolveClassName(name)`. Plain runs
19
+ * stay as strings. Nesting recurses. Escape sequences `\[`, `\]`,
20
+ * `\\` produce literal characters.
21
+ *
22
+ * Forgiving rules (ADR-174 AC-10..AC-12):
23
+ * - An unclosed `[` is treated as a literal character; the tail of
24
+ * the string remains unparsed text.
25
+ * - A bracket without `:` (e.g., `[em world]`) is emitted as literal
26
+ * `[em world]` — no decoration created.
27
+ * - A bracket with empty class name (e.g., `[:world]`) yields the
28
+ * parsed inner content directly, with no decoration wrapper.
29
+ *
30
+ * @param template Raw template string, post message-id resolution.
31
+ * @returns Flat array of strings and decorations.
32
+ */
33
+ export declare function parseDecorations(template: string): TextContent[];
34
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../../../../../repos/sharpee/packages/engine/src/prose-pipeline/decorations/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,SAAS,CAAC;AAExD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE,CAgDhE"}