@sharpee/devkit 1.0.9 → 1.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sharpee/devkit",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "The Sharpee CLI engine — build/test/verify/scaffold orchestration (ADR-180). Provides the `sharpee` command; orchestrates, tsf compiles.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -5,7 +5,7 @@
5
5
  * story-specific channel/audio renderers before `client.start()`.
6
6
  */
7
7
 
8
- import { GameEngine } from '@sharpee/engine';
8
+ import { GameEngine, type Story } from '@sharpee/engine';
9
9
  import { WorldModel, EntityType } from '@sharpee/world-model';
10
10
  import { Parser } from '@sharpee/parser-en-us';
11
11
  import { LanguageProvider } from '@sharpee/lang-en-us';
@@ -59,8 +59,12 @@ async function start(): Promise<void> {
59
59
 
60
60
  const language = new LanguageProvider();
61
61
  const parser = new Parser(language);
62
- if (story.extendParser) story.extendParser(parser);
63
- if (story.extendLanguage) story.extendLanguage(language);
62
+ // `story` may be typed as a concrete class that omits the optional Story hooks
63
+ // (extendParser/extendLanguage). View it through the Story interface so these
64
+ // checks compile regardless of how the story file annotates its export.
65
+ const typedStory: Story = story;
66
+ if (typedStory.extendParser) typedStory.extendParser(parser);
67
+ if (typedStory.extendLanguage) typedStory.extendLanguage(language);
64
68
 
65
69
  const perceptionService = new PerceptionService();
66
70
  const engine = new GameEngine({ world, player, parser, language, perceptionService });